aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2019-02-03 17:48:59 +0900
committerMichael Paquier <michael@paquier.xyz>2019-02-03 17:48:59 +0900
commit12ff406f35b6da535f2011917b38c57e7f6a9540 (patch)
tree96b4dd44767ba6c1a5443eb9d6fa1c7733521716 /src
parent6a2c9c6331359c48e4fb883ff2513ef7da9bc581 (diff)
downloadpostgresql-12ff406f35b6da535f2011917b38c57e7f6a9540.tar.gz
postgresql-12ff406f35b6da535f2011917b38c57e7f6a9540.zip
Add PG_CFLAGS, PG_CXXFLAGS, and PG_LDFLAGS variables to PGXS
Add PG_CFLAGS, PG_CXXFLAGS, and PG_LDFLAGS variables to pgxs.mk which will be appended or prepended to the corresponding make variables. Notably, there was previously no way to pass custom CXXFLAGS to third party extension module builds, COPT and PROFILE supporting only CFLAGS and LDFLAGS. Backpatch all the way down to ease integration with existing extensions. Author: Christoph Berg Reviewed-by: Andres Freund, Tom Lane, Michael Paquier Discussion: https://postgr.es/m/20181113104005.GA32154@msg.credativ.de Backpatch-through: 9.4
Diffstat (limited to 'src')
-rw-r--r--src/makefiles/pgxs.mk14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index 9a479fba6c3..d9c0e8c2cf9 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -41,7 +41,10 @@
# REGRESS -- list of regression test cases (without suffix)
# REGRESS_OPTS -- additional switches to pass to pg_regress
# EXTRA_CLEAN -- extra files to remove in 'make clean'
-# PG_CPPFLAGS -- will be added to CPPFLAGS
+# PG_CPPFLAGS -- will be prepended to CPPFLAGS
+# PG_CFLAGS -- will be appended to CFLAGS
+# PG_CXXFLAGS -- will be appended to CXXFLAGS
+# PG_LDFLAGS -- will be prepended 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
@@ -98,6 +101,15 @@ endif
ifdef PG_CPPFLAGS
override CPPFLAGS := $(PG_CPPFLAGS) $(CPPFLAGS)
endif
+ifdef PG_CFLAGS
+override CFLAGS := $(CFLAGS) $(PG_CFLAGS)
+endif
+ifdef PG_CXXFLAGS
+override CXXFLAGS := $(CXXFLAGS) $(PG_CXXFLAGS)
+endif
+ifdef PG_LDFLAGS
+override LDFLAGS := $(PG_LDFLAGS) $(LDFLAGS)
+endif
all: $(PROGRAM) $(DATA_built) $(SCRIPTS_built) $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .control, $(EXTENSION))