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"
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"
31 str="wantplugin=\$hwloc_${name}_component_wantplugin"
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"
37 hwloc_static_components="$hwloc_static_components $name"
38 str="hwloc_${name}_component=static"
45 # HWLOC_LIST_STATIC_COMPONENTS
47 # Append to file $1 an array of components by listing component names in $2.
50 # $2 = list of component names
52 AC_DEFUN([HWLOC_LIST_STATIC_COMPONENTS], [
54 #include <private/internal-components.h>
55 static const struct hwloc_component * hwloc_static_components[[]] = {
58 echo " &hwloc_${comp}_component," >>[$1]