Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9314141

Browse files
committed
Add pg-config utility that stores some configuration parameters other
packages can use to configure their build.E.g.,$ pg-config --libdir/usr/local/pgsql/lib`pg-config --configure' stores the configure command line.
1 parent40549e9 commit9314141

File tree

7 files changed

+199
-5
lines changed

7 files changed

+199
-5
lines changed

‎doc/src/sgml/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.17 2000/07/21 00:44:11 petere Exp $
11+
# $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.18 2000/08/26 13:08:14 petere Exp $
1212
#
1313
#----------------------------------------------------------------------------
1414

@@ -78,6 +78,7 @@ APPLICATIONS= createdb.sgml createlang.sgml createuser.sgml \
7878
pg_upgrade.sgml\
7979
pgaccess-ref.sgml\
8080
pgadmin-ref.sgml\
81+
pg-config-ref.sgml\
8182
pgctl-ref.sgml\
8283
pgtclsh.sgml\
8384
pgtksh.sgml\

‎doc/src/sgml/ref/allfiles.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/allfiles.sgml,v 1.20 2000/07/14 15:27:14 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/allfiles.sgml,v 1.21 2000/08/26 13:08:15 petere Exp $
33
Postgres documentation
44
Complete list of usable sgml source files in this directory.
55
-->
@@ -120,6 +120,7 @@ Complete list of usable sgml source files in this directory.
120120
<!entity ipcclean system "ipcclean.sgml">
121121
<!entity pgAccess system "pgaccess-ref.sgml">
122122
<!entity pgAdmin system "pgadmin-ref.sgml">
123+
<!entity pgConfig system "pg-config-ref.sgml">
123124
<!entity pgCtl system "pgctl-ref.sgml">
124125
<!entity pgDump system "pg_dump.sgml">
125126
<!entity pgDumpall system "pg_dumpall.sgml">

‎doc/src/sgml/ref/commands.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/commands.sgml,v 1.27 2000/07/14 15:27:14 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/commands.sgml,v 1.28 2000/08/26 13:08:15 petere Exp $
33
Postgres documentation
44
-->
55

@@ -124,6 +124,7 @@ functions supported by <productname>Postgres</productname>.
124124
&ecpgRef;
125125
&pgAccess;
126126
&pgAdmin;
127+
&pgConfig;
127128
&pgCtl;
128129
&pgDump;
129130
&pgDumpall;

‎doc/src/sgml/ref/pg-config-ref.sgml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<!-- $Header -->
2+
3+
<refentry id="app-pg-config">
4+
<refmeta>
5+
<refentrytitle id="app-pg-config-title">pg-config</>
6+
<refmiscinfo>Application</>
7+
</refmeta>
8+
9+
<refnamediv>
10+
<refname>pg-config</>
11+
<refpurpose>Provides information about the installed version of <productname>PostgreSQL</></>
12+
</refnamediv>
13+
14+
<refsynopsisdiv>
15+
<synopsis>
16+
pg-config --bindir | --includedir | --libdir | --configure | --version
17+
</synopsis>
18+
</refsynopsisdiv>
19+
20+
<refsect1>
21+
<title>Description</>
22+
<para>
23+
The <application>pg-config</> stores and provides configuration parameters
24+
of the currently installed version of <productname>PostgreSQL</>. It is
25+
intended, for example, to be used by software packages that want to interface
26+
to <productname>PostgreSQL</> in order to find the respective header files
27+
and libraries.
28+
</para>
29+
30+
<para>
31+
To use <application>pg-config</>, supply one or more of the following options:
32+
<variablelist>
33+
<varlistentry>
34+
<term>--bindir</>
35+
<listitem>
36+
<para>
37+
Print the location of user executables. Use this, for example, to find
38+
the <application>psql</> program. This is normally also the location
39+
where the <filename>pg-config</> program resides.
40+
</para>
41+
</listitem>
42+
</varlistentry>
43+
44+
<varlistentry>
45+
<term>--includedir</>
46+
<listitem>
47+
<para>
48+
Print the location of C and C++ header files.
49+
</para>
50+
</listitem>
51+
</varlistentry>
52+
53+
<varlistentry>
54+
<term>--libdir</>
55+
<listitem>
56+
<para>
57+
Print the location of object code libraries.
58+
</para>
59+
</listitem>
60+
</varlistentry>
61+
62+
<varlistentry>
63+
<term>--configure</>
64+
<listitem>
65+
<para>
66+
Print the options that were given to the <filename>configure</>
67+
script when <productname>PostgreSQL</> was configured for building.
68+
This can be used to reproduce the identical configuration, or
69+
to find out with what options a binary package was built. (Note
70+
however that binary packages often contain vendor-specific custom
71+
patches.)
72+
</para>
73+
</listitem>
74+
</varlistentry>
75+
76+
<varlistentry>
77+
<term>--version</>
78+
<listitem>
79+
<para>
80+
Print the version of <productname>PostgreSQL</> and exit.
81+
</para>
82+
</listitem>
83+
</varlistentry>
84+
</variablelist>
85+
86+
If more than one option (except for <option>--version</>) is given, the
87+
information is printed in that order, one item per line.
88+
</para>
89+
</refsect1>
90+
</refentry>

‎src/bin/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.29 2000/07/19 16:29:53 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.30 2000/08/26 13:08:15 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -13,7 +13,7 @@ top_builddir = ../..
1313
include ../Makefile.global
1414

1515
DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id\
16-
pg_passwd psql scripts
16+
pg_passwd psql scripts pg-config
1717

1818
ifdefMULTIBYTE
1919
DIRS += pg_encoding

‎src/bin/pg-config/Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# $Header: /cvsroot/pgsql/src/bin/pg-config/Attic/Makefile,v 1.1 2000/08/26 13:08:16 petere Exp $
2+
3+
subdir = src/bin/pg-config
4+
top_builddir = ../../..
5+
include$(top_builddir)/src/Makefile.global
6+
7+
all: pg-config
8+
9+
pg-config: pg-config.sh$(top_builddir)/config.status$(top_builddir)/src/Makefile.global Makefile
10+
rm -f$@$@.tmp
11+
configure=`sed -n'7s,^# [^ ]*configure *,,p'$(top_builddir)/config.status`&&\
12+
sed -e's,@bindir@,$(bindir),g'\
13+
-e's,@includedir@,$(includedir),g'\
14+
-e's,@libdir@,$(libdir),g'\
15+
-e"s,@configure@,$$configure,g"\
16+
-e's,@version@,$(VERSION),g'\
17+
$<>$@.tmp
18+
chmod a+x$@.tmp
19+
mv$@.tmp$@
20+
21+
install: all installdirs
22+
$(INSTALL_SCRIPT) pg-config$(bindir)/pg-config
23+
24+
installdirs:
25+
$(mkinstalldirs)$(bindir)
26+
27+
uninstall:
28+
rm -f$(bindir)/pg-config
29+
30+
cleandistcleanmaintainer-clean:
31+
rm -f pg-config

‎src/bin/pg-config/pg-config.sh

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#! /bin/sh
2+
3+
# This shell script saves various pieces of information about the
4+
# installed version of PostgreSQL. Packages that interface to
5+
# PostgreSQL can use it to configure their build.
6+
#
7+
# Author: Peter Eisentraut <peter_e@gmx.net>
8+
# Public domain
9+
10+
# $Header: /cvsroot/pgsql/src/bin/pg-config/Attic/pg-config.sh,v 1.1 2000/08/26 13:08:16 petere Exp $
11+
12+
me=`basename$0`
13+
14+
# stored configuration values
15+
val_bindir='@bindir@'
16+
val_includedir='@includedir@'
17+
val_libdir='@libdir@'
18+
val_configure='@configure@'
19+
val_version='@version@'
20+
21+
help="\
22+
$me provides information about the installed version of PostgreSQL.
23+
24+
Usage:$me --bindir | --includedir | --libdir | --configure | --version
25+
26+
Operation modes:
27+
--bindir show location of user executables
28+
--includedir show location of C header files
29+
--libdir show location of object code libraries
30+
--configure show options given to\`configure' script when
31+
PostgreSQL was built
32+
--version show PostgreSQL version and exit
33+
34+
Report bugs to <pgsql-bugs@postgresql.org>."
35+
36+
advice="\
37+
Try\`$me --help' for more information."
38+
39+
iftest$# -eq 0;then
40+
echo"$me: argument required"
41+
echo"$advice"
42+
exit 1
43+
fi
44+
45+
show=
46+
47+
for opt
48+
do
49+
case$optin
50+
--bindir) show="$show\$val_bindir";;
51+
--includedir) show="$show\$val_includedir";;
52+
--libdir) show="$show\$val_libdir";;
53+
--configure) show="$show\$val_configure";;
54+
55+
--version)echo"PostgreSQL$val_version"
56+
exit 0;;
57+
--help|-\?)echo"$help"
58+
exit 0;;
59+
*)echo"$me: invalid argument:$opt"
60+
echo"$advice"
61+
exit 1;;
62+
esac
63+
done
64+
65+
forthingin$show
66+
do
67+
eval"echo$thing"
68+
done
69+
70+
# end of pg-config

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp