void-packages/srcpkgs/postgresql/patches/pg_config-cross-value.patch

47 lines
2.0 KiB
Diff
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Sources: Doan Tran Cong Danh
Upstream: No
- First part needs to be rework in configure script to be usable
upstream
- Second part would un-usable for Windows
diff --git src/common/Makefile src/common/Makefile
index ec04710..2af845f 100644
--- src/common/Makefile
+++ src/common/Makefile
@@ -22,11 +22,14 @@ include $(top_builddir)/src/Makefile.global
# don't include subdirectory-path-dependent -I and -L switches
STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
+STD_CPPFLAGS := $(subst @XBPS_SYSROOT@,,$(STD_CPPFLAGS))
+STD_CFLAGS := $(subst @XBPS_SYSROOT@,,$(CFLAGS))
STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/common -L$(top_builddir)/src/port,$(LDFLAGS))
+STD_LDFLAGS := $(subst @XBPS_SYSROOT@,,$(STD_LDFLAGS))
override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
override CPPFLAGS += -DVAL_CC="\"$(CC)\""
override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
-override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
+override CPPFLAGS += -DVAL_CFLAGS="\"$(STD_CFLAGS)\""
override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\""
@@ -44,7 +47,19 @@ OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o restricted_token.o
OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o)
-all: libpgcommon.a libpgcommon_srv.a
+all: libpgcommon.a libpgcommon_srv.a pg_config.sh
+
+pg_config.sh: pg_config.sh.in
+ sed -e "s/@configure_args@/$(subst /,\\/,$(configure_args))/" \
+ -e "s/@CC@/$(subst /,\\/,$(CC))/" \
+ -e "s/@CPPFLAGS@/$(subst /,\\/,$(STD_CPPFLAGS))/" \
+ -e "s/@CFLAGS@/$(subst /,\\/,$(STD_CFLAGS))/" \
+ -e "s/@CFLAGS_SL@/$(subst /,\\/,$(CFLAGS_SL))/" \
+ -e "s/@LDFLAGS@/$(subst /,\\/,$(STD_LDFLAGS))/" \
+ -e "s/@LDFLAGS_EX@/$(subst /,\\/,$(LDFLAGS_EX))/" \
+ -e "s/@LDFLAGS_SL@/$(subst /,\\/,$(LDFLAGS_SL))/" \
+ -e "s/@LIBS@/$(subst /,\\/,$(LIBS))/" \
+ $< >$@
# libpgcommon is needed by some contrib
install: all installdirs