Anonymous avatar Anonymous committed 5a441d0 Draft

Merge r27950 into v1.7 code base

Comments (0)

Files changed (53)

config/ompi_ext.m4

     # now add the flags that were set in the environment variables
     # framework_component_FOO (for example, the flags set by
     # m4_configure components)
-    #
-    # Check for flags passed up from the component.  If we're
-    # compiling statically, then take all flags passed up from the
-    # component.
     m4_foreach(flags, [LDFLAGS, LIBS],
-        [[str="line=\$mpiext_${component}_WRAPPER_EXTRA_]flags["]
-          eval "$str"
-          if test -n "$line" ; then
-             $1[_WRAPPER_EXTRA_]flags[="$]$1[_WRAPPER_EXTRA_]flags[ $line"]
-          fi
-          ])dnl
+        [AS_IF([test "$mpiext_$1_WRAPPER_EXTRA_]flags[" = ""],
+                [OPAL_APPEND_UNIQ([ompi_mca_wrapper_extra_]m4_tolower(flags), [$mpiext_$1_]flags)],
+                [OPAL_APPEND_UNIQ([ompi_mca_wrapper_extra_]m4_tolower(flags), [$mpiext_$1_WRAPPER_EXTRA_]flags)])
+        ])
+
+    AS_IF([test "$mpiext_$1_WRAPPER_EXTRA_CPPFLAGS" != ""],
+        [OPAL_APPEND_UNIQ([ompi_mca_wrapper_extra_cppflags], [$mpiext_$1_WRAPPER_EXTRA_CPPFLAGS])])
 ])
 
 

config/ompi_mca.m4

     dnl for OPAL_CONFIGURE_USER env variable
     AC_REQUIRE([OPAL_CONFIGURE_SETUP])
 
+    # Set a special flag so that we can detect if the user calls
+    # OPAL_WRAPPER_FLAGS_ADD and error.
+    m4_define([mca_component_configure_active], [1])
+
     # Find which components should be built as run-time loadable components
     # Acceptable combinations:
     #
     MCA_SETUP_DIRECT_CALL(ompi, mtl)
 
     AC_SUBST(MCA_PROJECT_SUBDIRS)
+
+    m4_undefine([mca_component_configure_active])
 ])
 
 
                                    [MCA_]$1[_]mca_framework[_CONFIG]($1, mca_framework),
                                    [MCA_CONFIGURE_FRAMEWORK($1, mca_framework, 1)])])])
 
+    # note that mca_wrapper_extra_* is a running list, and we take checkpoints at the end of our project
+    $1_mca_wrapper_extra_cppflags="$mca_wrapper_extra_cppflags"
+    $1_mca_wrapper_extra_ldflags="$mca_wrapper_extra_ldflags"
+    $1_mca_wrapper_extra_libs="$mca_wrapper_extra_libs"
+
     AC_SUBST(MCA_$1_FRAMEWORKS)
     AC_SUBST(MCA_$1_FRAMEWORKS_SUBDIRS)
     AC_SUBST(MCA_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS)
            $4="$$4 $3"])
 
     m4_ifdef([MCA_$1_$2_$3_POST_CONFIG],
-             [MCA_$1_$2_$3_POST_CONFIG($should_build)])
+             [ MCA_$1_$2_$3_POST_CONFIG($should_build)])
 
     # set the AM_CONDITIONAL on how we should build
     AS_IF([test "$compile_mode" = "dso"], 
             fi
 
             if test "$should_build" = "1" ; then
+                # do some extra work to pass flags back from the
+                # top-level configure, the way a configure.m4
+                # component would.
+                infile="$srcdir/$1/mca/$2/$3/post_configure.sh"
+                if test -f $infile; then
+
+                    # First check for the ABORT tag
+                    line="`$GREP ABORT= $infile | cut -d= -f2-`"
+                    if test -n "$line" -a "$line" != "no"; then
+                        AC_MSG_WARN([MCA component configure script told me to abort])
+                        AC_MSG_ERROR([cannot continue])
+                    fi
+
+                    m4_foreach(flags, [LDFLAGS, LIBS],
+                        [[line="`$GREP WRAPPER_EXTRA_]flags[= $infile | cut -d= -f2-`"]
+                            eval "line=$line"
+                            if test -n "$line"; then
+                                $2[_]$3[_WRAPPER_EXTRA_]flags[="$line"]
+                            fi
+                        ])dnl
+                fi
+
                 MCA_PROCESS_COMPONENT($1, $2, $component, $3, $4, $5, $6, $compile_mode)
             else
                 MCA_PROCESS_DEAD_COMPONENT($1, $2, $component)
 ])
 
 
-######################################################################
-#
-# MCA_COMPONENT_COMPILE_MODE
-#
+# MCA_COMPONENT_COMPILE_MODE(project_name (1), framework_name (2),
+#                            component_name (3), compile_mode_variable (4))
+# -------------------------------------------------------------------------
 # set compile_mode_variable to the compile mode for the given component
 #
-# USAGE:
-#   MCA_COMPONENT_COMPILE_MODE(project_name, 
-#                              framework_name, component_name
-#                              compile_mode_variable)
-#
 #   NOTE: component_name may not be determined until runtime....
-#
-######################################################################
 AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
-    project=$1
-    framework=$2
-    component=$3
+    SHARED_FRAMEWORK="$DSO_$2"
+    AS_LITERAL_IF([$3],
+        [SHARED_COMPONENT="$DSO_$2_$3"],
+        [str="SHARED_COMPONENT=\$DSO_$2_$3"
+         eval $str])
 
-    # Is this component going to built staic or shared?  $component
-    # might not be known until configure time, so have to use eval
-    # tricks - can't set variable names at autogen time.
-    str="SHARED_FRAMEWORK=\$DSO_$framework"
-    eval $str
-    str="SHARED_COMPONENT=\$DSO_${framework}_$component"
-    eval $str
-
-    str="STATIC_FRAMEWORK=\$STATIC_$framework"
-    eval $str
-    str="STATIC_COMPONENT=\$STATIC_${framework}_$component"
-    eval $str
+    STATIC_FRAMEWORK="$STATIC_$2"
+    AS_LITERAL_IF([$3],
+        [STATIC_COMPONENT="$STATIC_$2_$3"],
+        [str="STATIC_COMPONENT=\$STATIC_$2_$3"
+         eval $str])
 
     shared_mode_override=static
 
         $4="static"
     fi
 
-    AC_MSG_CHECKING([for MCA component $framework:$component compile mode])
-    if test "$DIRECT_$2" = "$component" ; then
+    AC_MSG_CHECKING([for MCA component $2:$3 compile mode])
+    if test "$DIRECT_$2" = "$3" ; then
         AC_MSG_RESULT([$$4 - direct])
     else
         AC_MSG_RESULT([$$4])
 ])
 
 
-######################################################################
-#
-# MCA_PROCESS_COMPONENT
-#
-# does all setup work for given component.  It should be known before
+# MCA_PROCESS_COMPONENT(project_name(1), framework_name (2), component_name (3),
+#                        all_components_variable (4), static_components_variable (5)
+#                        dso_components_variable (6), static_ltlibs_variable (7),
+#                        compile_mode_variable (8))
+#---------------------------------------------------------------------
+# Final setup work for a given component.  It should be known before
 # calling that this component can build properly (and exists)
 #
-# USAGE:
-#   MCA_CONFIGURE_ALL_CONFIG_COMPONENTS(project_name, 
-#                         framework_name, component_name
-#                         all_components_variable (4), 
-#                         static_components_variable (5),
-#                         dso_components_variable (6),
-#                         static_ltlibs_variable (7),
-#                         compile_mode_variable (8))
-#
 #   NOTE: component_name may not be determined until runtime....
-#
-######################################################################
 AC_DEFUN([MCA_PROCESS_COMPONENT],[
     AC_REQUIRE([AC_PROG_GREP])
 
-    project=$1
-    framework=$2
-    component=$3
-
     # See if it dropped an output file for us to pick up some
     # shell variables in.  
-    infile="$srcdir/$project/mca/$framework/$component/post_configure.sh"
+    infile="$srcdir/$1/mca/$2/$3/post_configure.sh"
 
     # Add this subdir to the mast list of all MCA component subdirs
-    $4="$$4 $component"
+    $4="$$4 $3"
 
     if test "$8" = "dso" ; then
-        $6="$$6 $component"
+        $6="$$6 $3"
     else
-        $7="mca/$framework/$component/libmca_${framework}_${component}.la $$7"
-        echo "extern const mca_base_component_t mca_${framework}_${component}_component;" >> $outfile.extern
-        echo "  &mca_${framework}_${component}_component, " >> $outfile.struct
-        $5="$$5 $component"
+        $7="mca/$2/$3/libmca_$2_$3.la $$7"
+        echo "extern const mca_base_component_t mca_$2_$3_component;" >> $outfile.extern
+        echo "  &mca_$2_$3_component, " >> $outfile.struct
+        $5="$$5 $3"
     fi
 
     # Output pretty results
-    AC_MSG_CHECKING([if MCA component $framework:$component can compile])
+    AC_MSG_CHECKING([if MCA component $2:$3 can compile])
     AC_MSG_RESULT([yes])
     
-    # If there's an output file, add the values to
-    # scope_EXTRA_flags.
+    dnl BWB: FIX ME: We still use the post_configure.sh for frameworks that use the direct call infrastructure.
+    dnl All other uses we can ignore here, because config_components will have read it in and set all the
+    dnl proper environment variables.  At some point, we should handle the direct call stuff the same way we
+    dnl handle the headers for static components like timers in opal, ie, have a framework level configure.m4 that
+    dnl does the right thing
     if test -f $infile; then
-
-        # First check for the ABORT tag
-        line="`$GREP ABORT= $infile | cut -d= -f2-`"
-        if test -n "$line" -a "$line" != "no"; then
-            AC_MSG_WARN([MCA component configure script told me to abort])
-            AC_MSG_ERROR([cannot continue])
-        fi
-
-        # Check for flags passed up from the component.  If we're
-        # compiling statically, then take all flags passed up from the
-        # component.
-        if test "$8" = "static"; then
-            m4_foreach(flags, [LDFLAGS, LIBS],
-               [[line="`$GREP WRAPPER_EXTRA_]flags[= $infile | cut -d= -f2-`"]
-                eval "line=$line"
-                if test -n "$line"; then
-                    $1[_WRAPPER_EXTRA_]flags[="$]$1[_WRAPPER_EXTRA_]flags[ $line"]
-                fi
-            ])dnl
-        fi
-
-        dnl check for direct call header to include.  This will be
-        dnl AC_SUBSTed later.
-        if test "$DIRECT_$2" = "$component" ; then
+        # check for direct call header to include.  This will be
+        # AC_SUBSTed later.
+        if test "$DIRECT_$2" = "$3" ; then
             if test "`$GREP DIRECT_CALL_HEADER $infile`" != "" ; then
                 line="`$GREP DIRECT_CALL_HEADER $infile | cut -d= -f2-`"
-                str="MCA_${project}_${framework}_DIRECT_CALL_HEADER=$line"
+                str="MCA_$1_$2_DIRECT_CALL_HEADER=$line"
                 eval $str
             else
-AC_MSG_ERROR([*** ${framework} component ${component} was supposed to be direct-called, but
+AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
 *** does not appear to support direct calling.
 *** Aborting])
             fi
     else
         # were we supposed to have found something in the 
         # post_configure.sh, but the file didn't exist?
-        if test "$DIRECT_$2" = "$component" ; then
-AC_MSG_ERROR([*** ${framework} component ${component} was supposed to be direct-called, but
+        if test "$DIRECT_$2" = "$3" ; then
+AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
 *** does not appear to support direct calling.
 *** Aborting])
         fi
     fi
 
-    # now add the flags that were set in the environment variables
-    # framework_component_FOO (for example, the flags set by
-    # m4_configure components)
-    #
-    # Check for flags passed up from the component.  If we're
-    # compiling statically, then take all flags passed up from the
-    # component.
+    # if the component is building, add it's WRAPPER_EXTRA_LDFLAGS and
+    # WRAPPER_EXTRA_LIBS.  If the component doesn't specify it's
+    # WRAPPER_EXTRA_LIBS and WRAPPER_EXTRA_LDFLAGS, try using LDFLAGS and LIBS if
+    # component didn't have it's own configure script (in which case,
+    # we know it didn't set LDFLAGS and LIBS because it can't) Don't
+    # have to do this if the component is building dynamically,
+    # because it will link against these (without a dependency from
+    # libmpi.so to these flags)
     if test "$8" = "static"; then
-        m4_foreach(flags, [LDFLAGS, LIBS],
-            [[str="line=\$${framework}_${component}_WRAPPER_EXTRA_]flags["]
-             eval "$str"
-             if test -n "$line" ; then
-                 $1[_WRAPPER_EXTRA_]flags[="$]$1[_WRAPPER_EXTRA_]flags[ $line"]
-             fi
-             ])dnl
+        AS_LITERAL_IF([$3], 
+            [m4_foreach(flags, [LDFLAGS, LIBS],
+                    [AS_IF([test "$$2_$3_WRAPPER_EXTRA_]flags[" = ""],
+                           [OPAL_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$2_$3_]flags)],
+                           [OPAL_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$2_$3_WRAPPER_EXTRA_]flags)])
+                        ])],
+            [m4_foreach(flags, [LDFLAGS, LIBS],
+                    [[str="line=\$$2_$3_WRAPPER_EXTRA_]flags["]
+                      eval "$str"
+                      OPAL_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$line])])])
     fi
