]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - bootstrap.sh
Do not forward HTTP requests to dead idle peers.
[thirdparty/squid.git] / bootstrap.sh
index 8066529b711afcb4e18dc05ced71279c540fff5c..af6a80e1ed638ee8be9b71e4fc5f220e74289782 100755 (executable)
@@ -1,5 +1,13 @@
 #!/bin/sh
-# Used to setup the configure.in, autoheader and Makefile.in's if configure
+#
+## Copyright (C) 1996-2017 The Squid Software Foundation and contributors
+##
+## Squid software is distributed under GPLv2+ license and includes
+## contributions from numerous individuals and organizations.
+## Please see the COPYING and CONTRIBUTORS files for details.
+##
+#
+# Used to setup the configure.ac, autoheader and Makefile.in's if configure
 # has not been generated. This script is only needed for developers when
 # configure has not been run, or if a Makefile.am in a non-configured directory
 # has been updated
@@ -7,9 +15,9 @@
 # Autotool versions preferred. To override either edit the script
 # to match the versions you want to use, or set the variables on
 # the command line like "env acver=.. amver=... ./bootstrap.sh"
-acversions="${acver:-2.63 2.62 2.61}"
-amversions="${amver:-1.11 1.10 1.9}"
-ltversions="${ltver:-2 1.5 1.4}"
+acversions="${acver:-.}" # 2.68 2.67 2.66 2.65 2.64 2.63 2.62 2.61}"
+amversions="${amver:-.}" # 1.11 1.10 1.9}"
+ltversions="${ltver:-.}" # 2.2}"
 
 check_version()
 {
@@ -19,24 +27,8 @@ check_version()
 show_version()
 {
   tool=$1
-  found="NOT_FOUND"
-  shift
-  versions="$*"
-  for version in $versions; do
-    for variant in "" "-${version}" "`echo $version | sed -e 's/\.//g'`"; do
-      if check_version $tool ${tool}${variant} $version; then
-       found="${version}"
-       break
-      fi
-    done
-    if [ "x$found" != "xNOT_FOUND" ]; then
-      break
-    fi
-  done
-  if [ "x$found" = "xNOT_FOUND" ]; then
-    found="??"
-  fi
-  echo $found
+  variant=$2
+  ${tool}${variant} --version 2>/dev/null | head -1 | sed -e 's/.*) //'
 }
 
 find_variant()
@@ -46,7 +38,7 @@ find_variant()
   shift
   versions="$*"
   for version in $versions; do
-    for variant in "" "-${version}" "`echo $version | sed -e 's/\.//g'`"; do
+    for variant in "" "${version}" "-${version}" "`echo $version | sed -e 's/\.//g'`"; do
       if check_version $tool ${tool}${variant} $version; then
        found="${variant}"
        break
@@ -64,6 +56,18 @@ find_variant()
   echo $found
 }
 
