Added dist-zip.
authorTom Tromey <tromey@redhat.com>
Sat, 18 May 1996 00:29:32 +0000 (00:29 +0000)
committerTom Tromey <tromey@redhat.com>
Sat, 18 May 1996 00:29:32 +0000 (00:29 +0000)
Bug fixes.
Check for PACKAGE, VERSION

18 files changed:
ChangeLog
TODO
automake.in
automake.texi
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/acoutnoq.test
tests/acoutput.test
tests/acoutqnl.test
tests/acouttbs.test
tests/auxdir.test
tests/backsl.test [new file with mode: 0755]
tests/defs
tests/libobj.test
tests/package.test [new file with mode: 0755]
tests/subdir.test
version.texi

index 8fb6370..37fadfa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 Fri May 17 09:02:02 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
+       From Joerg-Martin Schwarz:
+       * automake.in (seen_package, seen_version): New globals.
+       (scan_configure): Look for PACKAGE= and VERSION=.
+
+       * automake.in (handle_options): Recognize dist-zip.
+       (handle_dist): Handle dist-zip.
+       (handle_options): Use ' ', not \s+, with split.  Test
+       backsl.test.
+       (handle_source_transform): Likewise.
+       (handle_lib_objects): Likewise.
+       (handle_libraries): Likewise.
+       (handle_texinfo): Likewise.
+       (handle_man_pages): Likewise.
+       (handle_subdirs): Likewise.
+       (handle_gettext): Likewise.
+       (handle_footer): Likewise.
+       (handle_tests): Likewise.
+       (scan_configure): Likewise.
+       (am_install_var): Likewise.
+
        * Makefile.am (TAGS_DEPENDENCIES): New macro.
 
        * tags.am (tags-recursive): New target.
diff --git a/TODO b/TODO
index 52f2c06..348fc60 100644 (file)
--- a/TODO
+++ b/TODO
@@ -73,9 +73,6 @@ an option
 
 Think about ways to make automake fit better with Cygnus-style trees.
 
-Automake should complain if PACKAGE and VERSION are not defined in
-configure.in.
-
 Use recode in dist target when MAINT_CHARSET specified.  Read caveats
 in automake.in before doing this.  Note the same problem used to apply
 to the no-dependencies option; maybe it still should?  Note also that
@@ -88,9 +85,9 @@ rest do not)
        merged distributions.
   DIST_CHARSET must be passed down to subdir makes during a "make dist"
 
