|  | 
|  | 1 | +# -*- shell-script -*- | 
|  | 2 | +# | 
|  | 3 | +# Copyright (c) 2009-2014 Cisco Systems, Inc.  All rights reserved. | 
|  | 4 | +# Copyright (c) 2014-2015 Intel, Inc. All rights reserved. | 
|  | 5 | +# | 
|  | 6 | +# $COPYRIGHT$ | 
|  | 7 | +#  | 
|  | 8 | +# Additional copyrights may follow | 
|  | 9 | +#  | 
|  | 10 | +# $HEADER$ | 
|  | 11 | +# | 
|  | 12 | + | 
|  | 13 | +# | 
|  | 14 | +# Priority | 
|  | 15 | +# | 
|  | 16 | +AC_DEFUN([MCA_opal_hwloc_hwloc1110_PRIORITY], [90]) | 
|  | 17 | + | 
|  | 18 | +# | 
|  | 19 | +# Force this component to compile in static-only mode | 
|  | 20 | +# | 
|  | 21 | +AC_DEFUN([MCA_opal_hwloc_hwloc1110_COMPILE_MODE], [ | 
|  | 22 | +    AC_MSG_CHECKING([for MCA component $2:$3 compile mode]) | 
|  | 23 | +    $4="static" | 
|  | 24 | +    AC_MSG_RESULT([$$4]) | 
|  | 25 | +]) | 
|  | 26 | + | 
|  | 27 | +# Include hwloc m4 files | 
|  | 28 | +m4_include(opal/mca/hwloc/hwloc1110/hwloc/config/hwloc.m4) | 
|  | 29 | +m4_include(opal/mca/hwloc/hwloc1110/hwloc/config/hwloc_pkg.m4) | 
|  | 30 | +m4_include(opal/mca/hwloc/hwloc1110/hwloc/config/hwloc_check_attributes.m4) | 
|  | 31 | +m4_include(opal/mca/hwloc/hwloc1110/hwloc/config/hwloc_check_visibility.m4) | 
|  | 32 | +m4_include(opal/mca/hwloc/hwloc1110/hwloc/config/hwloc_check_vendor.m4) | 
|  | 33 | +m4_include(opal/mca/hwloc/hwloc1110/hwloc/config/hwloc_components.m4) | 
|  | 34 | + | 
|  | 35 | +# MCA_hwloc_hwloc1110_POST_CONFIG() | 
|  | 36 | +# --------------------------------- | 
|  | 37 | +AC_DEFUN([MCA_opal_hwloc_hwloc1110_POST_CONFIG],[ | 
|  | 38 | +    OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc1110_basedir]) | 
|  | 39 | + | 
|  | 40 | +    # If we won, then do all the rest of the setup | 
|  | 41 | +    AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc1110_support" = "yes"], | 
|  | 42 | +          [ | 
|  | 43 | +           # Set this variable so that the framework m4 knows what | 
|  | 44 | +           # file to include in opal/mca/hwloc/hwloc.h | 
|  | 45 | +           opal_hwloc_hwloc1110_basedir=opal/mca/hwloc/hwloc1110 | 
|  | 46 | +           opal_hwloc_base_include="$opal_hwloc_hwloc1110_basedir/hwloc1110.h" | 
|  | 47 | + | 
|  | 48 | +           # Add some stuff to CPPFLAGS so that the rest of the source | 
|  | 49 | +           # tree can be built | 
|  | 50 | +           file=$opal_hwloc_hwloc1110_basedir/hwloc | 
|  | 51 | +           CPPFLAGS="$CPPFLAGS -I$OPAL_TOP_SRCDIR/$file/include" | 
|  | 52 | +           AS_IF([test "$OPAL_TOP_BUILDDIR" != "$OPAL_TOP_SRCDIR"], | 
|  | 53 | +                 [CPPFLAGS="$CPPFLAGS -I$OPAL_TOP_BUILDDIR/$file/include"]) | 
|  | 54 | +           unset file | 
|  | 55 | +          ]) | 
|  | 56 | +    OPAL_VAR_SCOPE_POP | 
|  | 57 | + | 
|  | 58 | +    # This must be run unconditionally | 
|  | 59 | +    HWLOC_DO_AM_CONDITIONALS | 
|  | 60 | +])dnl | 
|  | 61 | + | 
|  | 62 | + | 
|  | 63 | +# MCA_hwloc_hwloc1110_CONFIG([action-if-found], [action-if-not-found]) | 
|  | 64 | +# -------------------------------------------------------------------- | 
|  | 65 | +AC_DEFUN([MCA_opal_hwloc_hwloc1110_CONFIG],[ | 
|  | 66 | +    # Hwloc needs to know if we have Verbs support | 
|  | 67 | +    AC_REQUIRE([OPAL_CHECK_VERBS_DIR]) | 
|  | 68 | + | 
|  | 69 | +    AC_CONFIG_FILES([opal/mca/hwloc/hwloc1110/Makefile]) | 
|  | 70 | + | 
|  | 71 | +    OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc1110_save_CPPFLAGS opal_hwloc_hwloc1110_save_LDFLAGS opal_hwloc_hwloc1110_save_LIBS opal_hwloc_hwloc1110_save_cairo opal_hwloc_hwloc1110_save_xml opal_hwloc_hwloc1110_basedir opal_hwloc_hwloc1110_file opal_hwloc_hwloc1110_save_cflags CPPFLAGS_save LIBS_save]) | 
|  | 72 | + | 
|  | 73 | +    # default to this component not providing support | 
|  | 74 | +    opal_hwloc_hwloc1110_basedir=opal/mca/hwloc/hwloc1110 | 
|  | 75 | +    opal_hwloc_hwloc1110_support=no | 
|  | 76 | + | 
|  | 77 | +    if test "$with_hwloc" = "internal" -o "$with_hwloc" = "" -o "$with_hwloc" = "yes"; then | 
|  | 78 | +        opal_hwloc_hwloc1110_save_CPPFLAGS=$CPPFLAGS | 
|  | 79 | +        opal_hwloc_hwloc1110_save_LDFLAGS=$LDFLAGS | 
|  | 80 | +        opal_hwloc_hwloc1110_save_LIBS=$LIBS | 
|  | 81 | + | 
|  | 82 | +        # Run the hwloc configuration - set the prefix to minimize | 
|  | 83 | +        # the chance that someone will use the internal symbols | 
|  | 84 | +        HWLOC_SET_SYMBOL_PREFIX([opal_hwloc1110_]) | 
|  | 85 | + | 
|  | 86 | +        # save XML or graphical options | 
|  | 87 | +        opal_hwloc_hwloc1110_save_cairo=$enable_cairo | 
|  | 88 | +        opal_hwloc_hwloc1110_save_xml=$enable_xml | 
|  | 89 | +        opal_hwloc_hwloc1110_save_static=$enable_static | 
|  | 90 | +        opal_hwloc_hwloc1110_save_shared=$enable_shared | 
|  | 91 | +        opal_hwloc_hwloc1110_save_plugins=$enable_plugins | 
|  | 92 | + | 
|  | 93 | +        # never enable hwloc's graphical option | 
|  | 94 | +        enable_cairo=no | 
|  | 95 | + | 
|  | 96 | +        # never enable hwloc's plugin system | 
|  | 97 | +        enable_plugins=no | 
|  | 98 | +        enable_static=yes | 
|  | 99 | +        enable_shared=no | 
|  | 100 | + | 
|  | 101 | +        # Override -- disable hwloc's libxml2 support, but enable the | 
|  | 102 | +        # native hwloc XML support | 
|  | 103 | +        enable_libxml2=no | 
|  | 104 | +        enable_xml=yes | 
|  | 105 | + | 
|  | 106 | +        # hwloc checks for compiler visibility, and its needs to do | 
|  | 107 | +        # this without "picky" flags. | 
|  | 108 | +        opal_hwloc_hwloc1110_save_cflags=$CFLAGS | 
|  | 109 | +        CFLAGS=$OPAL_CFLAGS_BEFORE_PICKY | 
|  | 110 | +        HWLOC_SETUP_CORE([opal/mca/hwloc/hwloc1110/hwloc],  | 
|  | 111 | +                  [AC_MSG_CHECKING([whether hwloc configure succeeded]) | 
|  | 112 | +                   AC_MSG_RESULT([yes]) | 
|  | 113 | +                   HWLOC_VERSION="internal v`$srcdir/$opal_hwloc_hwloc1110_basedir/hwloc/config/hwloc_get_version.sh $srcdir/$opal_hwloc_hwloc1110_basedir/hwloc/VERSION`" | 
|  | 114 | + | 
|  | 115 | +                   # Build flags for our Makefile.am | 
|  | 116 | +                   opal_hwloc_hwloc1110_LDFLAGS='$(HWLOC_EMBEDDED_LDFLAGS)' | 
|  | 117 | +                   opal_hwloc_hwloc1110_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_hwloc_hwloc1110_basedir"'/hwloc/src/libhwloc_embedded.la $(HWLOC_EMBEDDED_LIBS)' | 
|  | 118 | +                   opal_hwloc_hwloc1110_support=yes | 
|  | 119 | + | 
|  | 120 | +                   AC_DEFINE_UNQUOTED([HWLOC_HWLOC1110_HWLOC_VERSION],  | 
|  | 121 | +                       ["$HWLOC_VERSION"],  | 
|  | 122 | +                       [Version of hwloc]) | 
|  | 123 | + | 
|  | 124 | +                   # Do we have verbs support? | 
|  | 125 | +                   CPPFLAGS_save=$CPPFLAGS | 
|  | 126 | +                   AS_IF([test "$opal_want_verbs" = "yes"], | 
|  | 127 | +                         [CPPFLAGS="-I$opal_verbs_dir/include $CPPFLAGS"]) | 
|  | 128 | +                   AC_CHECK_HEADERS([infiniband/verbs.h]) | 
|  | 129 | +                   CPPFLAGS=$CPPFLAGS_save | 
|  | 130 | +                  ], | 
|  | 131 | +                  [AC_MSG_CHECKING([whether hwloc configure succeeded]) | 
|  | 132 | +                   AC_MSG_RESULT([no]) | 
|  | 133 | +                   opal_hwloc_hwloc1110_support=no]) | 
|  | 134 | +        CFLAGS=$opal_hwloc_hwloc1110_save_cflags | 
|  | 135 | + | 
|  | 136 | +        # Restore some env variables, if necessary | 
|  | 137 | +        AS_IF([test -n "$opal_hwloc_hwloc1110_save_cairo"], | 
|  | 138 | +              [enable_cairo=$opal_hwloc_hwloc1110_save_cairo]) | 
|  | 139 | +        AS_IF([test -n "$opal_hwloc_hwloc1110_save_xml"], | 
|  | 140 | +              [enable_xml=$opal_hwloc_hwloc1110_save_xml]) | 
|  | 141 | +        AS_IF([test -n "$opal_hwloc_hwloc1110_save_static"], | 
|  | 142 | +              [enable_static=$opal_hwloc_hwloc1110_save_static]) | 
|  | 143 | +        AS_IF([test -n "$opal_hwloc_hwloc1110_save_shared"], | 
|  | 144 | +              [enable_shared=$opal_hwloc_hwloc1110_save_shared]) | 
|  | 145 | +        AS_IF([test -n "$opal_hwloc_hwloc1110_save_plugins"], | 
|  | 146 | +              [enable_plugins=$opal_hwloc_hwloc1110_save_shared]) | 
|  | 147 | +        | 
|  | 148 | +        CPPFLAGS=$opal_hwloc_hwloc1110_save_CPPFLAGS | 
|  | 149 | +        LDFLAGS=$opal_hwloc_hwloc1110_save_LDFLAGS | 
|  | 150 | +        LIBS=$opal_hwloc_hwloc1110_save_LIBS | 
|  | 151 | + | 
|  | 152 | +        AC_SUBST([opal_hwloc_hwloc1110_CFLAGS]) | 
|  | 153 | +        AC_SUBST([opal_hwloc_hwloc1110_CPPFLAGS]) | 
|  | 154 | +        AC_SUBST([opal_hwloc_hwloc1110_LDFLAGS]) | 
|  | 155 | +        AC_SUBST([opal_hwloc_hwloc1110_LIBS]) | 
|  | 156 | + | 
|  | 157 | +        # Finally, add some flags to the wrapper compiler so that our | 
|  | 158 | +        # headers can be found. | 
|  | 159 | +        hwloc_hwloc1110_WRAPPER_EXTRA_LDFLAGS="$HWLOC_EMBEDDED_LDFLAGS" | 
|  | 160 | +        hwloc_hwloc1110_WRAPPER_EXTRA_LIBS="$HWLOC_EMBEDDED_LIBS" | 
|  | 161 | +        hwloc_hwloc1110_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}/openmpi/'"$opal_hwloc_hwloc1110_basedir/hwloc/include" | 
|  | 162 | +    fi | 
|  | 163 | + | 
|  | 164 | +    # Done! | 
|  | 165 | +    AS_IF([test "$opal_hwloc_hwloc1110_support" = "yes"], | 
|  | 166 | +          [$1], | 
|  | 167 | +          [$2]) | 
|  | 168 | + | 
|  | 169 | +    OPAL_VAR_SCOPE_POP | 
|  | 170 | +])dnl | 
0 commit comments