summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2008-02-18 14:51:48 +0000
committerPeter Eisentraut2008-02-18 14:51:48 +0000
commit84ce707ba8f6dfd776e0d284fecd1fd497acf5a3 (patch)
tree623111980ef370b1b540624808112b412aafb9d8
parenta9bc069c0b0d0b6fa781a79de04e0273ca97f819 (diff)
Added --htmldir option to pg_config, equivalent to the new configure option.
-rw-r--r--doc/src/sgml/ref/pg_config-ref.sgml16
-rw-r--r--src/bin/pg_config/pg_config.c16
-rw-r--r--src/include/port.h3
-rw-r--r--src/port/Makefile3
-rw-r--r--src/port/path.c11
5 files changed, 41 insertions, 8 deletions
diff --git a/doc/src/sgml/ref/pg_config-ref.sgml b/doc/src/sgml/ref/pg_config-ref.sgml
index 0ccc851355..884ccea7af 100644
--- a/doc/src/sgml/ref/pg_config-ref.sgml
+++ b/doc/src/sgml/ref/pg_config-ref.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_config-ref.sgml,v 1.27 2007/02/20 15:01:17 momjian Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_config-ref.sgml,v 1.28 2008/02/18 14:51:48 petere Exp $ -->
<refentry id="app-pgconfig">
<refmeta>
@@ -57,9 +57,16 @@
<term><option>--docdir</option></>
<listitem>
<para>
- Print the location of documentation files. (This will be an empty
- string if <literal>--without-docdir</> was specified when
- <productname>PostgreSQL</> was built.)
+ Print the location of documentation files.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--htmldir</option></>
+ <listitem>
+ <para>
+ Print the location of HTML documentation files.
</para>
</listitem>
</varlistentry>
@@ -284,6 +291,7 @@
<option>--cflags</option>, <option>--cflags_sl</option>,
<option>--ldflags</option>, <option>--ldflags_sl</option>,
and <option>--libs</option> are new in <productname>PostgreSQL</> 8.1.
+ The option <option>--htmldir</option> is new in <productname>PostgreSQL</> 8.4.
</para>
<para>
diff --git a/src/bin/pg_config/pg_config.c b/src/bin/pg_config/pg_config.c
index 7f7fec2c3b..315b62622a 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-2008, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.26 2008/01/01 19:45:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.27 2008/02/18 14:51:48 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -98,6 +98,18 @@ show_docdir(bool all)
}
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)
{
char path[MAXPGPATH];
@@ -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 b0489eb0a4..f2907f4b34 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/port.h,v 1.116 2008/01/01 19:45:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.117 2008/02/18 14:51:48 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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 b1131599e3..572e7fc835 100644
--- a/src/port/Makefile
+++ b/src/port/Makefile
@@ -19,7 +19,7 @@
# OBJS adds additional object files that are always compiled.
#
# IDENTIFICATION
-# $PostgreSQL: pgsql/src/port/Makefile,v 1.35 2007/09/28 22:25:49 tgl Exp $
+# $PostgreSQL: pgsql/src/port/Makefile,v 1.36 2008/02/18 14:51:48 petere Exp $
#
#-------------------------------------------------------------------------
@@ -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 d353e6e17d..b3b757fd52 100644
--- a/src/port/path.c
+++ b/src/port/path.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/path.c,v 1.74 2008/01/01 19:46:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/path.c,v 1.75 2008/02/18 14:51:48 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -600,6 +600,15 @@ get_doc_path(const char *my_exec_path, char *ret_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
*/
void