head	1.6;
access;
symbols
	REL9_0_0:1.5.32.1
	REL9_1_ALPHA1:1.6
	REL9_0_RC1:1.5.32.1
	REL9_0_BETA4:1.5
	REL9_0_STABLE:1.5.0.32
	REL9_0_BETA3:1.5
	REL9_0_BETA2:1.5
	REL7_4_29:1.5
	REL8_0_25:1.5
	REL8_1_21:1.5
	REL8_2_17:1.5
	REL8_3_11:1.5
	REL8_4_4:1.5
	REL9_0_BETA1:1.5
	REL9_0_ALPHA5_BRANCH:1.5.0.30
	REL9_0_ALPHA5:1.5
	REL7_4_28:1.5
	REL8_0_24:1.5
	REL8_1_20:1.5
	REL8_2_16:1.5
	REL8_3_10:1.5
	REL8_4_3:1.5
	REL9_0_ALPHA4:1.5
	REL9_0_ALPHA4_BRANCH:1.5.0.28
	REL8_5_ALPHA3:1.5
	REL8_5_ALPHA3_BRANCH:1.5.0.26
	REL7_4_27:1.5
	REL8_0_23:1.5
	REL8_1_19:1.5
	REL8_2_15:1.5
	REL8_3_9:1.5
	REL8_4_2:1.5
	REL8_5_ALPHA2:1.5
	REL8_5_ALPHA2_BRANCH:1.5.0.24
	REL7_4_26:1.5
	REL8_0_22:1.5
	REL8_1_18:1.5
	REL8_2_14:1.5
	REL8_3_8:1.5
	REL8_4_1:1.5
	REL8_5_ALPHA1:1.5
	REL8_5_ALPHA1_BRANCH:1.5.0.22
	REL8_4_STABLE:1.5.0.20
	REL8_4_0:1.5
	REL8_4_RC2:1.5
	REL8_4_RC1:1.5
	REL8_4_BETA2:1.5
	REL8_4_BETA1:1.5
	REL7_4_25:1.5
	REL8_0_21:1.5
	REL8_1_17:1.5
	REL8_2_13:1.5
	REL8_3_7:1.5
	REL7_4_24:1.5
	REL8_0_20:1.5
	REL8_1_16:1.5
	REL8_2_12:1.5
	REL8_3_6:1.5
	REL7_4_23:1.5
	REL8_0_19:1.5
	REL8_1_15:1.5
	REL8_2_11:1.5
	REL8_3_5:1.5
	REL7_4_22:1.5
	REL8_0_18:1.5
	REL8_1_14:1.5
	REL8_2_10:1.5
	REL8_3_4:1.5
	REL7_4_21:1.5
	REL8_0_17:1.5
	REL8_1_13:1.5
	REL8_2_9:1.5
	REL8_3_3:1.5
	REL7_4_20:1.5
	REL8_0_16:1.5
	REL8_1_12:1.5
	REL8_2_8:1.5
	REL8_3_2:1.5
	REL8_2_7:1.5
	REL8_3_1:1.5
	REL8_3_STABLE:1.5.0.18
	REL8_3_0:1.5
	REL8_3_RC2:1.5
	REL7_3_21:1.5
	REL7_4_19:1.5
	REL8_0_15:1.5
	REL8_1_11:1.5
	REL8_2_6:1.5
	REL8_3_RC1:1.5
	REL8_3_BETA4:1.5
	REL8_3_BETA3:1.5
	REL8_3_BETA2:1.5
	REL8_3_BETA1:1.5
	REL7_3_20:1.5
	REL7_4_18:1.5
	REL8_0_14:1.5
	REL8_1_10:1.5
	REL8_2_5:1.5
	REL7_3_19:1.5
	REL7_4_17:1.5
	REL8_0_13:1.5
	REL8_1_9:1.5
	REL8_2_4:1.5
	REL8_0_12:1.5
	REL8_1_8:1.5
	REL8_2_3:1.5
	REL7_3_18:1.5
	REL7_4_16:1.5
	REL8_0_11:1.5
	REL8_1_7:1.5
	REL8_2_2:1.5
	REL8_0_10:1.5
	REL8_1_6:1.5
	REL8_2_1:1.5
	REL7_4_15:1.5
	REL7_3_17:1.5
	REL8_2_STABLE:1.5.0.16
	REL8_2_0:1.5
	REL8_2_RC1:1.5
	REL8_2_BETA3:1.5
	REL8_2_BETA2:1.5
	REL8_1_5:1.5
	REL8_0_9:1.5
	REL7_4_14:1.5
	REL7_3_16:1.5
	REL8_2_BETA1:1.5
	REL7_3_15:1.5
	REL7_4_13:1.5
	REL8_0_8:1.5
	REL8_1_4:1.5
	REL7_3_14:1.5
	REL7_4_12:1.5
	REL8_0_7:1.5
	REL8_1_3:1.5
	REL7_3_13:1.5
	REL7_4_11:1.5
	REL8_0_6:1.5
	REL8_1_2:1.5
	REL7_3_12:1.5
	REL7_4_10:1.5
	REL8_0_5:1.5
	REL8_1_1:1.5
	REL8_1_STABLE:1.5.0.14
	REL8_1_0:1.5
	REL8_1_0RC1:1.5
	REL8_1_0BETA4:1.5
	REL8_1_0BETA3:1.5
	REL7_3_11:1.5
	REL7_4_9:1.5
	REL8_0_4:1.5
	REL8_1_0BETA2:1.5
	REL8_1_0BETA1:1.5
	REL7_2_8:1.5
	REL7_3_10:1.5
	REL7_4_8:1.5
	REL8_0_3:1.5
	REL8_0_2:1.5
	REL7_2_7:1.5
	REL7_3_9:1.5
	REL7_4_7:1.5
	REL8_0_1:1.5
	REL8_0_STABLE:1.5.0.12
	REL8_0_0:1.5.0.10
	REL8_0_0RC5:1.5
	REL8_0_0RC4:1.5
	REL8_0_0RC3:1.5
	REL8_0_0RC2:1.5
	REL8_0_0RC1:1.5
	REL8_0_0BETA5:1.5
	REL8_0_0BETA4:1.5
	REL7_4_6:1.5
	REL7_3_8:1.5
	REL7_2_6:1.5
	REL8_0_0BETA3:1.5
	REL8_0_0BETA2:1.5
	REL7_2_5:1.5
	REL7_4_5:1.5
	REL7_3_7:1.5
	REL7_4_4:1.5
	REL8_0_0BETA1:1.5
	REL7_4_3:1.5
	REL7_4_2:1.5
	REL7_3_6:1.5
	REL7_4_1:1.5
	REL7_3_5:1.5
	REL7_4:1.5
	REL7_4_RC2:1.5
	REL7_4_STABLE:1.5.0.8
	REL7_4_RC1:1.5
	REL7_4_BETA5:1.5
	REL7_4_BETA4:1.5
	REL7_4_BETA3:1.5
	REL7_4_BETA2:1.5
	WIN32_DEV:1.5.0.6
	REL7_4_BETA1:1.5
	REL7_3_4:1.5
	REL7_3_2:1.5
	REL7_2_4:1.5
	REL7_3_STABLE:1.5.0.4
	REL7_2_3:1.5
	REL7_2_STABLE:1.5.0.2
	REL7_2:1.5
	REL7_2_RC2:1.5
	REL7_2_RC1:1.5
	REL7_2_BETA5:1.5
	REL7_2_BETA4:1.5
	REL7_2_BETA3:1.5
	REL7_2_BETA2:1.5
	REL7_2_BETA1:1.5
	REL7_1_2:1.3
	REL7_1_STABLE:1.3.0.2
	REL7_1_BETA:1.1
	REL7_1_BETA3:1.1
	REL7_1_BETA2:1.1
	REL7_1:1.3;
