autoconf-patches
[Top][All Lists]
Advanced

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

FYI: Pedantic quoting for AC_MSG_*


From: Pavel Roskin
Subject: FYI: Pedantic quoting for AC_MSG_*
Date: Sat, 11 Nov 2000 00:55:57 -0500 (EST)

Hello!

Whenever we write AC_MSG_RESULT(yes) somebody may take it and turn it to
AC_MSG_RESULT(yes, of course), which, of course, will not work as
expected.

So I just quoted the first argument for AC_MSG_* everywhere.

Maybe I'll quote all text (i.e. free-form) arguments for all the macros
later.

I noticed very suspicious double parentheses in the patch for
acfunctions.m4, but it will be a separate patch, should it be anything
serious.

ChangeLog:
        * acfunctions.m4: Always quote first argument of AC_MSG_ERROR,
        AC_MSG_WARN, AC_MSG_CHECKING, AC_MSG_RESULT,
        AC_MSG_RESULT_UNQUOTED.
        * acgeneral.m4: Likewise.
        * aclang.m4: Likewise.
        * acspecific.m4: Likewise.
        * configure.in: Likewise.
        * doc/autoconf.texi: Likewise.

Regards,
Pavel Roskin

______________________________
Index: acfunctions.m4
--- acfunctions.m4      Sat Nov  4 18:14:21 2000
+++ acfunctions.m4      Sat Nov 11 00:03:42 2000
@@ -629,7 +629,7 @@
       exit (s>>8);
     }
 }], ac_cv_func_getpgrp_void=yes, ac_cv_func_getpgrp_void=no,
-   AC_MSG_ERROR(cannot check getpgrp if cross compiling))
+   AC_MSG_ERROR([cannot check getpgrp if cross compiling]))
 ])
 if test $ac_cv_func_getpgrp_void = yes; then
   AC_DEFINE(GETPGRP_VOID, 1,
@@ -1221,7 +1221,7 @@
 if test $ac_cv_func_pow = no; then
   AC_CHECK_LIB(m, pow,
                [POW_LIB=-lm],
-               [AC_MSG_WARN(can't find library containing definition of pow)])
+               [AC_MSG_WARN([can't find library containing definition of 
pow])])
 fi
 ])# _AC_LIBOBJ_STRTOD
 
Index: acgeneral.m4
--- acgeneral.m4        Fri Nov 10 20:29:31 2000
+++ acgeneral.m4        Sat Nov 11 00:07:38 2000
@@ -945,9 +945,9 @@
 fi
 if test ! -r $srcdir/$ac_unique_file; then
   if test "$ac_srcdir_defaulted" = yes; then
-    AC_MSG_ERROR(cannot find sources in $ac_confdir or ..)
+    AC_MSG_ERROR([cannot find sources in $ac_confdir or ..])
   else
-    AC_MSG_ERROR(cannot find sources in $srcdir)
+    AC_MSG_ERROR([cannot find sources in $srcdir])
   fi
 fi
 dnl Double slashes in pathnames in object file debugging info
@@ -1294,7 +1294,7 @@
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  AC_MSG_ERROR(missing argument to $ac_option)
+  AC_MSG_ERROR([missing argument to $ac_option])
 fi
 
 # Be sure to have absolute paths.
@@ -2087,7 +2087,7 @@
 m4_define([AC_CACHE_CHECK],
 [AC_MSG_CHECKING([$1])
 AC_CACHE_VAL([$2], [$3])dnl
-AC_MSG_RESULT_UNQUOTED(AC_VAR_GET([$2]))])
+AC_MSG_RESULT_UNQUOTED([AC_VAR_GET([$2])])])
 
 
 
@@ -3037,7 +3037,7 @@
                     [$0 called without default to allow cross compiling])])dnl
 if test "$cross_compiling" = yes; then
   m4_default([$4],
-             [AC_MSG_ERROR(cannot run test program while cross compiling)])
+             [AC_MSG_ERROR([cannot run test program while cross compiling])])
 else
   AC_RUN_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3])
 fi
