1
1

* add the ability to only allow one component from a given framework

be compiled, as well as the ability for components to prioritize
  the order in which they should be compiled so that the "right"
  first one is selected.  Make autogen.sh do all the hard sorting
  work, so that the m4_defined lists of components are in the
  prioritized order.  From there, it's just forcing components
  to fail after the first one succeeds (if we are in the "only one
  compnent can build" mode).

This commit was SVN r6895.
Этот коммит содержится в:
Brian Barrett 2005-08-16 05:21:34 +00:00
родитель d9e68c1f36
Коммит a32a64f0a6
2 изменённых файлов: 72 добавлений и 20 удалений

Просмотреть файл

@ -448,7 +448,7 @@ EOF
--> $PARAM_CONFIG_FILES
EOF
echo "component_list=\"\$component_list $noconf_component\"" >> "$noconf_env_file"
echo "$PARAM_CONFIG_PRIORITY $noconf_component" >> "$noconf_env_file"
}
@ -505,7 +505,7 @@ EOF
--> $PARAM_CONFIG_FILES
EOF
echo "component_list=\"\$component_list $m4conf_component\"" >> "$m4conf_env_file"
echo "$PARAM_CONFIG_PRIORITY $m4conf_component" >> "$m4conf_env_file"
}
@ -553,6 +553,10 @@ process_dir() {
cd "$pd_cur_dir"
fi
# clean our environment a bit, since we might evaluate a configure.params
unset PARAM_CONFIG_FILES
PARAM_CONFIG_PRIORITY="0"
if test -d "$pd_dir"; then
cd "$pd_dir"
@ -774,6 +778,20 @@ EOF
unset PARAM_VERSION_FILE PARAM_CONFIG_FILES_save
}
component_list_sort() {
cls_filename="$1"
# why, oh, why can't non-gnu sort support the -s (stable) option?
# Solaris sort supports -r -n and -u, so we'll assume that works everywhere
# get the list of priorities
component_list=
cls_priority_list="`sort -r -n -u \"$cls_filename\" | cut -f1 -d' ' | xargs`"
for cls_priority in $cls_priority_list ; do
component_list="$component_list `grep \"^$cls_priority \" \"$cls_filename\" | cut -f2 -d' ' | xargs`"
done
}
##############################################################################
#
@ -847,10 +865,14 @@ EOF
-r "${framework_path}/${framework}.h" ; then
framework_list="$framework_list $framework"
# Add the framework's options file into configure,
# if there is one
if test -r "${framework_path}/configure.options" ; then
echo "m4_include(${framework_path}/configure.options)" >> "$mca_m4_include_file"
fi
rm -f "$mca_no_config_env_file" "$mca_m4_config_env_file"
touch "$mca_no_config_env_file" "$mca_m4_config_env_file"
echo "component_list=" >> "$mca_no_config_env_file"
echo "component_list=" >> "$mca_m4_config_env_file"
for component_path in "$framework_path"/*; do
if test -d "$component_path"; then
@ -867,8 +889,12 @@ EOF
done
fi
# make list of components that are "no configure"
. "$mca_no_config_env_file"
# make list of components that are "no configure".
# Sort the list by priority (stable, so things stay in
# alphabetical order at the same priority), then munge
# it into form we like
component_list=
component_list_sort $mca_no_config_env_file
component_list_define="m4_define(mca_${framework}_no_config_component_list, ["
component_list_define_first="1"
for component in $component_list ; do
@ -883,7 +909,8 @@ EOF
echo "$component_list_define" >> "$mca_no_configure_components_file"
# make list of components that are "m4 configure"
. "$mca_m4_config_env_file"
component_list=
component_list_sort $mca_m4_config_env_file
component_list_define="m4_define(mca_${framework}_m4_config_component_list, ["
component_list_define_first="1"
for component in $component_list ; do
@ -896,7 +923,6 @@ EOF
done
component_list_define="${component_list_define}])"
echo "$component_list_define" >> "$mca_no_configure_components_file"
fi
done
@ -944,7 +970,6 @@ AC_DEFUN([MCA_NO_CONFIG_CONFIG_FILES],[
EOF
# Remove temp files
rm -f $mca_no_config_list_file $mca_no_config_env_file $mca_m4_config_env_file
# Finally, after we found all the no-configure MCA components, run

Просмотреть файл

@ -15,6 +15,11 @@ dnl
dnl $HEADER$
dnl
# OMPI_EVAL_ARG(arg)
# ------------------
# evaluates and returns argument
AC_DEFUN([OMPI_EVAL_ARG], [$1])
######################################################################
#
# OMPI_MCA
@ -325,6 +330,16 @@ AC_DEFUN([MCA_CONFIGURE_FRAMEWORK],[
AC_MSG_CHECKING([for m4 configure components in framework $2])
AC_MSG_RESULT([mca_$2_m4_config_component_list])
# if we only want the first successful component, set the variable
# happy_value to 0 so we stop on first assignment. Otherwise, set
# it to zero so that components_looking_for_succeed is always 1
m4_if(OMPI_EVAL_ARG([MCA_]mca_framework[_CONFIGURE_MODE]),
[STOP_AT_FIRST],
[happy_value=0],
[happy_value=1])
components_looking_for_succeed=1
# configure components that don't have any component-specific
# configuration. See comment in CONFIGURE_PROJECT about the
# m4_ifval
@ -337,7 +352,8 @@ AC_DEFUN([MCA_CONFIGURE_FRAMEWORK],[
[all_components],
[static_components],
[dso_components],
[static_ltlibs])])])
[static_ltlibs],
[$components_looking_for_succeed])])])
# configure components that use built-in configuration scripts
# see comment in CONFIGURE_PROJECT about the m4_ifval
@ -350,13 +366,17 @@ AC_DEFUN([MCA_CONFIGURE_FRAMEWORK],[
[all_components],
[static_components],
[dso_components],
[static_ltlibs])])])
[static_ltlibs],
[$components_looking_for_succeed],
[components_looking_for_succeed="$happy_value"])])])
# configure components that provide their own configure script
MCA_CONFIGURE_ALL_CONFIG_COMPONENTS($1, $2, [all_components],
[static_components], [dso_components],
[static_ltlibs])
# configure components that provide their own configure script.
# It would be really hard to run these for "find first that
# works", so we don't :)
AS_IF([test "$happy_value" = "1"],
[MCA_CONFIGURE_ALL_CONFIG_COMPONENTS($1, $2, [all_components],
[static_components], [dso_components],
[static_ltlibs])])
# reminder - the dollar sign 2 substitutions are at autogen time, so
# this will actually work in a rational way...
@ -427,7 +447,8 @@ EOF
# all_components_variable,
# static_components_variable,
# dso_components_variable,
# static_ltlibs_variable)
# static_ltlibs_variable,
# allowed_to_succeed)
#
######################################################################
AC_DEFUN([MCA_CONFIGURE_NO_CONFIG_COMPONENT],[
@ -436,7 +457,8 @@ AC_DEFUN([MCA_CONFIGURE_NO_CONFIG_COMPONENT],[
# remove any possible symlink in the mca-dynamic tree
rm -f $1/dynamic-mca/$2/$3
MCA_COMPONENT_BUILD_CHECK($1, $2, $3, [should_build=1], [should_build=2])
MCA_COMPONENT_BUILD_CHECK($1, $2, $3,
[should_build=$8], [should_build=0])
MCA_COMPONENT_COMPILE_MODE($1, $2, $3, compile_mode)
if test "$should_build" = "1" ; then
@ -467,7 +489,10 @@ AC_DEFUN([MCA_CONFIGURE_NO_CONFIG_COMPONENT],[
# all_components_variable,
# static_components_variable,
# dso_components_variable,
# static_ltlibs_variable)
# static_ltlibs_variable,
# allowed_to_succeed,
# [eval if should build],
# [eval if should not build])
#
######################################################################
AC_DEFUN([MCA_CONFIGURE_M4_CONFIG_COMPONENT],[
@ -476,7 +501,7 @@ AC_DEFUN([MCA_CONFIGURE_M4_CONFIG_COMPONENT],[
# remove any possible symlink in the mca-dynamic tree
rm -f $1/dynamic-mca/$2/$3
MCA_COMPONENT_BUILD_CHECK($1, $2, $3, [should_build=1], [should_build=0])
MCA_COMPONENT_BUILD_CHECK($1, $2, $3, [should_build=$8], [should_build=0])
# Allow the component to override the build mode if it really wants to.
# It is, of course, free to end up calling MCA_COMPONENT_COMPILE_MODE
m4_ifdef([MCA_$2_$3_COMPILE_MODE],
@ -503,6 +528,8 @@ AC_DEFUN([MCA_CONFIGURE_M4_CONFIG_COMPONENT],[
[BUILD_$2_$3_DSO=0])
AM_CONDITIONAL(OMPI_BUILD_$2_$3_DSO, test "$BUILD_$2_$3_DSO" = "1")
AS_IF([test "$should_build" = "1"], [$9], [$10])
unset compile_mode
])