diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2000-10-20 21:04:27 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2000-10-20 21:04:27 +0000 |
commit | 805e431a3868ac71681316927403d1ba389e113b (patch) | |
tree | e20ff81ccb4be79cbd43e87cf76f33ee5fb1887d /config/prep_buildtree | |
parent | 039f3f1b051b189e7ccf0c28d86d415e693ee8d6 (diff) | |
download | postgresql-805e431a3868ac71681316927403d1ba389e113b.tar.gz |
Add support for VPATH builds, that is, building somewhere else than in the
source directory. This involves mostly makefiles using $(srcdir) when they
might have used ".". (Regression tests don't work with this, yet.)
Sort out usage of CPPFLAGS, CFLAGS (and CXXFLAGS). Add "override" keyword
in most places, to preserve necessary flags even when the user overrode the
flags.
Diffstat (limited to 'config/prep_buildtree')
-rw-r--r-- | config/prep_buildtree | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/config/prep_buildtree b/config/prep_buildtree new file mode 100644 index 0000000000..4e35b51813 --- /dev/null +++ b/config/prep_buildtree @@ -0,0 +1,33 @@ +#! /bin/sh + +# This script prepares a PostgreSQL build tree. It is intended +# to be run by the configure script. + +set -e +me=`basename $0` + +help="\ +Usage: $me sourcetree [buildtree]" + +if test -z "$1"; then + echo "$help" 1>&2 + exit 1 +elif test x"$1" = x"--help"; then + echo "$help" + exit 0 +fi +sourcetree=$1 + +buildtree=${2:-'.'} + +for item in `find "$sourcetree" -type d -\( -name CVS -prune -o -print -\)`; do + subdir=`expr "$item" : "$sourcetree\(.*\)"` || true + mkdir -p "$buildtree/$subdir" +done + +for item in `find "$sourcetree" -name Makefile -o -name GNUmakefile`; do + subdir=`expr "$item" : "$sourcetree\(.*\)"` || true + if test ! -e "${item}.in"; then + ln -fs "$item" "$buildtree/$subdir" + fi +done |