]> git.ipfire.org Git - thirdparty/squid.git/blame - bootstrap.sh
Use lowercase for syslog tags
[thirdparty/squid.git] / bootstrap.sh
CommitLineData
74b984b6 1#!/bin/sh
a2794549 2# Used to setup the configure.in, autoheader and Makefile.in's if configure
3# has not been generated. This script is only needed for developers when
4# configure has not been run, or if a Makefile.am in a non-configured directory
5# has been updated
6
fbf2848f 7# Autotool versions preferred. To override either edit the script
c3d3f1cf 8# to match the versions you want to use, or set the variables on
9# the command line like "env acver=.. amver=... ./bootstrap.sh"
af3004ff 10acversions="${acver:-2.59 2.57 2.53 2.52}"
11amversions="${amver:-1.9 1.7 1.6 1.5}"
4ee52a78 12ltversions="${ltver:-1.5 1.4}"
fbf2848f 13
14check_version()
15{
16 eval $2 --version 2>/dev/null | grep -i "$1.*$3" >/dev/null
17}
18
19find_version()
20{
21 tool=$1
22 found="NOT_FOUND"
23 shift
24 versions="$*"
25 for version in $versions; do
80feea5a 26 for variant in "" "-${version}" "`echo $version | sed -e 's/\.//g'`"; do
fbf2848f 27 if check_version $tool ${tool}${variant} $version; then
28 found="${variant}"
29 break
30 fi
31 done
32 if [ "x$found" != "xNOT_FOUND" ]; then
33 break
34 fi
35 done
36 if [ "x$found" = "xNOT_FOUND" ]; then
37 echo "WARNING: Cannot find $tool version $versions" >&2
38 echo "Trying `$tool --version | head -1`" >&2
39 found=""
40 fi
41 echo $found
42}
96b8d5c3 43
44bootstrap() {
307aa7bb 45 if "$@"; then
46 true # Everything OK
47 else
96b8d5c3 48 echo "$1 failed"
49 echo "Autotool bootstrapping failed. You will need to investigate and correct" ;
50 echo "before you can develop on this source tree"
51 exit 1
b4468b69 52 fi
96b8d5c3 53}
54
74b984b6 55# Adjust paths of required autool packages
fbf2848f 56amver=`find_version automake ${amversions}`
57acver=`find_version autoconf ${acversions}`
4ee52a78 58ltver=`find_version libtool ${ltversions}`
74b984b6 59
a8ed6bf6 60# Set environment variable to tell automake which autoconf to use.
61AUTOCONF="autoconf${acver}" ; export AUTOCONF
62
6f1fbc38 63echo "automake : $amver"
64echo "autoconfg: $acver"
65echo "libtool : $ltver"
a8ed6bf6 66
dc838e28 67for dir in \
68 "" \
63d03edb 69 lib/libTrie
dc838e28 70do
bd6d8fb7 71 if [ -z "$dir" ] || [ -d $dir ]; then
98c7875e 72 if (
dc838e28 73 echo "Bootstrapping $dir"
74 cd ./$dir
897c0dcf 75 if [ -n "$dir" ] && [ -f bootstrap.sh ]; then
67c29939 76 ./bootstrap.sh
4d00560c 77 elif [ ! -f $dir/configure ]; then
83c44f93 78 # Make sure cfgaux exists
79 mkdir -p cfgaux
80
67c29939 81 # Bootstrap the autotool subsystems
82 bootstrap aclocal$amver
67c29939 83 bootstrap autoheader$acver
03b2093c 84 bootstrap libtoolize$ltver --force --copy --automake
3e0237d6 85 bootstrap automake$amver --foreign --add-missing --copy -f
63ab7f2d 86 bootstrap autoconf$acver --force
67c29939 87 fi ); then
dc838e28 88 : # OK
89 else
90 exit 1
91 fi
98c7875e 92 fi
dc838e28 93done
b4468b69 94
9b472584 95# Fixup autoconf recursion using --silent/--quiet option
96# autoconf should inherit this option whe recursing into subdirectories
97# but it currently doesn't for some reason.
63ab7f2d 98if ! grep "configure_args --quiet" configure >/dev/null; then
99echo "Fixing configure recursion"
9b472584 100ed -s configure <<'EOS' >/dev/null || true
101/ac_sub_configure_args=/
102+1
103i
104 # Add --quiet option if used
105 test "$silent" = yes &&
106 ac_sub_configure_args="$ac_sub_configure_args --quiet"
107.
108w
109EOS
63ab7f2d 110fi
9b472584 111
96b8d5c3 112echo "Autotool bootstrapping complete."