From: Peter Eisentraut Date: Mon, 23 Mar 2026 06:18:11 +0000 (+0100) Subject: headerscheck: Get CXXFLAGS from Makefile.global X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f17d1dbfa6224b3ab0f4377c593b880be427f31;p=thirdparty%2Fpostgresql.git headerscheck: Get CXXFLAGS from Makefile.global 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 Discussion: https://www.postgresql.org/message-id/flat/CAMSWrt-PoQt4sHryWrB1ViuGBJF_PpbjoSGrWR2Ry47bHNLDqg%40mail.gmail.com --- diff --git a/src/tools/pginclude/README b/src/tools/pginclude/README index f7f5ff2c01b..4e1c486d051 100644 --- a/src/tools/pginclude/README +++ b/src/tools/pginclude/README @@ -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. diff --git a/src/tools/pginclude/headerscheck b/src/tools/pginclude/headerscheck index 7f03c2b47bd..e75661cc772 100755 --- a/src/tools/pginclude/headerscheck +++ b/src/tools/pginclude/headerscheck @@ -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"`