[xiph-commits] r3572 - browser_plugin/trunk

conrad at svn.annodex.net conrad at svn.annodex.net
Mon Apr 28 18:45:58 PDT 2008


Author: conrad
Date: 2008-04-28 18:45:58 -0700 (Mon, 28 Apr 2008)
New Revision: 3572

Modified:
   browser_plugin/trunk/autogen.sh
Log:
bye bye autogoat! use e-style autogen.sh


Modified: browser_plugin/trunk/autogen.sh
===================================================================
--- browser_plugin/trunk/autogen.sh	2008-04-29 01:45:55 UTC (rev 3571)
+++ browser_plugin/trunk/autogen.sh	2008-04-29 01:45:58 UTC (rev 3572)
@@ -1,176 +1,129 @@
 #!/bin/sh
+# Run this to set up the build system: configure, makefiles, etc.
+# (based on the version in enlightenment's cvs)
 
-# autogoat!
-# an omnivorous assistant for autotools
-#
-#         (__) 
-#         (oo) 
-#   /------\/ 
-#  / |    ||   
-# *  /\---/\ 
-#    ~~   ~~   
+package="browser_plugin"
 
-# clean function
-clean ()
-{
-  # remove autotools cruft
-  rm -f aclocal.m4 configure config.log
-  rm -Rf autom4te.cache
-  # remove old autotools extra cruft
-  rm -f config.guess config.sub missing mkinstalldirs compile depcomp install-sh
-  # remove libtool cruft
-  rm -f ltmain.sh libtool ltconfig
-}
+olddir=`pwd`
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
 
+cd "$srcdir"
+DIE=0
 
-#
-# option checking
-#
+ACLOCAL_FLAGS="-I $srcdir/m4"
 
-if test "x$1" = "xclean"; then
-  set -x
-  clean
-  set +x
-  exit 0
-fi
+echo "checking for autoconf... "
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+        echo
+        echo "You must have autoconf installed to compile $package."
+        echo "Download the appropriate package for your distribution,"
+        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+        DIE=1
+}
 
+VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/"
+VERSIONMKMAJ="sed -e s/\([0-9][0-9]*\)[^0-9].*/\\1/"
+VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//"
 
-
-#
-# check automake version number -- we require >= 1.5
-#
-
-automake_version="none"
-if automake-1.10 --version >/dev/null 2>&1; then
-  automake_version="-1.10"
-elif automake-1.9 --version >/dev/null 2>&1; then
-  automake_version="-1.9"
-elif automake-1.8 --version >/dev/null 2>&1; then
-  automake_version="-1.8"
-elif automake-1.7 --version >/dev/null 2>&1; then
-  automake_version="-1.7"
-elif automake-1.6 --version >/dev/null 2>&1; then
-  automake_version="-1.6"
-elif automake-1.5 --version >/dev/null 2>&1; then
-  automake_version="-1.5"
-elif automake --version > /dev/null 2>&1; then
-  automake_version=""
-  case "`automake --version | sed -e '1s/[^0-9]*//' -e q`" in
-    0|0.*|1|1.[01234]|1.[01234][-.]*) automake_version="none" ;;
-    1.5*)                             automake_version="-1.5" ;;
-    1.6*)                             automake_version="-1.6" ;;
-    1.7*)                             automake_version="-1.7" ;;
-    1.8*)                             automake_version="-1.8" ;;
-    1.9*)                             automake_version="-1.9" ;;
-  esac
-fi
-
-if test "x${automake_version}" = "xnone"; then
-  set +x
-  echo "you need automake version 1.5 or later"
-  exit 1
-fi
-
-automake_version_major=`echo "$automake_version" | cut -d. -f2`
-automake_version_minor=`echo "$automake_version" | cut -d. -f3`
-
-# need at least automake >= 1.5
-if test "$automake_version_major" -lt "5"; then
-  echo "$0"': this project requires automake >= 1.5.  Please upgrade your version of automake to at least 1.5'
-  exit 1
-fi
-
-AUTOMAKE="automake${automake_version}"
-ACLOCAL="aclocal${automake_version}"
-
-#
-# do we need pkg-config?
-#
-
-if grep -q PKG_CHECK_MODULES configure.*; then
-  if ! pkg-config --version > /dev/null 2> /dev/null; then
-    cat << EOF
-pkg-config is required, but it's not installed or can't be found in your
-search path.
-
-EOF
-    # be nice to the user if they have fink!
-    if test -d /sw ; then
-      cat << EOF
-You can install it via Fink with the command:
-
- apt-get install pkgconfig
-
-EOF
-    fi
-    exit 1
+# do we need automake?
+if test -r Makefile.am; then
+  AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
+  AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
+  if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then
+    AM_NEEDED=""
   fi