+find_path()
+{
+  tool=$1
+  path=`which $tool`
+  if test $? -gt 0 ; then
+    # path for $tool not found. Not defining, and hoping for the best
+    echo 
+    return
+  fi
+  echo $(dirname $path)
+}
+
 bootstrap() {
   if "$@"; then
     true # Everything OK
@@ -76,73 +80,44 @@ bootstrap() {
 }
 
 bootstrap_libtoolize() {
-    ltver=$1
-
-    # TODO: when we have libtool2, tell libtoolize where to put its files
-    # instead of manualy moving files from ltdl to lib/libLtdl
-    if egrep -q '^[[:space:]]*AC_LIBLTDL_' configure.in
-    then
-       if libtoolize$ltver --help | grep -q -- --ltdl.=; then
-           ltdl="--ltdl=lib/libLtdl"
-       else
-           ltdl="--ltdl"
-           copy_libltdl=1
-       fi
-    else
-        ltdl=""
-    fi
+    tool=$1
 
-    bootstrap libtoolize$ltver $ltdl --force --copy --automake
-
-    # customize generated libltdl, if any
-    if test -d libltdl && [ $copy_libltdl ]
-    then
-        src=libltdl
-
-        # do not bundle with the huge standard license text
-        rm -f $src/COPYING.LIB
-        makefile=$src/Makefile.in
-        sed 's/COPYING.LIB/ /g' $makefile > $makefile.new;
-        chmod u+w $makefile
-        mv $makefile.new $makefile
-        chmod u-w $makefile
-
-        dest=lib/libLtdl
-        # move $src to $dest
-       if test -d $dest # already exists
-       then
-           echo "Updating $dest from $src."
-            chmod u+w $dest/*
-            mv $src/* $dest/
-            rmdir $src
-       else
-           echo "Creating $dest from $src."
-           mv $src $dest
-        fi
-    fi
+    ltdl="--ltdl"
+
+    bootstrap $tool $ltdl --force --copy --automake
 }
 
+# On MAC OS X, GNU libtool is named 'glibtool':
+if [ `uname -s 2>/dev/null` = 'Darwin' ]
+then
+  LIBTOOL_BIN="glibtool"
+else
+  LIBTOOL_BIN="libtool"
+fi
+
 # Adjust paths of required autool packages
 amver=`find_variant automake ${amversions}`
 acver=`find_variant autoconf ${acversions}`
-ltver=`find_variant libtool ${ltversions}`
+ltver=`find_variant ${LIBTOOL_BIN} ${ltversions}`
 
 # Produce debug output about what version actually found.
-amversion=`show_version automake ${amversions}`
-acversion=`show_version autoconf ${acversions}`
-ltversion=`show_version libtool ${ltversions}`
+amversion=`show_version automake "${amver}"`
+acversion=`show_version autoconf "${acver}"`
+ltversion=`show_version ${LIBTOOL_BIN} "${ltver}"`
+
+# Find the libtool path to get the right aclocal includes
+ltpath=`find_path ${LIBTOOL_BIN}${ltver}`
 
 # Set environment variable to tell automake which autoconf to use.
 AUTOCONF="autoconf${acver}" ; export AUTOCONF
 
 echo "automake ($amversion) : automake$amver"
 echo "autoconf ($acversion) : autoconf$acver"
-echo "libtool  ($ltversion) : libtool$ltver"
+echo "libtool  ($ltversion) : ${LIBTOOL_BIN}${ltver}"
+echo "libtool path : $ltpath"
 
 for dir in \
-       "" \
-       lib/libTrie \
-       helpers/negotiate_auth/squid_kerb_auth
+       "" 
 do
     if [ -z "$dir" ] || [ -d $dir ]; then
        if (
@@ -154,10 +129,16 @@ do
            # Make sure cfgaux exists
            mkdir -p cfgaux
 
+            if test -n "$ltpath"; then
+              acincludeflag="-I $ltpath/../share/aclocal"
+            else
+              acincludeflag=""
+            fi
+
            # Bootstrap the autotool subsystems
-           bootstrap aclocal$amver
+           bootstrap aclocal$amver $acincludeflag
            bootstrap autoheader$acver
-           bootstrap_libtoolize $ltver
+           bootstrap_libtoolize ${LIBTOOL_BIN}ize${ltver}
            bootstrap automake$amver --foreign --add-missing --copy -f
            bootstrap autoconf$acver --force
        fi ); then
@@ -168,6 +149,11 @@ do
     fi
 done
 
+# Make a copy of SPONSORS we can package
+if test -f SPONSORS.list; then
+  sed -e 's/@Squid-[0-9\.]*://' <SPONSORS.list > SPONSORS || (rm -f SPONSORS && exit 1)
+fi
+
 # Fixup autoconf recursion using --silent/--quiet option
 # autoconf should inherit this option whe recursing into subdirectories
 # but it currently doesn't for some reason.