configure: Account CXXFLAGS in gcc-plugin.m4.
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 7 Aug 2023 11:07:17 +0000 (13:07 +0200)
committerAlan Modra <amodra@gmail.com>
Sat, 12 Aug 2023 00:28:23 +0000 (09:58 +0930)
We now use a C++ compiler so that we need to process
CXXFLAGS as well as CFLAGS in the gcc-plugin config
fragment.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
config/
* gcc-plugin.m4: Save and process CXXFLAGS.

config/gcc-plugin.m4

index 16ebe25182b493b5e2539b830ca43736c94d3a4b..c731a6fab3831e3c089c51bf1ada558b8befd5ca 100644 (file)
@@ -91,14 +91,18 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
      # Check that we can build shared objects with -fPIC -shared
      saved_LDFLAGS="$LDFLAGS"
      saved_CFLAGS="$CFLAGS"
+     saved_CXXFLAGS="$CXXFLAGS"
      case "${host}" in
        *-*-darwin*)
         CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
         CFLAGS="$CFLAGS -fPIC"
+        CXXFLAGS=`echo $CXXFLAGS | sed s/-mdynamic-no-pic//g`
+        CXXFLAGS="$CXXFLAGS -fPIC"
         LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
        ;;
        *)
         CFLAGS="$CFLAGS -fPIC"
+        CXXFLAGS="$CXXFLAGS -fPIC"
         LDFLAGS="$LDFLAGS -fPIC -shared"
        ;;
      esac
@@ -113,6 +117,7 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
      fi
      LDFLAGS="$saved_LDFLAGS"
      CFLAGS="$saved_CFLAGS"
+     CXXFLAGS="$saved_CXXFLAGS"
 
      # If plugin support had been requested but not available, fail.
      if test x"$enable_plugin" = x"no" ; then