]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
headerscheck: Get CXXFLAGS from Makefile.global
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 23 Mar 2026 06:18:11 +0000 (07:18 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 23 Mar 2026 06:53:43 +0000 (07:53 +0100)
headerscheck in C++ mode (cpluspluscheck) previously hardcoded
CXXFLAGS and documented that you might need to override them manually
from the environment.  Now that we have better C++ support in the
build system, we can just get CXXFLAGS from Makefile.global, like we
do for other variables.

Furthermore, this is necessary in some configurations to make
cpluspluscheck work under meson, because under meson, some -I options
end up in CXXFLAGS where under make they would be in CPPFLAGS.
Therefore, getting the correct CXXFLAGS is required in those cases.

Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAMSWrt-PoQt4sHryWrB1ViuGBJF_PpbjoSGrWR2Ry47bHNLDqg%40mail.gmail.com

src/tools/pginclude/README
src/tools/pginclude/headerscheck

index f7f5ff2c01b2e60357cd0b1a413bd7af6318c906..4e1c486d05156104fa76c50a5403f9529378b2fc 100644 (file)
@@ -95,10 +95,6 @@ related headers not being found.
 When using meson, run "meson compile -C build cpluspluscheck" or
 "ninja -C build cpluspluscheck".
 
-If you are using a non-g++-compatible C++ compiler, you may need to
-override the script's CXXFLAGS setting by setting a suitable environment
-value.
-
 A limitation of the current script is that it doesn't know exactly which
 headers are for frontend or backend; when in doubt it uses postgres.h as
 prerequisite, even if postgres_fe.h or c.h would be more appropriate.
index 7f03c2b47bde9d7f45b715d82650d37c9e160933..e75661cc772be86f10c149d5a2e74436d59b7e67 100755 (executable)
@@ -37,13 +37,11 @@ fi
 
 me=`basename $0`
 
-# These switches are g++ specific, you may override if necessary.
-CXXFLAGS=${CXXFLAGS:- -fsyntax-only -Wall}
-
 # Pull some info from configure's results.
 MGLOB="$builddir/src/Makefile.global"
 CPPFLAGS=`sed -n 's/^CPPFLAGS[         ]*=[    ]*//p' "$MGLOB"`
 CFLAGS=`sed -n 's/^CFLAGS[     ]*=[    ]*//p' "$MGLOB"`
+CXXFLAGS=`sed -n 's/^CXXFLAGS[         ]*=[    ]*//p' "$MGLOB"`
 ICU_CFLAGS=`sed -n 's/^ICU_CFLAGS[     ]*=[    ]*//p' "$MGLOB"`
 LLVM_CPPFLAGS=`sed -n 's/^LLVM_CPPFLAGS[       ]*=[    ]*//p' "$MGLOB"`
 CC=`sed -n 's/^CC[     ]*=[    ]*//p' "$MGLOB"`