Allow 'svn merge' to merge diffs which add 'svn:eol-style' properties
[svn.git] / build / buildcheck.sh
blob19cd13a80c96e119ecdd14614bd377731dd30b52
1 #! /bin/sh
3 # buildcheck.sh: Inspects the build setup to make detection and
4 # correction of problems an easier process.
6 # Initialize parameters
7 VERSION_CHECK="$1"
9 if test "$VERSION_CHECK" != "--release"; then
10 echo "buildcheck: checking installation..."
11 else
12 echo "buildcheck: checking installation for a source release..."
15 #--------------------------------------------------------------------------
16 # autoconf 2.50 or newer
18 ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//' -e 1q`
19 if test -z "$ac_version"; then
20 echo "buildcheck: autoconf not found."
21 echo " You need autoconf version 2.50 or newer installed."
22 exit 1
24 IFS=.; set $ac_version; IFS=' '
25 if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then
26 echo "buildcheck: autoconf version $ac_version found."
27 echo " You need autoconf version 2.50 or newer installed."
28 echo " If you have a sufficient autoconf installed, but it"
29 echo " is not named 'autoconf', then try setting the"
30 echo " AUTOCONF environment variable. (See the INSTALL file"
31 echo " for details.)"
32 exit 1
34 if test "$ac_version" = "2.58"; then
35 echo "buildcheck: autoconf version 2.58 found."
36 echo " This version of autoconf is broken. Please install at"
37 echo " least autoconf 2.59 or downgrade to version 2.57 which"
38 echo " is known to work."
39 exit 1
42 echo "buildcheck: autoconf version $ac_version (ok)"
44 #--------------------------------------------------------------------------
45 # autoheader 2.50 or newer
47 ah_version=`${AUTOHEADER:-autoheader} --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//' -e 1q`
48 if test -z "$ah_version"; then
49 echo "buildcheck: autoheader not found."
50 echo " You need autoheader version 2.50 or newer installed."
51 exit 1
53 IFS=.; set $ah_version; IFS=' '
54 if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then
55 echo "buildcheck: autoheader version $ah_version found."
56 echo " You need autoheader version 2.50 or newer installed."
57 echo " If you have a sufficient autoheader installed, but it"
58 echo " is not named 'autoheader', then try setting the"
59 echo " AUTOHEADER environment variable. (See the INSTALL file"
60 echo " for details.)"
61 exit 1
64 echo "buildcheck: autoheader version $ah_version (ok)"
66 #--------------------------------------------------------------------------
67 # libtool 1.4 or newer
69 LIBTOOL_WANTED_MAJOR=1
70 LIBTOOL_WANTED_MINOR=4
71 LIBTOOL_WANTED_PATCH=
72 LIBTOOL_WANTED_VERSION=1.4
74 # The minimum version for source releases is 1.4.3,
75 # because it's required by (at least) Solaris.
76 if test "$VERSION_CHECK" = "--release"; then
77 LIBTOOL_WANTED_PATCH=3
78 LIBTOOL_WANTED_VERSION=1.4.3
79 else
80 case `uname -sr` in
81 SunOS\ 5.*)
82 LIBTOOL_WANTED_PATCH=3
83 LIBTOOL_WANTED_VERSION=1.4.3
85 esac
88 libtool=`./build/PrintPath glibtool libtool libtool15`
89 # Extract the libtool version number: everything from the first number in
90 # the version text until a hyphen or space.
91 lt_pversion=`$libtool --version 2>/dev/null |
92 sed -e 's/^[^0-9]*//' -e 's/[- ].*//' -e '/^$/d' |
93 sed -e 1q`
94 if test -z "$lt_pversion"; then
95 echo "buildcheck: libtool not found."
96 echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed"
97 exit 1
99 lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
100 IFS=.; set $lt_version; IFS=' '
101 lt_status="good"
102 if test "$1" = "$LIBTOOL_WANTED_MAJOR"; then
103 if test "$2" -gt "$LIBTOOL_WANTED_MINOR"; then
104 lt_status="good"
105 elif test "$2" -lt "$LIBTOOL_WANTED_MINOR"; then
106 lt_status="bad"
107 elif test ! -z "$LIBTOOL_WANTED_PATCH"; then
108 if test "$3" -lt "$LIBTOOL_WANTED_PATCH"; then
109 lt_status="bad"
113 if test $lt_status != "good"; then
114 echo "buildcheck: libtool version $lt_pversion found."
115 echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed"
116 exit 1
119 echo "buildcheck: libtool version $lt_pversion (ok)"
121 #--------------------------------------------------------------------------
122 # check that our local copies of files match up with those in APR(UTIL)
124 if test -d ./apr; then
125 if cmp -s ./build/ac-macros/find_apr.m4 ./apr/build/find_apr.m4; then
127 else
128 echo "buildcheck: local copy of find_apr.m4 does not match APR's copy."
129 echo " An updated copy of find_apr.m4 may need to be checked in."
131 if cmp -s ./build/PrintPath ./apr/build/PrintPath; then
133 else
134 echo "buildcheck: local copy of PrintPath does not match APR's copy."
135 echo " An updated copy of PrintPath may need to be checked in."
139 if test -d ./apr-util; then
140 if cmp -s ./build/ac-macros/find_apu.m4 ./apr-util/build/find_apu.m4; then
142 else
143 echo "buildcheck: local copy of find_apu.m4 does not match APRUTIL's copy."
144 echo " An updated copy of find_apu.m4 may need to be checked in."
148 #--------------------------------------------------------------------------
149 exit 0