From ac322bb68e18a7b83f5b91c10d2b76fc26847818 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 18 Feb 2008 14:51:48 +0000 Subject: [PATCH] Added --htmldir option to pg_config, equivalent to the new configure option. --- doc/src/sgml/ref/pg_config-ref.sgml | 14 +++++++++++--- src/bin/pg_config/pg_config.c | 14 ++++++++++++++ src/include/port.h | 1 + src/port/Makefile | 1 + src/port/path.c | 9 +++++++++ 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/ref/pg_config-ref.sgml b/doc/src/sgml/ref/pg_config-ref.sgml index e788014713..7d5a0fe930 100644 --- a/doc/src/sgml/ref/pg_config-ref.sgml +++ b/doc/src/sgml/ref/pg_config-ref.sgml @@ -57,9 +57,16 @@ - Print the location of documentation files. (This will be an empty - string if --without-docdir was specified when - PostgreSQL was built.) + Print the location of documentation files. + + + + + + + + + Print the location of HTML documentation files. @@ -284,6 +291,7 @@ , , , , and are new in PostgreSQL 8.1. + The option is new in PostgreSQL 8.4. diff --git a/src/bin/pg_config/pg_config.c b/src/bin/pg_config/pg_config.c index d1884423f4..955d85a5b8 100644 --- a/src/bin/pg_config/pg_config.c +++ b/src/bin/pg_config/pg_config.c @@ -97,6 +97,18 @@ show_docdir(bool all) printf("%s\n", path); } +static void +show_htmldir(bool all) +{ + char path[MAXPGPATH]; + + if (all) + printf("HTMLDIR = "); + get_html_path(mypath, path); + cleanup_path(path); + printf("%s\n", path); +} + static void show_includedir(bool all) { @@ -369,6 +381,7 @@ typedef struct static const InfoItem info_items[] = { {"--bindir", show_bindir}, {"--docdir", show_docdir}, + {"--htmldir", show_htmldir}, {"--includedir", show_includedir}, {"--pkgincludedir", show_pkgincludedir}, {"--includedir-server", show_includedir_server}, @@ -401,6 +414,7 @@ help(void) printf(_("Options:\n")); printf(_(" --bindir show location of user executables\n")); printf(_(" --docdir show location of documentation files\n")); + printf(_(" --htmldir show location of HTML 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")); diff --git a/src/include/port.h b/src/include/port.h index d2f2ab1f8d..328deb2a0c 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -42,6 +42,7 @@ extern void get_lib_path(const char *my_exec_path, char *ret_path); extern void get_pkglib_path(const char *my_exec_path, char *ret_path); extern void get_locale_path(const char *my_exec_path, char *ret_path); extern void get_doc_path(const char *my_exec_path, char *ret_path); +extern void get_html_path(const char *my_exec_path, char *ret_path); extern void get_man_path(const char *my_exec_path, char *ret_path); extern bool get_home_path(char *ret_path); extern void get_parent_directory(char *path); diff --git a/src/port/Makefile b/src/port/Makefile index 4f12b40ac8..94707c4a97 100644 --- a/src/port/Makefile +++ b/src/port/Makefile @@ -84,6 +84,7 @@ pg_config_paths.h: $(top_builddir)/src/Makefile.global echo "#define PKGLIBDIR \"$(pkglibdir)\"" >>$@ echo "#define LOCALEDIR \"$(localedir)\"" >>$@ echo "#define DOCDIR \"$(docdir)\"" >>$@ + echo "#define HTMLDIR \"$(htmldir)\"" >>$@ echo "#define MANDIR \"$(mandir)\"" >>$@ clean distclean maintainer-clean: diff --git a/src/port/path.c b/src/port/path.c index 11788c6c1b..dc22c770d3 100644 --- a/src/port/path.c +++ b/src/port/path.c @@ -599,6 +599,15 @@ get_doc_path(const char *my_exec_path, char *ret_path) make_relative_path(ret_path, DOCDIR, PGBINDIR, my_exec_path); } +/* + * get_html_path + */ +void +get_html_path(const char *my_exec_path, char *ret_path) +{ + make_relative_path(ret_path, HTMLDIR, PGBINDIR, my_exec_path); +} + /* * get_man_path */ -- 2.39.5