-fi
-
-
-#
-# autogoat bootstrap process
-# 
-
-ACLOCAL=${ACLOCAL:-aclocal}
-AUTOCONF=${AUTOCONF:-autoconf}
-AUTOHEADER=${AUTOHEADER:-autoheader}
-AUTOMAKE=${AUTOMAKE:-automake}
-
-# clean out old cruft
-clean
-
-# add Fink's /sw path to various search directories
-if [ -d /sw ]; then
-  ACLOCAL="$ACLOCAL -I /sw/share/aclocal"
-  FINK_DETECTED=1
-fi
-
-
-
-eval "$ACLOCAL -I m4"
-
-# do we need libtool?
-if grep -q PROG_LIBTOOL configure.*; then
-  # what's libtoolize called?
-  if glibtoolize --version > /dev/null 2> /dev/null; then
-    LIBTOOLIZE="glibtoolize"
-  elif libtoolize --version > /dev/null 2> /dev/null; then
-    LIBTOOLIZE="libtoolize"
-  fi
-
-  # check libtool version -- only support 1.4 or 1.5 for now
-  if "$LIBTOOLIZE" --version | egrep -q '1\.4|1\.5'; then
-    if grep -q AC_LIBLTDL_CONVENIENCE configure.*; then
-      "$LIBTOOLIZE" --ltdl --copy --force
+  if test -z $AM_NEEDED; then
+    echo -n "checking for automake... "
+    AUTOMAKE=automake
+    ACLOCAL=aclocal
+    if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
+      echo "yes"
     else
-      "$LIBTOOLIZE" --copy --force
+      echo "no"
+      AUTOMAKE=
     fi
   else
-    # libtool version is too old :(
-    echo "$0: need libtool >= 1.4 installed"
-    exit 1
+    echo -n "checking for automake $AM_NEEDED or later... "
+    majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ`
+    minneeded=`echo $AM_NEEDED | $VERSIONMKMIN`
+    for am in automake-$AM_NEEDED automake$AM_NEEDED \
+	automake automake-1.7 automake-1.8 automake-1.9 automake-1.10; do
+      ($am --version < /dev/null > /dev/null 2>&1) || continue
+      ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP`
+      maj=`echo $ver | $VERSIONMKMAJ`
+      min=`echo $ver | $VERSIONMKMIN`
+      if test $maj -eq $majneeded -a $min -ge $minneeded; then
+        AUTOMAKE=$am
+        echo $AUTOMAKE
+        break
+      fi
+    done
+    test -z $AUTOMAKE &&  echo "no"
+    echo -n "checking for aclocal $AM_NEEDED or later... "
+    for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \
+	aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do
+      ($ac --version < /dev/null > /dev/null 2>&1) || continue
+      ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP`
+      maj=`echo $ver | $VERSIONMKMAJ`
+      min=`echo $ver | $VERSIONMKMIN`
+      if test $maj -eq $majneeded -a $min -ge $minneeded; then
+        ACLOCAL=$ac
+        echo $ACLOCAL
+        break
+      fi
+    done
+    test -z $ACLOCAL && echo "no"
   fi
+  test -z $AUTOMAKE || test -z $ACLOCAL && {
+        echo
+        echo "You must have automake installed to compile $package."
+        echo "Download the appropriate package for your distribution,"
+        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+        exit 1
+  }
 fi
 
-eval "$AUTOCONF"
-grep -q CONFIG_HEADER configure.* && "$AUTOHEADER"
-eval "$AUTOMAKE" --add-missing --copy
+echo -n "checking for libtool... "
+for LIBTOOLIZE in libtoolize glibtoolize nope; do
+  ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
+done
+if test x$LIBTOOLIZE = xnope; then
+  echo "nope."
+  LIBTOOLIZE=libtoolize
+else
+  echo $LIBTOOLIZE
+fi
+($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have libtool installed to compile $package."
+	echo "Download the appropriate package for your system,"
+	echo "or get the source from one of the GNU ftp sites"
+	echo "listed in http://www.gnu.org/order/ftp.html"
+	DIE=1
+}
 
-# Print warning message if Fink detected
-if test "$FINK_DETECTED" = 1; then
-  cat << EOF
+if test "$DIE" -eq 1; then
+        exit 1
+fi
 
-Fink detected; added /sw/share/aclocal to aclocal's include directories.
-Make sure you have CPPFLAGS, LDFLAGS and PKG_CONFIG_PATH including Fink's
-distribution directories, e.g.:
+if test -z "$*"; then
+        echo "I am going to run ./configure with no arguments - if you wish "
+        echo "to pass any to it, please specify them on the $0 command line."
+fi
 
- export CPPFLAGS="-I/sw/include \$CPPFLAGS"
- export LDFLAGS="-L/sw/lib \$LDFLAGS"
- export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/sw/lib/pkgconfig:\$PKG_CONFIG_PATH"
+echo "Generating configuration files for $package, please wait...."
 
- ./configure
+echo "  $ACLOCAL $ACLOCAL_FLAGS"
+$ACLOCAL $ACLOCAL_FLAGS || exit 1
+echo "  $LIBTOOLIZE --automake"
+$LIBTOOLIZE --automake || exit 1
+echo "  autoheader"
+autoheader || exit 1
+echo "  $AUTOMAKE --add-missing $AUTOMAKE_FLAGS"
+$AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1
+echo "  autoconf"
+autoconf || exit 1
 
-EOF
-fi
-
+cd $olddir
+#$srcdir/configure --enable-maintainer-mode "$@" && echo



More information about the commits mailing list