public inbox for [email protected]
help / color / mirror / Atom feedFrom: Peter Eisentraut <[email protected]>
To: Bilal Yavuz <[email protected]>
To: Miłosz Bieniek <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] Add `headerscheck` run_target to meson
Date: Wed, 18 Mar 2026 12:59:51 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAMSWrt-PoQt4sHryWrB1ViuGBJF_PpbjoSGrWR2Ry47bHNLDqg@mail.gmail.com>
<[email protected]>
<CAMSWrt-A0ha0qANftNYGpa8vEbtiD_7iV+0mdP0g9V8va=K0YA@mail.gmail.com>
<CAN55FZ1OkRkQMT==EtTWesKBFdBG28WrzhYsex3UG67F7bAQ8A@mail.gmail.com>
<CAN55FZ2fc++9-G=Mc4D2rNV2wQdbFn6EWszMno18vQTdqnKpJw@mail.gmail.com>
<CAMSWrt-2riJci+iGvt=Dggb4eh=2HgP3hy6+K=rZSeW=XFczAw@mail.gmail.com>
<CAN55FZ2vFfRJ5Ewj44oo27J=qY=E9+3d8S_rcMbuGJP-Rm7yPQ@mail.gmail.com>
<[email protected]>
On 18.03.26 11:56, Peter Eisentraut wrote:
> On 04.12.25 08:09, Bilal Yavuz wrote:
>> 0001 adds python_includespec and perl_includespec variables to the
>> Makefile.global of the meson build.
>
> Committed that, with some light cosmetic ordering changes.
>
>> 0002 adds headerscheck target to meson build like you do but with 2
>> extra changes. First one is that, I moved the headerscheck script to a
>> variable and used it in the target commands. Second one is that,
>> headerscheck script could not find the perl_includespec and
>> python_includespec variables because of the tabs in the sed command, I
>> changed them with '[:space:]' and it worked. I am not sure if that is
>> the correct fix but I just wanted to see if the script will work.
>
> Committed that, but without the regular expression changes. I don't
> understand why those would be needed. Please provide more information
> if necessary. It worked for me without it.
I need another tweak for the cpluspluscheck.
In meson, the distribution of the include flags between CPPFLAGS,
CFLAGS, and CXXFLAGS ends up being a bit different, and we need to get a
few -I options from CXXFLAGS in my case.
I have attached two different variants for how to do this. The first
one just gets the -D and -I flags from CXXFLAGS. This preserves most of
the existing behavior. The second aligns more with how CFLAGS works and
removes the ability to override CXXFLAGS from the command line. This is
probably now better since we have more support for getting correct CXX
and CXXFLAGS in the build system. But it might be a change for some users.
Thoughts?
From ec1da8265908b6d6761973fda54aa0008dd033c5 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 Mar 2026 12:58:47 +0100
Subject: [PATCH] headerscheck: Get CXXFLAGS (variant 1)
---
src/tools/pginclude/headerscheck | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/tools/pginclude/headerscheck b/src/tools/pginclude/headerscheck
index 3d3e371a8e1..4a66a194b46 100755
--- a/src/tools/pginclude/headerscheck
+++ b/src/tools/pginclude/headerscheck
@@ -44,6 +44,7 @@ CXXFLAGS=${CXXFLAGS:- -fsyntax-only -Wall}
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"`
@@ -60,8 +61,8 @@ CPPFLAGS=`echo "$CPPFLAGS" | sed "s|\\\$(PG_SYSROOT)|$PG_SYSROOT|g"`
if $cplusplus; then
ext=cpp
COMPILER=${CXX:-g++}
- # Extract any -I and -D switches from CPPFLAGS.
- for flag in $CPPFLAGS; do
+ # Extract any -I and -D switches from CPPFLAGS and CXXFLAGS from Makefile.global.
+ for flag in $CPPFLAGS $_CXXFLAGS; do
case $flag in
-I*|-D*) CXXPPFLAGS="$CXXPPFLAGS $flag";;
esac
--
2.53.0
From 64a4d26eaaff6509fbb3fea0fb7e0997741acec1 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 Mar 2026 12:58:59 +0100
Subject: [PATCH] headerscheck: Get CXXFLAGS (variant 2)
---
src/tools/pginclude/headerscheck | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/tools/pginclude/headerscheck b/src/tools/pginclude/headerscheck
index 3d3e371a8e1..72503c0cd89 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"`
--
2.53.0
Attachments:
[text/plain] 0001-headerscheck-Get-CXXFLAGS-variant-1.patch (1.3K, 2-0001-headerscheck-Get-CXXFLAGS-variant-1.patch)
download | inline diff:
From ec1da8265908b6d6761973fda54aa0008dd033c5 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 Mar 2026 12:58:47 +0100
Subject: [PATCH] headerscheck: Get CXXFLAGS (variant 1)
---
src/tools/pginclude/headerscheck | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/tools/pginclude/headerscheck b/src/tools/pginclude/headerscheck
index 3d3e371a8e1..4a66a194b46 100755
--- a/src/tools/pginclude/headerscheck
+++ b/src/tools/pginclude/headerscheck
@@ -44,6 +44,7 @@ CXXFLAGS=${CXXFLAGS:- -fsyntax-only -Wall}
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"`
@@ -60,8 +61,8 @@ CPPFLAGS=`echo "$CPPFLAGS" | sed "s|\\\$(PG_SYSROOT)|$PG_SYSROOT|g"`
if $cplusplus; then
ext=cpp
COMPILER=${CXX:-g++}
- # Extract any -I and -D switches from CPPFLAGS.
- for flag in $CPPFLAGS; do
+ # Extract any -I and -D switches from CPPFLAGS and CXXFLAGS from Makefile.global.
+ for flag in $CPPFLAGS $_CXXFLAGS; do
case $flag in
-I*|-D*) CXXPPFLAGS="$CXXPPFLAGS $flag";;
esac
--
2.53.0
[text/plain] 0001-headerscheck-Get-CXXFLAGS-variant-2.patch (1.1K, 3-0001-headerscheck-Get-CXXFLAGS-variant-2.patch)
download | inline diff:
From 64a4d26eaaff6509fbb3fea0fb7e0997741acec1 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 Mar 2026 12:58:59 +0100
Subject: [PATCH] headerscheck: Get CXXFLAGS (variant 2)
---
src/tools/pginclude/headerscheck | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/tools/pginclude/headerscheck b/src/tools/pginclude/headerscheck
index 3d3e371a8e1..72503c0cd89 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"`
--
2.53.0
view thread (10+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: [PATCH] Add `headerscheck` run_target to meson
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox