a741406ad6
Unfortunately, I didn't see Dave's review until CMR #4841 went in. Oops. This commit is a handful of minor m4 improvements to that original r32447 commit. It can go to v1.8.3, just to minimize drift between trunk and v1.8. Reviewed by Dave Goodell. cmr=v1.8.3:reviewer=ompi-rm1.8 This commit was SVN r32477. The following SVN revision numbers were found above: r32447 --> open-mpi/ompi@c6d9bf906e
66 строки
2.2 KiB
Bash
66 строки
2.2 KiB
Bash
dnl -*- shell-script -*-
|
|
dnl
|
|
dnl Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved.
|
|
dnl $COPYRIGHT$
|
|
dnl
|
|
dnl Additional copyrights may follow
|
|
dnl
|
|
dnl $HEADER$
|
|
dnl
|
|
|
|
# OPAL SEARCH_LIBS_CORE(func, list-of-libraries,
|
|
# action-if-found, action-if-not-found,
|
|
# other-libraries)
|
|
#
|
|
# Wrapper around AC SEARCH_LIBS. If a library ends up being added to
|
|
# $LIBS, then also add it to the wrapper LIBS list (so that it is
|
|
# added to the link command line for the static link case).
|
|
#
|
|
# NOTE: COMPONENTS SHOULD NOT USE THIS MACRO! Components should use
|
|
# OPAL_SEARCH_LIBS_COMPONENT. The reason why is because this macro
|
|
# calls OPAL_WRAPPER_FLAGS_ADD -- see big comment in
|
|
# opal_setup_wrappers.m4 for an explanation of why this is bad).
|
|
AC_DEFUN([OPAL_SEARCH_LIBS_CORE],[
|
|
m4_ifdef([mca_component_configure_active],
|
|
[m4_fatal([*** OPAL_SEARCH_LIBS_CORE cannot be called from a component configure.m4])])
|
|
|
|
OPAL_VAR_SCOPE_PUSH([LIBS_save add])
|
|
LIBS_save=$LIBS
|
|
|
|
AC_SEARCH_LIBS([$1], [$2],
|
|
[ # Found it! See if anything was added to LIBS
|
|
add=`printf '%s\n' "$LIBS" | sed -e "s/$LIBS_save$//"`
|
|
AS_IF([test -n "$add"],
|
|
[OPAL_WRAPPER_FLAGS_ADD([LIBS], [$add])])
|
|
$3],
|
|
[$4], [$5])
|
|
|
|
OPAL_VAR_SCOPE_POP
|
|
])dnl
|
|
|
|
# OPAL SEARCH_LIBS_COMPONENT(prefix, func, list-of-libraries,
|
|
# action-if-found, action-if-not-found,
|
|
# other-libraries)
|
|
#
|
|
# Same as OPAL SEARCH_LIBS_CORE, above, except that we don't call OPAL
|
|
# WRAPPER_FLAGS_ADD. Instead, we add it to the ${prefix}_LIBS
|
|
# variable (i.e., $prefix is usually "framework_component", such as
|
|
# "fbtl_posix").
|
|
AC_DEFUN([OPAL_SEARCH_LIBS_COMPONENT],[
|
|
m4_ifndef([mca_component_configure_active],
|
|
[m4_fatal([*** OPAL_SEARCH_LIBS_COMPONENT can only be called from a component configure.m4])])
|
|
|
|
OPAL_VAR_SCOPE_PUSH([LIBS_save add])
|
|
LIBS_save=$LIBS
|
|
|
|
AC_SEARCH_LIBS([$2], [$3],
|
|
[ # Found it! See if anything was added to LIBS
|
|
add=`printf '%s\n' "$LIBS" | sed -e "s/$LIBS_save$//"`
|
|
AS_IF([test -n "$add"],
|
|
[OPAL_FLAGS_APPEND_UNIQ($1_LIBS, [$add])])
|
|
$4],
|
|
[$5], [$6])
|
|
|
|
OPAL_VAR_SCOPE_POP
|
|
])dnl
|