Update hwloc to v1.11.12
[charm.git] / contrib / hwloc / config / hwloc_components.m4
blob620cc4d86e584d03991c9700a190929912220865
1 # Copyright © 2012-2018 Inria.  All rights reserved.
2 # See COPYING in top-level directory.
5 # HWLOC_PREPARE_FILTER_COMPONENTS
7 # Given a comma-separated list of names, define hwloc_<name>_component_maybeplugin=1.
9 # $1 = command-line given list of components to build as plugins
11 AC_DEFUN([HWLOC_PREPARE_FILTER_COMPONENTS], [
12   for name in `echo [$1] | sed -e 's/,/ /g'` ; do
13     str="hwloc_${name}_component_wantplugin=1"
14     eval $str
15   done
19 # HWLOC_FILTER_COMPONENTS
21 # For each component in hwloc_components,
22 # check if hwloc_<name>_component_wantplugin=1 or enable_plugin=yes,
23 # and check if hwloc_<name>_component_maybeplugin=1.
24 # Add <name> to hwloc_[static|plugin]_components accordingly.
25 # And set hwloc_<name>_component=[static|plugin] accordingly.
27 AC_DEFUN([HWLOC_FILTER_COMPONENTS], [
28 for name in $hwloc_components ; do
29   str="maybeplugin=\$hwloc_${name}_component_maybeplugin"
30   eval $str
31   str="wantplugin=\$hwloc_${name}_component_wantplugin"
32   eval $str
33   if test x$hwloc_have_plugins = xyes && test x$maybeplugin = x1 && test x$wantplugin = x1 -o x$enable_plugins = xyes; then
34     hwloc_plugin_components="$hwloc_plugin_components $name"
35     str="hwloc_${name}_component=plugin"
36   else
37     hwloc_static_components="$hwloc_static_components $name"
38     str="hwloc_${name}_component=static"
39   fi
40   eval $str
41 done
45 # HWLOC_LIST_STATIC_COMPONENTS
47 # Append to file $1 an array of components by listing component names in $2.
49 # $1 = filename
50 # $2 = list of component names
52 AC_DEFUN([HWLOC_LIST_STATIC_COMPONENTS], [
53 cat <<EOF >>[$1]
54 #include <private/internal-components.h>
55 static const struct hwloc_component * hwloc_static_components[[]] = {
56 EOF
57 for comp in [$2]; do
58   echo "  &hwloc_${comp}_component," >>[$1]
59 done
60 cat <<EOF >>[$1]
61   NULL
63 EOF