]>
git.ipfire.org Git - thirdparty/squid.git/blob - bootstrap.sh
3 ## Copyright (C) 1996-2023 The Squid Software Foundation and contributors
5 ## Squid software is distributed under GPLv2+ license and includes
6 ## contributions from numerous individuals and organizations.
7 ## Please see the COPYING and CONTRIBUTORS files for details.
10 # Used to setup the configure.ac, autoheader and Makefile.in's if configure
11 # has not been generated. This script is only needed for developers when
12 # configure has not been run, or if a Makefile.am in a non-configured directory
15 # Autotool versions preferred. To override either edit the script
16 # to match the versions you want to use, or set the variables on
17 # the command line like "env acver=.. amver=... ./bootstrap.sh"
18 acversions
="${acver:-.}" # 2.68 2.67 2.66 2.65 2.64 2.63 2.62 2.61}"
19 amversions
="${amver:-.}" # 1.11 1.10 1.9}"
20 ltversions
="${ltver:-.}" # 2.2}"
24 eval $2 --version 2>/dev
/null |
grep -i "$1.* $3" >/dev
/null
31 ${tool}${variant} --version 2>/dev
/null |
head -1 |
sed -e 's/.*) //'
40 for version
in $versions; do
41 for variant
in "" "${version}" "-${version}" "`echo $version | sed -e 's/\.//g'`"; do
42 if check_version
$tool ${tool}${variant} $version; then
47 if [ "x$found" != "xNOT_FOUND" ]; then
51 if [ "x$found" = "xNOT_FOUND" ]; then
52 echo "WARNING: Cannot find $tool version $versions" >&2
53 echo "Trying `$tool --version 2>&1 | head -1`" >&2
63 if test $?
-gt 0 ; then
64 # path for $tool not found. Not defining, and hoping for the best
76 echo "Autotool bootstrapping failed. You will need to investigate and correct" ;
77 echo "before you can develop on this source tree"
82 bootstrap_libtoolize
() {
87 bootstrap
$tool $ltdl --force --copy --automake
90 # On MAC OS X, GNU libtool is named 'glibtool':
91 if [ `uname -s 2>/dev/null` = 'Darwin' ]
93 LIBTOOL_BIN
="glibtool"
98 # Adjust paths of required autool packages
99 amver
=`find_variant automake ${amversions}`
100 acver
=`find_variant autoconf ${acversions}`
101 ltver
=`find_variant ${LIBTOOL_BIN} ${ltversions}`
103 # Produce debug output about what version actually found.
104 amversion
=`show_version automake "${amver}"`
105 acversion
=`show_version autoconf "${acver}"`
106 ltversion
=`show_version ${LIBTOOL_BIN} "${ltver}"`
108 # Find the libtool path to get the right aclocal includes
109 ltpath
=`find_path ${LIBTOOL_BIN}${ltver}`
111 # Set environment variable to tell automake which autoconf to use.
112 AUTOCONF
="autoconf${acver}" ; export AUTOCONF
114 echo "automake ($amversion) : automake$amver"
115 echo "autoconf ($acversion) : autoconf$acver"
116 echo "libtool ($ltversion) : ${LIBTOOL_BIN}${ltver}"
117 echo "libtool path : $ltpath"
122 if [ -z "$dir" ] ||
[ -d $dir ]; then
124 echo "Bootstrapping $dir"
126 if [ -n "$dir" ] && [ -f bootstrap.sh
]; then
128 elif [ ! -f $dir/configure
]; then
129 # Make sure cfgaux exists
132 if test -n "$ltpath"; then
133 acincludeflag
="-I $ltpath/../share/aclocal"
138 # Bootstrap the autotool subsystems
139 bootstrap aclocal
$amver $acincludeflag
140 bootstrap autoheader
$acver
141 bootstrap_libtoolize
${LIBTOOL_BIN}ize
${ltver}
142 bootstrap automake
$amver --foreign --add-missing --copy -f
143 bootstrap autoconf
$acver --force
152 # Make a copy of SPONSORS we can package
153 if test -f SPONSORS.list
; then
154 sed -e 's/@Squid-[0-9\.]*://' <SPONSORS.list
> SPONSORS ||
(rm -f SPONSORS
&& exit 1)
157 # Fixup autoconf recursion using --silent/--quiet option
158 # autoconf should inherit this option whe recursing into subdirectories
159 # but it currently doesn't for some reason.
160 if ! grep "configure_args --quiet" configure
>/dev
/null
; then
161 echo "Fixing configure recursion"
162 ed
-s configure
<<'EOS' >/dev/null || true
163 /ac_sub_configure_args=/
166 # Add --quiet option if used
167 test "$silent" = yes &&
168 ac_sub_configure_args="$ac_sub_configure_args --quiet"
174 echo "Autotool bootstrapping complete."