]>
git.ipfire.org Git - thirdparty/squid.git/blob - bootstrap.sh
2 # Used to setup the configure.ac, 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.68 2.67 2.66 2.65 2.64 2.63 2.62 2.61}"
11 amversions
="${amver:-.}" # 1.11 1.10 1.9}"
12 ltversions
="${ltver:-.}" # 2.2}"
16 eval $2 --version 2>/dev
/null |
grep -i "$1.* $3" >/dev
/null
23 ${tool}${variant} --version 2>/dev
/null |
head -1 |
sed -e 's/.*) //'
32 for version
in $versions; do
33 for variant
in "" "${version}" "-${version}" "`echo $version | sed -e 's/\.//g'`"; do
34 if check_version
$tool ${tool}${variant} $version; then
39 if [ "x$found" != "xNOT_FOUND" ]; then
43 if [ "x$found" = "xNOT_FOUND" ]; then
44 echo "WARNING: Cannot find $tool version $versions" >&2
45 echo "Trying `$tool --version | head -1`" >&2
55 if test $?
-gt 0 ; then
56 # path for $tool not found. Not defining, and hoping for the best
68 echo "Autotool bootstrapping failed. You will need to investigate and correct" ;
69 echo "before you can develop on this source tree"
74 bootstrap_libtoolize
() {
79 bootstrap
$tool $ltdl --force --copy --automake
81 # customize generated libltdl, if any
86 # do not bundle with the huge standard license text
87 rm -f $src/COPYING.LIB
88 makefile
=$src/Makefile.
in
89 sed 's/COPYING.LIB/ /g' $makefile > $makefile.new
;
91 mv $makefile.new
$makefile
96 # On MAC OS X, GNU libtool is named 'glibtool':
97 if [ `uname -s 2>/dev/null` = 'Darwin' ]
99 LIBTOOL_BIN
="glibtool"
101 LIBTOOL_BIN
="libtool"
104 # Adjust paths of required autool packages
105 amver
=`find_variant automake ${amversions}`
106 acver
=`find_variant autoconf ${acversions}`
107 ltver
=`find_variant ${LIBTOOL_BIN} ${ltversions}`
109 # Produce debug output about what version actually found.
110 amversion
=`show_version automake "${amver}"`
111 acversion
=`show_version autoconf "${acver}"`
112 ltversion
=`show_version ${LIBTOOL_BIN} "${ltver}"`
114 # Find the libtool path to get the right aclocal includes
115 ltpath
=`find_path ${LIBTOOL_BIN}${ltver}`
117 # Set environment variable to tell automake which autoconf to use.
118 AUTOCONF
="autoconf${acver}" ; export AUTOCONF
120 echo "automake ($amversion) : automake$amver"
121 echo "autoconf ($acversion) : autoconf$acver"
122 echo "libtool ($ltversion) : ${LIBTOOL_BIN}${ltver}"
123 echo "libtool path : $ltpath"
129 if [ -z "$dir" ] ||
[ -d $dir ]; then
131 echo "Bootstrapping $dir"
133 if [ -n "$dir" ] && [ -f bootstrap.sh
]; then
135 elif [ ! -f $dir/configure
]; then
136 # Make sure cfgaux exists
139 if test -n "$ltpath"; then
140 acincludeflag
="-I $ltpath/../share/aclocal"
145 # Bootstrap the autotool subsystems
146 bootstrap aclocal
$amver $acincludeflag
147 bootstrap autoheader
$acver
148 bootstrap_libtoolize
${LIBTOOL_BIN}ize
${ltver}
149 bootstrap automake
$amver --foreign --add-missing --copy -f
150 bootstrap autoconf
$acver --force
159 # Make a copy of SPONSORS we can package
160 sed -e 's/@Squid-[0-9\.]*://' <SPONSORS.list
> SPONSORS ||
(rm -f SPONSORS
&& exit 1)
162 # Fixup autoconf recursion using --silent/--quiet option
163 # autoconf should inherit this option whe recursing into subdirectories
164 # but it currently doesn't for some reason.
165 if ! grep "configure_args --quiet" configure
>/dev
/null
; then
166 echo "Fixing configure recursion"
167 ed
-s configure
<<'EOS' >/dev/null || true
168 /ac_sub_configure_args=/
171 # Add --quiet option if used
172 test "$silent" = yes &&
173 ac_sub_configure_args="$ac_sub_configure_args --quiet"
179 echo "Autotool bootstrapping complete."