9a146d1244
Previously, pg_config would report the paths of the underlying postgresql derivation and not the paths of the buildEnv that postgresql.withPackages creates. That's a problem when users of pg_config use it to find PostgreSQL's sharedir, in which they'd like to find the extensions added via withPackages. Those are only linked into the created buildEnv, but not available in the postgresql derivation. By providing our own nix-support/pg_config.env file, we can swap out those paths. We also do the same for the -man output, because this output is linked into buildEnv as well. Other paths, which are not available in the buildEnv environment, will still link to the original postgresql derivation. Win-win!
15 lines
744 B
Makefile
15 lines
744 B
Makefile
# Everything that pg_config normally returns is put into pg_config.env, so
|
|
# that we can read it from our own pg_config script later on.
|
|
pg_config.env: $(top_builddir)/src/port/pg_config_paths.h | $(top_builddir)/src/include/pg_config.h
|
|
echo "CC=\"$(CC)\"" >$@
|
|
echo "CPPFLAGS=\"$(STD_CPPFLAGS)\"" >>$@
|
|
echo "CFLAGS=\"$(CFLAGS)\"" >>$@
|
|
echo "CFLAGS_SL=\"$(CFLAGS_SL)\"" >>$@
|
|
echo "LDFLAGS=\"$(STD_LDFLAGS)\"" >>$@
|
|
echo "LDFLAGS_EX=\"$(LDFLAGS_EX)\"" >>$@
|
|
echo "LDFLAGS_SL=\"$(LDFLAGS_SL)\"" >>$@
|
|
echo "LIBS=\"$(LIBS)\"" >>$@
|
|
echo "PGXS=\"$(dev)/lib/pgxs/src/makefiles/pgxs.mk\"" >>$@
|
|
cat $(top_builddir)/src/port/pg_config_paths.h $(top_builddir)/src/include/pg_config.h \
|
|
| sed -nE 's/^#define ([^ ]+) ("?)(.*)\2$$/\1="\3"/p' >>$@
|