@@ -4641,7 +4641,7 @@
   echo "linking $srcdir/$ac_source to $ac_dest"
 
   if test ! -r $srcdir/$ac_source; then
-    AC_MSG_ERROR($srcdir/$ac_source: File not found)
+    AC_MSG_ERROR([$srcdir/$ac_source: File not found])
   fi
   rm -f $ac_dest
 
@@ -4665,7 +4665,7 @@
   if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
      ln $srcdir/$ac_source $ac_dest; then :
   else
-    AC_MSG_ERROR(cannot link $ac_dest to $srcdir/$ac_source)
+    AC_MSG_ERROR([cannot link $ac_dest to $srcdir/$ac_source])
   fi
 ifset([AC_LIST_LINKS_COMMANDS],
 [  # Run the commands associated with the file.
@@ -4789,7 +4789,7 @@
     elif test -f $ac_sub_srcdir/configure.in; then
       ac_sub_configure=$ac_configure
     else
-      AC_MSG_WARN(no configuration information is in $ac_subdir)
+      AC_MSG_WARN([no configuration information is in $ac_subdir])
       ac_sub_configure=
     fi
 
@@ -4813,7 +4813,7 @@
       if eval $ac_sub_configure $ac_sub_configure_args 
--cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
       then :
       else
-        AC_MSG_ERROR($ac_sub_configure failed for $ac_subdir)
+        AC_MSG_ERROR([$ac_sub_configure failed for $ac_subdir])
       fi
     fi
 
Index: aclang.m4
--- aclang.m4   Fri Nov 10 20:29:31 2000
+++ aclang.m4   Sat Nov 11 00:05:48 2000
@@ -537,11 +537,11 @@
     fi
   fi
 fi
-AC_MSG_RESULT(yes)],
-[AC_MSG_RESULT(no)
+AC_MSG_RESULT([yes])],
+[AC_MSG_RESULT([no])
 AC_MSG_ERROR([_AC_LANG compiler cannot create executables], 77)])
 AC_MSG_CHECKING([whether we are cross compiling])
-AC_MSG_RESULT($cross_compiling)
+AC_MSG_RESULT([$cross_compiling])
 ])# _AC_LANG_COMPILER_WORKS
 
 
