Skip to content

Commit badc318

Browse files
committed
Fix handling of configure component LDFLAGS/LIBS
Refactor the code to pull wrapper LDFLAGS and LIBS from component configure code into the opal_mca system. The previous code was a bit too cute for my own good (read: overly complicated) and also had a bug that it assumed $3 was not a shell variable (which is not true if a component provides a configure script). Properly use AS_VAR_COPY to avoid that bug, and manually expand the LDFLAGS and LIBS loops to simplify the code. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent 72ac1b8 commit badc318

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

config/opal_mca.m4

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -841,20 +841,16 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
841841
# variable is not set, then it is assumed that the component
842842
# wishes all LDFLAGS and LIBS to be provided as wrapper flags.
843843
AS_IF([test "$8" = "static"],
844-
[m4_foreach(flags, [LDFLAGS, LIBS],
845-
[m4_if(flags, [LIBS],
846-
[OPAL_MCA_STRIP_LAFILES([tmp_]flags, [$$2_$3_]flags)],
847-
[tmp_]flags[=$$2_$3_]flags)
848-
AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_]flags,
849-
[OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$2_$3_WRAPPER_EXTRA_]flags)],
850-
[OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$tmp_]flags)])
851-
dnl yes, this is weird indenting, but the
852-
dnl combination of m4_foreach and AS_VAR_SET_IF
853-
dnl will result in the closing of one if and the
854-
dnl start of the next on the same line, resulting
855-
dnl in parse errors, if this is not here.
856-
])])
857-
844+
[AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_LDFLAGS],
845+
[AS_VAR_COPY([tmp_flags], [$2_$3_WRAPPER_EXTRA_LDFLAGS])],
846+
[AS_VAR_COPY([tmp_flags], [$2_$3_LDFLAGS])])
847+
OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_ldflags], [$tmp_flags])
848+
849+
AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_LIBS],
850+
[AS_VAR_COPY([tmp_flags], [$2_$3_WRAPPER_EXTRA_LIBS])],
851+
[AS_VAR_COPY([tmp_all_flags], [$2_$3_LIBS])
852+
OPAL_MCA_STRIP_LAFILES([tmp_flags], [$tmp_all_flags])])
853+
OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_libs], [$tmp_flags])])
858854
859855
# WRAPPER_EXTRA_CPPFLAGS are only needed for STOP_AT_FIRST
860856
# components, as all other components are not allowed to leak

0 commit comments

Comments
 (0)