Skip to content

Commit 6d06552

Browse files
committed
build: Drop support for config-time components
Drop support for both adding components at configure time (ie, after autogen has run) and components that have a stand-alone configure script. The first change greatly simplifies reasoning about variable names in the MCA configure code, since the component name will never be a shell variable with this change. Note that there was already one place where we would have mis-handled such a component, in setting LDFLAGS for the wrapper compilers. The second is dead code after the first, as no component currently built in the OMPI tree uses an external configure script directly (note that config macros that call a third-party configure script, like the io/romio component, are still fine). Organizations can still build tarballs with added components after this change, they just must run autogen to add the components to the list of available component. And developers are also free to add run-time components that are built outside of the OMPI build (generally by building OMPI with the --with-devel-headers configure option). Signed-off-by: Brian Barrett <[email protected]>
1 parent d0c8ca9 commit 6d06552

File tree

1 file changed

+16
-104
lines changed

1 file changed

+16
-104
lines changed

config/opal_mca.m4

Lines changed: 16 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -455,18 +455,6 @@ AC_DEFUN([MCA_CONFIGURE_FRAMEWORK],[
455455
[AS_IF([test $components_last_result -eq 1], [best_mca_component_priority=]OPAL_EVAL_ARG([MCA_$1_$2_]mca_component[_PRIORITY]))])
456456
])])
457457
458-
# configure components that provide their own configure script.
459-
# It would be really hard to run these for "find first that
460-
# works", so we don't :)
461-
m4_if(OPAL_EVAL_ARG([MCA_$1_]$2[_CONFIGURE_MODE]), [STOP_AT_FIRST], [],
462-
[m4_if(OPAL_EVAL_ARG([MCA_$1_]$2[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY], [],
463-
[m4_if(OPAL_EVAL_ARG([MCA_$1_]$2[_CONFIGURE_MODE]), [PRIORITY], [],
464-
[MCA_CHECK_IGNORED_PRIORITY($1, $2)
465-
AS_IF([test "$3" != "0"],
466-
[MCA_CONFIGURE_ALL_CONFIG_COMPONENTS($1, $2, [all_components],
467-
[static_components], [dso_components],
468-
[static_ltlibs])])])])])
469-
470458
AS_VAR_SET_IF([OPAL_EVAL_ARG([DIRECT_$2])], [
471459
AC_MSG_CHECKING([if direct-selection component exists for $2 framework])
472460
direct_component_happy=no
@@ -640,74 +628,6 @@ AC_DEFUN([MCA_CONFIGURE_M4_CONFIG_COMPONENT],[
640628
unset compile_mode
641629
])
642630

643-
644-
######################################################################
645-
#
646-
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS
647-
#
648-
# configure all components in the given framework that have configure
649-
# scripts and should be configured according to the usual rules...
650-
#
651-
# USAGE:
652-
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS(project_name,
653-
# framework_name,
654-
# all_components_variable,
655-
# static_components_variable,
656-
# dso_components_variable,
657-
# static_ltlibs_variable)
658-
#
659-
######################################################################
660-
AC_DEFUN([MCA_CONFIGURE_ALL_CONFIG_COMPONENTS],[
661-
for component_path in $srcdir/$1/mca/$2/* ; do
662-
component="`basename $component_path`"
663-
if test -d $component_path && test -x $component_path/configure ; then
664-
opal_show_subsubsubtitle "MCA component $2:$component (need to configure)"
665-
666-
opal_show_verbose "OPAL_MCA_ALL_CONFIG_COMPONENTS: before, should_build=$8"
667-
MCA_COMPONENT_BUILD_CHECK($1, $2, $component,
668-
[should_build=1], [should_build=0])
669-
MCA_COMPONENT_COMPILE_MODE($1, $2, $component, compile_mode)
670-
opal_show_verbose "OPAL_MCA_ALL_CONFIG_COMPONENTS: after, should_build=$should_build"
671-
672-
if test "$should_build" = "1" ; then
673-
OPAL_CONFIG_SUBDIR([$1/mca/$2/$component],
674-
[$opal_subdir_args],
675-
[should_build=1], [should_build=0])
676-
opal_show_verbose "OPAL_MCA_ALL_CONFIG_COMPONENTS: after subdir, should_build=$should_build"
677-
fi
678-
679-
if test "$should_build" = "1" ; then
680-
# do some extra work to pass flags back from the
681-
# top-level configure, the way a configure.m4
682-
# component would.
683-
infile="$srcdir/$1/mca/$2/$3/post_configure.sh"
684-
if test -f $infile; then
685-
686-
# First check for the ABORT tag
687-
line="`$GREP ABORT= $infile | cut -d= -f2-`"
688-
if test -n "$line" && test "$line" != "no"; then
689-
AC_MSG_WARN([MCA component configure script told me to abort])
690-
AC_MSG_ERROR([cannot continue])
691-
fi
692-
693-
m4_foreach(flags, [LDFLAGS, LIBS],
694-
[[line="`$GREP WRAPPER_EXTRA_]flags[= $infile | cut -d= -f2-`"]
695-
eval "line=$line"
696-
if test -n "$line"; then
697-
$2[_]$3[_WRAPPER_EXTRA_]flags[="$line"]
698-
fi
699-
])dnl
700-
fi
701-
702-
MCA_PROCESS_COMPONENT($1, $2, $component, $3, $4, $5, $6, $compile_mode)
703-
else
704-
MCA_PROCESS_DEAD_COMPONENT($1, $2, $component)
705-
fi
706-
fi
707-
done
708-
])
709-
710-
711631
# MCA_COMPONENT_COMPILE_MODE(project_name (1), framework_name (2),
712632
# component_name (3), compile_mode_variable (4))
713633
# -------------------------------------------------------------------------
@@ -716,17 +636,15 @@ AC_DEFUN([MCA_CONFIGURE_ALL_CONFIG_COMPONENTS],[
716636
# the cached value for subsequent tests. The string is not stored in a cache
717637
# variable (ie .*_cv_.*) because cache variables would not be invalidated
718638
# based on changes to --enable-mca-dso or --enable-mca-static.
719-
#
720-
# NOTE: component_name may not be determined until runtime....
721639
AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
722640
OAC_ASSERT_LITERAL([$1], [1])dnl
723641
OAC_ASSERT_LITERAL([$2], [2])dnl
642+
OAC_ASSERT_LITERAL([$3], [3])dnl
724643
725644
AS_VAR_PUSHDEF([compile_mode_cv], [$1_$2_$3_compile_mode])dnl
726645
AS_VAR_SET_IF([compile_mode_cv],
727646
[],
728-
[AS_LITERAL_IF([$3],
729-
[m4_ifdef([MCA_$1_$2_$3_COMPILE_MODE],
647+
[m4_ifdef([MCA_$1_$2_$3_COMPILE_MODE],
730648
[dnl We introduced caching of this check after setting the compile
731649
dnl mode by the substitute macro was common, and there was not a
732650
dnl polymorphic variable assumption in all those macros, so we use
@@ -735,8 +653,7 @@ AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
735653
MCA_$1_$2_$3_COMPILE_MODE([$1], [$2], [$3], [component_compile_mode_tmp])
736654
AS_VAR_COPY([compile_mode_cv], [$component_compile_mode_tmp])
737655
OPAL_VAR_SCOPE_POP],
738-
[MCA_COMPONENT_COMPILE_MODE_INTERNAL([$1], [$2], [$3], [compile_mode_cv])])],
739-
[MCA_COMPONENT_COMPILE_MODE_INTERNAL([$1], [$2], [$3], [compile_mode_cv])])])
656+
[MCA_COMPONENT_COMPILE_MODE_INTERNAL([$1], [$2], [$3], [compile_mode_cv])])])
740657
AS_VAR_COPY([$4], [compile_mode_cv])
741658
AS_VAR_POPDEF([compile_mode_cv])dnl
742659
])
@@ -758,10 +675,10 @@ AC_DEFUN([MCA_COMPONENT_COMPILE_MODE_INTERNAL], [
758675
OPAL_VAR_SCOPE_PUSH([compile_mode_internal_tmp SHARED_FRAMEWORK SHARED_COMPONENT STATIC_FRAMEWORK STATIC_COMPONENT])
759676
760677
SHARED_FRAMEWORK="$DSO_$2"
761-
AS_VAR_COPY([SHARED_COMPONENT], [DSO_$2_$3])
678+
SHARED_COMPONENT="$DSO_$2_$3"
762679
763680
STATIC_FRAMEWORK="$STATIC_$2"
764-
AS_VAR_COPY([STATIC_COMPONENT], [STATIC_$2_$3])
681+
STATIC_COMPONENT="$STATIC_$2_$3"
765682
766683
# Look for the most specific specifier between static/dso. If
767684
# there is a tie (either neither or both specified), prefer
@@ -819,8 +736,6 @@ AC_DEFUN([OPAL_MCA_STRIP_LAFILES], [
819736
#---------------------------------------------------------------------
820737
# Final setup work for a given component. It should be known before
821738
# calling that this component can build properly (and exists)
822-
#
823-
# NOTE: component_name may not be determined until runtime....
824739
AC_DEFUN([MCA_PROCESS_COMPONENT],[
825740
AC_REQUIRE([AC_PROG_GREP])
826741
@@ -893,13 +808,13 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
893808
# wishes all LDFLAGS and LIBS to be provided as wrapper flags.
894809
AS_IF([test "$8" = "static"],
895810
[AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_LDFLAGS],
896-
[AS_VAR_COPY([tmp_flags], [$2_$3_WRAPPER_EXTRA_LDFLAGS])],
897-
[AS_VAR_COPY([tmp_flags], [$2_$3_LDFLAGS])])
811+
[tmp_flags=${$2_$3_WRAPPER_EXTRA_LDFLAGS}],
812+
[tmp_flags=${$2_$3_LDFLAGS}])
898813
OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_ldflags], [$tmp_flags])
899814
900815
AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_LIBS],
901-
[AS_VAR_COPY([tmp_flags], [$2_$3_WRAPPER_EXTRA_LIBS])],
902-
[AS_VAR_COPY([tmp_all_flags], [$2_$3_LIBS])
816+
[tmp_flags=${$2_$3_WRAPPER_EXTRA_LIBS}],
817+
[tmp_all_flags=${$2_$3_LIBS}
903818
OPAL_MCA_STRIP_LAFILES([tmp_flags], [$tmp_all_flags])])
904819
OPAL_FLAGS_APPEND_MOVE([mca_wrapper_extra_libs], [$tmp_flags])])
905820
@@ -910,13 +825,12 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
910825
# Since a configure script component can never be used in a
911826
# STOP_AT_FIRST framework, we don't have to implement the else
912827
# clause in the literal check.
913-
AS_LITERAL_IF([$3],
914-
[AS_IF([test "$$2_$3_WRAPPER_EXTRA_CPPFLAGS" != ""],
915-
[m4_if(OPAL_EVAL_ARG([MCA_$1_$2_CONFIGURE_MODE]), [STOP_AT_FIRST], [stop_at_first=1], [stop_at_first=0])
916-
AS_IF([test "$8" = "static" && test "$stop_at_first" = "1"],
917-
[AS_IF([test "$with_devel_headers" = "yes"],
918-
[OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_cppflags], [$$2_$3_WRAPPER_EXTRA_CPPFLAGS])])],
919-
[AC_MSG_WARN([ignoring $2_$3_WRAPPER_EXTRA_CPPFLAGS ($$2_$3_WRAPPER_EXTRA_CPPFLAGS): component conditions not met])])])])
828+
AS_IF([test "$$2_$3_WRAPPER_EXTRA_CPPFLAGS" != ""],
829+
[m4_if(OPAL_EVAL_ARG([MCA_$1_$2_CONFIGURE_MODE]), [STOP_AT_FIRST], [stop_at_first=1], [stop_at_first=0])
830+
AS_IF([test "$8" = "static" && test "$stop_at_first" = "1"],
831+
[AS_IF([test "$with_devel_headers" = "yes"],
832+
[OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_cppflags], [$$2_$3_WRAPPER_EXTRA_CPPFLAGS])])],
833+
[AC_MSG_WARN([ignoring $2_$3_WRAPPER_EXTRA_CPPFLAGS ($$2_$3_WRAPPER_EXTRA_CPPFLAGS): component conditions not met])])])
920834
])
921835

922836

@@ -926,8 +840,6 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
926840
# Final setup work for a component that can not be built. Do the
927841
# last minute checks to make sure the user isn't doing something
928842
# stupid.
929-
#
930-
# NOTE: component_name may not be determined until runtime....
931843
AC_DEFUN([MCA_PROCESS_DEAD_COMPONENT],[
932844
AC_MSG_CHECKING([if MCA component $2:$3 can compile])
933845
AC_MSG_RESULT([no])
@@ -1004,7 +916,7 @@ AC_DEFUN([MCA_COMPONENT_BUILD_CHECK],[
1004916
1005917
# if we were explicitly disabled, don't build :)
1006918
AS_IF([test "$DISABLE_$2" = "1"], [want_component=0])
1007-
AS_VAR_IF([DISABLE_$2_$3], [1], [want_component=0])
919+
AS_IF([test "${DISABLE_$2_$3}" = "1"], [want_component=0])
1008920
1009921
AS_IF([test "$want_component" = "1"], [$4], [$5])
1010922
])

0 commit comments

Comments
 (0)