From 199f50b0b092a2cebbe12d84581e7241e81d4b2a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 18 May 1996 00:29:25 +0000 Subject: [PATCH] Added dist-zip. Bug fixes. Check for PACKAGE, VERSION --- ChangeLog | 20 ++++++++++++++ TODO | 9 +++---- automake.in | 64 +++++++++++++++++++++++++++------------------ automake.texi | 7 +++++ tests/ChangeLog | 9 +++++++ tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- tests/acoutnoq.test | 2 ++ tests/acoutput.test | 2 ++ tests/acoutqnl.test | 2 ++ tests/acouttbs.test | 2 ++ tests/auxdir.test | 2 ++ tests/backsl.test | 15 +++++++++++ tests/defs | 2 ++ tests/libobj.test | 2 ++ tests/package.test | 18 +++++++++++++ tests/subdir.test | 2 ++ version.texi | 2 +- 18 files changed, 129 insertions(+), 35 deletions(-) create mode 100755 tests/backsl.test create mode 100755 tests/package.test diff --git a/ChangeLog b/ChangeLog index 8fb63706..37fadfa5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,25 @@ Fri May 17 09:02:02 1996 Tom Tromey + 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 52f2c068..348fc608 100644 --- 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 diff --git a/automake.in b/automake.in index 994efd51..bd2bbde5 100755 --- a/automake.in +++ b/automake.in @@ -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 () { @@ -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 =~ /^\@.*\@$/; diff --git a/automake.texi b/automake.texi index 8027481c..cd58189d 100644 --- a/automake.texi +++ b/automake.texi @@ -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 diff --git a/tests/ChangeLog b/tests/ChangeLog index fa5f38c9..c29316a2 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,12 @@ +Fri May 17 17:32:35 1996 Tom Tromey + + * 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 * subdir.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index 31e542a0..1abedf68 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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) diff --git a/tests/Makefile.in b/tests/Makefile.in index 1860ecee..523482e0 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 diff --git a/tests/acoutnoq.test b/tests/acoutnoq.test index d95be263..f753800e 100755 --- a/tests/acoutnoq.test +++ b/tests/acoutnoq.test @@ -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]) diff --git a/tests/acoutput.test b/tests/acoutput.test index abd11db1..53c59d03 100755 --- a/tests/acoutput.test +++ b/tests/acoutput.test @@ -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]) diff --git a/tests/acoutqnl.test b/tests/acoutqnl.test index 732a11ac..94c909d9 100755 --- a/tests/acoutqnl.test +++ b/tests/acoutqnl.test @@ -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], diff --git a/tests/acouttbs.test b/tests/acouttbs.test index bd738912..88be5d23 100755 --- a/tests/acouttbs.test +++ b/tests/acouttbs.test @@ -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 \ diff --git a/tests/auxdir.test b/tests/auxdir.test index a0a22d21..cf6872d4 100755 --- a/tests/auxdir.test +++ b/tests/auxdir.test @@ -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 index 00000000..bd6f6ae3 --- /dev/null +++ b/tests/backsl.test @@ -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 diff --git a/tests/defs b/tests/defs index cb5b2a98..321fa7b6 100644 --- a/tests/defs +++ b/tests/defs @@ -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) diff --git a/tests/libobj.test b/tests/libobj.test index 5a991ae9..9fe17b78 100755 --- a/tests/libobj.test +++ b/tests/libobj.test @@ -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 index 00000000..8b872d51 --- /dev/null +++ b/tests/package.test @@ -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 diff --git a/tests/subdir.test b/tests/subdir.test index a4b52aad..04ab9e0f 100755 --- a/tests/subdir.test +++ b/tests/subdir.test @@ -8,6 +8,8 @@ mkdir zot cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch AC_ARG_PROGRAM AC_PROG_MAKE_SET fp_PROG_INSTALL diff --git a/version.texi b/version.texi index fbad6a46..1b1b7795 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 14 May 1996 +@set UPDATED 17 May 1996 @set EDITION 0.33 @set VERSION 0.33 -- 2.43.5