postgresql: properly handle pg_config host build

pg_config needs to be build for each target which creates some
extra complications...

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle
2017-06-23 18:32:41 +02:00
parent 93a16dabc4
commit d0c3f8b967
2 changed files with 45 additions and 8 deletions
@@ -0,0 +1,14 @@
--- a/src/bin/pg_config/Makefile
+++ b/src/bin/pg_config/Makefile
@@ -22,9 +22,9 @@ STD_CPPFLAGS := $(filter-out -I$(top_src
STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/port,$(LDFLAGS))
override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
-override CPPFLAGS += -DVAL_CC="\"$(CC)\""
+override CPPFLAGS += -DVAL_CC="\"$(TARGET_CC)\""
override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
-override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
+override CPPFLAGS += -DVAL_CFLAGS="\"$(TARGET_CFLAGS)\""
override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\""