+
+    # if needed, copy over WRAPPER_EXTRA_CPPFLAGS.  Since a configure script
+    # component can never be used in a STOP_AT_FIRST framework, we
+    # don't have to implement the else clause in the literal check...
+    AS_LITERAL_IF([$3],
+        [AS_IF([test "$$2_$3_WRAPPER_EXTRA_CPPFLAGS" != ""], 
+           [m4_if(OMPI_EVAL_ARG([MCA_$1_$2_CONFIGURE_MODE]), [STOP_AT_FIRST], [stop_at_first=1], [stop_at_first=0])
+            AS_IF([test "$8" = "static" -a "$stop_at_first" = "1"],
+              [AS_IF([test "$with_devel_headers" = "yes"], 
+                     [OPAL_APPEND_UNIQ([mca_wrapper_extra_cppflags], [$$2_$3_WRAPPER_EXTRA_CPPFLAGS])])],
+              [AC_MSG_WARN([ignoring $2_$3_WRAPPER_EXTRA_CPPFLAGS ($$2_$3_WRAPPER_EXTRA_CPPFLAGS): component conditions not met])])])])
 ])
 
 
-######################################################################
-#
-# MCA_PROCESS_DEAD_COMPONENT
-#
-# process a component that can not be built.  Do the last minute checks
-# to make sure the user isn't doing something stupid.
-#
-# USAGE:
-#   MCA_PROCESS_DEAD_COMPONENT(project_name, 
-#                         framework_name, component_name)
+# MCA_PROCESS_DEAD_COMPONENT(project_name (1), framework_name (2),
+#                            component_name (3))
+# ----------------------------------------------------------------
+# Finall setup work for a component that can not be built.  Do the
+# last minute checks to make sure the user isn't doing something
+# stupid.
 #
 #   NOTE: component_name may not be determined until runtime....
-#
-######################################################################
 AC_DEFUN([MCA_PROCESS_DEAD_COMPONENT],[
     AC_MSG_CHECKING([if MCA component $2:$3 can compile])
     AC_MSG_RESULT([no])
         AC_MSG_WARN([MCA component "$3" failed to configure properly])
         AC_MSG_WARN([This component was selected as the default])
         AC_MSG_ERROR([Cannot continue])
-        exit 1
     fi
 
     if test ! -z "$DIRECT_$2" ; then
             AC_MSG_WARN([MCA component "$3" failed to configure properly])
             AC_MSG_WARN([This component was selected as the default (direct call)])
             AC_MSG_ERROR([Cannot continue])
-            exit 1
         fi
     fi
 ])
 
 
-
-######################################################################
-#
-# MCA_COMPONENT_BUILD_CHECK
-#
+# MCA_COMPONENT_BUILD_CHECK(project_name (1), framework_name(2), 
+#                           component_name (3), action-if-build (4)
+#                           action-if-not-build (5)
+# -----------------------------------------------------------------
 # checks the standard rules of component building to see if the 
 # given component should be built.
 #
-# USAGE:
-#    MCA_COMPONENT_BUILD_CHECK(project, framework, component, 
-#                              action-if-build, action-if-not-build)
-#
-######################################################################
+# Note: component_name may not be determined until runtime....
 AC_DEFUN([MCA_COMPONENT_BUILD_CHECK],[
     AC_REQUIRE([AC_PROG_GREP])
 
-    project=$1
-    framework=$2
-    component=$3
-    component_path="$srcdir/$project/mca/$framework/$component"
+    component_path="$srcdir/$1/mca/$2/$3"
     want_component=0
 
     # build if:
         # if this component type is direct and we are not it, we don't want
         # to be built.  Otherwise, we do want to be built.
         if test ! -z "$DIRECT_$2" ; then
-            if test "$DIRECT_$2" = "$component" ; then
+            if test "$DIRECT_$2" = "$3" ; then
                 want_component=1
             else
                 want_component=0
     fi
 
     # if we were explicitly disabled, don't build :)
-    str="DISABLED_COMPONENT_CHECK=\$DISABLE_${framework}"
-    eval $str
-    if test "$DISABLED_COMPONENT_CHECK" = "1" ; then
-        want_component=0
-    fi
-    str="DISABLED_COMPONENT_CHECK=\$DISABLE_${framework}_$component"
-    eval $str
-    if test "$DISABLED_COMPONENT_CHECK" = "1" ; then
-        want_component=0
-    fi
+    AS_IF([test "$DISABLE_$2" = "1"], [want_component=0])
+    AS_LITERAL_IF([$3],
+        [AS_IF([test "$DISABLE_$2_$3" = "1"], [want_component=0])],
+        [str="DISABLED_COMPONENT_CHECK=\$DISABLE_$2_$3"
+         eval $str
+         if test "$DISABLED_COMPONENT_CHECK" = "1" ; then
+             want_component=0
+         fi])
 
     AS_IF([test "$want_component" = "1"], [$4], [$5])
 ])
 
 
-######################################################################
-#
-# MCA_SETUP_DIRECT_CALL
-#
-# Do all the things necessary to setup the given framework for direct
-# call building
-#
-# USAGE:
-#   MCA_SETUP_DIRECT_CALL(project, framework)
-#
-######################################################################
+# MCA_SETUP_DIRECT_CALL(project_name (1), framework_name  (2))
+# -------------------------------------------------------------
 AC_DEFUN([MCA_SETUP_DIRECT_CALL],[
     if test ! -z "$DIRECT_$2" ; then
         MCA_$1_$2_DIRECT_CALL_COMPONENT=$DIRECT_$2

config/ompi_setup_component_package.m4

 #   the component, it's NOT a fatal error.
 # - Run OMPI_CHECK_PACKAGE (check for the specific presence of header
 #   files and/or libraries) to determine if the package is available
-# - Set <framework>_<component>_WRAPPER_EXTRA_LDFLAGS
-# - Set <framework>_<component>_WRAPPER_EXTRA_LIBS
 # - Set and AC_SUBST <framework>_<component>_CPPFLAGS
 # - Set and AC_SUBST <framework>_<component>_CFLAGS
 # - Set and AC_SUBST <framework>_<component>_LDFLAGS
                               [$1_$2_happy="no"])])
 
     AS_IF([test "$$1_$2_happy" = "yes"],
-          [$1_$2_WRAPPER_EXTRA_LDFLAGS="$$1_$2_LDFLAGS"
-           $1_$2_WRAPPER_EXTRA_LIBS="$$1_$2_LIBS"
-           $10],
+          [$10],
           [$11])
 
     # sanity check
                  [AC_MSG_WARN([$1:$2 requested but not found])
                   AC_MSG_ERROR([Cannot continue])])])
 
-    # substitute in the things needed to build libnuma
     AC_SUBST([$1_$2_CFLAGS])
     AC_SUBST([$1_$2_CPPFLAGS])
     AC_SUBST([$1_$2_LDFLAGS])
 AM_DISABLE_STATIC
 
 OPAL_SETUP_WRAPPER_INIT
-# There is no [need for] ORTE_SETUP_WRAPPER_INIT; this is not an
-# accidental omission
-m4_ifdef([project_ompi], [OMPI_SETUP_WRAPPER_INIT])
 
 ##################################
 # Check for known incompatibility
 
 CFLAGS="$CFLAGS $THREAD_CFLAGS"
 CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
-m4_ifdef([project_ompi],
-         [CXXFLAGS="$CXXFLAGS $THREAD_CXXFLAGS"
-          CXXCPPFLAGS="$CXXCPPFLAGS $THREAD_CXXCPPFLAGS"])
+CXXFLAGS="$CXXFLAGS $THREAD_CXXFLAGS"
+CXXCPPFLAGS="$CXXCPPFLAGS $THREAD_CXXCPPFLAGS"
 LDFLAGS="$LDFLAGS $THREAD_LDFLAGS"
 LIBS="$LIBS $THREAD_LIBS"
 
-WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS $THREAD_CFLAGS"
-m4_ifdef([project_ompi],
-         [WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS $THREAD_CXXFLAGS"
-          WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $THREAD_FCFLAGS"])
-WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $THREAD_LDFLAGS"
+OPAL_WRAPPER_FLAGS_ADD([CFLAGS], [$THREAD_CFLAGS])
+OPAL_WRAPPER_FLAGS_ADD([CXXFLAGS], [$THREAD_CXXFLAGS])
+OPAL_WRAPPER_FLAGS_ADD([FCFLAGS], [$THREAD_FCFLAGS])
+OPAL_WRAPPER_FLAGS_ADD([LDFLAGS], [$THREAD_LDFLAGS])
 # no need to update WRAPPER_EXTRA_LIBS - we'll get it from LT later
 
 #
 AC_PATH_PROG(PERL, perl, perl)
 
 OPAL_SETUP_WRAPPER_FINAL
-m4_ifdef([project_orte], [ORTE_SETUP_WRAPPER_FINAL])
-m4_ifdef([project_ompi], [OMPI_SETUP_WRAPPER_FINAL])
 
 # Recreate some defines prefixed with OMPI_ so that there are no bare
 # autoconf macro defines in mpi.h.  Since AC sometimes changes whether

ompi/config/ompi_setup_cxx.m4

             AC_MSG_WARN([$OMPI_COVERAGE_FLAGS has been added to CFLAGS (--enable-coverage)])
             WANT_DEBUG=1
             CXXFLAGS="${CXXFLAGS} $OMPI_COVERAGE_FLAGS"
-            WRAPPER_EXTRA_CXXFLAGS="${WRAPPER_EXTRA_CXXFLAGS} $OMPI_COVERAGE_FLAGS"
+            OPAL_WRAPPER_FLAGS_ADD([CXXFLAGS], [$OMPI_COVERAGE_FLAGS])
         else
             AC_MSG_WARN([Code coverage functionality is currently available only with GCC suite])
             AC_MSG_ERROR([Configure: cannot continue])
             CXXFLAGS="$CXXFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
             LDFLAGS="$LDFLAGS $OMPI_CXX_EXCEPTIONS_LDFLAGS"
 
-            WRAPPER_EXTRA_CFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_CFLAGS}"
-            WRAPPER_EXTRA_FCFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_FCFLAGS}"
-            WRAPPER_EXTRA_CXXFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_CXXFLAGS}"
+            OPAL_WRAPPER_FLAGS_ADD([CFLAGS], [$OMPI_CXX_EXCEPTIONS_CXXFLAGS])
+            OPAL_WRAPPER_FLAGS_ADD([CXXFLAGS], [$OMPI_CXX_EXCEPTIONS_CXXFLAGS])
+            OPAL_WRAPPER_FLAGS_ADD([FCFLAGS], [$OMPI_CXX_EXCEPTIONS_CXXFLAGS])
         fi
     fi
 ])