-Handle dist-zoo and dist-zip.  Generally add more DOS support.  Maybe
-run "doschk" (why isn't this merged with "pathchk"?) when doing a
-dist.  Do whatever else François says here...
+Handle dist-zoo.  Generally add more DOS support.  Maybe run "doschk"
+(why isn't this merged with "pathchk"?) when doing a dist.  Do
+whatever else François says here...
 
 Add support for html via an option.  Use texi2html.  Use
 "html_TEXINFOS", and htmldir = .../html.  Include html files in
index 994efd5..bd2bbde 100755 (executable)
@@ -3,7 +3,7 @@
 # @configure_input@
 
 eval 'exec @PERL@ -S $0 ${1+"$@"}'
-    if $running_under_some_shell;
+    if 0;
 
 # automake - create Makefile.in from Makefile.am
 # Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
@@ -148,6 +148,10 @@ $libtool_line = 0;
 # TRUE if we've seen jm_MAINTAINER_MODE.
 $seen_maint_mode = 0;
 
+# TRUE if we've seen PACKAGE and VERSION.
+$seen_package = 0;
+$seen_version = 0;
+
 
 # Charsets used by maintainer and in distribution.  MAINT_CHARSET is
 # handled in a funny way: if seen in the top-level Makefile.am, it is
@@ -414,14 +418,15 @@ sub handle_options
 {
     return if ! &variable_defined ('AUTOMAKE_OPTIONS');
 
-    foreach (split (/\s+/, $contents{'AUTOMAKE_OPTIONS'}))
+    foreach (split (' ', $contents{'AUTOMAKE_OPTIONS'}))
     {
        $options{$_} = 1;
        if ($_ eq 'gnits' || $_ eq 'gnu' || $_ eq 'foreign')
        {
            &set_strictness ($_);
        }
-       elsif ($_ eq 'no-installman' || $_ eq 'ansi2knr' || $_ eq 'dist-shar')
+       elsif ($_ eq 'no-installman' || $_ eq 'ansi2knr'
+              || $_ eq 'dist-shar' || $_ eq 'dist-zip')
        {
            # Explicitly recognize these.
        }
@@ -556,7 +561,7 @@ sub handle_source_transform
        if ($source_list)
        {
            # Turn sources into objects.
-           local (@files) = split (/\s+/, $source_list);
+           local (@files) = split (' ', $source_list);
            local (@result) = ();
            foreach (@files)
            {
@@ -569,14 +574,6 @@ sub handle_source_transform
                # Skip things that look like configure substitutions.
                next if /^\@.*\@$/;
 
-               # One wonders how this can happen.  But, apparently,
-               # it can.  I believe it happens when nothing precedes
-               # a backslash-newline on a line -- the \s+ regexp
-               # doesn't match the newline.  Anyway, skip empty
-               # strings.  See tests/depend.test for an example of
-               # how to trigger this code.
-               next if /^\s*$/;
-
                if (/^(.*)\.[yl]$/)
                {
                    # Automatically include generated .c file in
@@ -623,7 +620,7 @@ sub handle_lib_objects
     # LDADD.
     local ($lsearch);
 
-    foreach $lsearch (split (/\s+/, $contents{$var}))
+    foreach $lsearch (split (' ', $contents{$var}))
     {
        # Automatically handle @LIBOBJS@ and @ALLOCA@.  Basically this
        # means adding entries to dep_files.
@@ -736,7 +733,7 @@ sub handle_libraries
        if (&variable_defined ($onedir . '_LIBRARIES'))
        {
            @outlist = ();
-           foreach $onelib (split (/\s+/, $contents{$onedir . '_LIBRARIES'}))
+           foreach $onelib (split (' ', $contents{$onedir . '_LIBRARIES'}))
            {
                push (@outlist, 'lib' . $onelib . '.a');
            }
@@ -851,7 +848,7 @@ sub handle_texinfo
     return if (! &variable_defined ('info_TEXINFOS')
               && ! &variable_defined ('html_TEXINFOS'));
 
-    local (@texis) = split (/\s+/, $contents{'info_TEXINFOS'});
+    local (@texis) = split (' ', $contents{'info_TEXINFOS'});
 
     local (@infos_list, @info_deps_list, @dvis_list, @texi_deps);
     local ($infobase, $info_cursor);
@@ -982,7 +979,7 @@ sub handle_man_pages
 
     # We generate the manpage install code by hand to avoid the use of
     # basename in the generated Makefile.
-    local (@mans) = split (/\s+/, $contents{'man_MANS'});
+    local (@mans) = split (' ', $contents{'man_MANS'});
     local (%sections, %inames, %secmap, %fullsecmap);
     foreach (@mans)
     {
@@ -1085,7 +1082,7 @@ sub handle_tags
     }
 }
 
-# Generate actual 'dist' (or dist-shar) rule.
+# Worker for handle_dist.
 sub handle_dist_worker
 {
     $output_rules .= 'distdir: $(DEP_DISTFILES)' . "\n";
@@ -1243,7 +1240,7 @@ sub handle_dist
                          . "\n");
     }
 
-    # Generate 'dist' target, and maybe dist-shar.
+    # Generate 'dist' target, and maybe dist-shar / dist-zip.
     if ($relative_dir eq '.')
     {
        # Rule to check whether a distribution is viable.
@@ -1277,6 +1274,14 @@ distcheck: dist
            $output_rules .= 'shar $(distdir) | gzip > $(distdir).shar.gz';
            $output_rules .= "\n\t" . 'rm -rf $(distdir)' . "\n";
        }
+
+       if (defined $options{'dist-zip'})
+       {
+           $output_rules .= 'dist-zip: distdir' . "\n\t";
+           $output_rules .= 'chmod -R a+r $(distdir)' . "\n\t";
+           $output_rules .= 'zip -rq $(distdir).zip $(distdir)';
+           $output_rules .= "\n\t" . 'rm -rf $(distdir)' . "\n";
+       }
     }
 
     # Generate distdir target.
@@ -1341,7 +1346,7 @@ sub handle_subdirs
 
     # Make sure each directory mentioned in SUBDIRS actually exists.
     local ($dir);
-    foreach $dir (split (/\s+/, $contents{'SUBDIRS'}))
+    foreach $dir (split (' ', $contents{'SUBDIRS'}))
     {
        # Skip directories substituted by configure.
        next if $dir =~ /^\@.*\@$/;
@@ -1530,7 +1535,7 @@ sub handle_gettext
     if ($seen_linguas)
     {
        local (%linguas) = ();
-       grep ($linguas{$_} = 1, split (/\s+/, $all_linguas));
+       grep ($linguas{$_} = 1, split (' ', $all_linguas));
 
        foreach (<po/*.po>)
        {
@@ -1561,12 +1566,12 @@ sub handle_footer
     if ($contents{'SOURCES'})
     {
        &pretty_print ('SOURCES =', "",
-                      split (/\s+/, $contents{'SOURCES'}));
+                      split (' ', $contents{'SOURCES'}));
     }
     if ($contents{'OBJECTS'})
     {
        &pretty_print ('OBJECTS =', "",
-                      split (/\s+/, $contents{'OBJECTS'}));
+                      split (' ', $contents{'OBJECTS'}));
     }
     if ($contents{'SOURCES'} || $contents{'OBJECTS'})
     {
@@ -1884,7 +1889,7 @@ sub handle_tests
 {
     return if ! &variable_defined ('TESTS');
 
-    &push_dist_common (split (/\s+/, $contents{'TESTS'}));
+    &push_dist_common (split (' ', $contents{'TESTS'}));
     push (@check, 'check-TESTS');
     push (@phony, 'check-TESTS');
     # FIXME use $(SHELL) here?  That is what Ulrich suggests.  Maybe a
@@ -1962,7 +1967,7 @@ sub scan_configure
        }
        elsif (/AC_REPLACE_FUNCS\s*\((.*)\)/)
        {
-           foreach (split (/\s+/, $1))
+           foreach (split (' ', $1))
            {
                $libsources{$_ . '.c'} = 1;
            }
@@ -1975,7 +1980,7 @@ sub scan_configure
        elsif (/LIBOBJS="(.*)\s+\$LIBOBJS"/
               || /LIBOBJS="\$LIBOBJS\s+(.*)"/)
        {
-           foreach $libobj_iter (split (/\s+/, $1))
+           foreach $libobj_iter (split (' ', $1))
            {
                if ($libobj_iter =~ /^(.*)\.o$/)
                {
@@ -2065,6 +2070,8 @@ sub scan_configure
        $seen_arg_prog = 1 if /AC_ARG_PROGRAM/;
        $seen_ranlib = 1 if /AC_PROG_RANLIB/;
         $seen_maint_mode = 1 if /jm_MAINTAINER_MODE/;
+        $seen_package = 1 if /PACKAGE=/;
+        $seen_version = 1 if /VERSION=/;        
 
         if (/AC_PROG_LIBTOOL/ || /gm_PROG_LIBTOOL/)
        {
@@ -2079,6 +2086,11 @@ sub scan_configure
 
     close (CONFIGURE);
 
+    &am_conf_error ("\`PACKAGE' not defined in configure.in")
+        if ! $seen_package;
+    &am_conf_error ("\`VERSION' not defined in configure.in")
+        if ! $seen_version;
+
     # Look for some files we need.  Always check for these.  This
     # check must be done for every run, even those where we are only
     # looking at a subdir Makefile.  We must set relative_dir so that
@@ -2698,7 +2710,7 @@ sub am_install_var
            # Append actual contents of where_PRIMARY variable to
            # result.
            local ($rcurs);
-           foreach $rcurs (split (/\s+/, $contents{$one_name}))
+           foreach $rcurs (split (' ', $contents{$one_name}))
            {
                # Skip configure substitutions.  Possibly bogus.
                next if $rcurs =~ /^\@.*\@$/;
index 8027481..cd58189 100644 (file)
@@ -1101,6 +1101,7 @@ The same as the corresponding @samp{--strictness} option.
 The generated @file{Makefile.in} will not cause man pages to be
 installed by default.  However, an @code{install-man} target will still
 be available for optional installation.
+@trindex install-man
 
 @item @code{ansi2knr}
 Turn on automatic de-ANSI-fication.
@@ -1108,6 +1109,12 @@ Turn on automatic de-ANSI-fication.
 @item @code{dist-shar}
 Generate a @code{dist-shar} target as well as the ordinary @code{dist}
 target.
+@trindex dist-shar
+
+@item @code{dist-zip}
+Generate a @code{dist-zip} target as well as the ordinary @code{dist}
+target.
+@trindex dist-zip
 
 @item @code{no-dependencies}
 This is similar to using @samp{--include-deps} on the command line, but
index fa5f38c..c29316a 100644 (file)
@@ -1,3 +1,12 @@
+Fri May 17 17:32:35 1996  Tom Tromey  <tromey@creche.cygnus.com>
+
+       * defs, many .test files: Define PACKAGE and VERSION in
+       configure.in.
+
+       * package.test: New file.
+
+       * backsl.test: New file.
+
 Thu May 16 09:15:57 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
        * subdir.test: New file.
index 31e542a..1abedf6 100644 (file)
@@ -7,6 +7,6 @@ acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test \
 confincl.test spelling.test prefix.test badprog.test depend.test exdir.test \
 canon.test installsh.test empty.test rulepat.test insh.test canon2.test \
 target.test extra.test noinst.test instman.test mkinstall.test auxdir.test \
-canon3.test mdate2.test subdir.test
+canon3.test mdate2.test subdir.test backsl.test package.test
 
 EXTRA_DIST = defs $(TESTS)
index 1860ece..523482e 100644 (file)
@@ -45,7 +45,7 @@ acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test \
 confincl.test spelling.test prefix.test badprog.test depend.test exdir.test \
 canon.test installsh.test empty.test rulepat.test insh.test canon2.test \
 target.test extra.test noinst.test instman.test mkinstall.test auxdir.test \
-canon3.test mdate2.test subdir.test
+canon3.test mdate2.test subdir.test backsl.test package.test
 
 EXTRA_DIST = defs $(TESTS)
 mkinstalldirs = $(top_srcdir)/mkinstalldirs
index d95be26..f753800 100755 (executable)
@@ -9,6 +9,8 @@
 . $srcdir/defs || exit 1
 
 cat > configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
 AC_ARG_PROGRAM
 AC_PROG_INSTALL
 AC_OUTPUT(Makefile, [true])
index abd11db..53c59d0 100755 (executable)
@@ -6,6 +6,8 @@
 . $srcdir/defs || exit 1
 
 cat > configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
 AC_ARG_PROGRAM
 AC_PROG_INSTALL
 AC_OUTPUT([Makefile], [true])
index 732a11a..94c909d 100755 (executable)
@@ -5,6 +5,8 @@
 . $srcdir/defs || exit 1
 
 cat > configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
 AC_ARG_PROGRAM
 AC_PROG_INSTALL
 AC_OUTPUT([Makefile],
index bd73891..88be5d2 100755 (executable)
@@ -6,6 +6,8 @@
 . $srcdir/defs || exit 1
 
 cat > configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
 AC_ARG_PROGRAM
 AC_PROG_INSTALL
 AC_OUTPUT(Makefile \
index a0a22d2..cf6872d 100755 (executable)
@@ -6,6 +6,8 @@
 
 # The "./." is here so we don't have to mess with subdirs.
 cat >> configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
 AC_CONFIG_AUX_DIR(./.)
 END
 
diff --git a/tests/backsl.test b/tests/backsl.test
new file mode 100755 (executable)
index 0000000..bd6f6ae
--- /dev/null
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+# Test for "\" problems.  Bug report from Joerg-Martin Schwarz.
+
+. $srcdir/defs || exit 1
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = \
+   frob
+END
+
+$AUTOMAKE || exit 1
+
+grep '^_SOURCE' Makefile.in && exit 1
+exit 0
index cb5b2a9..321fa7b 100644 (file)
@@ -25,6 +25,8 @@ cd testSubDir
 # Build appropriate environment in test directory.  Eg create
 # configure.in, touch all necessary files, etc.
 cat > configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
 AC_ARG_PROGRAM
 fp_PROG_INSTALL
 AC_OUTPUT(Makefile)
index 5a991ae..9fe17b7 100755 (executable)
@@ -7,6 +7,8 @@
 . $srcdir/defs || exit 1
 
 cat > configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
 AC_ARG_PROGRAM
 AC_PROG_INSTALL
 AC_PROG_RANLIB
diff --git a/tests/package.test b/tests/package.test
new file mode 100755 (executable)
index 0000000..8b872d5
--- /dev/null
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+# Test to ensure PACKAGE required.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_ARG_PROGRAM
+fp_PROG_INSTALL
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+pkgdata_DATA =
+END
+
+$AUTOMAKE && exit 1
+exit 0
index a4b52aa..04ab9e0 100755 (executable)
@@ -8,6 +8,8 @@
 mkdir zot
 
 cat > configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
 AC_ARG_PROGRAM
 AC_PROG_MAKE_SET
 fp_PROG_INSTALL
index fbad6a4..1b1b779 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 14 May 1996
+@set UPDATED 17 May 1996
 @set EDITION 0.33
 @set VERSION 0.33