@@ -640,7 +640,7 @@
 # -----------
 # Find a working C preprocessor
 AC_DEFUN([AC_PROG_CPP],
-[AC_MSG_CHECKING(how to run the C preprocessor)
+[AC_MSG_CHECKING([how to run the C preprocessor])
 AC_LANG_PUSH(C)dnl
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
@@ -664,7 +664,7 @@
   _AC_PROG_PREPROC_WORKS()
   ac_cv_prog_CPP=$CPP
 fi
-AC_MSG_RESULT($CPP)
+AC_MSG_RESULT([$CPP])
 if test -n "$ac_cpp_err"; then
   AC_MSG_ERROR([C preprocessor "$CPP" fails sanity check])
 fi
@@ -783,9 +783,9 @@
 AC_DEFUN([AC_PROG_CC_C_O],
 [AC_REQUIRE([AC_PROG_CC])dnl
 if test "x$CC" != xcc; then
-  AC_MSG_CHECKING(whether $CC and cc understand -c and -o together)
+  AC_MSG_CHECKING([whether $CC and cc understand -c and -o together])
 else
-  AC_MSG_CHECKING(whether cc understands -c and -o together)
+  AC_MSG_CHECKING([whether cc understands -c and -o together])
 fi
 set dummy $CC; ac_cc=`echo $[2] |
                      sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'`
@@ -820,9 +820,9 @@
 rm -f conftest*
 ])dnl
 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
-  AC_MSG_RESULT(yes)
+  AC_MSG_RESULT([yes])
 else
-  AC_MSG_RESULT(no)
+  AC_MSG_RESULT([no])
   AC_DEFINE(NO_MINUS_C_MINUS_O, 1,
             [Define if your C compiler doesn't accept -c and -o together.])
 fi
@@ -839,7 +839,7 @@
 # --------------
 # Find a working C++ preprocessor
 AC_DEFUN([AC_PROG_CXXCPP],
-[AC_MSG_CHECKING(how to run the C++ preprocessor)
+[AC_MSG_CHECKING([how to run the C++ preprocessor])
 AC_LANG_PUSH(C++)dnl
 if test -z "$CXXCPP"; then
   AC_CACHE_VAL(ac_cv_prog_CXXCPP,
@@ -859,7 +859,7 @@
   _AC_PROG_PREPROC_WORKS()
   ac_cv_prog_CXXCPP=$CXXCPP
 fi
-AC_MSG_RESULT($CXXCPP)
+AC_MSG_RESULT([$CXXCPP])
 if test -n "$ac_cpp_err"; then
   AC_MSG_ERROR([C++ preprocessor "$CXXCPP" fails sanity check])
 fi
@@ -1091,7 +1091,7 @@
 dnl FIXME: can't do this because then AC_AIX won't work due to a
 dnl circular dependency.
 dnl AC_BEFORE([$0], [AC_PROG_CPP])
-AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
+AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
 AC_CACHE_VAL(ac_cv_prog_cc_stdc,
 [ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
@@ -1144,7 +1144,7 @@
   x|xno)
     AC_MSG_RESULT([none needed]) ;;
   *)
-    AC_MSG_RESULT($ac_cv_prog_cc_stdc)
+    AC_MSG_RESULT([$ac_cv_prog_cc_stdc])
     CC="$CC $ac_cv_prog_cc_stdc" ;;
 esac
 ])# AC_PROG_CC_STDC
@@ -1391,11 +1391,11 @@
 AC_REQUIRE([AC_PROG_CPP])dnl
 AC_MSG_CHECKING([for function prototypes])
 if test "$ac_cv_prog_cc_stdc" != no; then
-  AC_MSG_RESULT(yes)
+  AC_MSG_RESULT([yes])
   AC_DEFINE(PROTOTYPES, 1,
             [Define if the C compiler supports function prototypes.])
 else
-  AC_MSG_RESULT(no)
+  AC_MSG_RESULT([no])
 fi
 ])# AC_C_PROTOTYPES
 
@@ -1725,7 +1725,7 @@
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME ## _])
           AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __]) ;;
   *)
-          AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
+          AC_MSG_WARN([unknown Fortran 77 name-mangling scheme])
           ;;
 esac
 ])# AC_F77_WRAPPERS
