diff --git a/autogen.sh b/autogen.sh index 8c0bb0ade4ba..0ac16f1f9779 100755 --- a/autogen.sh +++ b/autogen.sh @@ -39,6 +39,7 @@ sub clean() } my $aclocal; +my $autoconf; # check we have various vital tools sub sanity_checks($) @@ -48,7 +49,7 @@ sub sanity_checks($) my %required = ( 'pkg-config' => "pkg-config is required to be installed", - 'autoconf' => "autoconf is required", + $autoconf => "autoconf is required", $aclocal => "$aclocal is required", ); @@ -135,6 +136,9 @@ die "\$src_path must not contain spaces, but it is '$src_path'." if ($src_path = # Alloc $ACLOCAL to specify which aclocal to use $aclocal = $ENV{ACLOCAL} ? $ENV{ACLOCAL} : 'aclocal'; +# Alloc $AUTOCONF to specify which autoconf to use +# (e.g. autoconf268 from a backports repo) +$autoconf = $ENV{AUTOCONF} ? $ENV{AUTOCONF} : 'autoconf'; my $system = `uname -s`; chomp $system; @@ -191,7 +195,7 @@ if ($src_path ne $build_path) } system ("$aclocal $aclocal_flags") && die "Failed to run aclocal"; unlink ("configure"); -system ("autoconf -I ${src_path}") && die "Failed to run autoconf"; +system ("$autoconf -I ${src_path}") && die "Failed to run autoconf"; die "Failed to generate the configure script" if (! -f "configure"); # Handle help arguments first, so we don't clobber autogen.lastrun diff --git a/configure.ac b/configure.ac index 7ececcaeb282..7297c72a1db9 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,12 @@ dnl in order to create a configure script. AC_INIT([LibreOffice],[6.3.0.0.alpha0+],[],[],[http://documentfoundation.org/]) -AC_PREREQ([2.68]) +dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed +dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard +dnl so check for the version of autoconf that is actually used to create the configure script +AC_PREREQ([2.59]) +m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.68]), -1, + [AC_MSG_ERROR([at least autoconf version 2.68 is needed (you can use AUTOCONF environment variable to point to a suitable one)])]) if test -n "$BUILD_TYPE"; then AC_MSG_ERROR([You have sourced config_host.mk in this shell. This may lead to trouble, please run in a fresh (login) shell.])