]>
git.ipfire.org Git - thirdparty/squid.git/blob - bootstrap.sh
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
7 # Autotool versions preferred. To override either edit the script
8 # to match the versions you want to use, or set the variables on
9 # the command line like "env acver=.. amver=... ./bootstrap.sh"
10 acversions
="${acver:-2.63 2.62 2.61}"
11 amversions
="${amver:-1.11 1.10 1.9}"
12 ltversions
="${ltver:-2 1.5 1.4}"
16 eval $2 --version 2>/dev
/null |
grep -i "$1.* $3" >/dev
/null
25 for version
in $versions; do
26 for variant
in "" "-${version}" "`echo $version | sed -e 's/\.//g'`"; do
27 if check_version
$tool ${tool}${variant} $version; then
32 if [ "x$found" != "xNOT_FOUND" ]; then
36 if [ "x$found" = "xNOT_FOUND" ]; then
48 for version
in $versions; do
49 for variant
in "" "-${version}" "`echo $version | sed -e 's/\.//g'`"; do
50 if check_version
$tool ${tool}${variant} $version; then
55 if [ "x$found" != "xNOT_FOUND" ]; then
59 if [ "x$found" = "xNOT_FOUND" ]; then
60 echo "WARNING: Cannot find $tool version $versions" >&2
61 echo "Trying `$tool --version | head -1`" >&2
72 echo "Autotool bootstrapping failed. You will need to investigate and correct" ;
73 echo "before you can develop on this source tree"
78 bootstrap_libtoolize
() {
81 # TODO: when we have libtool2, tell libtoolize where to put its files
82 # instead of manualy moving files from ltdl to lib/libLtdl
83 if egrep -q '^[[:space:]]*AC_LIBLTDL_' configure.
in
85 if libtoolize
$ltver --help |
grep -q -- --ltdl.
=; then
86 ltdl
="--ltdl=lib/libLtdl"
95 bootstrap libtoolize
$ltver $ltdl --force --copy --automake
97 # customize generated libltdl, if any
98 if test -d libltdl
&& [ $copy_libltdl ]
102 # do not bundle with the huge standard license text
103 rm -f $src/COPYING.LIB
104 makefile
=$src/Makefile.
in
105 sed 's/COPYING.LIB/ /g' $makefile > $makefile.new
;
107 mv $makefile.new
$makefile
112 if test -d $dest # already exists
114 echo "Updating $dest from $src."
119 echo "Creating $dest from $src."
125 # Adjust paths of required autool packages
126 amver
=`find_variant automake ${amversions}`
127 acver
=`find_variant autoconf ${acversions}`
128 ltver
=`find_variant libtool ${ltversions}`
130 # Produce debug output about what version actually found.
131 amversion
=`show_version automake ${amversions}`
132 acversion
=`show_version autoconf ${acversions}`
133 ltversion
=`show_version libtool ${ltversions}`
135 # Set environment variable to tell automake which autoconf to use.
136 AUTOCONF
="autoconf${acver}" ; export AUTOCONF
138 echo "automake ($amversion) : automake$amver"
139 echo "autoconf ($acversion) : autoconf$acver"
140 echo "libtool ($ltversion) : libtool$ltver"
146 if [ -z "$dir" ] ||
[ -d $dir ]; then
148 echo "Bootstrapping $dir"
150 if [ -n "$dir" ] && [ -f bootstrap.sh
]; then
152 elif [ ! -f $dir/configure
]; then
153 # Make sure cfgaux exists
156 # Bootstrap the autotool subsystems
157 bootstrap aclocal
$amver
158 bootstrap autoheader
$acver
159 bootstrap_libtoolize
$ltver
160 bootstrap automake
$amver --foreign --add-missing --copy -f
161 bootstrap autoconf
$acver --force
170 # Fixup autoconf recursion using --silent/--quiet option
171 # autoconf should inherit this option whe recursing into subdirectories
172 # but it currently doesn't for some reason.
173 if ! grep "configure_args --quiet" configure
>/dev
/null
; then
174 echo "Fixing configure recursion"
175 ed
-s configure
<<'EOS' >/dev/null || true
176 /ac_sub_configure_args=/
179 # Add --quiet option if used
180 test "$silent" = yes &&
181 ac_sub_configure_args="$ac_sub_configure_args --quiet"
187 echo "Autotool bootstrapping complete."