mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-03 08:00:21 +08:00
23e41fb7fb
Recode test for equality of source and build directory using 'test -ef', because even using pwd you might not get equal strings. Thanks, QNX.
40 lines
833 B
Bash
40 lines
833 B
Bash
#! /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
|
|
|
|
unset CDPATH
|
|
|
|
sourcetree=`cd $1 && pwd`
|
|
|
|
buildtree=`cd ${2:-'.'} && pwd`
|
|
|
|
for item in `find "$sourcetree" -type d \( -name CVS -prune -o -print \)`; do
|
|
subdir=`expr "$item" : "$sourcetree\(.*\)"`
|
|
if test ! -d "$buildtree/$subdir"; then
|
|
mkdir -p "$buildtree/$subdir" || exit 1
|
|
fi
|
|
done
|
|
|
|
for item in `find "$sourcetree" -name Makefile -o -name GNUmakefile`; do
|
|
subdir=`expr "$item" : "$sourcetree\(.*\)"`
|
|
if test ! -f "${item}.in"; then
|
|
ln -fs "$item" "$buildtree/$subdir" || exit 1
|
|
fi
|
|
done
|
|
|
|
exit 0
|