Index: acspecific.m4
--- acspecific.m4       Fri Nov  3 21:26:22 2000
+++ acspecific.m4       Sat Nov 11 00:02:10 2000
@@ -81,7 +81,7 @@
 # ----------------
 # Define SET_MAKE to set ${MAKE} if make doesn't.
 AC_DEFUN([AC_PROG_MAKE_SET],
-[AC_MSG_CHECKING(whether ${MAKE-make} sets \${MAKE})
+[AC_MSG_CHECKING([whether ${MAKE-make} sets \${MAKE}])
 set dummy ${MAKE-make}; ac_make=`echo "$[2]" | sed 'y,./+-,__p_,'`
 AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set,
 [cat >conftestmake <<\EOF
@@ -97,10 +97,10 @@
 fi
 rm -f conftestmake])dnl
 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  AC_MSG_RESULT(yes)
+  AC_MSG_RESULT([yes])
   SET_MAKE=
 else
-  AC_MSG_RESULT(no)
+  AC_MSG_RESULT([no])
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 AC_SUBST([SET_MAKE])dnl
@@ -156,7 +156,7 @@
 elif test -f lexyy.c; then
   ac_cv_prog_lex_root=lexyy
 else
-  AC_MSG_ERROR(cannot find output from $LEX; giving up)
+  AC_MSG_ERROR([cannot find output from $LEX; giving up])
 fi])
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 AC_SUBST(LEX_OUTPUT_ROOT)dnl
@@ -203,7 +203,7 @@
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
-AC_MSG_CHECKING(for a BSD compatible install)
+AC_MSG_CHECKING([for a BSD compatible install])
 if test -z "$INSTALL"; then
 AC_CACHE_VAL(ac_cv_path_install,
 [  ac_save_IFS=$IFS; IFS=':'
@@ -250,7 +250,7 @@
 fi
 dnl We do special magic for INSTALL instead of AC_SUBST, to get
 dnl relative paths right.
-AC_MSG_RESULT($INSTALL)
+AC_MSG_RESULT([$INSTALL])
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -268,7 +268,7 @@
 # AC_PROG_LN_S
 # ------------
 AC_DEFUN([AC_PROG_LN_S],
-[AC_MSG_CHECKING(whether ln -s works)
+[AC_MSG_CHECKING([whether ln -s works])
 AC_CACHE_VAL(ac_cv_prog_LN_S,
 [rm -f conftest.sym conftest.file
 echo >conftest.file
@@ -614,8 +614,8 @@
 when you ajust your code to use HAVE_STRING_H.])dnl
 AC_MSG_CHECKING([for BSD string and memory functions])
 AC_TRY_LINK(address@hidden:@include <strings.h>], [rindex(0, 0); bzero(0, 0);],
-  [AC_MSG_RESULT(yes)],
-  [AC_MSG_RESULT(no)
+  [AC_MSG_RESULT([yes])],
+  [AC_MSG_RESULT([no])
    AC_DEFINE(USG, 1,
        [Define if you do not have <strings.h>, index, bzero, etc...
         This symbol is obsolete, you should not depend upon it.])])
@@ -1199,7 +1199,7 @@
 X features:
   --x-includes=DIR    X include files are in DIR
   --x-libraries=DIR   X library files are in DIR])dnl
-AC_MSG_CHECKING(for X)
+AC_MSG_CHECKING([for X])
 
 AC_ARG_WITH(x, [  --with-x                use the X Window System])
 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
@@ -1229,7 +1229,7 @@
 fi # $with_x != no
 
 if test "$have_x" != yes; then
-  AC_MSG_RESULT($have_x)
+  AC_MSG_RESULT([$have_x])
   no_x=yes
 else
   # If each of the values was on the command line, it overrides each guess.
@@ -1388,20 +1388,20 @@
     # others require no space.  Words are not sufficient . . . .
     case `(uname -sr) 2>/dev/null` in
     "SunOS 5"*)
-      AC_MSG_CHECKING(whether -R must be followed by a space)
+      AC_MSG_CHECKING([whether -R must be followed by a space])
       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
       AC_LINK_IFELSE([AC_LANG_PROGRAM()], ac_R_nospace=yes, ac_R_nospace=no)
       if test $ac_R_nospace = yes; then
-       AC_MSG_RESULT(no)
+       AC_MSG_RESULT([no])
        X_LIBS="$X_LIBS -R$x_libraries"
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        AC_LINK_IFELSE([AC_LANG_PROGRAM()], ac_R_space=yes, ac_R_space=no)
        if test $ac_R_space = yes; then
-         AC_MSG_RESULT(yes)
+         AC_MSG_RESULT([yes])
          X_LIBS="$X_LIBS -R $x_libraries"
        else
-         AC_MSG_RESULT(neither works)
+         AC_MSG_RESULT([neither works])
        fi
       fi
       LIBS=$ac_xsave_LIBS
@@ -1629,15 +1629,15 @@
 #endif])dnl
 AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
 AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_MSG_CHECKING(for AIX)
+AC_MSG_CHECKING([for AIX])
 AC_EGREP_CPP(yes,
 [#ifdef _AIX
   yes
 #endif
 ],
-[AC_MSG_RESULT(yes)
+[AC_MSG_RESULT([yes])
 AC_DEFINE(_ALL_SOURCE)],
-AC_MSG_RESULT(no))
+AC_MSG_RESULT([no]))
 ])# AC_AIX
 
 
@@ -1666,11 +1666,11 @@
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
 AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_MSG_CHECKING(for POSIXized ISC)
+AC_MSG_CHECKING([for POSIXized ISC])
 if test -d /etc/conf/kconfig.d &&
    grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1
 then
