mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
#
|
||||
# Copyright (c) 1994, Regents of the University of California
|
||||
#
|
||||
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.29 2000/07/19 16:29:53 petere Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.30 2000/08/26 13:08:15 petere Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -13,7 +13,7 @@ top_builddir = ../..
|
||||
include ../Makefile.global
|
||||
|
||||
DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id \
|
||||
pg_passwd psql scripts
|
||||
pg_passwd psql scripts pg-config
|
||||
|
||||
ifdef MULTIBYTE
|
||||
DIRS += pg_encoding
|
||||
|
31
src/bin/pg-config/Makefile
Normal file
31
src/bin/pg-config/Makefile
Normal file
@ -0,0 +1,31 @@
|
||||
# $Header: /cvsroot/pgsql/src/bin/pg-config/Attic/Makefile,v 1.1 2000/08/26 13:08:16 petere Exp $
|
||||
|
||||
subdir = src/bin/pg-config
|
||||
top_builddir = ../../..
|
||||
include $(top_builddir)/src/Makefile.global
|
||||
|
||||
all: pg-config
|
||||
|
||||
pg-config: pg-config.sh $(top_builddir)/config.status $(top_builddir)/src/Makefile.global Makefile
|
||||
rm -f $@ $@.tmp
|
||||
configure=`sed -n '7s,^# [^ ]*configure *,,p' $(top_builddir)/config.status` && \
|
||||
sed -e 's,@bindir@,$(bindir),g' \
|
||||
-e 's,@includedir@,$(includedir),g' \
|
||||
-e 's,@libdir@,$(libdir),g' \
|
||||
-e "s,@configure@,$$configure,g" \
|
||||
-e 's,@version@,$(VERSION),g' \
|
||||
$< >$@.tmp
|
||||
chmod a+x $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
install: all installdirs
|
||||
$(INSTALL_SCRIPT) pg-config $(bindir)/pg-config
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(bindir)
|
||||
|
||||
uninstall:
|
||||
rm -f $(bindir)/pg-config
|
||||
|
||||
clean distclean maintainer-clean:
|
||||
rm -f pg-config
|
70
src/bin/pg-config/pg-config.sh
Normal file
70
src/bin/pg-config/pg-config.sh
Normal file
@ -0,0 +1,70 @@
|
||||
#! /bin/sh
|
||||
|
||||
# This shell script saves various pieces of information about the
|
||||
# installed version of PostgreSQL. Packages that interface to
|
||||
# PostgreSQL can use it to configure their build.
|
||||
#
|
||||
# Author: Peter Eisentraut <peter_e@gmx.net>
|
||||
# Public domain
|
||||
|
||||
# $Header: /cvsroot/pgsql/src/bin/pg-config/Attic/pg-config.sh,v 1.1 2000/08/26 13:08:16 petere Exp $
|
||||
|
||||
me=`basename $0`
|
||||
|
||||
# stored configuration values
|
||||
val_bindir='@bindir@'
|
||||
val_includedir='@includedir@'
|
||||
val_libdir='@libdir@'
|
||||
val_configure='@configure@'
|
||||
val_version='@version@'
|
||||
|
||||
help="\
|
||||
$me provides information about the installed version of PostgreSQL.
|
||||
|
||||
Usage: $me --bindir | --includedir | --libdir | --configure | --version
|
||||
|
||||
Operation modes:
|
||||
--bindir show location of user executables
|
||||
--includedir show location of C header files
|
||||
--libdir show location of object code libraries
|
||||
--configure show options given to \`configure' script when
|
||||
PostgreSQL was built
|
||||
--version show PostgreSQL version and exit
|
||||
|
||||
Report bugs to <pgsql-bugs@postgresql.org>."
|
||||
|
||||
advice="\
|
||||
Try \`$me --help' for more information."
|
||||
|
||||
if test $# -eq 0 ; then
|
||||
echo "$me: argument required"
|
||||
echo "$advice"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
show=
|
||||
|
||||
for opt
|
||||
do
|
||||
case $opt in
|
||||
--bindir) show="$show \$val_bindir";;
|
||||
--includedir) show="$show \$val_includedir";;
|
||||
--libdir) show="$show \$val_libdir";;
|
||||
--configure) show="$show \$val_configure";;
|
||||
|
||||
--version) echo "PostgreSQL $val_version"
|
||||
exit 0;;
|
||||
--help|-\?) echo "$help"
|
||||
exit 0;;
|
||||
*) echo "$me: invalid argument: $opt"
|
||||
echo "$advice"
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
for thing in $show
|
||||
do
|
||||
eval "echo $thing"
|
||||
done
|
||||
|
||||
# end of pg-config
|
Reference in New Issue
Block a user