locks; strict;
comment	@# @;


1.6
date	2010.08.26.18.34.37;	author tgl;	state Exp;
branches;
next	1.5;

1.5
date	2001.09.10.23.28.59;	author petere;	state Exp;
branches
	1.5.32.1;
next	1.4;

1.4
date	2001.09.10.22.25.48;	author petere;	state Exp;
branches;
next	1.3;

1.3
date	2001.03.03.15.53.41;	author petere;	state Exp;
branches;
next	1.2;

1.2
date	2001.02.09.20.24.08;	author petere;	state Exp;
branches;
next	1.1;

1.1
date	2000.10.20.21.03.01;	author petere;	state Exp;
branches;
next	;

1.5.32.1
date	2010.08.26.18.34.44;	author tgl;	state Exp;
branches;
next	;


desc
@@


1.6
log
@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.
@
text
@#! /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
@


1.5
log
@Make prep_buildtree harmless when run on top of the source tree.

from Ian Lance Taylor
@
text
@d41 9
@


1.5.32.1
log
@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.
@
text
@a40 9
# 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

@


1.4
log
@Add explicit '-print' to 'find' commands.

(partially) from Ian Lance Taylor
@
text
@d33 1
a33 1
    subdir=`expr "$item" : "$sourcetree\(.*\)"`
d35 3
a37 1
        ln -fs "$item" "$buildtree/$subdir" || exit 1
@


1.3
log
@Add configure check for -lunix, for QNX.

Recode test for equality of source and build directory using 'test -ef',
because even using pwd you might not get equal strings.  Thanks, QNX.
@
text
@d32 1
a32 1
for item in `find "$sourcetree" -name Makefile -o -name GNUmakefile`; do
@


1.2
log
@Make more portable.
@
text
@a17 1
sourcetree=$1
d19 5
a23 1
buildtree=${2:-'.'}
d28 1
a28 1
        mkdir -p "$buildtree/$subdir" || exit
d35 1
a35 1
        ln -fs "$item" "$buildtree/$subdir" || exit
d38 2
@


1.1
log
@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.
@
text
@a5 1
set -e
d22 5
a26 3
for item in `find "$sourcetree" -type d -\( -name CVS -prune -o -print -\)`; do
    subdir=`expr "$item" : "$sourcetree\(.*\)"` || true
    mkdir -p "$buildtree/$subdir"
d30 3
a32 3
    subdir=`expr "$item" : "$sourcetree\(.*\)"` || true
    if test ! -e "${item}.in"; then
        ln -fs "$item" "$buildtree/$subdir"
@
