better error message when AC_OUTPUT arg empty
authorTom Tromey <tromey@redhat.com>
Wed, 24 Sep 1997 22:32:56 +0000 (22:32 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 24 Sep 1997 22:32:56 +0000 (22:32 +0000)
ChangeLog
automake.in
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/output5.test [new file with mode: 0755]

index cf601f6..45c97da 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 Wed Sep 24 16:10:37 1997  Tom Tromey  <tromey@cygnus.com>
 
+       * automake.in (scan_one_configure_file): Detect AC_OUTPUT().
+       (handle_single_transform_list): Don't apply length() to a list.
+
        * automake.in (handle_programs): Define _DEPENDENCIES variable if
        not defined by user.
 
index 0a86dc1..ff68787 100755 (executable)
@@ -1066,7 +1066,7 @@ sub handle_single_transform_list
     local (@result) = ();
     local ($nonansi_obj) = $obj;
     $nonansi_obj =~ s/_//g;
-    if (length (@files))
+    if (@files > 0)
     {
        # Turn sources into objects.
        foreach (@files)
@@ -3912,7 +3912,12 @@ sub scan_one_configure_file
        }
        if ($in_ac_output)
        {
-           $in_ac_output = 0 if s/[\]\),].*$//;
+           local ($closing) = 0;
+           if (s/[\]\),].*$//)
+           {
+               $in_ac_output = 0;
+               $closing = 1;
+           }
 
            # Look at potential Makefile.am's.
            foreach (split)
@@ -3946,6 +3951,14 @@ sub scan_one_configure_file
                    push (@other_input_files, $_);
                }
            }
+
+           if ($closing)
+           {
+               &am_conf_line_error ($filename, $ac_output_line,
+                                    "No files mentioned in \`AC_OUTPUT'")
+                   if @make_input_list == 0 && @other_input_files == 0;
+               exit 1;
+           }
        }
 
        if (/$AC_CONFIG_AUX_DIR_PATTERN/o)
index 5580cae..fa52642 100644 (file)
@@ -1,5 +1,7 @@
 Wed Sep 24 16:01:59 1997  Tom Tromey  <tromey@cygnus.com>
 
+       * output5.test: New file.
+
        * depend3.test: New file.
 
 Mon Aug 25 17:24:42 1997  Tom Tromey  <tromey@cygnus.com>
index 100ea1d..fde9021 100644 (file)
@@ -26,7 +26,7 @@ remake2.test output3.test output4.test colneq2.test subst.test \
 defun2.test yaccpp.test texinfo3.test texinfo4.test tagsub.test        \
 cxxlibobj.test seenc.test cygwin32.test lisp.test stamph.test \
 ldadd.test version2.test conf2.test cond.test cond2.test xsource.test \
-libobj6.test depend3.test
+libobj6.test depend3.test output5.test
 
 EXTRA_DIST = defs $(TESTS)
 
index 0e08fc4..10911b5 100644 (file)
@@ -87,7 +87,7 @@ remake2.test output3.test output4.test colneq2.test subst.test \
 defun2.test yaccpp.test texinfo3.test texinfo4.test tagsub.test        \
 cxxlibobj.test seenc.test cygwin32.test lisp.test stamph.test \
 ldadd.test version2.test conf2.test cond.test cond2.test xsource.test \
-libobj6.test depend3.test
+libobj6.test depend3.test output5.test
 
 EXTRA_DIST = defs $(TESTS)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/tests/output5.test b/tests/output5.test
new file mode 100755 (executable)
index 0000000..8bfd99f
--- /dev/null
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+# Test for AC_OUTPUT().  From Mark Galassi.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
+AC_ARG_PROGRAM
+AC_PROG_INSTALL
+AC_OUTPUT()
+END
+
+: > Makefile.am
+
+$AUTOMAKE > output 2>&1 && exit 1
+grep 'found or specified' output && exit 1
+exit 0