-  AC_MSG_RESULT(yes)
+  AC_MSG_RESULT([yes])
   ISC=yes # If later tests want to check for ISC.
   AC_DEFINE(_POSIX_SOURCE, 1,
             [Define if you need to in order for stat and other things to
@@ -1681,7 +1681,7 @@
     CC="$CC -Xp"
   fi
 else
-  AC_MSG_RESULT(no)
+  AC_MSG_RESULT([no])
   ISC=
 fi
 ])# AC_ISC_POSIX
@@ -1691,13 +1691,13 @@
 # ------------
 AU_DEFUN(AC_XENIX_DIR,
 [# You shouldn't need to depend upon XENIX.  Remove this test if useless.
-AC_MSG_CHECKING(for Xenix)
+AC_MSG_CHECKING([for Xenix])
 AC_EGREP_CPP(yes,
 [#if defined(M_XENIX) && !defined(M_UNIX)
   yes
 @%:@endif],
-             [AC_MSG_RESULT(yes); XENIX=yes],
-             [AC_MSG_RESULT(no); XENIX=])
+             [AC_MSG_RESULT([yes]); XENIX=yes],
+             [AC_MSG_RESULT([no]); XENIX=])
 
 AC_HEADER_DIRENT[]dnl
 ])
Index: configure.in
--- configure.in        Tue Oct 17 17:02:15 2000
+++ configure.in        Sat Nov 11 00:11:21 2000
@@ -32,7 +32,7 @@
 if test "$PERL" != no; then
   PERLSCRIPTS=autoscan
 else
-  AC_MSG_WARN(autoscan will not be built since perl is not found)
+  AC_MSG_WARN([autoscan will not be built since perl is not found])
 fi
 
 AC_PROG_INSTALL
Index: doc/autoconf.texi
--- doc/autoconf.texi   Fri Nov 10 23:24:18 2000
+++ doc/autoconf.texi   Sat Nov 11 00:15:02 2000
@@ -5958,7 +5958,7 @@
 
 @example
 @group
-AC_MSG_CHECKING(how to get file system type)
+AC_MSG_CHECKING([how to get file system type])
 fstype=no
 # The order of these tests is important.
 AC_TRY_CPP([#include <sys/statvfs.h>
@@ -5975,7 +5975,7 @@
              [AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX])
 fi
 # (more cases omitted here)
-AC_MSG_RESULT($fstype)
+AC_MSG_RESULT([$fstype])
 @end group
 @end example
 
@@ -6466,7 +6466,7 @@
 e.g.,
 
 @example
-AC_MSG_NOTICE(checking if stack overflow is detectable)
+AC_MSG_NOTICE([checking if stack overflow is detectable])
 @end example
 
 This macro prints nothing if @code{configure} is run with the
@@ -7362,7 +7362,7 @@
 
 @example
 AC_DEFUN([AC_PATH_X],
-[AC_MSG_CHECKING(for X)
+[AC_MSG_CHECKING([for X])
 AC_REQUIRE_CPP()
 @r{# cut...}
   AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
@@ -7375,7 +7375,7 @@
 @example
 AC_DEFUN([AC_PATH_X],
 [AC_REQUIRE_CPP()dnl
-AC_MSG_CHECKING(for X)
+AC_MSG_CHECKING([for X])
 @r{# cut...}
   AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
 fi[]dnl
@@ -9126,13 +9126,13 @@
 running @sc{xenix} on which you should not depend:
 
 @example
-AC_MSG_CHECKING(for Xenix)
+AC_MSG_CHECKING([for Xenix])
 AC_EGREP_CPP(yes,
 [#if defined M_XENIX && !defined M_UNIX
   yes
 #endif],
-             [AC_MSG_RESULT(yes); XENIX=yes],
-             [AC_MSG_RESULT(no); XENIX=])
+             [AC_MSG_RESULT([yes]); XENIX=yes],
+             [AC_MSG_RESULT([no]); XENIX=])
 @end example
 @end defmac
 
______________________________





reply via email to

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