2000-10-21 05:04:27 +08:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# This script prepares a PostgreSQL build tree. It is intended
|
|
|
|
# to be run by the configure script.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2001-03-03 23:53:41 +08:00
|
|
|
unset CDPATH
|
|
|
|
|
|
|
|
sourcetree=`cd $1 && pwd`
|
|
|
|
|
|
|
|
buildtree=`cd ${2:-'.'} && pwd`
|
2000-10-21 05:04:27 +08:00
|
|
|
|
2001-02-10 04:24:08 +08:00
|
|
|
for item in `find "$sourcetree" -type d \( -name CVS -prune -o -print \)`; do
|
|
|
|
subdir=`expr "$item" : "$sourcetree\(.*\)"`
|
|
|
|
if test ! -d "$buildtree/$subdir"; then
|
2001-03-03 23:53:41 +08:00
|
|
|
mkdir -p "$buildtree/$subdir" || exit 1
|
2001-02-10 04:24:08 +08:00
|
|
|
fi
|
2000-10-21 05:04:27 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
for item in `find "$sourcetree" -name Makefile -o -name GNUmakefile`; do
|
2001-02-10 04:24:08 +08:00
|
|
|
subdir=`expr "$item" : "$sourcetree\(.*\)"`
|
|
|
|
if test ! -f "${item}.in"; then
|
2001-03-03 23:53:41 +08:00
|
|
|
ln -fs "$item" "$buildtree/$subdir" || exit 1
|
2000-10-21 05:04:27 +08:00
|
|
|
fi
|
|
|
|
done
|
2001-03-03 23:53:41 +08:00
|
|
|
|
|
|
|
exit 0
|