From b862f06d511af7dc92a5a4731798a634b8c7878a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 12 Mar 1996 05:33:16 +0000 Subject: [PATCH] Added Gord's check change. Check ALL_LINGUAS. --- ChangeLog | 14 +++++++ NEWS | 1 + TODO | 6 +++ automake.in | 111 ++++++++++++++++++++++++++++++++++++-------------- automake.texi | 17 ++++++++ version.texi | 2 +- 6 files changed, 120 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index c385f09f..edde41f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Mon Mar 11 17:50:58 1996 Tom Tromey + + * automake.in (seen_linguas, all_linguas_line): New variables. + (handle_gettext): New function. + (generate_makefile): Run it. + (scan_configure): Recognize ALL_LINGUAS. + +Mon Mar 11 14:34:36 1996 Gord Matzigkeit + + * automake.texi: doc fix. + + * automake.in (am_install_var): Added support for check and + installcheck special prefixes. + Sun Mar 10 10:44:42 1996 Tom Tromey * automake.in (handle_subdirs): Don't do SUBDIRS check for diff --git a/NEWS b/NEWS index b023e24c..05f40d98 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ New in 0.31: * @ALLOCA@ and @LIBOBJS@ now work in _LDADD variables * Better error messages in many cases * Program names are canonicalized +* Added "check" prefix; from Gord Matzigkeit New in 0.30: * Bug fixes diff --git a/TODO b/TODO index 2edbf6bf..a65279d8 100644 --- a/TODO +++ b/TODO @@ -7,6 +7,10 @@ Other priorities: * Rewrite clean targets. * Must rewrite error handling code. Right now it is a real mess +Currently gettext requires @INTLSUB@ and @POSUB@ in SUBDIRS. In the +future this will be just intl and po. When that happens, re-enable +warnings in handle_subdirs. + Consider allowing mkinstalldirs, mdate-sh, and others to be put in AC_CONFIG_AUX_DIR. Maybe even ansi2knr? @@ -172,6 +176,8 @@ Greg Woods) Must document macros which can be used when writing one's own rules. Must document INCLUDES +Document gettext support + ================================================================ Libraries: diff --git a/automake.in b/automake.in index 56f5d81d..268962ae 100755 --- a/automake.in +++ b/automake.in @@ -111,6 +111,13 @@ $seen_gettext = 0; # Line number at which ud_GNU_GETTEXT seen. $ac_gettext_line = 0; +# Whether ALL_LINGUAS has been seen. +$seen_linguas = ''; +# The actual text. +$all_linguas = ''; +# Line number at which it appears. +$all_linguas_line = 0; + # 1 if AC_PROG_INSTALL seen, 2 if fp_PROG_INSTALL seen. $seen_prog_install = 0; @@ -324,6 +331,7 @@ sub generate_makefile &check_gnits_standards; &handle_configure; + &handle_gettext; &handle_libraries; &handle_programs; &handle_scripts; @@ -598,7 +606,7 @@ sub handle_programs local (@proglist) = &am_install_var ('-clean', 'programs', 'PROGRAMS', 'bin', 'sbin', 'libexec', 'pkglib', - 'noinst'); + 'noinst', 'check'); return if ! @proglist; local ($obj) = &get_object_extension; @@ -648,7 +656,7 @@ sub handle_libraries { local (@liblist) = &am_install_var ('-no-all', '-clean', 'libraries', 'LIBRARIES', - 'lib', 'pkglib', 'noinst'); + 'lib', 'pkglib', 'noinst', 'check'); return if ! @liblist; if (! $seen_ranlib) @@ -720,7 +728,7 @@ sub handle_scripts # eg in Automake itself. $scripts_installed = &am_install_var ('scripts', 'SCRIPTS', 'bin', 'sbin', 'libexec', 'pkgdata', - 'noinst'); + 'noinst', 'check'); # We really only want a boolean value. $scripts_installed = 1 if $scripts_installed; @@ -954,7 +962,7 @@ sub handle_data { &am_install_var ('data', 'DATA', 'data', 'sysconf', 'sharedstate', 'localstate', 'pkgdata', - 'noinst'); + 'noinst', 'check'); } # Handle TAGS. @@ -1228,21 +1236,6 @@ sub handle_subdirs return; } - # As of 0.10.6, gettext still wants @INTLSUB@ and @POSUB@ in - # SUBDIRS. This is going to change in a future version. So for - # now we simply do no checking. - if (0 && $seen_gettext) - { - &am_line_error - ('SUBDIRS', - "ud_GNU_GETTEXT in configure.in but \`po' not in SUBDIRS") - if $contents{'SUBDIRS'} !~ /\bpo\b/; - &am_line_error - ('SUBDIRS', - "ud_GNU_GETTEXT in configure.in but \`intl' not in SUBDIRS") - if $contents{'SUBDIRS'} !~ /\bintl\b/; - } - &require_file_with_conf_line ($ac_gettext_line, $FOREIGN, 'ABOUT-NLS') if $seen_gettext; @@ -1404,7 +1397,56 @@ sub handle_headers { &am_install_var ('header', 'HEADERS', 'include', 'oldinclude', 'pkginclude', - 'noinst'); + 'noinst', 'check'); +} + +sub handle_gettext +{ + return if ! $seen_gettext || $relative_dir ne '.'; + + # As of 0.10.6, gettext still wants @INTLSUB@ and @POSUB@ in + # SUBDIRS. This is going to change in a future version. So for + # now we simply do no checking. + if (0 && defined $contents{'SUBDIRS'}) + { + &am_line_error + ('SUBDIRS', + "ud_GNU_GETTEXT in configure.in but \`po' not in SUBDIRS") + if $contents{'SUBDIRS'} !~ /\bpo\b/; + &am_line_error + ('SUBDIRS', + "ud_GNU_GETTEXT in configure.in but \`intl' not in SUBDIRS") + if $contents{'SUBDIRS'} !~ /\bintl\b/; + } + + # Ensure that each language in ALL_LINGUAS has a .po file, and + # each po file is mentioned in ALL_LINGUAS. + if ($seen_linguas) + { + local (%linguas) = (); + grep ($linguas{$_} = 1, split (/\s+/, $all_linguas)); + + foreach () + { + s/^po\///; + s/\.po$//; + + &am_line_error ($all_linguas_line, + ("po/$_.po exists but \`$_' not in \`ALL_LINGUAS'")) + if ! $linguas{$_}; + } + + foreach (keys %linguas) + { + &am_line_error ($all_linguas_line, + "$_ in \`ALL_LINGUAS' but po/$_.po does not exist") + if ! -f "po/$_.po"; + } + } + else + { + &am_error ("ud_GNU_GETTEXT in configure.in but \`ALL_LINGUAS' not defined"); + } } # Handle footer elements. @@ -1833,6 +1875,14 @@ sub scan_configure $ac_gettext_line = $.; } + # Look for ALL_LINGUAS. + if (/ALL_LINGUAS="(.*)"$/ || /ALL_LINGUAS=(.*)$/) + { + $seen_linguas = 1; + $all_linguas = $1; + $all_linguas_line = $.; + } + # Handle configuration headers. if (/AC_CONFIG_HEADER\s*\((.*)\)/) { @@ -2198,13 +2248,6 @@ sub initialize_global_constants # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. "; - - # Element is TRUE if primary variable is further parsed by - # Automake. In such a case the contents must be valid Makefile - # variable names. - %primary_uses_subobjects = - ('PROGRAMS', 1, - 'LIBRARIES', 1); } # (Re)-Initialize per-Makefile.am variables. @@ -2484,10 +2527,18 @@ sub am_install_var &push_phony_cleaners ($X . $primary); } - push (@used, '$(' . $one_name . ')'); - if ($X eq 'noinst') + if ($X eq 'check') + { + push (@check, '$(' . $one_name . ')'); + } + else + { + push (@used, '$(' . $one_name . ')'); + } + if ($X eq 'noinst' || $X eq 'check') { - # Objects in noinst_FOO never get installed. + # Objects in noinst_FOO or check_FOO never get + # installed. next; } diff --git a/automake.texi b/automake.texi index d6fd37a2..7b4114b3 100644 --- a/automake.texi +++ b/automake.texi @@ -356,6 +356,9 @@ html_DATA = automake.html The special prefix @samp{noinst} indicates that the objects in question should not be installed at all. +The special prefix @samp{check} indicates that the objects in question +should not be built until the @code{make check} command is run. + Possible primary names are @samp{PROGRAMS}, @samp{LIBRARIES}, @samp{SCRIPTS}, @samp{DATA}, @samp{HEADERS}, @samp{MANS}, and @samp{TEXINFOS}. @@ -751,6 +754,7 @@ distribution. * Scripts:: Executable scripts * Headers:: Header files * Data:: Architecture-independent data files +* Sources:: Derived sources @end menu @@ -823,6 +827,19 @@ texinfos-vars.am texinfos.am hack-make.sed nl-remove.sed @end example +@node Sources +@section Built sources + +Occasionally a file which would otherwise be called ``source'' (eg a C +@samp{.h} file) is actually derived from some other file. Such files +should be listed in the @code{BUILT_SOURCES} variable. +@vindex BUILT_SOURCES + +Files listed in @code{BUILT_SOURCES} are built before any automatic +dependency tracking is done. Built sources are included in a +distribution. + + @node Documentation @chapter Building documentation diff --git a/version.texi b/version.texi index a3cf0de7..b2143bcf 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 5 March 1996 +@set UPDATED 11 March 1996 @set EDITION 0.31 @set VERSION 0.31 -- 2.43.5