@@ -103,12 +103,10 @@ AC_DEFUN([OPAL_MCA],[
103
103
type=$item
104
104
fi
105
105
if test -z $comp ; then
106
- str=" ` echo DISABLE_${type} =1 | sed s/-/_/g` "
107
- eval $str
106
+ AS_VAR_COPY([AS_TR_SH([DISABLE_$type ])], [1])
108
107
msg=" $item $msg "
109
108
else
110
- str=" ` echo DISABLE_${type} _${comp} =1 | sed s/-/_/g` "
111
- eval $str
109
+ AS_VAR_COPY([AS_TR_SH([DISABLE_$type_$comp ])], [1])
112
110
msg=" $item $msg "
113
111
fi
114
112
done
@@ -151,8 +149,7 @@ AC_DEFUN([OPAL_MCA],[
151
149
AC_MSG_ERROR([*** The enable-mca-direct flag requires a
152
150
*** list of type-component pairs. Invalid input detected.])
153
151
else
154
- str=" ` echo DIRECT_$type =$comp | sed s/-/_/g` "
155
- eval $str
152
+ AS_VAR_COPY([AS_TR_SH([DIRECT_$type ])], [AS_TR_SH([$comp ])])
156
153
msg=" $item $msg "
157
154
fi
158
155
done
@@ -187,8 +184,7 @@ AC_DEFUN([OPAL_MCA],[
187
184
IFS=" ${IFS} $PATH_SEPARATOR ,"
188
185
msg=
189
186
for item in $enable_mca_dso ; do
190
- str=" ` echo DSO_$item =1 | sed s/-/_/g` "
191
- eval $str
187
+ AS_VAR_COPY([AS_TR_SH([DSO_$item ])], [1])
192
188
msg=" $item $msg "
193
189
done
194
190
IFS=" $ifs_save "
@@ -216,8 +212,7 @@ AC_DEFUN([OPAL_MCA],[
216
212
IFS=" ${IFS} $PATH_SEPARATOR ,"
217
213
msg=
218
214
for item in $enable_mca_static ; do
219
- str=" ` echo STATIC_$item =1 | sed s/-/_/g` "
220
- eval $str
215
+ AS_VAR_COPY([AS_TR_SH([STATIC_$item ])], [1])
221
216
msg=" $item $msg "
222
217
done
223
218
IFS=" $ifs_save "
@@ -698,16 +693,10 @@ AC_DEFUN([MCA_CONFIGURE_ALL_CONFIG_COMPONENTS],[
698
693
# NOTE: component_name may not be determined until runtime....
699
694
AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
700
695
SHARED_FRAMEWORK=" $DSO_ $2 "
701
- AS_LITERAL_IF([$3 ],
702
- [SHARED_COMPONENT=" $DSO_ $2 _$3 " ],
703
- [str=" SHARED_COMPONENT=\$ DSO_$2 _$3 "
704
- eval $str ])
696
+ AS_VAR_COPY([SHARED_COMPONENT], [DSO_$2 _$3 ])
705
697
706
698
STATIC_FRAMEWORK=" $STATIC_ $2 "
707
- AS_LITERAL_IF([$3 ],
708
- [STATIC_COMPONENT=" $STATIC_ $2 _$3 " ],
709
- [str=" STATIC_COMPONENT=\$ STATIC_$2 _$3 "
710
- eval $str ])
699
+ AS_VAR_COPY([STATIC_COMPONENT], [DSO_$2 _$3 ])
711
700
712
701
# Look for the most specific specifier between static/dso. If
713
702
# there is a tie (either neither or both specified), prefer
@@ -807,26 +796,25 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
807
796
fi
808
797
fi
809
798
810
- # if the component is building, add it's WRAPPER_EXTRA_LDFLAGS and
811
- # WRAPPER_EXTRA_LIBS. If the component doesn't specify it's
812
- # WRAPPER_EXTRA_LIBS and WRAPPER_EXTRA_LDFLAGS, try using LDFLAGS and LIBS if
813
- # component didn't have it's own configure script (in which case,
814
- # we know it didn't set LDFLAGS and LIBS because it can't) Don't
815
- # have to do this if the component is building dynamically,
816
- # because it will link against these (without a dependency from
817
- # libmpi.so to these flags)
818
- if test " $8 " = " static" ; then
819
- AS_LITERAL_IF([$3 ],
820
- [m4_foreach(flags, [LDFLAGS, LIBS],
821
- [AS_IF([test " $$ 2_$3 _WRAPPER_EXTRA_]flags[" = " " ],
822
- [OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$ 2_$3 _]flags)],
823
- [OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$ 2_$3 _WRAPPER_EXTRA_]flags)])
824
- ])],
825
- [m4_foreach(flags, [LDFLAGS, LIBS],
826
- [[str=" line= \$ $2 _$3 _WRAPPER_EXTRA_]flags[" ]
827
- eval " $str "
828
- OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$line ])])])
829
- fi
799
+ # If a component is building static, we need to provide LDFLAGS
800
+ # and LIBS configuration to the wrapper compiler, so that it can
801
+ # provide them for the final link of the application. Components
802
+ # can explicitly set <framework>_<component>_WRAPPER_EXTRA_<flag>
803
+ # for either LDFLAGS or LIBS, for cases where the component wants
804
+ # to explicitly manage that behavior. If the full variable is not
805
+ # defined, this macro will copy <framework>_<component>_<flag>
806
+ # into the wrapper flags.
807
+ AS_IF([test " $8 " = " static" ],
808
+ [m4_foreach(flags, [LDFLAGS, LIBS],
809
+ [AS_VAR_SET_IF([$2 _$3 _WRAPPER_EXTRA_]flags,
810
+ [OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$ 2_$3 _WRAPPER_EXTRA_]flags)],
811
+ [OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$ 2_$3 ]_flags)])
812
+ dnl yes, this is weird indenting, but the
813
+ dnl combination of m4_foreach and AS_VAR_SET_IF
814
+ dnl will result in the closing of one if and the
815
+ dnl start of the next on the same line, resulting
816
+ dnl in parse errors, if this is not here.
817
+ ])])
830
818
831
819
# if needed, copy over WRAPPER_EXTRA_CPPFLAGS. Since a configure script
832
820
# component can never be used in a STOP_AT_FIRST framework, we
@@ -925,13 +913,7 @@ AC_DEFUN([MCA_COMPONENT_BUILD_CHECK],[
925
913
926
914
# if we were explicitly disabled, don't build :)
927
915
AS_IF([test " $DISABLE_ $2 " = " 1" ], [want_component=0])
928
- AS_LITERAL_IF([$3 ],
929
- [AS_IF([test " $DISABLE_ $2 _$3 " = " 1" ], [want_component=0])],
930
- [str=" DISABLED_COMPONENT_CHECK= \$ DISABLE_$2 _$3 "
931
- eval $str
932
- if test " $DISABLED_COMPONENT_CHECK " = " 1" ; then
933
- want_component=0
934
- fi])
916
+ AS_VAR_IF([DISABLE_$2 _$3 ], [1], [want_component = 0])
935
917
936
918
AS_IF([test " $want_component " = " 1" ], [$4 ], [$5 ])
937
919
])
0 commit comments