1
1

Clean up variables used in configure with OPAL_VAR_SCOPE.

This is helpful in the work for #3694: ensure that many places that
eventually end up in configure don't overly-pollute the global shell
variable space (because debugging accidental shell variable pollution
can be a real pain).

Refs trac:3694

This commit was SVN r29830.

The following Trac tickets were found above:
  Ticket 3694 --> https://svn.open-mpi.org/trac/ompi/ticket/3694
This commit is contained in:
Jeff Squyres 2013-12-06 23:40:34 +00:00
parent bb6908c9f0
commit 3bd9c603ff
15 changed files with 58 additions and 19 deletions

View File

@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -26,6 +26,7 @@ dnl
# in LIBS) then lib is added to LIBS. If func is not in lib, then
# LIBS is not modified.
AC_DEFUN([OMPI_CHECK_FUNC_LIB],[
OPAL_VAR_SCOPE_PUSH([LIBS_save])
AS_VAR_PUSHDEF([ompi_var], [ompi_cv_func_lib_$1_$2])dnl
AC_CACHE_CHECK([if we need -l$2 for $1],
ompi_var,
@ -45,4 +46,5 @@ AC_DEFUN([OMPI_CHECK_FUNC_LIB],[
# so will check in -l$2 if we decided we needed it above
AC_CHECK_FUNCS([$1], $3, $4)
AS_VAR_POPDEF([ompi_var])dnl
OPAL_VAR_SCOPE_POP
])

View File

@ -2,6 +2,7 @@
#
# Copyright (c) 2011 Mellanox Technologies. All rights reserved.
# Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -15,6 +16,8 @@
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
# support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_FCA],[
OPAL_VAR_SCOPE_PUSH([ompi_check_fca_dir ompi_check_fca_libdir ompi_check_fca_incdir ompi_check_fca_libs ompi_check_fca_happy CPPFLAGS_save LDFLAGS_save LIBS_save])
AC_ARG_WITH([fca],
[AC_HELP_STRING([--with-fca(=DIR)],
[Build fca (Mellanox Fabric Collective Accelerator) support, searching for libraries in DIR])])
@ -61,5 +64,7 @@ AC_DEFUN([OMPI_CHECK_FCA],[
[AS_IF([test ! -z "$with_fca" -a "$with_fca" != "no"],
[AC_MSG_ERROR([FCA support requested but not found. Aborting])])
$3])
OPAL_VAR_SCOPE_POP
])

View File

@ -2,6 +2,7 @@
#
# Copyright (c) 2011 Mellanox Technologies. All rights reserved.
# Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -15,6 +16,8 @@
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
# support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_HCOLL],[
OPAL_VAR_SCOPE_PUSH([ompi_check_hcoll_dir ompi_hcoll_libdir ompi_check_hcoll_incdir ompi_check_hcoll_libs ompi_check_hcoll_happy CPPFLAGS_save LDFLAGS_save LIBS_save])
AC_ARG_WITH([hcoll],
[AC_HELP_STRING([--with-hcoll(=DIR)],
[Build hcoll (Mellanox Hierarchical Collectives) support, searching for libraries in DIR])])
@ -63,5 +66,7 @@ AC_DEFUN([OMPI_CHECK_HCOLL],[
[AS_IF([test ! -z "$with_hcoll" -a "$with_hcoll" != "no"],
[AC_MSG_ERROR([HCOLL support requested but not found. Aborting])])
$3])
OPAL_VAR_SCOPE_POP
])

View File

@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
dnl $COPYRIGHT$
dnl
@ -23,7 +23,6 @@ dnl
# ----------------------------------------------------
AC_DEFUN([OMPI_FORTRAN_CHECK_REAL16_C_EQUIV],[
unset happy
unset CFLAGS_save
OPAL_VAR_SCOPE_PUSH([happy define_value msg CFLAGS_save])
AS_VAR_PUSHDEF([real16_matches_c_var], [ompi_cv_real16_c_equiv])

View File

@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -164,6 +164,7 @@ AS_IF([test "x$enable_wrapper_rpath" = "xyes"],
# ld-specific option). These flags are more social than
# DT_RPATH -- they can be overridden by LD_LIBRARY_PATH (where
# a regular DT_RPATH cannot).
OPAL_VAR_SCOPE_PUSH([LDFLAGS_save])
AC_MSG_CHECKING([if linker supports RUNPATH (vs. RPATH)])
LDFLAGS_save=$LDFLAGS
LDFLAGS="$LDFLAGS $rpath_args -Wl,--enable-new-dtags"
@ -176,5 +177,6 @@ AS_IF([test "x$enable_wrapper_rpath" = "xyes"],
AC_LANG_POP([C])
LDFLAGS=$LDFLAGS_save
AC_MSG_RESULT([$msg])
OPAL_VAR_SCOPE_POP
])
])dnl

View File

@ -13,7 +13,7 @@ dnl All rights reserved.
dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -50,7 +50,7 @@ AC_DEFUN_ONCE([_OMPI_SETUP_FC_COMPILER],[
# General Fortran compiler setup
AC_DEFUN([OMPI_SETUP_FC],[
OPAL_VAR_SCOPE_PUSH([ompi_fc_happy])
OPAL_VAR_SCOPE_PUSH([ompi_fc_happy LDFLAGS_save fc_version])
# Force the intro banner to be displayed first
AC_REQUIRE([_OMPI_SETUP_FC_BANNER])

View File

@ -9,7 +9,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -32,6 +32,8 @@ AC_DEFUN([OPAL_CHECK_PTHREAD_PIDS],[
#
AC_MSG_CHECKING([if threads have different pids (pthreads on linux)])
OPAL_VAR_SCOPE_PUSH([CFLAGS_save CPPFLAGS_save LDFLAGS_save LIBS_save MSG])
CFLAGS_save="$CFLAGS"
CFLAGS="$CFLAGS $THREAD_CFLAGS"
CPPFLAGS_save="$CPPFLAGS"
@ -107,4 +109,4 @@ AS_IF([test "$OPAL_THREADS_HAVE_DIFFERENT_PIDS" = "1"],
# if pthreads is not available, then the system does not have an insane threads
# model
#
unset MSG])dnl
OPAL_VAR_SCOPE_POP])dnl

View File

@ -11,7 +11,7 @@ dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2006 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2012 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl $COPYRIGHT$
@ -337,6 +337,7 @@ AC_DEFUN([_OMPI_PROG_CC],[
#
# Check for the compiler
#
OPAL_VAR_SCOPE_PUSH([ompi_cflags_save dummy ompi_cc_arvgv0])
ompi_cflags_save="$CFLAGS"
AC_PROG_CC
BASECC="`basename $CC`"
@ -346,4 +347,5 @@ AC_DEFUN([_OMPI_PROG_CC],[
ompi_cc_argv0=[$]2
OPAL_WHICH([$ompi_cc_argv0], [OPAL_CC_ABSOLUTE])
AC_SUBST(OPAL_CC_ABSOLUTE)
OPAL_VAR_SCOPE_POP
])

View File

@ -34,6 +34,7 @@ AC_DEFUN([OPAL_SETUP_JAVA_BANNER],[
AC_DEFUN([OPAL_SETUP_JAVA],[
AC_REQUIRE([OPAL_SETUP_JAVA_BANNER])
OPAL_VAR_SCOPE_PUSH([orte_java_happy bad found dir jnih PATH_save CPPFLAGS_save])
AC_ARG_ENABLE(java,
AC_HELP_STRING([--enable-java],
[Enable Java-based support in the system - use this option to disable all Java-based compiler tests (default: enabled)]))
@ -202,5 +203,5 @@ AC_DEFUN([OPAL_SETUP_JAVA],[
AC_DEFINE_UNQUOTED([OPAL_HAVE_JAVA_SUPPORT], [$HAVE_JAVA_SUPPORT], [do we have Java support])
AM_CONDITIONAL(OPAL_HAVE_JAVA_SUPPORT, test "$opal_java_happy" = "yes")
OPAL_VAR_SCOPE_POP
])

View File

@ -9,7 +9,7 @@ dnl Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
dnl reserved.
@ -145,6 +145,8 @@ AC_DEFUN([OPAL_SETUP_LIBLTDL],[
# Setup to build the internal copy of libltdl
#
AC_DEFUN([_OPAL_SETUP_LIBLTDL_INTERNAL],[
OPAL_VAR_SCOPE_PUSH([CFLAGS_save CPPFLAGS_save])
ompi_subdir_args="$ompi_subdir_args --enable-ltdl-convenience --disable-ltdl-install"
if test "$enable_shared" = "yes"; then
ompi_subdir_args="$ompi_subdir_args --enable-shared"
@ -192,4 +194,6 @@ AC_DEFUN([_OPAL_SETUP_LIBLTDL_INTERNAL],[
AC_MSG_ERROR([Cannot continue])
fi
CFLAGS="$CFLAGS_save"
OPAL_VAR_SCOPE_POP
])dnl

View File

@ -10,7 +10,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2009 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -21,6 +21,7 @@
# ORTE_CHECK_TM_LIBS_FLAGS(prefix, [LIBS or LDFLAGS])
# ---------------------------------------------------
AC_DEFUN([ORTE_CHECK_TM_LIBS_FLAGS],[
OPAL_VAR_SCOPE_PUSH([orte_check_tm_flags])
orte_check_tm_flags=`$orte_check_tm_pbs_config --libs`
for orte_check_tm_val in $orte_check_tm_flags; do
if test "`echo $orte_check_tm_val | cut -c1-2`" = "-l"; then
@ -33,12 +34,14 @@ AC_DEFUN([ORTE_CHECK_TM_LIBS_FLAGS],[
fi
fi
done
OPAL_VAR_SCOPE_POP
])
# ORTE_CHECK_TM(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([ORTE_CHECK_TM],[
OPAL_VAR_SCOPE_PUSH([orte_check_tm_found orte_check_tm_happy orte_check_tm_dir orte_check_tm_pbs_config LDFLAGS_save CPPFLAGS_save LIBS_save])
AC_ARG_WITH([tm],
[AC_HELP_STRING([--with-tm(=DIR)],
[Build TM (Torque, PBSPro, and compatible) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
@ -142,4 +145,6 @@ AC_DEFUN([ORTE_CHECK_TM],[
[AS_IF([test ! -z "$with_tm" -a "$with_tm" != "no"],
[AC_MSG_ERROR([TM support requested but not found. Aborting])])
$3])
OPAL_VAR_SCOPE_POP
])

View File

@ -76,13 +76,14 @@ AS_IF([test "$host" != "$target"],
AC_MSG_WARN([Cross-compiling is only partially supported])
AC_MSG_WARN([Proceed at your own risk!])])
# AC_USE_SYSTEM_EXTENSIONS alters CFLAGS (e.g., adds -g -O2)
OPAL_VAR_SCOPE_PUSH([CFLAGS_save])
CFLAGS_save=$CFLAGS
AC_USE_SYSTEM_EXTENSIONS
# AC_USE_SYSTEM_EXTENSIONS will modify CFLAGS if nothing was in there
# beforehand. We don't want that. So if there was nothing in
# CFLAGS, put nothing back in there.
AS_IF([test -z "$CFLAGS_save"], [CFLAGS=])
CFLAGS_save=
OPAL_VAR_SCOPE_POP
#
# Init automake
@ -455,6 +456,7 @@ OMPI_C_GET_ALIGNMENT(size_t, OPAL_ALIGNMENT_SIZE_T)
# <stdbool.h> or any other help)
#
OPAL_VAR_SCOPE_PUSH([MSG])
AC_MSG_CHECKING(for C bool type)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
AC_INCLUDES_DEFAULT],
@ -464,11 +466,13 @@ AC_DEFINE_UNQUOTED(OPAL_NEED_C_BOOL, $OPAL_NEED_C_BOOL,
[Whether the C compiler supports "bool" without any other help (such as <stdbool.h>)])
AC_MSG_RESULT([$MSG])
AC_CHECK_SIZEOF(_Bool)
OPAL_VAR_SCOPE_POP
#
# Check for other compiler characteristics
#
OPAL_VAR_SCOPE_PUSH([CFLAGS_save])
if test "$GCC" = "yes"; then
# gcc 2.96 will emit oodles of warnings if you use "inline" with
@ -487,7 +491,7 @@ if test "$GCC" = "yes"; then
# This also works nicely for gcc 3.x because "inline" will work on
# the first check, and all is fine. :-)
CFLAGS_save="$CFLAGS"
CFLAGS_save=$CFLAGS
CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY -Werror -ansi"
fi
AC_C_INLINE
@ -501,8 +505,9 @@ if test "x$ompi_cv_c_compiler_vendor" != "xmicrosoft"; then
fi
OMPI_C_WEAK_SYMBOLS
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS_save"
CFLAGS=$CFLAGS_save
fi
OPAL_VAR_SCOPE_POP
if test "x$CC" = "xicc"; then
OMPI_CHECK_ICC_VARARGS
@ -653,6 +658,7 @@ AC_CHECK_HEADERS([net/if.h], [], [],
# above). If we do have it, then check to see if it actually works.
# Define OPAL_USE_STDBOOL_H as approrpaite.
AC_CHECK_HEADERS([stdbool.h], [have_stdbool_h=1], [have_stdbool_h=0])
OPAL_VAR_SCOPE_PUSH([MSG])
AC_MSG_CHECKING([if <stdbool.h> works])
if test "$have_stdbool_h" = "1"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
@ -669,6 +675,7 @@ fi
AC_DEFINE_UNQUOTED(OPAL_USE_STDBOOL_H, $OPAL_USE_STDBOOL_H,
[Whether to use <stdbool.h> or not])
AC_MSG_RESULT([$MSG])
OPAL_VAR_SCOPE_POP
# checkpoint results
AC_CACHE_SAVE
@ -703,6 +710,7 @@ AC_CHECK_DECLS([AF_UNSPEC, PF_UNSPEC, AF_INET6, PF_INET6],
#endif])
# SA_RESTART in signal.h
OPAL_VAR_SCOPE_PUSH([MSG])
AC_MSG_CHECKING([if SA_RESTART defined in signal.h])
AC_EGREP_CPP(yes, [
#include <signal.h>
@ -712,6 +720,7 @@ AC_EGREP_CPP(yes, [
AC_DEFINE_UNQUOTED(OPAL_HAVE_SA_RESTART, $VALUE,
[Whether we have SA_RESTART in <signal.h> or not])
AC_MSG_RESULT([$MSG])
OPAL_VAR_SCOPE_POP
AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [], [
#include <sys/types.h>

View File

@ -10,7 +10,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2008-2011 Mellanox Technologies. All rights reserved.
# Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
@ -37,7 +37,7 @@ AC_DEFUN([MCA_ompi_btl_openib_POST_CONFIG], [
AC_DEFUN([MCA_ompi_btl_openib_CONFIG],[
AC_CONFIG_FILES([ompi/mca/btl/openib/Makefile])
OPAL_VAR_SCOPE_PUSH([cpcs have_threads])
OPAL_VAR_SCOPE_PUSH([cpcs have_threads LDFLAGS_save LIBS_save])
cpcs="oob"
OMPI_CHECK_OPENFABRICS([btl_openib],

View File

@ -82,6 +82,8 @@ EOF
# [action-if-cant-compile])
# ------------------------------------------------
AC_DEFUN([MCA_opal_event_libevent2021_CONFIG],[
OPAL_VAR_SCOPE_PUSH([CFLAGS_save CPPFLAGS_save file event_args libevent_happy])
AC_CONFIG_FILES([opal/mca/event/libevent2021/Makefile])
basedir="opal/mca/event/libevent2021"
@ -178,5 +180,6 @@ AC_DEFUN([MCA_opal_event_libevent2021_CONFIG],[
$1],
[$2
OPAL_HAVE_WORKING_EVENTOPS=0])
unset file
OPAL_VAR_SCOPE_POP
])

View File

@ -67,7 +67,7 @@ AC_DEFUN([MCA_opal_hwloc_hwloc172_CONFIG],[
AC_CONFIG_FILES([opal/mca/hwloc/hwloc172/Makefile])
OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc172_save_CPPFLAGS opal_hwloc_hwloc172_save_LDFLAGS opal_hwloc_hwloc172_save_LIBS opal_hwloc_hwloc172_save_cairo opal_hwloc_hwloc172_save_xml opal_hwloc_hwloc172_basedir opal_hwloc_hwloc172_file opal_hwloc_hwloc172_save_cflags])
OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc172_save_CPPFLAGS opal_hwloc_hwloc172_save_LDFLAGS opal_hwloc_hwloc172_save_LIBS opal_hwloc_hwloc172_save_cairo opal_hwloc_hwloc172_save_xml opal_hwloc_hwloc172_basedir opal_hwloc_hwloc172_file opal_hwloc_hwloc172_save_cflags CPPFLAGS_save])
# default to this component not providing support
opal_hwloc_hwloc172_basedir=opal/mca/hwloc/hwloc172