2005-12-11 Martin Schlemmer * libltdl/m4/libtool.m4 (_LT_VERSION_CHECK): sanity check to make sure libtool.m4 version matches ltmain.sh version. (LT_INIT): execute new _LT_VERSION_CHECK function. Index: libltdl/m4/libtool.m4 =================================================================== RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v retrieving revision 1.51 diff -u -r1.51 libtool.m4 --- libltdl/m4/libtool.m4 8 Dec 2005 04:17:02 -0000 1.51 +++ libltdl/m4/libtool.m4 8 Dec 2005 19:41:08 -0000 @@ -68,6 +68,7 @@ AC_REQUIRE([LTVERSION_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl m4_require([_LT_SET_OPTIONS], [_LT_SET_OPTIONS([$1])])dnl +AC_REQUIRE([_LT_VERSION_CHECK])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" @@ -115,6 +116,34 @@ : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS + + +# _LT_VERSION_CHECK +# ----------------- +# Check that we do not have a version mismatch between libtool.m4 and +# ltmain.sh. +# Note that this should be called after _LT_PROG_LTMAIN have setup $ltmain, +# but *before* _LT_SETUP so that libtool is not created. +AC_DEFUN([_LT_VERSION_CHECK], +[AC_REQUIRE([_LT_PROG_LTMAIN])dnl +AC_BEFORE([$0], [_LT_SETUP])dnl + +AC_MSG_CHECKING([for correct ltmain.sh version]) +_ltmain_version=`grep '^[[ ]]*VERSION=' $ltmain | sed -e 's/^[[ ]]*VERSION=//'` +if test X"${_ltmain_version+set}" != Xset ; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([could not determine ltmain.sh version]) +fi + +_lt_m4_verion=m4_quote(m4_defn([LT_PACKAGE_VERSION])) +if test "X$_lt_m4_verion" = "X$_ltmain_version" ; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([ltmain.sh version mismatch +Try running 'libtoolize -c -f; aclocal; autoconf' and then try again']) +fi +])# _LT_VERSION_CHECK # _LT_SETUP