Re: Michael Paquier 2019-01-23 <20190123004722.ge3...@paquier.xyz> > >> Largely because I think it's an independent patch from the CXXOPT need > >> from Christopher / Debian packaging. It's a larger patch, that needs > >> more docs etc. If whoever applies that wants to backpatch it - I'm not > >> going to protest, I just wouldn't myself, unless somebody pipes up that > >> it'd help them. > > > > Ah, I see. No arguments against.
Fwiw I'm not attached to using COPT and friends, I just happend to pick these because that was one way that worked. With what I've learned now, PG_*FLAGS is the better approach. > The new PGXS flags would be I think useful to make sure > that things for CFLAGS and LDFLAGS get propagated without having to > hijack the original flags, so I can handle that part. Which one would > be wanted though? > - PG_CXXFLAGS > - PG_LDFLAGS > - PG_CFLAGS > > I'd see value in all of them, still everybody has likely a different > opinion, so I would not mind discarding the ones are not thought as > that much useful. New PGXS infrastructure usually finds only its way > on HEAD, so I'd rather not back-patch that part. No issues with the > back-patch portion for CXXOPT from me as that helps Debian. The attached patch adds these three. Re backpatching, I would at least need them in PG11 because that's what is going to be released with Debian buster. An official backpatch to all supported versions would be nice, but I could also sneak in that change into the Debian packages without breaking anything. Christoph -- Senior Berater, Tel.: +49 2166 9901 187 credativ GmbH, HRB Mönchengladbach 12080, USt-ID-Nummer: DE204566209 Trompeterallee 108, 41189 Mönchengladbach Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer Unser Umgang mit personenbezogenen Daten unterliegt folgenden Bestimmungen: https://www.credativ.de/datenschutz
>From 04bc55089a46697fec721aca6225a7ca1db6c66f Mon Sep 17 00:00:00 2001 From: Christoph Berg <christoph.b...@credativ.de> Date: Tue, 13 Nov 2018 11:35:26 +0100 Subject: [PATCH] Add PG_CFLAGS, PG_CXXFLAGS, and PG_LDFLAGS variables Add PG_CFLAGS, PG_CXXFLAGS, and PG_LDFLAGS variables to pgxs.mk which will append to the corresponding make variables. Notably, there was previously no way to pass custom CXXFLAGS to 3rd party extension module builds. (COPT and PROFILE support only CFLAGS and LDFLAGS) --- doc/src/sgml/extend.sgml | 27 +++++++++++++++++++++++++++ src/makefiles/pgxs.mk | 12 ++++++++++++ 2 files changed, 39 insertions(+) diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index a6b77c1cfe..a94b216e77 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -1358,6 +1358,33 @@ include $(PGXS) </listitem> </varlistentry> + <varlistentry> + <term><varname>PG_CFLAGS</varname></term> + <listitem> + <para> + will be added to <varname>CFLAGS</varname> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><varname>PG_CXXFLAGS</varname></term> + <listitem> + <para> + will be added to <varname>CXXFLAGS</varname> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><varname>PG_LDFLAGS</varname></term> + <listitem> + <para> + will be added to <varname>LDFLAGS</varname> + </para> + </listitem> + </varlistentry> + <varlistentry> <term><varname>PG_LIBS</varname></term> <listitem> diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk index d214cb9cf2..56a8b26183 100644 --- a/src/makefiles/pgxs.mk +++ b/src/makefiles/pgxs.mk @@ -53,6 +53,9 @@ # tests require special configuration, or don't use pg_regress # EXTRA_CLEAN -- extra files to remove in 'make clean' # PG_CPPFLAGS -- will be added to CPPFLAGS +# PG_CFLAGS -- will be added to CFLAGS +# PG_CXXFLAGS -- will be added to CXXFLAGS +# PG_LDFLAGS -- will be added to LDFLAGS # PG_LIBS -- will be added to PROGRAM link line # PG_LIBS_INTERNAL -- same, for references to libraries within build tree # SHLIB_LINK -- will be added to MODULE_big link line @@ -119,6 +122,15 @@ endif ifdef PG_CPPFLAGS override CPPFLAGS := $(PG_CPPFLAGS) $(CPPFLAGS) endif +ifdef PG_CFLAGS +override CFLAGS := $(PG_CFLAGS) $(CFLAGS) +endif +ifdef PG_CXXFLAGS +override CXXFLAGS := $(PG_CXXFLAGS) $(CXXFLAGS) +endif +ifdef PG_LDFLAGS +override LDFLAGS := $(PG_LDFLAGS) $(LDFLAGS) +endif # logic for HEADERS_* stuff -- 2.20.1