ompi/config/ompi_setup_fc.m4

   integer :: i
 end program]])],
                               [OMPI_FORTRAN_WRAPPER_FLAGS="-Wl,-commons,use_dylibs"
-                               WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $OMPI_FORTRAN_WRAPPER_FLAGS"],
+                               OPAL_WRAPPER_FLAGS_ADD([FCFLAGS], [$OMPI_FORTRAN_WRAPPER_FLAGS])],
                               [OMPI_FORTRAN_WRAPPER_FLAGS=none])
                AC_LANG_POP([Fortran])
                LDFLAGS=$LDFLAGS_save
     integer :: i
 end program]])],
                        [OMPI_FORTRAN_WRAPPER_FLAGS="-Wl,-commons,use_dylibs"
-                        WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $OMPI_FORTRAN_WRAPPER_FLAGS"],
+                        OPAL_WRAPPER_FLAGS_ADD([FCFLAGS], [$OMPI_FORTRAN_WRAPPER_FLAGS])],
                        [OMPI_FORTRAN_WRAPPER_FLAGS=none])
         AC_LANG_POP([Fortran])
         LDFLAGS=$LDFLAGS_save

ompi/config/ompi_setup_wrappers.m4

-dnl -*- shell-script -*-
-dnl
-dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
-dnl                         University Research and Technology
-dnl                         Corporation.  All rights reserved.
-dnl Copyright (c) 2004-2005 The University of Tennessee and The University
-dnl                         of Tennessee Research Foundation.  All rights
-dnl                         reserved.
-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) 2006-2010 Oracle and/or its affiliates.  All rights reserved.
-dnl Copyright (c) 2009-2012 Cisco Systems, Inc.  All rights reserved.
-dnl $COPYRIGHT$
-dnl 
-dnl Additional copyrights may follow
-dnl 
-dnl $HEADER$
-dnl
-
-
-# OMPI_SETUP_WRAPPER_INIT()
-# -------------------------
-# Setup wrapper compiler configuration information - should be called
-# before the bulk of the tests that can affect the wrapper compilers
-#
-# Note that we keep the user-specified flags seperately because we
-# don't want them to go through OPAL_UNIQ because that has resulted in
-# unexpected behavior for the user in the past.
-AC_DEFUN([OMPI_SETUP_WRAPPER_INIT],[
-    WRAPPER_EXTRA_FCFLAGS=
-    WRAPPER_EXTRA_FCFLAGS_PREFIX=
-    USER_WRAPPER_EXTRA_FCFLAGS=
-    USER_WRAPPER_EXTRA_FCLAGS_PREFIX=
-
-    AC_ARG_WITH([wrapper-fcflags], 
-        [AC_HELP_STRING([--with-wrapper-fcflags],
-             [Extra flags to add to FCFLAGS when using mpifort])])
-    if test "$with_wrapper_fcflags" = "yes" -o "$with_wrapper_fcflags" = "no"; then
-        AC_MSG_ERROR([--with-wrapper-fcflags must have an argument.  Aborting])
-    elif test ! -z "$with_wrapper_fcflags" ; then
-        USER_WRAPPER_EXTRA_FCFLAGS="$with_wrapper_fcflags"
-    fi
-
-    AC_ARG_WITH([wrapper-fcflags-prefix], 
-        [AC_HELP_STRING([--with-wrapper-fcflags-prefix],
-             [Extra flags (before user flags) to add to FCFLAGS when using mpifort])])
-    if test "$with_wrapper_fcflags_prefix" = "yes" -o "$with_wrapper_fcflags_prefix" = "no"; then
-        AC_MSG_ERROR([--with-wrapper-fcflags-prefix must have an argument.  Aborting])
-    elif test ! -z "$with_wrapper_fcflags_prefix" ; then
-        USER_WRAPPER_EXTRA_FCFLAGS_PREFIX="$with_wrapper_fcflags_prefix"
-    fi
-
-])
-
-AC_DEFUN([_OMPI_SETUP_ORTE_WRAPPERS],[
-    AC_MSG_CHECKING([for OMPI CPPFLAGS])
-    OMPI_WRAPPER_EXTRA_CPPFLAGS="$ORTE_WRAPPER_EXTRA_CPPFLAGS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_CPPFLAGS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CPPFLAGS])
-
-    AC_MSG_CHECKING([for OMPI CFLAGS])
-    OMPI_WRAPPER_EXTRA_CFLAGS="$ORTE_WRAPPER_EXTRA_CFLAGS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_CFLAGS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CFLAGS])
-
-    AC_MSG_CHECKING([for OMPI CFLAGS_PREFIX])
-    OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX="$ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX])
-
-    AC_MSG_CHECKING([for OMPI CXXFLAGS])
-    OMPI_WRAPPER_EXTRA_CXXFLAGS="$ORTE_WRAPPER_EXTRA_CXXFLAGS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_CXXFLAGS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CXXFLAGS])
-
-    AC_MSG_CHECKING([for OMPI CXXFLAGS_PREFIX])
-    OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX="$ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
-
-    AC_MSG_CHECKING([for OMPI FCFLAGS])
-    OMPI_WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $USER_WRAPPER_EXTRA_FCFLAGS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS])
-
-    AC_MSG_CHECKING([for OMPI FCFLAGS_PREFIX])
-    OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX="$WRAPPER_EXTRA_FCFLAGS_PREFIX $USER_WRAPPER_EXTRA_FCFLAGS_PREFIX"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX])
-
-    AC_MSG_CHECKING([for OMPI LDFLAGS])
-    OMPI_WRAPPER_EXTRA_LDFLAGS="$OMPI_WRAPPER_EXTRA_LDFLAGS $ORTE_WRAPPER_EXTRA_LDFLAGS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_LDFLAGS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LDFLAGS])
-
-    AC_MSG_CHECKING([for OMPI LIBS])
-    OMPI_WRAPPER_EXTRA_LIBS="$OMPI_WRAPPER_EXTRA_LIBS $ORTE_WRAPPER_EXTRA_LIBS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_LIBS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LIBS])
-
-    AC_MSG_CHECKING([for OMPI extra include dirs])
-    OMPI_WRAPPER_EXTRA_INCLUDES="$ORTE_WRAPPER_EXTRA_INCLUDES"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_INCLUDES])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_INCLUDES])
-])
-
-AC_DEFUN([_OMPI_SETUP_OPAL_WRAPPERS],[
-    AC_MSG_CHECKING([for OMPI CPPFLAGS])
-    OMPI_WRAPPER_EXTRA_CPPFLAGS="$OPAL_WRAPPER_EXTRA_CPPFLAGS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_CPPFLAGS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CPPFLAGS])
-
-    AC_MSG_CHECKING([for OMPI CFLAGS])
-    OMPI_WRAPPER_EXTRA_CFLAGS="$OPAL_WRAPPER_EXTRA_CFLAGS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_CFLAGS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CFLAGS])
-
-    AC_MSG_CHECKING([for OMPI CFLAGS_PREFIX])
-    OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX="$OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX])
-
-    AC_MSG_CHECKING([for OMPI CXXFLAGS])
-    OMPI_WRAPPER_EXTRA_CXXFLAGS="$OPAL_WRAPPER_EXTRA_CXXFLAGS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_CXXFLAGS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CXXFLAGS])
-
-    AC_MSG_CHECKING([for OMPI CXXFLAGS_PREFIX])
-    OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX="$OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CXXFLAGS])
-
-    AC_MSG_CHECKING([for OMPI FCFLAGS])
-    OMPI_WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $USER_WRAPPER_EXTRA_FCFLAGS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS])
-
-    AC_MSG_CHECKING([for OMPI FCFLAGS_PREFIX])
-    OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX="$WRAPPER_EXTRA_FCFLAGS_PREFIX $USER_WRAPPER_EXTRA_FCFLAGS_PREFIX"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX])
-
-    AC_MSG_CHECKING([for OMPI LDFLAGS])
-    OMPI_WRAPPER_EXTRA_LDFLAGS="$OMPI_WRAPPER_EXTRA_LDFLAGS $OPAL_WRAPPER_EXTRA_LDFLAGS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_LDFLAGS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LDFLAGS])
-
-    AC_MSG_CHECKING([for OMPI LIBS])
-    OMPI_WRAPPER_EXTRA_LIBS="$OMPI_WRAPPER_EXTRA_LIBS $OPAL_WRAPPER_EXTRA_LIBS"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_LIBS])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LIBS])
-
-    AC_MSG_CHECKING([for OMPI extra include dirs])
-    OMPI_WRAPPER_EXTRA_INCLUDES="$OPAL_WRAPPER_EXTRA_INCLUDES"
-    AC_SUBST([OMPI_WRAPPER_EXTRA_INCLUDES])
-    AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_INCLUDES])
-])
-
-AC_DEFUN([OMPI_SETUP_WRAPPER_FINAL],[
-    OPAL_UNIQ([WRAPPER_EXTRA_FCFLAGS])
-    OPAL_UNIQ([WRAPPER_EXTRA_FCFLAGS_PREFIX])
-
-    OPAL_UNIQ([OMPI_WRAPPER_EXTRA_LDFLAGS])
-    OPAL_UNIQ([OMPI_WRAPPER_EXTRA_LIBS])
-
-    m4_ifdef([project_orte], [_OMPI_SETUP_ORTE_WRAPPERS], [_OMPI_SETUP_OPAL_WRAPPERS])
-
-    # language binding support.  C++ is a bit different, as the
-    # compiler should work even if there is no MPI C++ bindings
-    # support.  However, we do want it to fail if there is no C++
-    # compiler.
-    if test "$WANT_MPI_CXX_SUPPORT" = "1" ; then
-        OMPI_WRAPPER_CXX_LIB="-lmpi_cxx"
-        OMPI_WRAPPER_CXX_REQUIRED_FILE=""
-    elif test "$CXX" = "none"; then
-        OMPI_WRAPPER_CXX_LIB=""
-        OMPI_WRAPPER_CXX_REQUIRED_FILE="not supported"
-    else
-        OMPI_WRAPPER_CXX_LIB=""
-        OMPI_WRAPPER_CXX_REQUIRED_FILE=""
-    fi
-    AC_SUBST([OMPI_WRAPPER_CXX_LIB])
-    AC_SUBST([OMPI_WRAPPER_CXX_REQUIRED_FILE])
-
-    if test "$OMPI_WANT_FORTRAN_BINDINGS" = "1" ; then
-        OMPI_WRAPPER_FORTRAN_REQUIRED_FILE=""
-    else
-        OMPI_WRAPPER_FORTRAN_REQUIRED_FILE="not supported"
-    fi
-    AC_SUBST([OMPI_WRAPPER_FORTRAN_REQUIRED_FILE])
-
-    # For script-based wrappers that don't do relocatable binaries.
-    # Don't use if you don't have to.
-    exec_prefix_save="${exec_prefix}"
-    test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
-    eval "OMPI_WRAPPER_INCLUDEDIR=\"${includedir}\""
-    eval "OMPI_WRAPPER_LIBDIR=\"${libdir}\""
-    exec_prefix="${exec_prefix_save}"
-    AC_SUBST([OMPI_WRAPPER_INCLUDEDIR])
-    AC_SUBST([OMPI_WRAPPER_LIBDIR])
-
-    # compatibility defines that will eventually go away
-    WRAPPER_EXTRA_FCFLAGS="$OMPI_WRAPPER_EXTRA_FCFLAGS"
-    WRAPPER_EXTRA_FCFLAGS_PREFIX="$OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX"
-    AC_SUBST([WRAPPER_EXTRA_FCFLAGS])
-    AC_SUBST([WRAPPER_EXTRA_FCFLAGS_PREFIX])
-
-    AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS, "$WRAPPER_EXTRA_FCFLAGS",
-        [Additional FCFLAGS to pass through the wrapper compilers])
-    AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS_PREFIX, "$WRAPPER_EXTRA_FCFLAGS_PREFIX",
-        [Additional FCFLAGS to pass through the wrapper compilers])
-
-
-    # if wrapper compilers were requested, set the ompi one up
-    if test "$WANT_SCRIPT_WRAPPER_COMPILERS" = "1" ; then
-        AC_CONFIG_FILES([ompi/tools/wrappers/ompi_wrapper_script],
-                        [chmod +x ompi/tools/wrappers/ompi_wrapper_script])
-    fi
-
-])

ompi/mca/bcol/iboffload/configure.m4

     OMPI_CHECK_MLNX_OPENFABRICS([bcol_iboffload], [bcol_mlnx_ofed_happy="yes"])
 
     AS_IF([test "$bcol_ofa_happy" = "yes" -a "$bcol_mlnx_ofed_happy" = "yes"],
-          [bcol_iboffload_WRAPPER_EXTRA_LDFLAGS="$bcol_iboffload_LDFLAGS"
-           bcol_iboffload_WRAPPER_EXTRA_LIBS="$bcol_iboffload_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # substitute in the things needed to build iboffload

ompi/mca/coll/fca/configure.m4

                      [coll_fca_happy="no"])
 
     AS_IF([test "$coll_fca_happy" = "yes"],
-          [coll_fca_WRAPPER_EXTRA_LDFLAGS="$coll_fca_LDFLAGS"
-           coll_fca_CPPFLAGS="$coll_fca_CPPFLAGS"
-           coll_fca_WRAPPER_EXTRA_CPPFLAGS="$coll_fca_CPPFLAGS"
-           coll_fca_WRAPPER_EXTRA_LIBS="$coll_fca_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # substitute in the things needed to build fca

ompi/mca/common/mx/configure.m4

                      [common_mx_happy="no"])
 
     AS_IF([test "$common_mx_happy" = "yes"],
-          [common_mx_WRAPPER_EXTRA_LDFLAGS="$common_mx_LDFLAGS"
-           common_mx_WRAPPER_EXTRA_LIBS="$common_mx_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # substitute in the things needed to build mx

ompi/mca/common/ofacm/configure.m4

                             OMPI_CHECK_OPENFABRICS_CM([common_ofacm])])
 
     AS_IF([test "$common_ofacm_happy" = "yes"],
-          [common_ofacm_WRAPPER_EXTRA_LDFLAGS="$common_ofacm_LDFLAGS"
-           common_ofacm_WRAPPER_EXTRA_LIBS="$common_ofacm_LIBS"
-           $1],
+          [$1],
           [$2])
 
     AS_IF([test "$common_ofacm_happy" = "yes"],

ompi/mca/common/ugni/configure.m4

         [common_ugni_happy="no"])
 
     AS_IF([test "$common_ugni_happy" = "yes"],
-        [common_ugni_WRAPPER_EXTRA_LDFLAGS="$common_ugni_LDFLAGS"
-	    common_ugni_WRAPPER_EXTRA_LIBS="$common_ugni_LIBS"
-	    $1],
+        [$1],
         [$2])
 
     # substitute in the things needed to build ugni

ompi/mca/common/verbs/configure.m4

                            [common_verbs_happy="yes"])
 
     AS_IF([test "$common_verbs_happy" = "yes"],
-          [common_verbs_WRAPPER_EXTRA_LDFLAGS="$common_verbs_LDFLAGS"
-           common_verbs_WRAPPER_EXTRA_LIBS="$common_verbs_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # substitute in the things needed to build openib

ompi/mca/fbtl/pvfs2/configure.m4

                      [fbtl_pvfs2_happy="no"])
 
     AS_IF([test "$fbtl_pvfs2_happy" = "yes"],
-           [fbtl_pvfs2_WRAPPER_EXTRA_LDFLAGS="$fbtl_pvfs2_LDFLAGS"
-           fbtl_pvfs2_WRAPPER_EXTRA_LIBS="$fbtl_pvfs2_LIBS"
-           $1],
+          [$1],
           [$2])
 
 

ompi/mca/fs/lustre/configure.m4

                      [fs_lustre_happy="no"])
 
     AS_IF([test "$fs_lustre_happy" = "yes"],
-           [fs_lustre_WRAPPER_EXTRA_LDFLAGS="$fs_lustre_LDFLAGS"
-           fs_lustre_WRAPPER_EXTRA_LIBS="$fs_lustre_LIBS"
-           $1],
+          [$1],
           [$2])
 
 #    AC_CHECK_HEADERS([lustre/liblustreapi.h], [],

ompi/mca/fs/pvfs2/configure.m4

                      [fs_pvfs2_happy="no"])
 
     AS_IF([test "$fs_pvfs2_happy" = "yes"],
-           [fs_pvfs2_WRAPPER_EXTRA_LDFLAGS="$fs_pvfs2_LDFLAGS"
-           fs_pvfs2_WRAPPER_EXTRA_LIBS="$fs_pvfs2_LIBS"
-           $1],
+          [$1],
           [$2])
 
 #    AC_CHECK_HEADERS([pvfs2.h], [],

ompi/mca/io/romio/configure.m4

                           LIBS="$io_romio_save_LIBS"
 
                           echo "ROMIO distribution configured successfully"
