From 17549dfdf7cf00e278e9ce5a89c205bf619d0556 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 8 Jun 2003 12:04:30 +0000 Subject: [PATCH] (STEPMAKE_CHECK_VERSION_SUPPORT): New function. (STEPMAKE_GETTEXT): If g++ >= 3.3, use gcc for gettext checking. --- ChangeLog | 6 ++++++ stepmake/aclocal.m4 | 42 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b9ed9ec4c..0dba09ea85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-06-08 Jan Nieuwenhuizen + + * stepmake/aclocal.m4 (STEPMAKE_CHECK_VERSION_SUPPORT): New + function. + (STEPMAKE_GETTEXT): If g++ >= 3.3, use gcc for gettext checking. + 2003-06-08 Heikki Junes * lilypond-indent.el: tune regexp for show-paren-function. diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index a0ff389201..079bd0e4da 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -92,7 +92,23 @@ AC_DEFUN(STEPMAKE_CHECK_VERSION, [ req=`STEPMAKE_NUMERIC_VERSION($3)` AC_MSG_RESULT([$ver]) if test "$num" -lt "$req"; then - STEPMAKE_ADD_ENTRY($2, ["$r $3 (installed: $ver)"]) + STEPMAKE_ADD_ENTRY($2, ["$r >= $3 (installed: $ver)"]) + fi +]) + +# Check version of program ($1) +# If version is greater than or equals requested ($3), +# add entry to unsupported list ($2, 'UNSUPPORTED') +AC_DEFUN(STEPMAKE_CHECK_VERSION_SUPPORT, [ + r="`eval echo '$'"$1"`" + AC_MSG_CHECKING([$r version]) + exe=`STEPMAKE_GET_EXECUTABLE($r)` + ver=`STEPMAKE_GET_VERSION($exe)` + num=`STEPMAKE_NUMERIC_VERSION($ver)` + sup=`STEPMAKE_NUMERIC_VERSION($3)` + AC_MSG_RESULT([$ver]) + if test "$num" -ge "$sup"; then + STEPMAKE_ADD_ENTRY($2, ["$r < $3 (installed: $ver)"]) fi ]) @@ -275,8 +291,7 @@ AC_DEFUN(STEPMAKE_END, [ AC_SUBST(REQUIRED) AC_CONFIG_FILES([$CONFIGFILE.make:config.make.in]) -AC_OUTPUT - + AC_OUTPUT if test -n "$OPTIONAL"; then echo @@ -288,6 +303,11 @@ AC_OUTPUT echo "ERROR: Please install required programs: $REQUIRED" fi + if test -n "$UNSUPPORTED"; then + echo + echo "ERROR: Please use older version of programs: $UNSUPPORTED" + fi + if test -n "$OPTIONAL$REQUIRED"; then echo echo "See INSTALL.txt for more information on how to build $PACKAGE_NAME" @@ -376,8 +396,24 @@ AC_DEFUN(STEPMAKE_GETTEXT, [ AC_SUBST(localedir) AC_DEFINE_UNQUOTED(LOCALEDIR, ["${LOCALEDIR}"]) + # ouch. autoconf <= 2.57's gettext check fails for + # g++ >= 3.3 (with -std=gnu++98, the default). + # While the check is OK for g++ -std=c++98, + # LilyPond needs GNU g++, so who is to blame here? + # Use a workaround until this is resolved: + # for g++ >= 3.3, select C language. + GCC_UNSUPPORTED= + STEPMAKE_CHECK_VERSION_SUPPORT(CXX, GCC_UNSUPPORTED, 3.3) + if test -n "$GCC_UNSUPPORTED"; then + AC_MSG_WARN([autoconf <= 2.57 with g++ >= 3.3 gettext test broken.]) + AC_MSG_WARN([Trying gcc, cross thumbs.]) + AC_LANG_PUSH(C) + fi AC_CHECK_LIB(intl, gettext) AC_CHECK_FUNCS(gettext) + if test -n "$GCC_UNSUPPORTED"; then + AC_LANG_POP(C) + fi ]) -- 2.39.2