diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2006-10-25 16:06:42 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2006-10-25 16:07:34 -0400 |
commit | f85aca4c3ff02a38b83da48b618e420b79b29c37 (patch) | |
tree | e6c86d3fc0a5b132de27ab94d30f5611c407256c /autogen.sh | |
parent | 838ff68cd5d866ca373af95f43afe0219fdd6159 (diff) |
Make autogen.sh extract required versions from configure.in
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 42 |
1 files changed, 26 insertions, 16 deletions
@@ -2,22 +2,6 @@ # Run this to generate all the initial makefiles, etc. set -e -PACKAGE=cairo - -LIBTOOLIZE=${LIBTOOLIZE-libtoolize} -LIBTOOLIZE_FLAGS="--copy --force" -AUTOHEADER=${AUTOHEADER-autoheader} -AUTOMAKE_FLAGS="--add-missing --foreign" -AUTOCONF=${AUTOCONF-autoconf} - -# automake 1.9 requires autoconf ??? -# automake 1.8 requires autoconf 2.58 -# automake 1.7 requires autoconf 2.54 -automake_min_vers=1.9 -aclocal_min_vers=$automake_min_vers -autoconf_min_vers=2.54 -libtoolize_min_vers=1.4 - # The awk-based string->number conversion we use needs a C locale to work # as expected. Setting LC_ALL overrides whether the user set LC_ALL, # LC_NUMERIC, or LANG. @@ -34,6 +18,32 @@ ORIGDIR=`pwd` cd $srcdir +PACKAGE=cairo + +LIBTOOLIZE=${LIBTOOLIZE-libtoolize} +LIBTOOLIZE_FLAGS="--copy --force" +AUTOHEADER=${AUTOHEADER-autoheader} +AUTOMAKE_FLAGS="--add-missing --foreign" +AUTOCONF=${AUTOCONF-autoconf} + +CONFIGURE_IN= +test -f configure.in && CONFIGURE_IN=configure.in +test -f configure.ac && CONFIGURE_IN=configure.ac + +if test "X$CONFIGURE_IN" = X; then + echo "$ARGV0: ERROR: No $srcdir/configure.in or $srcdir/configure.ac found." + exit 1 +fi + +extract_version() { + grep "^ *$1" $CONFIGURE_IN | sed 's/.*(\[\?\([^])]\+\)]\?).*/\1/' +} + +autoconf_min_vers=`extract_version AC_PREREQ` +automake_min_vers=`extract_version AM_INIT_AUTOMAKE` +libtoolize_min_vers=`extract_version AC_PROG_LIBTOOL` +aclocal_min_vers=$automake_min_vers + if ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 ; then if ($AUTOCONF --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$autoconf_min_vers') \ exit 1; exit 0; }'); |