postgresql/config/prep_buildtree
Tom Lane 39ce62b110 Don't auto-create the subdirectories holding built documentation in a VPATH
build tree.  If we actually build the docs in the VPATH tree, those dirs
will get created then; but if they're present and empty, they capture the
vpathsearch searches in "make install", preventing installation of prebuilt
docs that might exist in the source tree.  Per bug #5595 from Dmtiriy Igrishin.
Fix based on idea from Peter Eisentraut.
2010-08-26 18:34:37 +00:00

51 lines
1.3 KiB
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 -print -o -name GNUmakefile -print`; do
filename=`expr "$item" : "$sourcetree\(.*\)"`
if test ! -f "${item}.in"; then
if cmp "$item" "$buildtree/$filename" >/dev/null 2>&1; then : ; else
ln -fs "$item" "$buildtree/$filename" || exit 1
fi
fi
done
# 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.
rmdir "$buildtree/doc/src/sgml/html" 2>/dev/null
rmdir "$buildtree/doc/src/sgml/man1" 2>/dev/null
rmdir "$buildtree/doc/src/sgml/man3" 2>/dev/null
rmdir "$buildtree/doc/src/sgml/man7" 2>/dev/null
exit 0