-                          io_romio_WRAPPER_EXTRA_LIBS="$io_romio_LIBS"
                           $1],
                          [AS_IF([test "$enable_io_romio" = "yes"],
                                 [AC_MSG_ERROR([ROMIO distribution did not configure successfully])],

ompi/mca/mtl/mx/configure.m4

                      [mtl_mx_happy="no"])
 
     AS_IF([test "$mtl_mx_happy" = "yes"],
-          [mtl_mx_WRAPPER_EXTRA_LDFLAGS="$mtl_mx_LDFLAGS"
-           mtl_mx_WRAPPER_EXTRA_LIBS="$mtl_mx_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # substitute in the things needed to build mx

ompi/mca/mtl/mxm/configure.m4

                    [mtl_mxm_happy="no"])
 
     AS_IF([test "$mtl_mxm_happy" = "yes"],
-          [mtl_mxm_WRAPPER_EXTRA_LDFLAGS="$mtl_mxm_LDFLAGS"
-           mtl_mxm_WRAPPER_EXTRA_LIBS="$mtl_mxm_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # substitute in the things needed to build mxm

ompi/mca/mtl/portals4/configure.m4

                      [mtl_portals4_happy="no"])
 
     AS_IF([test "$mtl_portals4_happy" = "yes"],
-          [mtl_portals4_WRAPPER_EXTRA_LDFLAGS="$mtl_portals4_LDFLAGS"
-           mtl_portals4_WRAPPER_EXTRA_LIBS="$mtl_portals4_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # need to propogate CPPFLAGS to all of OMPI
     AS_IF([test "$DIRECT_mtl" = "portals4"],
-          [CPPFLAGS="$CPPFLAGS $mtl_portals4_CPPFLAGS"])
+          [mtl_portals4_WRAPPER_EXTRA_CPPFLAGS="$mtl_portals4_CPPFLAGS"
+           CPPFLAGS="$CPPFLAGS $mtl_portals4_CPPFLAGS"])
 
     AC_ARG_ENABLE([mtl-portals4-flow-control],
        [AC_HELP_STRING([--enable-mtl-portals4-flow-control],

ompi/mca/mtl/psm/configure.m4

                      [mtl_psm_happy="no"])
 
     AS_IF([test "$mtl_psm_happy" = "yes"],
-          [mtl_psm_WRAPPER_EXTRA_LDFLAGS="$mtl_psm_LDFLAGS"
-           mtl_psm_WRAPPER_EXTRA_LIBS="$mtl_psm_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # substitute in the things needed to build psm

ompi/mca/sbgp/ibnet/configure.m4

     OMPI_CHECK_MLNX_OPENFABRICS([sbgp_ibnet], [sbgp_mlnx_ofed_happy="yes"])
 
     AS_IF([test "$sbgp_ofa_happy" = "yes" -a "$sbgp_mlnx_ofed_happy" = "yes"],
-          [sbgp_ibnet_WRAPPER_EXTRA_LDFLAGS="$sbgp_ibnet_LDFLAGS"
-           sbgp_ibnet_WRAPPER_EXTRA_LIBS="$sbgp_ibnet_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # substitute in the things needed to build iboffload

ompi/tools/wrappers/mpic++-wrapper-data.txt.in

 # intentionally only link in the MPI libraries (ORTE, OPAL, etc. are
 # pulled in implicitly) because we intend MPI applications to only use
 # the MPI API.
-libs=@OMPI_WRAPPER_CXX_LIB@ -lmpi @OMPI_WRAPPER_EXTRA_LIBS@
-libs_static=@OMPI_WRAPPER_CXX_LIB@ -lmpi @OMPI_WRAPPER_EXTRA_LIBS@ -lopen-rte @ORTE_WRAPPER_EXTRA_LIBS@ -lopen-pal @OPAL_WRAPPER_EXTRA_LIBS@
+libs=@OMPI_WRAPPER_CXX_LIB@ -lmpi
+libs_static=@OMPI_WRAPPER_CXX_LIB@ -lmpi -lopen-rte -lopen-pal @OMPI_WRAPPER_EXTRA_LIBS@
 dyn_lib_file=libmpi.@OPAL_DYN_LIB_SUFFIX@
 static_lib_file=libmpi.a
 required_file=@OMPI_WRAPPER_CXX_REQUIRED_FILE@

ompi/tools/wrappers/mpicc-wrapper-data.txt.in

 # intentionally only link in the MPI libraries (ORTE, OPAL, etc. are
 # pulled in implicitly) because we intend MPI applications to only use
 # the MPI API.
-libs=-lmpi @OMPI_WRAPPER_EXTRA_LIBS@
-libs_static=-lmpi @OMPI_WRAPPER_EXTRA_LIBS@ -lopen-rte @ORTE_WRAPPER_EXTRA_LIBS@ -lopen-pal @OPAL_WRAPPER_EXTRA_LIBS@
+libs=-lmpi
+libs_static=-lmpi -lopen-rte -lopen-pal @OMPI_WRAPPER_EXTRA_LIBS@
 dyn_lib_file=libmpi.@OPAL_DYN_LIB_SUFFIX@
 static_lib_file=libmpi.a
 required_file=

ompi/tools/wrappers/mpifort-wrapper-data.txt.in

 # intentionally only link in the MPI libraries (ORTE, OPAL, etc. are
 # pulled in implicitly) because we intend MPI applications to only use
 # the MPI API.
-libs=@OMPI_FORTRAN_USEMPIF08_LIB@ @OMPI_FORTRAN_USEMPI_LIB@ -lmpi_mpifh -lmpi @OMPI_WRAPPER_EXTRA_LIBS@
-libs_static=@OMPI_FORTRAN_USEMPIF08_LIB@ @OMPI_FORTRAN_USEMPI_LIB@ -lmpi_mpifh -lmpi @OMPI_WRAPPER_EXTRA_LIBS@ -lopen-rte @ORTE_WRAPPER_EXTRA_LIBS@ -lopen-pal @OPAL_WRAPPER_EXTRA_LIBS@
+libs=@OMPI_FORTRAN_USEMPIF08_LIB@ @OMPI_FORTRAN_USEMPI_LIB@ -lmpi_mpifh -lmpi
+libs_static=@OMPI_FORTRAN_USEMPIF08_LIB@ @OMPI_FORTRAN_USEMPI_LIB@ -lmpi_mpifh -lmpi -lopen-rte -lopen-pal  @OMPI_WRAPPER_EXTRA_LIBS@
 dyn_lib_file=libmpi.@OPAL_DYN_LIB_SUFFIX@
 static_lib_file=libmpi.a
 required_file=@OMPI_WRAPPER_FORTRAN_REQUIRED_FILE@

opal/config/opal_functions.m4

 dnl #######################################################################
 dnl #######################################################################
 
+# OPAL_APPEND_UNIQ(variable, new_argument)
+# ----------------------------------------
+# Append new_argument to variable if not already in variable.  This assumes a
+# space seperated list.
+#
+# This could probably be made more efficient :(.
+AC_DEFUN([OPAL_APPEND_UNIQ], [
+for arg in $2; do
+    ompi_found=0;
+    for val in ${$1}; do
+        if test "x$val" = "x$arg" ; then
+            ompi_found=1
+            break
+        fi
+    done
+    if test "$ompi_found" = "0" ; then
+        if test -z "$$1"; then
+            $1="$arg"
+        else
+            $1="$$1 $arg"
+        fi
+    fi
+done
+unset ompi_found
+])
+
+dnl #######################################################################
+dnl #######################################################################
+dnl #######################################################################
+
 # Macro that serves as an alternative to using `which <prog>`. It is
 # preferable to simply using `which <prog>` because backticks (`) (aka
 # backquotes) invoke a sub-shell which may source a "noisy"

opal/config/opal_setup_cc.m4

             fi
             CFLAGS="$CFLAGS_orig $OMPI_COVERAGE_FLAGS"
             LDFLAGS="$LDFLAGS_orig $OMPI_COVERAGE_FLAGS"
-            WRAPPER_EXTRA_CFLAGS="${WRAPPER_EXTRA_CFLAGS} $OMPI_COVERAGE_FLAGS"
-            WRAPPER_EXTRA_LDFLAGS="${WRAPPER_EXTRA_LDFLAGS} $OMPI_COVERAGE_FLAGS"
+            OPAL_WRAPPER_FLAGS_ADD([CFLAGS], [$OMPI_COVERAGE_FLAGS])
+            OPAL_WRAPPER_FLAGS_ADD([LDFLAGS], [$OMPI_COVERAGE_FLAGS])
 
             OPAL_UNIQ(CFLAGS)
             OPAL_UNIQ(LDFLAGS)
-            OPAL_UNIQ(WRAPPER_EXTRA_CFLAGS)
-            OPAL_UNIQ(WRAPPER_EXTRA_LDFLAGS)
             AC_MSG_WARN([$OMPI_COVERAGE_FLAGS has been added to CFLAGS (--enable-coverage)])
 
             WANT_DEBUG=1

opal/config/opal_setup_cxx.m4

             AC_MSG_WARN([$OPAL_COVERAGE_FLAGS has been added to CFLAGS (--enable-coverage)])
             WANT_DEBUG=1
             CXXFLAGS="${CXXFLAGS} $OPAL_COVERAGE_FLAGS"
-            WRAPPER_EXTRA_CXXFLAGS="${WRAPPER_EXTRA_CXXFLAGS} $OPAL_COVERAGE_FLAGS"
+            OPAL_WRAPPER_FLAGS_ADD([CXXFLAGS], [$OPAL_COVERAGE_FLAGS])
         else
             AC_MSG_WARN([Code coverage functionality is currently available only with GCC suite])
             AC_MSG_ERROR([Configure: cannot continue])

opal/config/opal_setup_libltdl.m4

           [AC_MSG_WARN([libltdl support disabled (by --disable-dlopen)])
            LIBLTDL=
            LDTLINCL=
-           WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $LIBS"],
+           OPAL_WRAPPER_FLAGS_ADD(LIBS, "$LIBS")],
           [
            # Default to building the internal copy.  After this,
            # paffinity_hwloc_location is guaranteed to be set to one of:
         OMPI_CHECK_LINKER_FLAGS([opal/libltdl/libtool], 
                                 [-export-dynamic $flags])
 
-        WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $extra_ldflags"
+        OPAL_WRAPPER_FLAGS_ADD([LIBS], [$extra_ldflags])
         LDFLAGS="-export-dynamic $LDFLAGS"
     else
         AC_MSG_WARN([Failed to build GNU libltdl.  This usually means that something])

opal/config/opal_setup_wrappers.m4

 dnl $HEADER$
 dnl
 
+# OPAL_WRAPPER_FLAGS_ADD(variable, new_argument)
+# ----------------------------------------------
+# Add new_argument to the list of arguments for variable in the wrapper compilers,
+# if it's not already there.  For example:
+#   OPAL_WRAPPER_FLAGS_ADD(CFLAGS, "-pthread")
+# will add -pthread to the list of CFLAGS the wrappers use when invoked.
+#
+# This macro MAY NOT be invoked from configure macros for MCA components.
+# See the comment in SETUP_WRAPPER_INIT (below) for more information.
+AC_DEFUN([OPAL_WRAPPER_FLAGS_ADD], [
+    m4_ifdef([mca_component_configure_active],
+        [m4_fatal([OPAL_WRAPPER_FLAGS_ADD can not be called from a component configure])])
+    m4_if([$1], [CPPFLAGS], [OPAL_APPEND_UNIQ([wrapper_extra_cppflags], [$2])],
+          [$1], [CFLAGS], [OPAL_APPEND_UNIQ([wrapper_extra_cflags], [$2])],
+          [$1], [CXXFLAGS], [OPAL_APPEND_UNIQ([wrapper_extra_cxxflags], [$2])],
+          [$1], [FCFLAGS], [OPAL_APPEND_UNIQ([wrapper_extra_fcflags], [$2])],
+          [$1], [LDFLAGS], [OPAL_APPEND_UNIQ([wrapper_extra_ldflags], [$2])],
+          [$1], [LIBS], [OPAL_APPEND_UNIQ([wrapper_extra_libs], [$2])],
+          [m4_fatal([Unknown wrapper flag type $1])])
+])
+
 
 # OPAL_SETUP_WRAPPER_INIT()
 # -------------------------
-# Setup wrapper compiler configuration information - should be called
-# before the bulk of the tests that can affect the wrapper compilers
+# Setup wrapper compiler configuration information.  Should be called early to 
+# prevent lots of calculations and then an abort for a silly user typo.  This 
+# macro works in pair with OPAL_SETUP_WRAPPER_FINAL, which should be called
+# almost at the end of configure (after the last call to OPAL_WRAPPER_FLAGS_ADD
+# and after the MCA system has been setup).
 #
-# Note that we keep the user-specified flags seperately because we
-# don't want them to go through OPAL_UNIQ because that has resulted in
-# unexpected behavior for the user in the past.
+# The wrapper compiler arguments are a little fragile and should NOT
+# be edited by configure directly.  Instead, main configure should use
+# OPAL_WRAPPER_FLAGS_ADD.
+#
+# When building statically, the MCA system will add
+# <framework>_<component>_WRAPPER_EXTRA_{LDFLAGS, LIBS} if set and try
+# to add <framework>_<component>_{LDFLAGS, LIBS} (if not an external
+# configure) to the wrapper LDFLAGS and LIBS.  Any arguments in
+# <framework>_<component>_WRAPPER_EXTRA_CPPFLAGS are passed to the
+# wrapper compilers IF AND ONLY IF the framework was a STOP_AT_FIRST
+# framework, the component is a static component, and devel headers
+# are installed.  Note that MCA components are ONLY allowed to
+# (indirectly) influence the wrapper CPPFLAGS, LDFLAGS, and LIBS.
+# That is, a component may not influence CFLAGS, CXXFLAGS, or FCFLAGS.
+#
+# Notes:
+#   * Keep user flags seperate as 1) they should have no influence
+#     over build and 2) they don't go through the uniqification we do
+#     with the other wrapper compiler options
+#   * While the user (the person who runs configure) is allowed to set
+#     <flag>_prefix, configure is not.  There's no known use case for
+#     doing so, and we'd like to force the issue.
 AC_DEFUN([OPAL_SETUP_WRAPPER_INIT],[
-    WRAPPER_EXTRA_CPPFLAGS=
-    WRAPPER_EXTRA_CFLAGS=
-    WRAPPER_EXTRA_CFLAGS_PREFIX=
-    WRAPPER_EXTRA_CXXFLAGS=
-    WRAPPER_EXTRA_CXXFLAGS_PREFIX=
-    WRAPPER_EXTRA_LDFLAGS=
-    WRAPPER_EXTRA_LIBS=
-
-    USER_WRAPPER_EXTRA_CFLAGS=
-    USER_WRAPPER_EXTRA_CFLAGS_PREFIX=
-    USER_WRAPPER_EXTRA_CXXFLAGS=
-    USER_WRAPPER_EXTRA_CXXFLAGS_PREFIX=
-    USER_WRAPPER_EXTRA_LDFLAGS=
-    USER_WRAPPER_EXTRA_LIBS=
-
     AC_ARG_WITH([wrapper-cflags], 
                 [AC_HELP_STRING([--with-wrapper-cflags],
                                 [Extra flags to add to CFLAGS when using mpicc])])
-    if test "$with_wrapper_cflags" = "yes" -o "$with_wrapper_cflags" = "no"; then
-        AC_MSG_ERROR([--with-wrapper-cflags must have an argument.  Aborting])
-    elif test ! -z "$with_wrapper_cflags" ; then
-        USER_WRAPPER_EXTRA_CFLAGS="$with_wrapper_cflags"
-    fi
+    AS_IF([test "$with_wrapper_cflags" = "yes" -o "$with_wrapper_cflags" = "no"],
+          [AC_MSG_ERROR([--with-wrapper-cflags must have an argument.])])
 
     AC_ARG_WITH([wrapper-cflags-prefix], 
                 [AC_HELP_STRING([--with-wrapper-cflags-prefix],
-                                [Extra flags to add to CFLAGS when using mpicc])])
-    if test "$with_wrapper_cflags_prefix" = "yes" -o "$with_wrapper_cflags_prefix" = "no"; then
-        AC_MSG_ERROR([--with-wrapper-cflags-prefix must have an argument.  Aborting])
-    elif test ! -z "$with_wrapper_cflags_prefix" ; then
-        USER_WRAPPER_EXTRA_CFLAGS_PREFIX="$with_wrapper_cflags_prefix"
-    fi
+                                [Extra flags (before user flags) to add to CFLAGS when using mpicc])])
+    AS_IF([test "$with_wrapper_cflags_prefix" = "yes" -o "$with_wrapper_cflags_prefix" = "no"],
+          [AC_MSG_ERROR([--with-wrapper-cflags-prefix must have an argument.])])
 
     AC_ARG_WITH([wrapper-cxxflags], 
         [AC_HELP_STRING([--with-wrapper-cxxflags],
                         [Extra flags to add to CXXFLAGS when using mpiCC/mpic++])])
-    if test "$with_wrapper_cxxflags" = "yes" -o "$with_wrapper_cxxflags" = "no"; then
-        AC_MSG_ERROR([--with-wrapper-cxxflags must have an argument.  Aborting])
-    elif test ! -z "$with_wrapper_cxxflags" ; then
-        USER_WRAPPER_EXTRA_CXXFLAGS="$with_wrapper_cxxflags"
-    fi
+    AS_IF([test "$with_wrapper_cxxflags" = "yes" -o "$with_wrapper_cxxflags" = "no"],
+          [AC_MSG_ERROR([--with-wrapper-cxxflags must have an argument.])])
 
     AC_ARG_WITH([wrapper-cxxflags-prefix], 
         [AC_HELP_STRING([--with-wrapper-cxxflags-prefix],
                         [Extra flags to add to CXXFLAGS when using mpiCC/mpic++])])
-    if test "$with_wrapper_cxxflags_prefix" = "yes" -o "$with_wrapper_cxxflags_prefix" = "no"; then
-        AC_MSG_ERROR([--with-wrapper-cxxflags-prefix must have an argument.  Aborting])
-    elif test ! -z "$with_wrapper_cxxflags_prefix" ; then
-        USER_WRAPPER_EXTRA_CXXFLAGS_PREFIX="$with_wrapper_cxxflags_prefix"
-    fi
+    AS_IF([test "$with_wrapper_cxxflags_prefix" = "yes" -o "$with_wrapper_cxxflags_prefix" = "no"],
+          [AC_MSG_ERROR([--with-wrapper-cxxflags-prefix must have an argument.])])
+
+    m4_ifdef([project_ompi], [
+            AC_ARG_WITH([wrapper-fcflags], 
+                [AC_HELP_STRING([--with-wrapper-fcflags],
+                        [Extra flags to add to FCFLAGS when using mpifort])])
+            AS_IF([test "$with_wrapper_fcflags" = "yes" -o "$with_wrapper_fcflags" = "no"],
+                [AC_MSG_ERROR([--with-wrapper-fcflags must have an argument.])])
+
+            AC_ARG_WITH([wrapper-fcflags-prefix], 
+                [AC_HELP_STRING([--with-wrapper-fcflags-prefix],
+                        [Extra flags (before user flags) to add to FCFLAGS when using mpifort])])
+            AS_IF([test "$with_wrapper_fcflags_prefix" = "yes" -o "$with_wrapper_fcflags_prefix" = "no"],
+                [AC_MSG_ERROR([--with-wrapper-fcflags-prefix must have an argument.])])])
 
     AC_ARG_WITH([wrapper-ldflags], 
                 [AC_HELP_STRING([--with-wrapper-ldflags],
                                 [Extra flags to add to LDFLAGS when using wrapper compilers])])
-    if test "$with_wrapper_ldflags" = "yes" -o "$with_wrapper_ldflags" = "no"; then
-        AC_MSG_ERROR([--with-wrapper-ldflags must have an argument.  Aborting])
-    elif test ! -z "$with_wrapper_ldflags" ; then
-        USER_WRAPPER_EXTRA_LDFLAGS="$with_wrapper_ldflags"
-    fi
+    AS_IF([test "$with_wrapper_ldflags" = "yes" -o "$with_wrapper_ldflags" = "no"],
+          [AC_MSG_ERROR([--with-wrapper-ldflags must have an argument.])])
 
     AC_ARG_WITH([wrapper-libs], 
                 [AC_HELP_STRING([--with-wrapper-libs],
                                 [Extra flags to add to LIBS when using wrapper compilers])])
-    if test "$with_wrapper_libs" = "yes" -o "$with_wrapper_libs" = "no"; then
-        AC_MSG_ERROR([--with-wrapper-libs must have an argument.  Aborting])
-    elif test ! -z "$with_wrapper_libs" ; then
-        USER_WRAPPER_EXTRA_LIBS="$with_wrapper_libs"
-    fi
+    AS_IF([test "$with_wrapper_libs" = "yes" -o "$with_wrapper_libs" = "no"],
+          [AC_MSG_ERROR([--with-wrapper-libs must have an argument.])])
 ])
 
 
+# OPAL_SETUP_WRAPPER_FINAL()
+# ---------------------------
 AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[
-    OPAL_UNIQ([WRAPPER_EXTRA_CPPFLAGS])
-    OPAL_UNIQ([WRAPPER_EXTRA_CFLAGS])
-    OPAL_UNIQ([WRAPPER_EXTRA_CFLAGS_PREFIX])
-    OPAL_UNIQ([WRAPPER_EXTRA_CXXFLAGS])
-    OPAL_UNIQ([WRAPPER_EXTRA_CXXFLAGS_PREFIX])
-    OPAL_UNIQ([WRAPPER_EXTRA_LDFLAGS])
+    m4_ifdef([project_opal], [
+       AC_MSG_CHECKING([for OPAL CPPFLAGS])
+       OPAL_WRAPPER_EXTRA_CPPFLAGS="$opal_mca_wrapper_extra_cppflags $wrapper_extra_cppflags $with_wrapper_cppflags"
+       AC_SUBST([OPAL_WRAPPER_EXTRA_CPPFLAGS])
+       AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CPPFLAGS])
 
-    OPAL_UNIQ([OPAL_WRAPPER_EXTRA_LDFLAGS])
-    OPAL_UNIQ([OPAL_WRAPPER_EXTRA_LIBS])
+       AC_MSG_CHECKING([for OPAL CFLAGS])
+       OPAL_WRAPPER_EXTRA_CFLAGS="$wrapper_extra_cflags $with_wrapper_cflags"
+       AC_SUBST([OPAL_WRAPPER_EXTRA_CFLAGS])
+       AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CFLAGS])
 
-    AC_MSG_CHECKING([for OPAL CPPFLAGS])
-    OPAL_WRAPPER_EXTRA_CPPFLAGS="$WRAPPER_EXTRA_CPPFLAGS $USER_WRAPPER_EXTRA_CPPFLAGS"
-    AC_SUBST([OPAL_WRAPPER_EXTRA_CPPFLAGS])
-    AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CPPFLAGS])
+       AC_MSG_CHECKING([for OPAL CFLAGS_PREFIX])
+       OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX="$with_wrapper_cflags_prefix"
+       AC_SUBST([OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX])
+       AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX])
 
-    AC_MSG_CHECKING([for OPAL CFLAGS])
-    OPAL_WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS $USER_WRAPPER_EXTRA_CFLAGS"
-    AC_SUBST([OPAL_WRAPPER_EXTRA_CFLAGS])
-    AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CFLAGS])
+       AC_MSG_CHECKING([for OPAL CXXFLAGS])
+       OPAL_WRAPPER_EXTRA_CXXFLAGS="$wrapper_extra_cxxflags $with_wrapper_cxxflags"
+       AC_SUBST([OPAL_WRAPPER_EXTRA_CXXFLAGS])
+       AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CXXFLAGS])
 
