From 643e6064bb233e5ff9c286831d98b5e29ad696c0 Mon Sep 17 00:00:00 2001 From: Yanfei Guo Date: Wed, 25 Sep 2024 10:01:22 -0500 Subject: [PATCH] mpl: pass MPL's CFLAGS back to MPICH MPL exports additional CFLAGS as MPL_CFLAGS. Only the ones that added by the MPL configure will be passed. The PAC_CONFIG_MPL macro will add them to CFLAGS. --- confdb/aclocal_modules.m4 | 1 + src/mpl/configure.ac | 4 ++++ src/mpl/localdefs.in | 1 + 3 files changed, 6 insertions(+) diff --git a/confdb/aclocal_modules.m4 b/confdb/aclocal_modules.m4 index 2c5294ad24d..76f3c3cacca 100644 --- a/confdb/aclocal_modules.m4 +++ b/confdb/aclocal_modules.m4 @@ -18,6 +18,7 @@ AC_DEFUN([PAC_CONFIG_MPL],[ PAC_CONFIG_MPL_EMBEDDED PAC_APPEND_FLAG([-I${main_top_builddir}/src/mpl/include], [CPPFLAGS]) PAC_APPEND_FLAG([-I${use_top_srcdir}/src/mpl/include], [CPPFLAGS]) + PAC_APPEND_FLAG([${MPL_CFLAGS}], [CFLAGS]) mplsrcdir="src/mpl" mpllib="src/mpl/libmpl.la" ], [ diff --git a/src/mpl/configure.ac b/src/mpl/configure.ac index 3986121fdeb..442bdd6131b 100644 --- a/src/mpl/configure.ac +++ b/src/mpl/configure.ac @@ -29,6 +29,7 @@ LT_PREREQ([2.2.6]) PAC_PUSH_FLAG([CFLAGS]) LT_INIT() PAC_POP_FLAG([CFLAGS]) +PARENT_CFLAGS=${CFLAGS} # ---------------------------------------------------------------------------- # Set default library names if names haven't already been provided @@ -1405,6 +1406,9 @@ AX_GCC_VAR_ATTRIBUTE(used) PAC_POP_ALL_FLAGS +MPL_CFLAGS="${CFLAGS#${PARENT_CFLAGS}}" +AC_SUBST(MPL_CFLAGS) + dnl Final output AC_CONFIG_FILES([Makefile localdefs include/mpl_timer.h]) AC_OUTPUT diff --git a/src/mpl/localdefs.in b/src/mpl/localdefs.in index aaa0146b21b..3fb7a169514 100644 --- a/src/mpl/localdefs.in +++ b/src/mpl/localdefs.in @@ -5,5 +5,6 @@ GPU_SUPPORT="@GPU_SUPPORT@" CPPFLAGS="@CPPFLAGS@" +MPL_CFLAGS="@MPL_CFLAGS@" WRAPPER_LIBS="$WRAPPER_LIBS @LDFLAGS@ @LIBS@" COMPILER_TLS="@COMPILER_TLS@"