summaryrefslogtreecommitdiffstats
path: root/config/prep_buildtree
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:17:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:17:33 +0000
commit5e45211a64149b3c659b90ff2de6fa982a5a93ed (patch)
tree739caf8c461053357daa9f162bef34516c7bf452 /config/prep_buildtree
parentInitial commit. (diff)
downloadpostgresql-15-5e45211a64149b3c659b90ff2de6fa982a5a93ed.tar.xz
postgresql-15-5e45211a64149b3c659b90ff2de6fa982a5a93ed.zip
Adding upstream version 15.5.upstream/15.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'config/prep_buildtree')
-rw-r--r--config/prep_buildtree45
1 files changed, 45 insertions, 0 deletions
diff --git a/config/prep_buildtree b/config/prep_buildtree
new file mode 100644
index 0000000..a0eabd3
--- /dev/null
+++ b/config/prep_buildtree
@@ -0,0 +1,45 @@
+#! /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`
+
+# 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.
+for item in `find "$sourcetree" -type d \( \( -name CVS -prune \) -o \( -name .git -prune \) -o -print \) | grep -v "$sourcetree/doc/src/sgml/\+"`; 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 | grep -v "$sourcetree/doc/src/sgml/images/"`; 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
+
+exit 0