-    AC_MSG_CHECKING([for OPAL CFLAGS_PREFIX])
-    OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX="$WRAPPER_EXTRA_CFLAGS_PREFIX $USER_WRAPPER_EXTRA_CFLAGS_PREFIX"
-    AC_SUBST([OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX])
-    AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX])
+       AC_MSG_CHECKING([for OPAL CXXFLAGS_PREFIX])
+       OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX="$with_wrapper_cxxflags_prefix"
+       AC_SUBST([OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
+       AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
 
-    AC_MSG_CHECKING([for OPAL CXXFLAGS])
-    OPAL_WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS $USER_WRAPPER_EXTRA_CXXFLAGS"
-    AC_SUBST([OPAL_WRAPPER_EXTRA_CXXFLAGS])
-    AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CXXFLAGS])
+       AC_MSG_CHECKING([for OPAL LDFLAGS])
+       OPAL_WRAPPER_EXTRA_LDFLAGS="$opal_mca_wrapper_extra_ldflags $wrapper_extra_ldflags $with_wrapper_ldflags"
+       AC_SUBST([OPAL_WRAPPER_EXTRA_LDFLAGS])
+       AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_LDFLAGS])
 
-    AC_MSG_CHECKING([for OPAL CXXFLAGS_PREFIX])
-    OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX="$WRAPPER_EXTRA_CXXFLAGS_PREFIX $USER_WRAPPER_EXTRA_CXXFLAGS_PREFIX"
-    AC_SUBST([OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
-    AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
+       # wrapper_extra_libs doesn't really get populated until after the mca system runs
+       # since most of the libs come from libtool.  So this is the first time we can
+       # uniq them.  ROMIO in particular adds lots of things already in wrapper_extra_libs,
+       # and this cleans the duplication up a bunch.  Always add everything the user
+       # asked for, as they know better than us.
+       AC_MSG_CHECKING([for OPAL LIBS])
+       OPAL_WRAPPER_EXTRA_LIBS="$opal_mca_wrapper_extra_libs"
+       OPAL_APPEND_UNIQ([OPAL_WRAPPER_EXTRA_LIBS], [$wrapper_extra_libs])
+       OPAL_WRAPPER_EXTRA_LIBS="$OPAL_WRAPPER_EXTRA_LIBS $with_wrapper_libs"
+       AC_SUBST([OPAL_WRAPPER_EXTRA_LIBS])
+       AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_LIBS])
 
-    AC_MSG_CHECKING([for OPAL LDFLAGS])
-    OPAL_WRAPPER_EXTRA_LDFLAGS="$OPAL_WRAPPER_EXTRA_LDFLAGS $WRAPPER_EXTRA_LDFLAGS $USER_WRAPPER_EXTRA_LDFLAGS"
-    AC_SUBST([OPAL_WRAPPER_EXTRA_LDFLAGS])
-    AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_LDFLAGS])
+       AC_MSG_CHECKING([for OPAL extra include dirs])
+       if test "$WANT_INSTALL_HEADERS" = "1" ; then
+           OPAL_WRAPPER_EXTRA_INCLUDES="openmpi"
+       else
+           OPAL_WRAPPER_EXTRA_INCLUDES=
+       fi
+       AC_SUBST([OPAL_WRAPPER_EXTRA_INCLUDES])
+       AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_INCLUDES])
+    ])
 
-    AC_MSG_CHECKING([for OPAL LIBS])
-    OPAL_WRAPPER_EXTRA_LIBS="$OPAL_WRAPPER_EXTRA_LIBS $WRAPPER_EXTRA_LIBS $USER_WRAPPER_EXTRA_LIBS"
-    AC_SUBST([OPAL_WRAPPER_EXTRA_LIBS])
-    AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_LIBS])
+    m4_ifdef([project_orte], [
+       AC_MSG_CHECKING([for ORTE CPPFLAGS])
+       ORTE_WRAPPER_EXTRA_CPPFLAGS="$orte_mca_wrapper_extra_cppflags $wrapper_extra_cppflags $with_wrapper_cppflags"
+       AC_SUBST([ORTE_WRAPPER_EXTRA_CPPFLAGS])
+       AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CPPFLAGS])
 
-    AC_MSG_CHECKING([for OPAL extra include dirs])
-    if test "$WANT_INSTALL_HEADERS" = "1" ; then
-        OPAL_WRAPPER_EXTRA_INCLUDES="openmpi"
-    else
-        OPAL_WRAPPER_EXTRA_INCLUDES=
-    fi
-    AC_SUBST([OPAL_WRAPPER_EXTRA_INCLUDES])
-    AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_INCLUDES])
+       AC_MSG_CHECKING([for ORTE CFLAGS])
+       ORTE_WRAPPER_EXTRA_CFLAGS="$wrapper_extra_cflags $with_wrapper_cflags"
+       AC_SUBST([ORTE_WRAPPER_EXTRA_CFLAGS])
+       AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CFLAGS])
 
+       AC_MSG_CHECKING([for ORTE CFLAGS_PREFIX])
+       ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX="$with_wrapper_cflags_prefix"
+       AC_SUBST([ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX])
+       AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX])
 
-    # For script-based wrappers that don't do relocatable binaries.
-    # Don't use if you don't have to.
-    exec_prefix_save="${exec_prefix}"
-    test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
-    eval "OPAL_WRAPPER_INCLUDEDIR=\"${includedir}\""
-    eval "OPAL_WRAPPER_LIBDIR=\"${libdir}\""
-    exec_prefix="${exec_prefix_save}"
-    AC_SUBST([OPAL_WRAPPER_INCLUDEDIR])
-    AC_SUBST([OPAL_WRAPPER_LIBDIR])
+       AC_MSG_CHECKING([for ORTE CXXFLAGS])
+       ORTE_WRAPPER_EXTRA_CXXFLAGS="$wrapper_extra_cxxflags $with_wrapper_cxxflags"
+       AC_SUBST([ORTE_WRAPPER_EXTRA_CXXFLAGS])
+       AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CXXFLAGS])
 
-    # compatibility defines that will eventually go away
-    WRAPPER_EXTRA_CFLAGS="$OPAL_WRAPPER_EXTRA_CFLAGS"
-    WRAPPER_EXTRA_CFLAGS_PREFIX="$OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX"
-    WRAPPER_EXTRA_CXXFLAGS="$OPAL_WRAPPER_EXTRA_CXXFLAGS"
-    WRAPPER_EXTRA_CXXFLAGS_PREFIX="$OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX"
-    WRAPPER_EXTRA_LDFLAGS="$OPAL_WRAPPER_EXTRA_LDFLAGS"
-    WRAPPER_EXTRA_LIBS="$OPAL_WRAPPER_EXTRA_LIBS"
+       AC_MSG_CHECKING([for ORTE CXXFLAGS_PREFIX])
+       ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX="$with_wrapper_cxxflags_prefix"
+       AC_SUBST([ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
+       AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
 
-    AC_SUBST([WRAPPER_EXTRA_CFLAGS])
-    AC_SUBST([WRAPPER_EXTRA_CFLAGS_PREFIX])
-    AC_SUBST([WRAPPER_EXTRA_CXXFLAGS])
-    AC_SUBST([WRAPPER_EXTRA_CXXFLAGS_PREFIX])
-    AC_SUBST([WRAPPER_EXTRA_LDFLAGS])
-    AC_SUBST([WRAPPER_EXTRA_LIBS])
+       AC_MSG_CHECKING([for ORTE LDFLAGS])
+       ORTE_WRAPPER_EXTRA_LDFLAGS="$orte_mca_wrapper_extra_ldflags $wrapper_extra_ldflags $with_wrapper_ldflags"
+       AC_SUBST([ORTE_WRAPPER_EXTRA_LDFLAGS])
+       AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_LDFLAGS])
 
