Skip to content

Commit d05b0ba

Browse files
bwbarrettawlauria
authored andcommitted
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> (cherry picked from commit badc318)
1 parent cc12216 commit d05b0ba

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
@@ -825,20 +825,16 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
825825
# variable is not set, then it is assumed that the component
826826
# wishes all LDFLAGS and LIBS to be provided as wrapper flags.
827827
AS_IF([test "$8" = "static"],
828-
[m4_foreach(flags, [LDFLAGS, LIBS],
829-
[m4_if(flags, [LIBS],
830-
[OPAL_MCA_STRIP_LAFILES([tmp_]flags, [$$2_$3_]flags)],
831-
[tmp_]flags[=$$2_$3_]flags)
832-
AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_]flags,
833-
[OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$2_$3_WRAPPER_EXTRA_]flags)],
834-
[OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$tmp_]flags)])
835-
dnl yes, this is weird indenting, but the
836-
dnl combination of m4_foreach and AS_VAR_SET_IF
837-
dnl will result in the closing of one if and the
838-
dnl start of the next on the same line, resulting
839-
dnl in parse errors, if this is not here.
840-
])])
841-
828+
[AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_LDFLAGS],
829+
[AS_VAR_COPY([tmp_flags], [$2_$3_WRAPPER_EXTRA_LDFLAGS])],
830+
[AS_VAR_COPY([tmp_flags], [$2_$3_LDFLAGS])])
831+
OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_ldflags], [$tmp_flags])
832+
833+
AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_LIBS],
834+
[AS_VAR_COPY([tmp_flags], [$2_$3_WRAPPER_EXTRA_LIBS])],
835+
[AS_VAR_COPY([tmp_all_flags], [$2_$3_LIBS])
836+
OPAL_MCA_STRIP_LAFILES([tmp_flags], [$tmp_all_flags])])
837+
OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_libs], [$tmp_flags])])
842838
843839
# WRAPPER_EXTRA_CPPFLAGS are only needed for STOP_AT_FIRST
844840
# components, as all other components are not allowed to leak

0 commit comments

Comments
 (0)