]>
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.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
71 if test $?
-gt 0 ; then
72 # path for $tool not found. Not defining, and hoping for the best
84 echo "Autotool bootstrapping failed. You will need to investigate and correct" ;
85 echo "before you can develop on this source tree"
90 bootstrap_libtoolize
() {
93 # TODO: when we have libtool2, tell libtoolize where to put its files
94 # instead of manualy moving files from ltdl to lib/libLtdl
95 if egrep -q '^[[:space:]]*AC_LIBLTDL_' configure.
in
102 bootstrap libtoolize
$ltver $ltdl --force --copy --automake
104 # customize generated libltdl, if any
109 # do not bundle with the huge standard license text
110 rm -f $src/COPYING.LIB
111 makefile
=$src/Makefile.
in
112 sed 's/COPYING.LIB/ /g' $makefile > $makefile.new
;
114 mv $makefile.new
$makefile
117 # Libtool 2.2.6b we bundle is slightly broken with non-portable dependencies
118 sed 's/<libltdl\/lt_system.h>/\"libltdl\/lt_system.h\"/g' $src/ltdl.h |
119 sed 's/<libltdl\/lt_error.h>/\"libltdl\/lt_error.h\"/g' |
120 sed 's/<libltdl\/lt_dlloader.h>/\"libltdl\/lt_dlloader.h\"/g' > $src/ltdl.h.new
;
121 chmod u
+w
$src/ltdl.h
122 mv $src/ltdl.h.new
$src/ltdl.h
123 chmod u-w
$src/ltdl.h
127 # Adjust paths of required autool packages
128 amver
=`find_variant automake ${amversions}`
129 acver
=`find_variant autoconf ${acversions}`
130 ltver
=`find_variant libtool ${ltversions}`
132 # Produce debug output about what version actually found.
133 amversion
=`show_version automake ${amversions}`
134 acversion
=`show_version autoconf ${acversions}`
135 ltversion
=`show_version libtool ${ltversions}`
137 # Find the libtool path to get the right aclocal includes
138 ltpath
=`find_path libtool$ltver`
140 # Set environment variable to tell automake which autoconf to use.
141 AUTOCONF
="autoconf${acver}" ; export AUTOCONF
143 echo "automake ($amversion) : automake$amver"
144 echo "autoconf ($acversion) : autoconf$acver"
145 echo "libtool ($ltversion) : libtool$ltver"
146 echo "libtool path : $ltpath"
152 if [ -z "$dir" ] ||
[ -d $dir ]; then
154 echo "Bootstrapping $dir"
156 if [ -n "$dir" ] && [ -f bootstrap.sh
]; then
158 elif [ ! -f $dir/configure
]; then
159 # Make sure cfgaux exists
162 if test -n "$ltpath"; then
163 acincludeflag
="-I $ltpath/../share/aclocal"
168 # Bootstrap the autotool subsystems
169 bootstrap aclocal
$amver $acincludeflag
170 bootstrap autoheader
$acver
171 bootstrap_libtoolize
$ltver
172 bootstrap automake
$amver --foreign --add-missing --copy -f
173 bootstrap autoconf
$acver --force
182 # Fixup autoconf recursion using --silent/--quiet option
183 # autoconf should inherit this option whe recursing into subdirectories
184 # but it currently doesn't for some reason.
185 if ! grep "configure_args --quiet" configure
>/dev
/null
; then
186 echo "Fixing configure recursion"
187 ed
-s configure
<<'EOS' >/dev/null || true
188 /ac_sub_configure_args=/
191 # Add --quiet option if used
192 test "$silent" = yes &&
193 ac_sub_configure_args="$ac_sub_configure_args --quiet"
199 echo "Autotool bootstrapping complete."