-    AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS, "$WRAPPER_EXTRA_CFLAGS",
-        [Additional CFLAGS to pass through the wrapper compilers])
-    AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS_PREFIX, "$WRAPPER_EXTRA_CFLAGS_PREFIX",
-        [Additional CFLAGS_PREFIX to pass through the wrapper compilers])
-    AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CXXFLAGS, "$WRAPPER_EXTRA_CXXFLAGS",
-        [Additional CXXFLAGS to pass through the wrapper compilers])
-    AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CXXFLAGS_PREFIX, "$WRAPPER_EXTRA_CXXFLAGS_PREFIX",
-        [Additional CXXFLAGS_PREFIX to pass through the wrapper compilers])
-    AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LDFLAGS, "$WRAPPER_EXTRA_LDFLAGS",
-        [Additional LDFLAGS to pass through the wrapper compilers])
-    AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LIBS, "$WRAPPER_EXTRA_LIBS",
-        [Additional LIBS to pass through the wrapper compilers])
+       AC_MSG_CHECKING([for ORTE LIBS])
+       ORTE_WRAPPER_EXTRA_LIBS="$orte_mca_wrapper_extra_libs"
+       OPAL_APPEND_UNIQ([ORTE_WRAPPER_EXTRA_LIBS], [$wrapper_extra_libs])
+       ORTE_WRAPPER_EXTRA_LIBS="$ORTE_WRAPPER_EXTRA_LIBS $with_wrapper_libs"
+       AC_SUBST([ORTE_WRAPPER_EXTRA_LIBS])
+       AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_LIBS])
+
+       AC_MSG_CHECKING([for ORTE extra include dirs])
+       if test "$WANT_INSTALL_HEADERS" = "1" ; then
+           ORTE_WRAPPER_EXTRA_INCLUDES="openmpi"
+       else
+           ORTE_WRAPPER_EXTRA_INCLUDES=
+       fi
+       AC_SUBST([ORTE_WRAPPER_EXTRA_INCLUDES])
+       AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_INCLUDES])
+
+       # For script-based wrappers that don't do relocatable binaries.
+       # Don't use if you don't have to.
+       exec_prefix_save="${exec_prefix}"
+       test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+       eval "ORTE_WRAPPER_INCLUDEDIR=\"${includedir}\""
+       eval "ORTE_WRAPPER_LIBDIR=\"${libdir}\""
+       exec_prefix="${exec_prefix_save}"
+       AC_SUBST([ORTE_WRAPPER_INCLUDEDIR])
+       AC_SUBST([ORTE_WRAPPER_LIBDIR])
+
+       # if wrapper compilers were requested, set the orte one up
+       if test "$WANT_SCRIPT_WRAPPER_COMPILERS" = "1" ; then
+         AC_CONFIG_FILES([orte/tools/wrappers/orte_wrapper_script],
+                         [chmod +x orte/tools/wrappers/orte_wrapper_script])
+       fi
+    ])
+
+    m4_ifdef([project_ompi], [
+       AC_MSG_CHECKING([for OMPI CPPFLAGS])
+       OMPI_WRAPPER_EXTRA_CPPFLAGS="$ompi_mca_wrapper_extra_cppflags $wrapper_extra_cppflags $with_wrapper_cppflags"
+       AC_SUBST([OMPI_WRAPPER_EXTRA_CPPFLAGS])
+       AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CPPFLAGS])
+
+       AC_MSG_CHECKING([for OMPI CFLAGS])
+       OMPI_WRAPPER_EXTRA_CFLAGS="$wrapper_extra_cflags $with_wrapper_cflags"
+       AC_SUBST([OMPI_WRAPPER_EXTRA_CFLAGS])
+       AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CFLAGS])
+
+       AC_MSG_CHECKING([for OMPI CFLAGS_PREFIX])
+       OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX="$with_wrapper_cflags_prefix"
+       AC_SUBST([OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX])
+       AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX])
+
+       AC_MSG_CHECKING([for OMPI CXXFLAGS])
+       OMPI_WRAPPER_EXTRA_CXXFLAGS="$wrapper_extra_cxxflags $with_wrapper_cxxflags"
+       AC_SUBST([OMPI_WRAPPER_EXTRA_CXXFLAGS])
+       AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CXXFLAGS])
+
+       AC_MSG_CHECKING([for OMPI CXXFLAGS_PREFIX])
+       OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX="$with_wrapper_cxxflags_prefix"
+       AC_SUBST([OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
+       AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
+
+       AC_MSG_CHECKING([for OMPI FCFLAGS])
+       OMPI_WRAPPER_EXTRA_FCFLAGS="$wrapper_extra_fcflags $with_wrapper_fcflags"
+       AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS])
+       AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS])
+
+       AC_MSG_CHECKING([for OMPI FCFLAGS_PREFIX])
+       OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX="$with_wrapper_fcflags_prefix"
+       AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX])
+       AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX])
+
+       AC_MSG_CHECKING([for OMPI LDFLAGS])
+       OMPI_WRAPPER_EXTRA_LDFLAGS="$ompi_mca_wrapper_extra_ldflags $wrapper_extra_ldflags $with_wrapper_ldflags"
+       AC_SUBST([OMPI_WRAPPER_EXTRA_LDFLAGS])
+       AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LDFLAGS])
+
+       AC_MSG_CHECKING([for OMPI LIBS])
+       OMPI_WRAPPER_EXTRA_LIBS="$ompi_mca_wrapper_extra_libs"
+       OPAL_APPEND_UNIQ([OMPI_WRAPPER_EXTRA_LIBS], [$wrapper_extra_libs])
+       OMPI_WRAPPER_EXTRA_LIBS="$OMPI_WRAPPER_EXTRA_LIBS $with_wrapper_libs"
+       AC_SUBST([OMPI_WRAPPER_EXTRA_LIBS])
+       AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LIBS])
+
+       AC_MSG_CHECKING([for OMPI extra include dirs])
+       if test "$WANT_INSTALL_HEADERS" = "1" ; then
+           OMPI_WRAPPER_EXTRA_INCLUDES="openmpi"
+       else
+           OMPI_WRAPPER_EXTRA_INCLUDES=
+       fi
+       AC_SUBST([OMPI_WRAPPER_EXTRA_INCLUDES])
+       AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_INCLUDES])
+
+      # language binding support.  C++ is a bit different, as the
+      # compiler should work even if there is no MPI C++ bindings
+      # support.  However, we do want it to fail if there is no C++
+      # compiler.
+       if test "$WANT_MPI_CXX_SUPPORT" = "1" ; then
+          OMPI_WRAPPER_CXX_LIB="-lmpi_cxx"
+          OMPI_WRAPPER_CXX_REQUIRED_FILE=""
+       elif test "$CXX" = "none"; then
+          OMPI_WRAPPER_CXX_LIB=""
+          OMPI_WRAPPER_CXX_REQUIRED_FILE="not supported"
+       else
+          OMPI_WRAPPER_CXX_LIB=""
+          OMPI_WRAPPER_CXX_REQUIRED_FILE=""
+       fi
+       AC_SUBST([OMPI_WRAPPER_CXX_LIB])
+       AC_SUBST([OMPI_WRAPPER_CXX_REQUIRED_FILE])
+
+       if test "$OMPI_WANT_FORTRAN_BINDINGS" = "1" ; then
+          OMPI_WRAPPER_FORTRAN_REQUIRED_FILE=""
+       else
+          OMPI_WRAPPER_FORTRAN_REQUIRED_FILE="not supported"
+       fi
+       AC_SUBST([OMPI_WRAPPER_FORTRAN_REQUIRED_FILE])
+
+       # For script-based wrappers that don't do relocatable binaries.
+       # Don't use if you don't have to.
+       exec_prefix_save="${exec_prefix}"
+       test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+       eval "OMPI_WRAPPER_INCLUDEDIR=\"${includedir}\""
+       eval "OMPI_WRAPPER_LIBDIR=\"${libdir}\""
+       exec_prefix="${exec_prefix_save}"
+       AC_SUBST([OMPI_WRAPPER_INCLUDEDIR])
+       AC_SUBST([OMPI_WRAPPER_LIBDIR])
+
+       # if wrapper compilers were requested, set the ompi one up
+       if test "$WANT_SCRIPT_WRAPPER_COMPILERS" = "1" ; then
+         AC_CONFIG_FILES([ompi/tools/wrappers/ompi_wrapper_script],
+                         [chmod +x ompi/tools/wrappers/ompi_wrapper_script])
+       fi
+
+       AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS, "$OMPI_WRAPPER_EXTRA_CFLAGS",
+           [Additional CFLAGS to pass through the wrapper compilers])
+       AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS_PREFIX, "$OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX",
+           [Additional CFLAGS_PREFIX to pass through the wrapper compilers])
+       AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CXXFLAGS, "$OMPI_WRAPPER_EXTRA_CXXFLAGS",
+           [Additional CXXFLAGS to pass through the wrapper compilers])
+       AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CXXFLAGS_PREFIX, "$OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX",
+           [Additional CXXFLAGS_PREFIX to pass through the wrapper compilers])
+       AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS, "$OMPI_WRAPPER_EXTRA_FCFLAGS",
+           [Additional FCFLAGS to pass through the wrapper compilers])
+       AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS_PREFIX, "$OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX",
+           [Additional FCFLAGS to pass through the wrapper compilers])
+       AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LDFLAGS, "$OMPI_WRAPPER_EXTRA_LDFLAGS",
+           [Additional LDFLAGS to pass through the wrapper compilers])
+       AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LIBS, "$OMPI_WRAPPER_EXTRA_LIBS",
+           [Additional LIBS to pass through the wrapper compilers])
+    ])
 ])

opal/mca/event/libevent2019/configure.m4

            AS_IF([test "$OMPI_TOP_BUILDDIR" != "$OMPI_TOP_SRCDIR"],
                  [CPPFLAGS="$CPPFLAGS -I$OMPI_TOP_BUILDDIR/$file/include"])
            unset file
-
-           # Finally, add some flags to the wrapper compiler if we're
-           # building with developer headers so that our headers can
-           # be found.
-           if test "$with_devel_headers" = "yes" ; then
-               WRAPPER_EXTRA_CPPFLAGS="$WRAPPER_EXTRA_CPPFLAGS "'-I${includedir}/openmpi/opal/mca/event/libevent2019/libevent -I${includedir}/openmpi/opal/mca/event/libevent2019/libevent/include'
-           fi
           ])
 ])
 
         AC_MSG_ERROR([Cannot continue])
     fi
 
+    # Finally, add some flags to the wrapper compiler if we're
+    # building with developer headers so that our headers can
+    # be found.
+    event_libevent2019_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}/openmpi/opal/mca/event/libevent2019/libevent -I${includedir}/openmpi/opal/mca/event/libevent2019/libevent/include'
+
     CFLAGS="$CFLAGS_save"
     CPPFLAGS="$CPPFLAGS_save"
 

opal/mca/hwloc/external/configure.m4

            # Finally, add some flags to the wrapper compiler if we're
            # building with developer headers so that our headers can
            # be found.
-           AS_IF([test "$with_devel_headers" = "yes"],
-               [OPAL_WRAPPER_EXTRA_CPPFLAGS="$OPAL_WRAPPER_EXTRA_CPPFLAGS $opal_hwloc_external_CPPFLAGS"])
-
-           OPAL_WRAPPER_EXTRA_LDFLAGS="$OPAL_WRAPPER_EXTRA_LDFLAGS $opal_hwloc_external_LDFLAGS"
-           OPAL_WRAPPER_EXTRA_LIBS="$OPAL_WRAPPER_EXTRA_LIBS $opal_hwloc_external_LIBS"
+           hwloc_external_WRAPPER_EXTRA_CPPFLAGS="$opal_hwloc_external_CPPFLAGS"
+           hwloc_external_WRAPPER_EXTRA_LDFLAGS="$opal_hwloc_external_LDFLAGS"
+           hwloc_external_WRAPPER_EXTRA_LIBS="$opal_hwloc_external_LIBS"
           ])
     OPAL_VAR_SCOPE_POP
 ])dnl

opal/mca/hwloc/hwloc151/configure.m4

            AS_IF([test "$OMPI_TOP_BUILDDIR" != "$OMPI_TOP_SRCDIR"],
                  [CPPFLAGS="$CPPFLAGS -I$OMPI_TOP_BUILDDIR/$file/include"])
            unset file
-
-           # Finally, add some flags to the wrapper compiler if we're
-           # building with developer headers so that our headers can
-           # be found.
-           AS_IF([test "$with_devel_headers" = "yes"],
-               [WRAPPER_EXTRA_CPPFLAGS="$WRAPPER_EXTRA_CPPFLAGS "'-I${includedir}/openmpi/'"$opal_hwloc_hwloc151_basedir/hwloc/include"])
           ])
     OPAL_VAR_SCOPE_POP
 
         AC_SUBST([opal_hwloc_hwloc151_CPPFLAGS])
         AC_SUBST([opal_hwloc_hwloc151_LDFLAGS])
         AC_SUBST([opal_hwloc_hwloc151_LIBS])
