bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Prefer documented autoconf macro 'm4_if' over 'ifelse'


From: Bruno Haible
Subject: Prefer documented autoconf macro 'm4_if' over 'ifelse'
Date: Sat, 01 Aug 2020 22:40:57 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-186-generic; KDE/5.18.0; x86_64; ; )

The Autoconf equivalent to the m4 built-in macro 'ifelse' is not 'm4_ifelse'
but 'm4_if'. Sometimes I remember this, sometimes I don't...


2020-08-01  Bruno Haible  <bruno@clisp.org>

        Prefer documented autoconf macro 'm4_if' over 'ifelse'.
        * m4/autobuild.m4 (AB_INIT): Use m4_if instead of ifelse.
        * m4/csharpexec.m4 (gt_CSHARPEXEC): Likewise.
        * m4/javacomp.m4 (gt_JAVACOMP): Likewise.
        * m4/javaexec.m4 (gt_JAVAEXEC): Likewise.
        * m4/libtextstyle.m4 (gl_LIBTEXTSTYLE): Likewise.

diff --git a/m4/autobuild.m4 b/m4/autobuild.m4
index fd1ed87..91928c1 100644
--- a/m4/autobuild.m4
+++ b/m4/autobuild.m4
@@ -1,4 +1,4 @@
-# autobuild.m4 serial 7
+# autobuild.m4 serial 8
 dnl Copyright (C) 2004, 2006-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,7 @@ AC_DEFUN([AB_INIT],
     AC_MSG_NOTICE([autobuild hostname... $hostname])
   fi
 
-  ifelse([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
+  m4_if([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
 
   date=`TZ=UTC0 date +%Y%m%dT%H%M%SZ`
   if test "$?" != 0; then
diff --git a/m4/csharpexec.m4 b/m4/csharpexec.m4
index 6c10741..5158a1a 100644
--- a/m4/csharpexec.m4
+++ b/m4/csharpexec.m4
@@ -1,4 +1,4 @@
-# csharpexec.m4 serial 7
+# csharpexec.m4 serial 8
 dnl Copyright (C) 2003-2005, 2009-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -33,7 +33,7 @@ AC_DEFUN([gt_CSHARPEXEC],
       mono)
         if test -n "$HAVE_MONO_IN_PATH" \
            && mono --version >/dev/null 2>/dev/null \
-           ifelse([$1], , , [&& mono $2/$1 >/dev/null 2>/dev/null]); then
+           m4_if([$1], , , [&& mono $2/$1 >/dev/null 2>/dev/null]); then
           HAVE_MONO=1
           ac_result="mono"
           break
@@ -41,7 +41,7 @@ AC_DEFUN([gt_CSHARPEXEC],
         ;;
       sscli)
         if test -n "$HAVE_CLIX_IN_PATH" \
-           ifelse([$1], , , [&& clix $2/$1 >/dev/null 2>/dev/null]); then
+           m4_if([$1], , , [&& clix $2/$1 >/dev/null 2>/dev/null]); then
           HAVE_CLIX=1
           case $host_os in
             cygwin* | mingw* | pw32*)
diff --git a/m4/javacomp.m4 b/m4/javacomp.m4
index f1bc38b..b5eea07 100644
--- a/m4/javacomp.m4
+++ b/m4/javacomp.m4
@@ -1,4 +1,4 @@
-# javacomp.m4 serial 17
+# javacomp.m4 serial 18
 dnl Copyright (C) 2001-2003, 2006-2007, 2009-2020 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -85,7 +85,7 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 AC_DEFUN([gt_JAVACOMP],
 [
-  ifelse([$2], [], [AC_REQUIRE([gt_JAVAEXEC])], [])
+  m4_if([$2], [], [AC_REQUIRE([gt_JAVAEXEC])], [])
   AC_EGREP_CPP([yes], [
 #if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined 
__DJGPP__
   yes
@@ -95,7 +95,7 @@ AC_DEFUN([gt_JAVACOMP],
   test -n "$source_version" || {
     AC_MSG_ERROR([missing source-version argument to gt_@&t@JAVACOMP])
   }
-  ifelse([$2], [],
+  m4_if([$2], [],
     [if test -n "$HAVE_JAVAEXEC"; then
        dnl Use $CONF_JAVA to determine the JVM's version.
 changequote(,)dnl
diff --git a/m4/javaexec.m4 b/m4/javaexec.m4
index 4cbee7c..c69575b 100644
--- a/m4/javaexec.m4
+++ b/m4/javaexec.m4
@@ -1,4 +1,4 @@
-# javaexec.m4 serial 6
+# javaexec.m4 serial 7
 dnl Copyright (C) 2001-2003, 2006, 2009-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,14 +37,14 @@ AC_DEFUN([gt_JAVAEXEC],
     popdef([AC_MSG_RESULT])dnl
     popdef([AC_CHECKING])dnl
     popdef([AC_MSG_CHECKING])dnl
-    ifelse([$1], , , [
+    m4_if([$1], , , [
       save_CLASSPATH="$CLASSPATH"
       CLASSPATH="$2"${CLASSPATH+"$CLASSPATH_SEPARATOR$CLASSPATH"}
       ])
     export CLASSPATH
     if test -n "$HAVE_GIJ_IN_PATH" \
        && gij --version >/dev/null 2>/dev/null \
-       ifelse([$1], , , [&& {
+       m4_if([$1], , , [&& {
          echo "$as_me:__oline__: gij $1" >&AS_MESSAGE_LOG_FD
          gij $1 >&AS_MESSAGE_LOG_FD 2>&1
        }]); then
@@ -53,7 +53,7 @@ AC_DEFUN([gt_JAVAEXEC],
     else
       if test -n "$HAVE_JAVA_IN_PATH" \
          && java -version >/dev/null 2>/dev/null \
-         ifelse([$1], , , [&& {
+         m4_if([$1], , , [&& {
            echo "$as_me:__oline__: gij $1" >&AS_MESSAGE_LOG_FD
            java $1 >&AS_MESSAGE_LOG_FD 2>&1
          }]); then
@@ -62,7 +62,7 @@ AC_DEFUN([gt_JAVAEXEC],
       else
         if test -n "$HAVE_JRE_IN_PATH" \
            && (jre >/dev/null 2>/dev/null || test $? = 1) \
-           ifelse([$1], , , [&& {
+           m4_if([$1], , , [&& {
              echo "$as_me:__oline__: gij $1" >&AS_MESSAGE_LOG_FD
              jre $1 >&AS_MESSAGE_LOG_FD 2>&1
            }]); then
@@ -71,7 +71,7 @@ AC_DEFUN([gt_JAVAEXEC],
         else
           if test -n "$HAVE_JVIEW_IN_PATH" \
              && (jview -? >/dev/null 2>/dev/null || test $? = 1) \
-             ifelse([$1], , , [&& {
+             m4_if([$1], , , [&& {
                echo "$as_me:__oline__: gij $1" >&AS_MESSAGE_LOG_FD
                jview $1 >&AS_MESSAGE_LOG_FD 2>&1
              }]); then
@@ -83,7 +83,7 @@ AC_DEFUN([gt_JAVAEXEC],
         fi
       fi
     fi
-    ifelse([$1], , , [
+    m4_if([$1], , , [
       CLASSPATH="$save_CLASSPATH"
     ])
   fi
diff --git a/m4/libtextstyle.m4 b/m4/libtextstyle.m4
index 0b1b1d2..a974966 100644
--- a/m4/libtextstyle.m4
+++ b/m4/libtextstyle.m4
@@ -1,4 +1,4 @@
-# libtextstyle.m4 serial 2
+# libtextstyle.m4 serial 3
 dnl Copyright (C) 2019-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,12 +21,12 @@ AC_DEFUN([gl_LIBTEXTSTYLE],
 [
   AC_REQUIRE([gl_LIBTEXTSTYLE_INITIALIZE])
   AC_REQUIRE([gl_LIBTEXTSTYLE_SEARCH])
-  pushdef([MINVERSION], ifelse([$1], [], [gl_LIBTEXTSTYLE_NEWEST_VERSION], 
[$1]))
+  pushdef([MINVERSION], m4_if([$1], [], [gl_LIBTEXTSTYLE_NEWEST_VERSION], 
[$1]))
   dnl Signal a fatal error if MINVERSION is not among the allowed values.
-  ifelse(ifelse(MINVERSION, [0.20], [x], [])ifelse(MINVERSION, [0.20.5], [x], 
[]), [],
+  m4_if(m4_if(MINVERSION, [0.20], [x], [])m4_if(MINVERSION, [0.20.5], [x], 
[]), [],
     [m4_fatal([The argument to gl_LIBTEXTSTYLE or gl_LIBTEXTSTYLE_OPTIONAL is 
not one of the expected values.])])
   dnl Store the specified minimum version in gl_libtextstyle_minversion.
-  dnl (This needs to be outside the ifelse. m4_divert_text inside ifelse does
+  dnl (This needs to be outside the m4_if. m4_divert_text inside m4_if does
   dnl not work reliably in Autoconf 2.69.)
   m4_divert_text([INIT_PREPARE],
     [gl_libtextstyle_minversion="$gl_libtextstyle_minversion MINVERSION "])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]