autoconf-patches
[Top][All Lists]
Advanced

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

AC_MSG_ERROR is not suitable for config.status


From: Pavel Roskin
Subject: AC_MSG_ERROR is not suitable for config.status
Date: Wed, 25 Oct 2000 18:20:50 -0400 (EDT)

Hello!

The recent changes in AC_MSG_ERROR make it inappropriate for using in
config.status. There is no logfile for config.status.

Also it's better to indicate that an error happens in config.status, not
in configure.

ChangeLog:
        * acgeneral.m4 (_AC_MSG_ERROR_CS): New macro for reporting
        fatal errors from config.status.
        (_AC_OUTPUT_FILES): Use _AC_MSG_ERROR_CS.
        (_AC_OUTPUT_HEADERS): Likewise.
        (_AC_OUTPUT_LINKS): Likewise.
        * tests/semantics.m4: Updated to match error message.

Regards,
Pavel Roskin

________________________________
Index: acgeneral.m4
--- acgeneral.m4        Wed Oct 25 14:17:41 2000
+++ acgeneral.m4        Wed Oct 25 18:15:00 2000
@@ -2798,6 +2798,14 @@
   exit m4_default([$2], 1); }])
 
 
+# _AC_MSG_ERROR_CS(ERROR, [EXIT-STATUS = 1])
+# ------------------------------------------
+# Likewise, but for using in config.status
+define([_AC_MSG_ERROR_CS],
+[{ _AC_ECHO([config.status: error: $1], 2)
+  exit m4_default([$2], 1); }])
+
+
 # AU::AC_CHECKING(FEATURE)
 # ------------------------
 AU_ALIAS([AC_CHECKING],
@@ -4792,7 +4800,7 @@
       -) echo $tmp/stdin ;;
       [[\\/$]]* | ?:[[\\/]]*)
          # Absolute
-         test -f "$f" || AC_MSG_ERROR([cannot find input file \\`$f'])
+         test -f "$f" || _AC_MSG_ERROR_CS([cannot find input file \\`$f'])
          echo $f;;
       *) # Relative
          if test -f "$f"; then
@@ -4803,7 +4811,7 @@
            echo $ac_given_srcdir/$f
          else
            # /dev/null tree
-           AC_MSG_ERROR([cannot find input file \\`$f'])
+           _AC_MSG_ERROR_CS([cannot find input file \\`$f'])
          fi;;
       esac
     done` || { (exit 1); exit; }
@@ -4939,7 +4947,7 @@
       -) echo $tmp/stdin ;;
       [[\\/$]]* | ?:[[\\/]]*)
          # Absolute
-         test -f "$f" || AC_MSG_ERROR([cannot find input file \\`$f'])
+         test -f "$f" || _AC_MSG_ERROR_CS([cannot find input file \\`$f'])
          echo $f;;
       *) # Relative
          if test -f "$f"; then
@@ -4950,7 +4958,7 @@
            echo $ac_given_srcdir/$f
          else
            # /dev/null tree
-           AC_MSG_ERROR([cannot find input file \\`$f'])
+           _AC_MSG_ERROR_CS([cannot find input file \\`$f'])
          fi;;
       esac
     done` || { (exit 1); exit; }
@@ -5113,7 +5121,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_CS([$srcdir/$ac_source: File not found])
   fi
   rm -f $ac_dest
 
@@ -5137,7 +5145,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_CS([cannot link $ac_dest to $srcdir/$ac_source])
   fi
 ifset([AC_LIST_LINKS_COMMANDS],
 [  # Run the commands associated with the file.
Index: tests/semantics.m4
--- tests/semantics.m4  Mon Sep 25 16:12:01 2000
+++ tests/semantics.m4  Wed Oct 25 18:06:37 2000
@@ -432,7 +432,7 @@
 
 AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
 AT_CHECK([./configure], 1, ignore,
-[[configure: error: cannot find input file `nonexistent.in'
+[[config.status: error: cannot find input file `nonexistent.in'
 ]])
 # Make sure that the output file doesn't exist
 AT_CHECK([test -f nonexistent], 1)
________________________________






reply via email to

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