diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-09-27 17:39:35 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-09-27 17:39:35 +0000 |
| commit | 4fc935a5d47d40aac5b1ecf51aa5beaab03e8f76 (patch) | |
| tree | 9aef18fd9bff87d88ae58fb0d3eb93654cf9c83e /src/bin/pg_config | |
| parent | 2d8225eecc555552b89b66bc6d975760e4f1de4c (diff) | |
| download | postgresql-4fc935a5d47d40aac5b1ecf51aa5beaab03e8f76.tar.gz | |
Fix problems with PGXS builds against an installation tree that was
relocated after installation. We can't trust the installation paths
inserted into Makefile.global by configure, so instead we must get the
paths from pg_config. This requires extending pg_config to support all
the separately-configurable path names, but that was on TODO anyway.
Diffstat (limited to 'src/bin/pg_config')
| -rw-r--r-- | src/bin/pg_config/pg_config.c | 80 | ||||
| -rw-r--r-- | src/bin/pg_config/win32.mak | 2 |
2 files changed, 81 insertions, 1 deletions
diff --git a/src/bin/pg_config/pg_config.c b/src/bin/pg_config/pg_config.c index ae1fce770d..3902f58512 100644 --- a/src/bin/pg_config/pg_config.c +++ b/src/bin/pg_config/pg_config.c @@ -17,7 +17,7 @@ * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.12 2005/08/09 22:47:03 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.13 2005/09/27 17:39:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,17 @@ show_bindir(bool all) } static void +show_docdir(bool all) +{ + char path[MAXPGPATH]; + + if (all) + printf("DOCDIR = "); + get_doc_path(mypath, path); + printf("%s\n", path); +} + +static void show_includedir(bool all) { char path[MAXPGPATH]; @@ -64,6 +75,17 @@ show_includedir(bool all) } static void +show_pkgincludedir(bool all) +{ + char path[MAXPGPATH]; + + if (all) + printf("PKGINCLUDEDIR = "); + get_pkginclude_path(mypath, path); + printf("%s\n", path); +} + +static void show_includedir_server(bool all) { char path[MAXPGPATH]; @@ -97,6 +119,50 @@ show_pkglibdir(bool all) } static void +show_localedir(bool all) +{ + char path[MAXPGPATH]; + + if (all) + printf("LOCALEDIR = "); + get_locale_path(mypath, path); + printf("%s\n", path); +} + +static void +show_mandir(bool all) +{ + char path[MAXPGPATH]; + + if (all) + printf("MANDIR = "); + get_man_path(mypath, path); + printf("%s\n", path); +} + +static void +show_sharedir(bool all) +{ + char path[MAXPGPATH]; + + if (all) + printf("SHAREDIR = "); + get_share_path(mypath, path); + printf("%s\n", path); +} + +static void +show_sysconfdir(bool all) +{ + char path[MAXPGPATH]; + + if (all) + printf("SYSCONFDIR = "); + get_etc_path(mypath, path); + printf("%s\n", path); +} + +static void show_pgxs(bool all) { char path[MAXPGPATH]; @@ -234,10 +300,16 @@ typedef struct static const InfoItem info_items[] = { { "--bindir", show_bindir }, + { "--docdir", show_docdir }, { "--includedir", show_includedir }, + { "--pkgincludedir", show_pkgincludedir }, { "--includedir-server", show_includedir_server }, { "--libdir", show_libdir }, { "--pkglibdir", show_pkglibdir }, + { "--localedir", show_localedir }, + { "--mandir", show_mandir }, + { "--sharedir", show_sharedir }, + { "--sysconfdir", show_sysconfdir }, { "--pgxs", show_pgxs }, { "--configure", show_configure }, { "--cc", show_cc }, @@ -260,11 +332,17 @@ help(void) printf(_(" %s [ OPTION ... ]\n\n"), progname); printf(_("Options:\n")); printf(_(" --bindir show location of user executables\n")); + printf(_(" --docdir show location of documentation files\n")); printf(_(" --includedir show location of C header files of the client\n" " interfaces\n")); + printf(_(" --pkgincludedir show location of other C header files\n")); printf(_(" --includedir-server show location of C header files for the server\n")); printf(_(" --libdir show location of object code libraries\n")); printf(_(" --pkglibdir show location of dynamically loadable modules\n")); + printf(_(" --localedir show location of locale support files\n")); + printf(_(" --mandir show location of manual pages\n")); + printf(_(" --sharedir show location of architecture-independent support files\n")); + printf(_(" --sysconfdir show location of system-wide configuration files\n")); printf(_(" --pgxs show location of extension makefile\n")); printf(_(" --configure show options given to \"configure\" script when\n" " PostgreSQL was built\n")); diff --git a/src/bin/pg_config/win32.mak b/src/bin/pg_config/win32.mak index 0017e57851..f00f301255 100644 --- a/src/bin/pg_config/win32.mak +++ b/src/bin/pg_config/win32.mak @@ -39,6 +39,8 @@ CLEAN : echo #define LIBDIR "" >>$@ echo #define PKGLIBDIR "" >>$@ echo #define LOCALEDIR "" >>$@ + echo #define DOCDIR "" >>$@ + echo #define MANDIR "" >>$@ "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" |
