~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to config/prep_buildtree

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
# This script prepares a PostgreSQL build tree.  It is intended
 
4
# to be run by the configure script.
 
5
 
 
6
me=`basename $0`
 
7
 
 
8
help="\
 
9
Usage: $me sourcetree [buildtree]"
 
10
 
 
11
if test -z "$1"; then
 
12
    echo "$help" 1>&2
 
13
    exit 1
 
14
elif test x"$1" = x"--help"; then
 
15
    echo "$help"
 
16
    exit 0
 
17
fi
 
18
 
 
19
unset CDPATH
 
20
 
 
21
sourcetree=`cd $1 && pwd`
 
22
 
 
23
buildtree=`cd ${2:-'.'} && pwd`
 
24
 
 
25
for item in `find "$sourcetree" -type d \( -name CVS -prune -o -print \)`; do
 
26
    subdir=`expr "$item" : "$sourcetree\(.*\)"`
 
27
    if test ! -d "$buildtree/$subdir"; then
 
28
        mkdir -p "$buildtree/$subdir" || exit 1
 
29
    fi
 
30
done
 
31
 
 
32
for item in `find "$sourcetree" -name Makefile -print -o -name GNUmakefile -print`; do
 
33
    filename=`expr "$item" : "$sourcetree\(.*\)"`
 
34
    if test ! -f "${item}.in"; then
 
35
        if cmp "$item" "$buildtree/$filename" >/dev/null 2>&1; then : ; else
 
36
            ln -fs "$item" "$buildtree/$filename" || exit 1
 
37
        fi
 
38
    fi
 
39
done
 
40
 
 
41
exit 0