diff --git a/autogen.sh b/autogen.sh index dd5b91ad2..37db90e0e 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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; }'); diff --git a/configure.in b/configure.in index 90530f858..966a5caec 100644 --- a/configure.in +++ b/configure.in @@ -1,8 +1,8 @@ AC_PREREQ(2.54) -# cairo package version number, (as distinct from shared library version) -# An odd micro number indicates in-progress development, (eg. from git/cvs) -# An even micro number indicates a released version. +dnl cairo package version number, (as distinct from shared library version) +dnl An odd micro number indicates in-progress development, (eg. from git/cvs) +dnl An even micro number indicates a released version. m4_define(cairo_version_major, 1) m4_define(cairo_version_minor, 2) m4_define(cairo_version_micro, 5) @@ -12,6 +12,9 @@ AC_INIT([cairo], [http://bugs.freedesktop.org/enter_bug.cgi?product=cairo]) AC_CONFIG_SRCDIR(src/cairo.h) AC_CONFIG_HEADERS(config.h) + +dnl automake 1.8 requires autoconf 2.58 +dnl automake 1.7 requires autoconf 2.54 AM_INIT_AUTOMAKE([1.9]) dnl =========================================================================== @@ -49,7 +52,7 @@ AM_MAINTAINER_MODE AC_PROG_CC AC_PROG_CPP -AM_PROG_LIBTOOL +AC_PROG_LIBTOOL dnl required version (1.4) DON'T REMOVE! AC_STDC_HEADERS AC_C_BIGENDIAN @@ -57,10 +60,10 @@ dnl =========================================================================== dnl === Local macros dnl =========================================================================== -# _CHECK_FUNCS_WITH_FLAGS(FUNCTION..., CFLAGS, LIBS -# [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -# Like AC_CHECK_FUNCS but with additional CFLAGS and LIBS -# -------------------------------------------------------------------- +dnl _CHECK_FUNCS_WITH_FLAGS(FUNCTION..., CFLAGS, LIBS +dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Like AC_CHECK_FUNCS but with additional CFLAGS and LIBS +dnl -------------------------------------------------------------------- AC_DEFUN([_CHECK_FUNCS_WITH_FLAGS], [ save_cflags="$CFLAGS"