Added --htmldir option to pg_config, equivalent to the new configure option.
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 18 Feb 2008 14:51:48 +0000 (14:51 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 18 Feb 2008 14:51:48 +0000 (14:51 +0000)
doc/src/sgml/ref/pg_config-ref.sgml
src/bin/pg_config/pg_config.c
src/include/port.h
src/port/Makefile
src/port/path.c

index e788014713d192903ced46624a4437351dc23ac9..7d5a0fe9300028a228347d71ef8910d71e8a45ae 100644 (file)
      <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>
    <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>
index d1884423f47193222642affd1dfe2cc652b3c93d..955d85a5b82b4815ed16d5109d653f9a7d4c6241 100644 (file)
@@ -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"));
index d2f2ab1f8dd60cde4eb8dcadd50ecffa7069ef61..328deb2a0c304ad36e6023f7d3fae59084972572 100644 (file)
@@ -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);
index 4f12b40ac8ecb757411606e0634f6d20052d1bd7..94707c4a9719806f4b05347de5d7fe66fe97cd2e 100644 (file)
@@ -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:
index 11788c6c1b83af1ae07b414aea52ad6f23aee1bc..dc22c770d3635edf89bb7f397f1b29855aee4676 100644 (file)
@@ -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
  */