+
+        # Finally, add some flags to the wrapper compiler so that our
+        # headers can be found.
+        hwloc_hwloc151_WRAPPER_EXTRA_LDFLAGS="$HWLOC_EMBEDDED_LDFLAGS"
+        hwloc_hwloc151_WRAPPER_EXTRA_LIBS="$HWLOC_EMBEDDED_LIBS"
+        hwloc_hwloc151_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}/openmpi/'"$opal_hwloc_hwloc151_basedir/hwloc/include"
     fi
 
     # Done!

opal/mca/memory/linux/configure.m4

 
     # If all is good, save the extra libs for the wrapper
     AS_IF([test "$memory_linux_ptmalloc2_happy" = yes],
-          [memory_linux_WRAPPER_EXTRA_LIBS="$memory_linux_LIBS"
-           value=1],
+          [value=1],
           [value=0])
     AC_DEFINE_UNQUOTED([MEMORY_LINUX_PTMALLOC2], [$value],
                        [Whether ptmalloc2 is supported on this system or not])

opal/mca/memory/malloc_solaris/configure.m4

                                   [Whether to use the legacy Solaris munmap prototype or not])
                ])
 
-        AS_IF([test "$memory_malloc_solaris_happy" = "yes"],
-              [memory_malloc_solaris_WRAPPER_EXTRA_LIBS="$memory_malloc_solaris_LIBS"])
-
         AS_IF([test "$memory_malloc_solaris_happy" = "no" -a \
                 "$memory_malloc_solaris_should_use" = "1"],
               [AC_MSG_ERROR([malloc_solaris memory management requested but not available.  Aborting.])])

opal/mca/timer/aix/configure.m4

     AC_SUBST(timer_aix_LIBS)
 
     AS_IF([test "$timer_aix_happy" = "yes"], 
-          [timer_aix_WRAPPER_EXTRA_LIBS="$timer_aix_LIBS"
-           $1], 
+          [$1], 
           [$2])
 ])

opal/tools/wrappers/opalc++-wrapper-data.txt.in

 compiler_flags_prefix=@OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX@
 compiler_flags=@OPAL_WRAPPER_EXTRA_CXXFLAGS@
 linker_flags=@OPAL_WRAPPER_EXTRA_LDFLAGS@
-libs=-lopen-pal @OPAL_WRAPPER_EXTRA_LIBS@
+libs=-lopen-pal
 libs_static=-lopen-pal @OPAL_WRAPPER_EXTRA_LIBS@
 dyn_lib_file=libopen-pal.@OPAL_DYN_LIB_SUFFIX@
 static_lib_file=libopen-pal.a

opal/tools/wrappers/opalcc-wrapper-data.txt.in

 compiler_flags_prefix=@OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX@
 compiler_flags=@OPAL_WRAPPER_EXTRA_CFLAGS@
 linker_flags=@OPAL_WRAPPER_EXTRA_LDFLAGS@
-libs=-lopen-pal @OPAL_WRAPPER_EXTRA_LIBS@
+libs=-lopen-pal
 libs_static=-lopen-pal @OPAL_WRAPPER_EXTRA_LIBS@
 dyn_lib_file=libopen-pal.@OPAL_DYN_LIB_SUFFIX@
 static_lib_file=libopen-pal.a

orte/config/orte_check_alps.m4

                          [AC_MSG_RESULT([not found])])
 
                    AS_IF([test "$orte_check_alps_pmi_happy" = "yes" -a "$orte_without_full_support" = 0],
-                         [WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS -L$orte_check_alps_libdir"
-                          WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lalpslli -lalpsutil"],
+                         [$1_LIBS="-lalpslli -lalpsutil"],
                          [AC_MSG_WARN([PMI support for Alps requested but not found])
                           AC_MSG_ERROR([Cannot continue])])
                fi

orte/config/orte_check_pmi.m4

                   $1_LDFLAGS="$orte_check_pmi_$1_LDFLAGS"
                   $1_CPPFLAGS="$orte_check_pmi_$1_CPPFLAGS"
                   $1_LIBS="-lpmi"
-                  AS_IF([test -z "$orte_pmi_wrapper_flags_added"],
-                        [orte_pmi_wrapper_flags_added=yes
-                         WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $orte_check_pmi_$1_LDFLAGS"
-                         WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lpmi"])
                   $2],
                  [AC_MSG_RESULT([no])
                   AC_MSG_WARN([PMI support requested (via --with-pmi) but not found.])

orte/config/orte_setup_wrappers.m4

-dnl -*- shell-script -*-
-dnl
-dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
-dnl                         University Research and Technology
-dnl                         Corporation.  All rights reserved.
-dnl Copyright (c) 2004-2005 The University of Tennessee and The University
-dnl                         of Tennessee Research Foundation.  All rights
-dnl                         reserved.
-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) 2006-2010 Oracle and/or its affiliates.  All rights reserved.
-dnl Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
-dnl $COPYRIGHT$
-dnl 
-dnl Additional copyrights may follow
-dnl 
-dnl $HEADER$
-dnl
-
-
-AC_DEFUN([ORTE_SETUP_WRAPPER_FINAL],[
-    OPAL_UNIQ([ORTE_WRAPPER_EXTRA_LDFLAGS])
-    OPAL_UNIQ([ORTE_WRAPPER_EXTRA_LIBS])
-
-    AC_MSG_CHECKING([for ORTE CPPFLAGS])
-    ORTE_WRAPPER_EXTRA_CPPFLAGS="$WRAPPER_EXTRA_CPPFLAGS"
-    AC_SUBST([ORTE_WRAPPER_EXTRA_CPPFLAGS])
-    AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CPPFLAGS])
-
-    AC_MSG_CHECKING([for ORTE CXXFLAGS])
-    ORTE_WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS"
-    AC_SUBST([ORTE_WRAPPER_EXTRA_CXXFLAGS])
-    AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CXXFLAGS])
-
-    AC_MSG_CHECKING([for ORTE CXXFLAGS_PREFIX])
-    ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX="$WRAPPER_EXTRA_CXXFLAGS_PREFIX"
-    AC_SUBST([ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
-    AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
-
-    AC_MSG_CHECKING([for ORTE CFLAGS])
-    ORTE_WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS"
-    AC_SUBST([ORTE_WRAPPER_EXTRA_CFLAGS])
-    AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CFLAGS])
-
-    AC_MSG_CHECKING([for ORTE CFLAGS_PREFIX])
-    ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX="$WRAPPER_EXTRA_CFLAGS_PREFIX"
-    AC_SUBST([ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX])
-    AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX])
-
-    AC_MSG_CHECKING([for ORTE LDFLAGS])
-    ORTE_WRAPPER_EXTRA_LDFLAGS="$ORTE_WRAPPER_EXTRA_LDFLAGS $WRAPPER_EXTRA_LDFLAGS"
-    AC_SUBST([ORTE_WRAPPER_EXTRA_LDFLAGS])
-    AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_LDFLAGS])
-
-    AC_MSG_CHECKING([for ORTE LIBS])
-    ORTE_WRAPPER_EXTRA_LIBS="$ORTE_WRAPPER_EXTRA_LIBS $WRAPPER_EXTRA_LIBS"
-    AC_SUBST([ORTE_WRAPPER_EXTRA_LIBS])
-    AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_LIBS])
-
-    AC_MSG_CHECKING([for ORTE extra include dirs])
-    if test "$WANT_INSTALL_HEADERS" = "1" ; then
-        ORTE_WRAPPER_EXTRA_INCLUDES="openmpi"
-    else
-        ORTE_WRAPPER_EXTRA_INCLUDES=
-    fi
-    AC_SUBST([ORTE_WRAPPER_EXTRA_INCLUDES])
-    AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_INCLUDES])
-
-
-    # For script-based wrappers that don't do relocatable binaries.
-    # Don't use if you don't have to.
-    exec_prefix_save="${exec_prefix}"
-    test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
-    eval "ORTE_WRAPPER_INCLUDEDIR=\"${includedir}\""
-    eval "ORTE_WRAPPER_LIBDIR=\"${libdir}\""
-    exec_prefix="${exec_prefix_save}"
-    AC_SUBST([ORTE_WRAPPER_INCLUDEDIR])
-    AC_SUBST([ORTE_WRAPPER_LIBDIR])
-
-    # if wrapper compilers were requested, set the orte one up
-    if test "$WANT_SCRIPT_WRAPPER_COMPILERS" = "1" ; then
-        AC_CONFIG_FILES([orte/tools/wrappers/orte_wrapper_script],
-                        [chmod +x orte/tools/wrappers/orte_wrapper_script])
-    fi
-
-])

orte/mca/ess/lsf/configure.m4

     # if check worked, set wrapper flags if so.  
     # Evaluate succeed / fail
     AS_IF([test "$ess_lsf_good" = "1" -a "$orte_without_full_support" = 0],
-          [ess_lsf_WRAPPER_EXTRA_LDFLAGS="$ess_lsf_LDFLAGS"
-           ess_lsf_WRAPPER_EXTRA_LIBS="$ess_lsf_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # set build flags to use in makefile

orte/mca/ess/slurm/configure.m4

     # if check worked, set wrapper flags if so.  
     # Evaluate succeed / fail
     AS_IF([test "$ess_slurm_good" = "1" -a "$orte_without_full_support" = 0],
-          [ess_slurm_WRAPPER_EXTRA_LDFLAGS="$ess_slurm_LDFLAGS"
-           ess_slurm_WRAPPER_EXTRA_LIBS="$ess_slurm_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # set build flags to use in makefile

orte/mca/ess/tm/configure.m4

     # if check worked, set wrapper flags if so.  
     # Evaluate succeed / fail
     AS_IF([test "$ess_tm_good" = "1" -a "$orte_without_full_support" = 0],
-          [ess_tm_WRAPPER_EXTRA_LDFLAGS="$ess_tm_LDFLAGS"
-           ess_tm_WRAPPER_EXTRA_LIBS="$ess_tm_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # set build flags to use in makefile

orte/mca/plm/lsf/configure.m4

     # if check worked, set wrapper flags if so.  
     # Evaluate succeed / fail
     AS_IF([test "$plm_lsf_good" = "1" -a "$orte_without_full_support" = 0],
-          [plm_lsf_WRAPPER_EXTRA_LDFLAGS="$plm_lsf_LDFLAGS"
-           plm_lsf_WRAPPER_EXTRA_LIBS="$plm_lsf_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # set build flags to use in makefile

orte/mca/plm/slurm/configure.m4

     # if check worked, set wrapper flags if so.  
     # Evaluate succeed / fail
     AS_IF([test "$plm_slurm_good" = "1" -a "$orte_without_full_support" = 0],
-          [plm_slurm_WRAPPER_EXTRA_LDFLAGS="$plm_slurm_LDFLAGS"
-           plm_slurm_WRAPPER_EXTRA_LIBS="$plm_slurm_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # set build flags to use in makefile

orte/mca/plm/tm/configure.m4

     # if check worked, set wrapper flags if so.  
     # Evaluate succeed / fail
     AS_IF([test "$plm_tm_good" = "1" -a "$orte_without_full_support" = 0],
-          [plm_tm_WRAPPER_EXTRA_LDFLAGS="$plm_tm_LDFLAGS"
-           plm_tm_WRAPPER_EXTRA_LIBS="$plm_tm_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # set build flags to use in makefile

orte/mca/ras/loadleveler/configure.m4

     # if check worked, set wrapper flags if so.  
     # Evaluate succeed / fail
     AS_IF([test "$ras_loadleveler_good" = "1" -a "$orte_without_full_support" = 0],
-          [ras_loadleveler_WRAPPER_EXTRA_LDFLAGS="$ras_loadleveler_LDFLAGS"
-           ras_loadleveler_WRAPPER_EXTRA_LIBS="$ras_loadleveler_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # set build flags to use in makefile

orte/mca/ras/lsf/configure.m4

     # if check worked, set wrapper flags if so.  
     # Evaluate succeed / fail
     AS_IF([test "$ras_lsf_good" = "1" -a "$orte_without_full_support" = 0],
-          [ras_lsf_WRAPPER_EXTRA_LDFLAGS="$ras_lsf_LDFLAGS"
-           ras_lsf_WRAPPER_EXTRA_LIBS="$ras_lsf_LIBS"
-           $1],
+          [$1],
           [$2])
 
     # set build flags to use in makefile

orte/mca/ras/slurm/configure.m4