2000-10-21 01:04:27 +04: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 18:53:41 +03:00
|
|
|
unset CDPATH
|
|
|
|
|
|
|
|
sourcetree=`cd $1 && pwd`
|
|
|
|
|
|
|
|
buildtree=`cd ${2:-'.'} && pwd`
|
2000-10-21 01:04:27 +04:00
|
|
|
|
2010-09-24 09:32:52 +04:00
|
|
|
# We must not auto-create the subdirectories holding built documentation.
|
|
|
|
# If we did, it would interfere with installation of prebuilt docs from
|
|
|
|
# the source tree, if a VPATH build is done from a distribution tarball.
|
|
|
|
# See bug #5595.
|
2010-10-25 16:24:02 +04:00
|
|
|
for item in `find "$sourcetree" -type d \( \( -name CVS -prune \) -o \( -name .git -prune \) -o -print \) | grep -v "$sourcetree/doc/src/sgml/\+"`; do
|
2001-02-09 23:24:08 +03:00
|
|
|
subdir=`expr "$item" : "$sourcetree\(.*\)"`
|
|
|
|
if test ! -d "$buildtree/$subdir"; then
|
2001-03-03 18:53:41 +03:00
|
|
|
mkdir -p "$buildtree/$subdir" || exit 1
|
2001-02-09 23:24:08 +03:00
|
|
|
fi
|
2000-10-21 01:04:27 +04:00
|
|
|
done
|
|
|
|
|
2019-03-28 01:36:00 +03:00
|
|
|
for item in `find "$sourcetree" -name Makefile -print -o -name GNUmakefile -print | grep -v "$sourcetree/doc/src/sgml/images/"`; do
|
2001-09-11 03:28:59 +04:00
|
|
|
filename=`expr "$item" : "$sourcetree\(.*\)"`
|
2001-02-09 23:24:08 +03:00
|
|
|
if test ! -f "${item}.in"; then
|
2001-09-11 03:28:59 +04:00
|
|
|
if cmp "$item" "$buildtree/$filename" >/dev/null 2>&1; then : ; else
|
|
|
|
ln -fs "$item" "$buildtree/$filename" || exit 1
|
|
|
|
fi
|
2000-10-21 01:04:27 +04:00
|
|
|
fi
|
|
|
|
done
|
2001-03-03 18:53:41 +03:00
|
|
|
|
|
|
|
exit 0
|