@@ -130,6 +130,16 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_INIT],[
130130 [enable rpath/runpath support in the wrapper compilers (default=yes)])])
131131 AS_IF([test " $enable_wrapper_rpath " != " no" ], [enable_wrapper_rpath= yes])
132132 AC_MSG_RESULT([$enable_wrapper_rpath ])
133+
134+ AC_MSG_CHECKING([if want wrapper compiler runpath support])
135+ AC_ARG_ENABLE([wrapper-runpath],
136+ [AS_HELP_STRING([--enable--wrapper-runpath],
137+ [enable runpath in the wrapper compilers if linker supports it (default: enabled, unless wrapper-rpath is disabled).])])
138+ AS_IF([test " $enable_wrapper_runpath " != " no" ], [enable_wrapper_runpath= yes])
139+ AC_MSG_RESULT([$enable_wrapper_runpath ])
140+
141+ AS_IF([test " $enable_wrapper_rpath " = " no" && test " $enable_wrapper_runpath " = " yes" ],
142+ [AC_MSG_ERROR([--enable-wrapper-runpath cannot be selected with --disable-wrapper-rpath])])
133143])
134144
135145# Check to see whether the linker supports DT_RPATH. We'll need to
@@ -220,18 +230,19 @@ EOF
220230AC_DEFUN([OPAL_SETUP_RUNPATH],[
221231 OPAL_VAR_SCOPE_PUSH([LDFLAGS_save rpath_script rpath_outfile wl_fc])
222232
223- AC_MSG_CHECKING([if linker supports RUNPATH])
224233 # Set the output in $runpath_args
225234 runpath_args=
226235 LDFLAGS_save= $LDFLAGS
227236 LDFLAGS= " $LDFLAGS -Wl,--enable-new-dtags"
228- AC_LANG_PUSH([C])
229- AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 7; ])],
230- [WRAPPER_RPATH_SUPPORT= runpath
231- runpath_args= " -Wl,--enable-new-dtags"
232- AC_MSG_RESULT([yes (-Wl,--enable-new-dtags)])],
233- [AC_MSG_RESULT([no])])
234- AC_LANG_POP([C])
237+ AS_IF([test x" $enable_wrapper_runpath " = x" yes" ],
238+ [AC_LANG_PUSH([C])
239+ AC_MSG_CHECKING([if linker supports RUNPATH])
240+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 7; ])],
241+ [WRAPPER_RPATH_SUPPORT= runpath
242+ runpath_args= " -Wl,--enable-new-dtags"
243+ AC_MSG_RESULT([yes (-Wl,--enable-new-dtags)])],
244+ [AC_MSG_RESULT([no])])
245+ AC_LANG_POP([C])])
235246m4_ifdef([project_ompi],[
236247 # Output goes into globally-visible $rpath_args. Run this in a
237248 # sub-process so that we don't pollute the current process
0 commit comments