[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-952-
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-952-gf1652f6 |
Date: |
Fri, 02 Sep 2011 09:14:14 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=f1652f6f8ef9db10cadd41fa77f77a87aed304d2
The branch, master has been updated
via f1652f6f8ef9db10cadd41fa77f77a87aed304d2 (commit)
via 199b9086f51927fb99663cac42934337352cce69 (commit)
via 136b48998f4a5db717e16200fcdf4bb907703646 (commit)
via 392800a64e30930e8ff3771db6805b1faeb2ce13 (commit)
via c8d4c3f4b21b598302f2310f6fcc747cf92f8d64 (commit)
via 16f67b47492d97cac0866b02304b08fdde4d069e (commit)
via 1a1c1339db861cee13ed8b8b05b0c41428214b7a (commit)
via 0cbcf393dbdaa2ff36b11cf2516675e78eada49f (commit)
from b110067c6ec69ac5081a2fc50d1d645d60c73aab (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 104 +++
NEWS | 7 +-
automake.in | 285 +-------
doc/automake.texi | 119 +----
lib/Automake/Options.pm | 14 +-
lib/Automake/Variable.pm | 2 -
lib/Makefile.am | 7 +-
lib/Makefile.in | 14 +-
lib/am/Makefile.am | 3 +-
lib/am/Makefile.in | 3 +-
lib/am/ansi2knr.am | 77 --
lib/ansi2knr.1 | 36 -
lib/ansi2knr.c | 739 --------------------
m4/depout.m4 | 4 +-
m4/protos.m4 | 27 +-
tests/Makefile.am | 17 +-
tests/Makefile.in | 17 +-
tests/ansi.test | 51 --
tests/ansi10.test | 72 --
tests/ansi2.test | 38 -
tests/ansi2knr-deprecation.test | 69 --
tests/ansi2knr-no-more.test | 56 ++
tests/ansi3.test | 58 --
tests/ansi3b.test | 59 --
tests/ansi4.test | 40 --
tests/ansi5.test | 89 ---
tests/ansi6.test | 83 ---
tests/ansi7.test | 85 ---
tests/ansi8.test | 28 -
tests/ansi9.test | 60 --
tests/cxxansi.test | 45 --
tests/depacl2.test | 13 +-
tests/libobj8.test | 51 --
.../{acoutbs.test => no-extra-makefile-code.test} | 23 +-
tests/subobj3.test | 66 --
35 files changed, 226 insertions(+), 2235 deletions(-)
delete mode 100644 lib/am/ansi2knr.am
delete mode 100644 lib/ansi2knr.1
delete mode 100644 lib/ansi2knr.c
delete mode 100755 tests/ansi.test
delete mode 100755 tests/ansi10.test
delete mode 100755 tests/ansi2.test
delete mode 100755 tests/ansi2knr-deprecation.test
create mode 100755 tests/ansi2knr-no-more.test
delete mode 100755 tests/ansi3.test
delete mode 100755 tests/ansi3b.test
delete mode 100755 tests/ansi4.test
delete mode 100755 tests/ansi5.test
delete mode 100755 tests/ansi6.test
delete mode 100755 tests/ansi7.test
delete mode 100755 tests/ansi8.test
delete mode 100755 tests/ansi9.test
delete mode 100755 tests/cxxansi.test
delete mode 100755 tests/libobj8.test
copy tests/{acoutbs.test => no-extra-makefile-code.test} (63%)
delete mode 100755 tests/subobj3.test
diff --git a/ChangeLog b/ChangeLog
index 464e67d..b8c24f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,107 @@
+2011-09-01 Stefano Lattarini <address@hidden>
+
+ automake: fix regression due to de-ansification support removal
+ The last change `v1.11-947-g136b489' removed code that automake
+ was using to decide whether binary objects were built by the
+ generated Makefile.in, so that it could avoid to emit unneeded
+ code when this was not the case. Re-introduce such code in a
+ less-obfuscated form, and add a test to ensure we don't regress
+ again.
+ * automake.in ($must_handle_compiled_objects): New global
+ variable, telling whether the generated Makefile has to build
+ compiled objects.
+ (initialize_per_input): Reset it.
+ (handle_programs, handle_libraries, handle_ltlibraries): Set
+ it to a true value when required.
+ (handle_compile): Don't generate any code if the variable
+ `$must_handle_compiled_objects' is not set to a true value.
+ * tests/no-extra-makefile-code.test: New test.
+ * tests/Makefile.am (TESTS): Add it.
+
+2011-08-28 Stefano Lattarini <address@hidden>
+
+ automake: cleanups after de-ansification support removal (2)
+ * automake.in ($get_object_extension_was_run): Remove, it's not
+ really needed anymore.
+ (&get_object_extension): Remove, it's a no-op now.
+ All callers adjusted.
+
+2011-08-28 Stefano Lattarini <address@hidden>
+
+ automake: cleanups after de-ansification support removal (1)
+ * automake.in (lang_c_rewrite, handle_single_transform): Rename
+ variable `$nonansi_obj' to `$obj'.
+
+2011-08-28 Stefano Lattarini <address@hidden>
+
+ ansi: remove obsolete code/files for de-ANSI-fication support
+ * lib/ansi2knr.1, lib/ansi2knr.c: Deleted.
+ * lib/Makefile.am (dist_pkgvdata_DATA): Do not list them anymore.
+ * lib/am/ansi2knr.am: Delete.
+ * lib/am/Makefile.am (dist_am_DATA): Do not list it anymore.
+ * lib/Automake/Variable.pm (%_am_macro_for_var): Remove entries for
+ `ANSI2KNR' and `U'.
+ * m4/depout.m4 (_AM_OUTPUT_DEPENDENCY_COMMANDS): Don't care anymore
+ about possible definition of the `$U' variable.
+ * automake.in (@common_files): Drop `ansi2knr.1' and `ansi2knr.c'.
+ (struct): Remove scalar field `ansi'.
+ All callers adjusted.
+ (&lang_c_finish, %de_ansi_files): Remove, they're not required
+ anymore.
+ All callers adjusted.
+ ($get_object_extension_was_run): Fix typo in comment.
+ (&get_object_extension): Drop code dealing with de-ansification;
+ this function basically a no-op now, but is required to properly
+ initialize `$get_object_extension_was_run' variable.
+ (&handle_languages, &handle_compile, &lang_c_rewrite): Drop code
+ dealing with de-ansification.
+
+2011-08-28 Stefano Lattarini <address@hidden>
+
+ ansi: reject attempts to use automatic de-ANSI-fication support
+ * tests/protos.m4 (AM_C_PROTOTYPES): Error out whenever called.
+ * lib/Automake/Options.pm (_process_option_list ): Error out
+ with a proper error message when the `ansi2knr' option is used.
+ Related updates to comments.
+ * tests/depacl2.test: Update.
+ * tests/ansi2knr-no-more.test: New test.
+ * tests/Makefile.am (TESTS): Add it.
+ * NEWS: Update.
+
+2011-08-28 Stefano Lattarini <address@hidden>
+
+ tests: remove tests about obsolete de-ANSI-fication support
+ * tests/ansi.test: Delete.
+ * tests/ansi10.test: Likewise.
+ * tests/ansi2.test: Likewise.
+ * tests/ansi2knr-deprecation.test: Likewise.
+ * tests/ansi3.test: Likewise.
+ * tests/ansi3b.test: Likewise.
+ * tests/ansi4.test: Likewise.
+ * tests/ansi5.test: Likewise.
+ * tests/ansi6.test: Likewise.
+ * tests/ansi7.test: Likewise.
+ * tests/ansi8.test: Likewise.
+ * tests/ansi9.test: Likewise.
+ * tests/cxxansi.test: Likewise.
+ * tests/libobj8.test: Likewise.
+ * tests/subobj3.test: Likewise.
+ * tests/Makefile.am (TESTS): Update.
+
+2011-08-28 Stefano Lattarini <address@hidden>
+
+ docs: remove description of de-ANSI-fication support from manual
+ * doc/automake.texi (Auxiliary Programs): Remove mention of
+ `ansi2knr.c' and `ansi2knr.1'.
+ (Obsolete Macros): Remove mention of `AM_C_PROTOTYPES'. Do not
+ index it nor variables `ANSI2KNR' and `U' anymore.
+ (List of Automake options): Remove mention of `ansi2knr' option,
+ and obsolete entries for concept and option indexes.
+ (Optional): Remove entry about `AM_C_PROTOTYPES'.
+ (@c LocalWords): Remove `ansi' and `knr'.
+ (@menu, @detailmenu): Remove entries about de-ANSI-fication
+ support.
+
2011-09-02 Stefano Lattarini <address@hidden>
coverage: vala support failing for VPATH from-scratch builds
diff --git a/NEWS b/NEWS
index 50e702b..9e391c9 100644
--- a/NEWS
+++ b/NEWS
@@ -11,11 +11,6 @@ New in 1.11a:
- New `cscope' target to build a cscope database for the source tree.
-* WARNING: Future backward-incompatibilities!
-
- - The Automake support for automatic de-ANSI-fication will be removed in
- the next major Automake release (1.12).
-
* Miscellaneous changes:
- The `dist' and `dist-all' targets now can run compressors in parallel.
@@ -57,6 +52,8 @@ New in 1.11a:
user; still, the old Makefile.am files that used to define it should
still continue to work as before.
+ - Support for automatic de-ANSI-fication has been removed.
+
Bugs fixed in 1.11a:
- Lots of minor bugfixes.
diff --git a/automake.in b/automake.in
index 517eea9..288ff61 100644
--- a/automake.in
+++ b/automake.in
@@ -53,7 +53,6 @@ struct (# Short name of the language (c, f77...).
# List of configure variables which must be defined.
'config_vars' => '@',
- 'ansi' => "\$",
# `pure' is `1' or `'. A `pure' language is one where, if
# all the files in a directory are of that language, then we
# do not require the C compiler or any code to call it.
@@ -233,7 +232,7 @@ my @libtool_sometimes = qw(ltconfig ltcf-c.sh ltcf-cxx.sh
ltcf-gcj.sh);
my @common_files =
(qw(ABOUT-GNU ABOUT-NLS AUTHORS BACKLOG COPYING COPYING.DOC COPYING.LIB
COPYING.LESSER ChangeLog INSTALL NEWS README THANKS TODO
- ansi2knr.1 ansi2knr.c ar-lib compile config.guess config.rpath
+ ar-lib compile config.guess config.rpath
config.sub depcomp elisp-comp install-sh libversion.in mdate-sh
missing mkinstalldirs py-compile texinfo.tex ylwrap),
@libtool_files, @libtool_sometimes);
@@ -568,12 +567,6 @@ my @dist_targets;
my %known_programs;
my %known_libraries;
-# Keys in this hash are the basenames of files which must depend on
-# ansi2knr. Values are either the empty string, or the directory in
-# which the ANSI source file appears; the directory must have a
-# trailing `/'.
-my %de_ansi_files;
-
# This keeps track of which extensions we've seen (that we care
# about).
my %extension_seen;
@@ -597,9 +590,9 @@ my %linkers_used;
# True if we need `LINK' defined. This is a hack.
my $need_link;
-# Was get_object_extension run?
-# FIXME: This is a hack. a better switch should be found.
-my $get_object_extension_was_run;
+# Does the generated Makefile have to build some compiled object
+# (for binary programs, or plain or libtool libraries)?
+my $must_handle_compiled_objects;
# Record each file processed by make_paragraphs.
my %transformed_files;
@@ -699,8 +692,6 @@ sub initialize_per_input ()
%known_programs = ();
%known_libraries= ();
- %de_ansi_files = ();
-
%extension_seen = ();
%language_scratch = ();
@@ -711,7 +702,7 @@ sub initialize_per_input ()
$need_link = 0;
- $get_object_extension_was_run = 0;
+ $must_handle_compiled_objects = 0;
%transformed_files = ();
}
@@ -725,7 +716,6 @@ sub initialize_per_input ()
register_language ('name' => 'c',
'Name' => 'C',
'config_vars' => ['CC'],
- 'ansi' => 1,
'autodep' => '',
'flags' => ['CFLAGS', 'CPPFLAGS'],
'ccer' => 'CC',
@@ -737,8 +727,7 @@ register_language ('name' => 'c',
'link' => '$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS)
$(LDFLAGS) -o $@',
'compile_flag' => '-c',
'libtool_tag' => 'CC',
- 'extensions' => ['.c'],
- '_finish' => \&lang_c_finish);
+ 'extensions' => ['.c']);
# C++.
register_language ('name' => 'cxx',
@@ -895,10 +884,7 @@ register_language ('name' => 'asm',
'compiler' => 'CCASCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
- 'extensions' => ['.s'],
-
- # With assembly we still use the C linker.
- '_finish' => \&lang_c_finish);
+ 'extensions' => ['.s']);
# Preprocessed Assembler.
register_language ('name' => 'cppasm',
@@ -912,10 +898,7 @@ register_language ('name' => 'cppasm',
'compiler' => 'CPPASCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
- 'extensions' => ['.S', '.sx'],
-
- # With assembly we still use the C linker.
- '_finish' => \&lang_c_finish);
+ 'extensions' => ['.S', '.sx']);
# Fortran 77
register_language ('name' => 'f77',
@@ -1284,22 +1267,6 @@ sub shadow_unconditionally ($$)
return "\$($varname)"
}
-# get_object_extension ($EXTENSION)
-# ---------------------------------
-# Prefix $EXTENSION with $U if ansi2knr is in use.
-sub get_object_extension ($)
-{
- my ($extension) = @_;
-
- # Check for automatic de-ANSI-fication.
- $extension = '$U' . $extension
- if option 'ansi2knr';
-
- $get_object_extension_was_run = 1;
-
- return $extension;
-}
-
# check_user_variables (@LIST)
# ----------------------------
# Make sure each variable VAR in @LIST does not exist, suggest using AM_VAR
@@ -1524,97 +1491,6 @@ sub handle_languages
unless $depbase eq '';
$depbase .= '$(DEPDIR)/' . basename ($obj);
- # Support for deansified files in subdirectories is ugly
- # enough to deserve an explanation.
- #
- # A Note about normal ansi2knr processing first. On
- #
- # AUTOMAKE_OPTIONS = ansi2knr
- # bin_PROGRAMS = foo
- # foo_SOURCES = foo.c
- #
- # we generate rules similar to:
- #
- # foo: foo$U.o; link ...
- # foo$U.o: foo$U.c; compile ...
- # foo_.c: foo.c; ansi2knr ...
- #
- # this is fairly compact, and will call ansi2knr depending
- # on the value of $U (`' or `_').
- #
- # It's harder with subdir sources. On
- #
- # AUTOMAKE_OPTIONS = ansi2knr
- # bin_PROGRAMS = foo
- # foo_SOURCES = sub/foo.c
- #
- # we have to create foo_.c in the current directory.
- # (Unless the user asks 'subdir-objects'.) This is important
- # in case the same file (`foo.c') is compiled from other
- # directories with different cpp options: foo_.c would
- # be preprocessed for only one set of options if it were
- # put in the subdirectory.
- #
- # Because foo$U.o must be built from either foo_.c or
- # sub/foo.c we can't be as concise as in the first example.
- # Instead we output
- #
- # foo: foo$U.o; link ...
- # foo_.o: foo_.c; compile ...
- # foo.o: sub/foo.c; compile ...
- # foo_.c: foo.c; ansi2knr ...
- #
- # This is why we'll now transform $rule_file twice
- # if we detect this case.
- # A first time we output the compile rule with `$U'
- # replaced by `_' and the source directory removed,
- # and another time we simply remove `$U'.
- #
- # Note that at this point $source (as computed by
- # &handle_single_transform) is `sub/foo$U.c'.
- # This can be confusing: it can be used as-is when
- # subdir-objects is set, otherwise you have to know
- # it really means `foo_.c' or `sub/foo.c'.
- my $objdir = dirname ($obj);
- my $srcdir = dirname ($source);
- if ($lang->ansi && $obj =~ /\$U/)
- {
- prog_error "`$obj' contains \$U, but `$source' doesn't"
- if $source !~ /\$U/;
-
- (my $source_ = $source) =~ s/\$U/_/g;
- # Output an additional rule if _.c and .c are not in
- # the same directory. (_.c is always in $objdir.)
- if ($objdir ne $srcdir)
- {
- (my $obj_ = $obj) =~ s/\$U/_/g;
- (my $depbase_ = $depbase) =~ s/\$U/_/g;
- $source_ = basename ($source_);
-
- $output_rules .=
- file_contents ($rule_file,
- new Automake::Location,
- %transform,
- GENERIC => 0,
-
- DEPBASE => $depbase_,
- BASE => $obj_,
- SOURCE => $source_,
- SOURCEFLAG => $sourceflags{$srcext} || '',
- OBJ => "$obj_$myext",
- OBJOBJ => "$obj_.obj",
- LTOBJ => "$obj_.lo",
-
- COMPILE => $obj_compile,
- LTCOMPILE => $obj_ltcompile,
- -o => $output_flag,
- %file_transform);
- $obj =~ s/\$U//g;
- $depbase =~ s/\$U//g;
- $source =~ s/\$U//g;
- }
- }
-
$output_rules .=
file_contents ($rule_file,
new Automake::Location,
@@ -1770,7 +1646,7 @@ sub check_libobjs_sources
# $VAR is the name of the variable that the source filenames come from
# $TOPPARENT is the name of the _SOURCES variable which is being processed
# $DERIVED is the name of resulting executable or library
-# $OBJ is the object extension (e.g., `$U.lo')
+# $OBJ is the object extension (e.g., `.lo')
# $FILE the source file to transform
# %TRANSFORM contains extras arguments to pass to file_contents
# when producing explicit rules
@@ -1781,8 +1657,6 @@ sub handle_single_transform ($$$$$%)
my ($var, $topparent, $derived, $obj, $_file, %transform) = @_;
my @files = ($_file);
my @result = ();
- my $nonansi_obj = $obj;
- $nonansi_obj =~ s/\$U//g;
# Turn sources into objects. We use a while loop like this
# because we might add to @files in the loop.
@@ -1829,7 +1703,7 @@ sub handle_single_transform ($$$$$%)
# language function.
my $aggregate = 'AM';
- $extension = &derive_suffix ($extension, $nonansi_obj);
+ $extension = &derive_suffix ($extension, $obj);
my $lang;
if ($extension_map{$extension} &&
($lang = $languages{$extension_map{$extension}}))
@@ -1840,7 +1714,7 @@ sub handle_single_transform ($$$$$%)
# Do we have per-executable flags for this executable?
my $have_per_exec_flags = 0;
my @peflags = @{$lang->flags};
- push @peflags, 'LIBTOOLFLAGS' if $nonansi_obj eq '.lo';
+ push @peflags, 'LIBTOOLFLAGS' if $obj eq '.lo';
foreach my $flag (@peflags)
{
if (set_seen ("${derived}_$flag"))
@@ -1860,7 +1734,7 @@ sub handle_single_transform ($$$$$%)
my $subr = \&{'lang_' . $lang->name . '_rewrite'};
my ($r, $source_extension)
= &$subr ($directory, $base, $extension,
- $nonansi_obj, $have_per_exec_flags, $var);
+ $obj, $have_per_exec_flags, $var);
# Skip this entry if we were asked not to process it.
next if $r == LANG_IGNORE;
@@ -1873,13 +1747,9 @@ sub handle_single_transform ($$$$$%)
$this_obj_ext = $source_extension;
$derived_source = 1;
}
- elsif ($lang->ansi)
- {
- $this_obj_ext = $obj;
- }
else
{
- $this_obj_ext = $nonansi_obj;
+ $this_obj_ext = $obj;
}
$object = $base . $this_obj_ext;
@@ -1968,12 +1838,6 @@ sub handle_single_transform ($$$$$%)
$full_ansi = $base . $extension;
}
- if ($lang->ansi && option 'ansi2knr')
- {
- $full_ansi =~ s/$KNOWN_EXTENSIONS_PATTERN$/\$U$&/;
- $obj_sans_ext .= '$U';
- }
-
my @specifics = ($full_ansi, $obj_sans_ext,
# Only use $this_obj_ext in the derived
# source case because in the other case we
@@ -2005,7 +1869,7 @@ sub handle_single_transform ($$$$$%)
address@hidden, %transform]);
}
}
- elsif ($extension eq $nonansi_obj)
+ elsif ($extension eq $obj)
{
# This is probably the result of a direct suffix rule.
# In this case we just accept the rewrite.
@@ -2523,8 +2387,7 @@ sub check_canonical_spelling
# Set up the compile suite.
sub handle_compile ()
{
- return
- unless $get_object_extension_was_run;
+ return if ! $must_handle_compiled_objects;
# Boilerplate.
my $default_includes = '';
@@ -2573,38 +2436,6 @@ sub handle_compile ()
'DISTRMS' => join ("\n", @dist_rms)));
$output_vars .= $vars;
$output_rules .= "$coms$rules";
-
- # Check for automatic de-ANSI-fication.
- if (option 'ansi2knr')
- {
- my ($ansi2knr_filename, $ansi2knr_where) = @{option 'ansi2knr'};
- my $ansi2knr_dir = '';
-
- require_variables ($ansi2knr_where, "option `ansi2knr' is used",
- TRUE, "ANSI2KNR", "U");
-
- # topdir is where ansi2knr should be.
- if ($ansi2knr_filename eq 'ansi2knr')
- {
- # Only require ansi2knr files if they should appear in
- # this directory.
- require_file ($ansi2knr_where, FOREIGN,
- 'ansi2knr.c', 'ansi2knr.1');
-
- # ansi2knr needs to be built before subdirs, so unshift it
- # rather then pushing it.
- unshift (@all, '$(ANSI2KNR)');
- }
- else
- {
- $ansi2knr_dir = dirname ($ansi2knr_filename);
- }
-
- $output_rules .= &file_contents ('ansi2knr',
- new Automake::Location,
- 'ANSI2KNR-DIR' => $ansi2knr_dir);
-
- }
}
# handle_libtool ()
@@ -2645,6 +2476,7 @@ sub handle_programs
'bin', 'sbin', 'libexec', 'pkglibexec',
'noinst', 'check');
return if ! @proglist;
+ $must_handle_compiled_objects = 1;
my $seen_global_libobjs =
var ('LDADD') && &handle_lib_objects ('', 'LDADD');
@@ -2654,7 +2486,7 @@ sub handle_programs
my ($where, $one_file) = @$pair;
my $seen_libobjs = 0;
- my $obj = get_object_extension '.$(OBJEXT)';
+ my $obj = '.$(OBJEXT)';
$known_programs{$one_file} = $where;
@@ -2735,6 +2567,7 @@ sub handle_libraries
my @liblist = &am_install_var ('libs', 'LIBRARIES',
'lib', 'pkglib', 'noinst', 'check');
return if ! @liblist;
+ $must_handle_compiled_objects = 1;
my @prefix = am_primary_prefixes ('LIBRARIES', 0, 'lib', 'pkglib',
'noinst', 'check');
@@ -2771,7 +2604,7 @@ sub handle_libraries
$where->push_context ("while processing library `$onelib'");
$where->set (INTERNAL->get);
- my $obj = get_object_extension '.$(OBJEXT)';
+ my $obj = '.$(OBJEXT)';
# Canonicalize names and check for misspellings.
my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES',
@@ -2840,6 +2673,7 @@ sub handle_ltlibraries
my @liblist = &am_install_var ('ltlib', 'LTLIBRARIES',
'noinst', 'lib', 'pkglib', 'check');
return if ! @liblist;
+ $must_handle_compiled_objects = 1;
my @prefix = am_primary_prefixes ('LTLIBRARIES', 0, 'lib', 'pkglib',
'noinst', 'check');
@@ -2936,7 +2770,7 @@ sub handle_ltlibraries
my ($where, $onelib) = @$pair;
my $seen_libobjs = 0;
- my $obj = get_object_extension '.lo';
+ my $obj = '.lo';
# Canonicalize names and check for misspellings.
my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS',
@@ -5768,13 +5602,7 @@ sub lang_sub_obj
# Rewrite a single C source file.
sub lang_c_rewrite
{
- my ($directory, $base, $ext, $nonansi_obj, $have_per_exec_flags, $var) = @_;
-
- if (option 'ansi2knr' && $base =~ /_$/)
- {
- # FIXME: include line number in error.
- err_am "C source file `$base.c' would be deleted by ansi2knr rules";
- }
+ my ($directory, $base, $ext, $obj, $have_per_exec_flags, $var) = @_;
my $r = LANG_PROCESS;
if (option 'subdir-objects')
@@ -5791,24 +5619,14 @@ sub lang_c_rewrite
. "`AM_PROG_CC_C_O' in `$configure_ac'",
uniq_scope => US_GLOBAL,
uniq_part => 'AM_PROG_CC_C_O subdir')
- unless $seen_cc_c_o || $nonansi_obj eq '.lo';
+ unless $seen_cc_c_o || $obj eq '.lo';
}
-
- # In this case we already have the directory information, so
- # don't add it again.
- $de_ansi_files{$base} = '';
- }
- else
- {
- $de_ansi_files{$base} = (($directory eq '.' || $directory eq '')
- ? ''
- : "$directory/");
}
if (! $seen_cc_c_o
&& $have_per_exec_flags
&& ! option 'subdir-objects'
- && $nonansi_obj ne '.lo')
+ && $obj ne '.lo')
{
msg_var ('portability',
$var, "compiling `$base.c' with per-target flags requires "
@@ -5947,59 +5765,6 @@ sub lang_java_rewrite
# language, etc. A finish function is only called if a source file of
# the appropriate type has been seen.
-sub lang_c_finish
-{
- # Push all libobjs files onto de_ansi_files. We actually only
- # push files which exist in the current directory, and which are
- # genuine source files.
- foreach my $file (keys %libsources)
- {
- if ($file =~ /^(.*)\.[cly]$/ && -f "$relative_dir/$file")
- {
- $de_ansi_files{$1} = ''
- }
- }
-
- if (option 'ansi2knr' && keys %de_ansi_files)
- {
- # Make all _.c files depend on their corresponding .c files.
- my @objects;
- foreach my $base (sort keys %de_ansi_files)
- {
- # Each _.c file must depend on ansi2knr; otherwise it
- # might be used in a parallel build before it is built.
- # We need to support files in the srcdir and in the build
- # dir (because these files might be auto-generated. But
- # we can't use $< -- some makes only define $< during a
- # suffix rule.
- my $ansfile = $de_ansi_files{$base} . $base . '.c';
- $output_rules .= ($base . "_.c: $ansfile \$(ANSI2KNR)\n\t"
- . '$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) '
- . '`if test -f $(srcdir)/' . $ansfile
- . '; then echo $(srcdir)/' . $ansfile
- . '; else echo ' . $ansfile . '; fi` '
- . "| sed 's/^# \\([0-9]\\)/#line \\1/' "
- . '| $(ANSI2KNR) > $@'
- # If ansi2knr fails then we shouldn't
- # create the _.c file
- . " || rm -f address@hidden");
- push (@objects, $base . '_.$(OBJEXT)');
- push (@objects, $base . '_.lo')
- if var ('LIBTOOL');
-
- # Explicitly clean the _.c files if they are in a
- # subdirectory. (In the current directory they get erased
- # by a `rm -f *_.c' rule.)
- $clean_files{$base . '_.c'} = MOSTLY_CLEAN
- if dirname ($base) ne '.';
- }
-
- # Make all _.o (and _.lo) files depend on ansi2knr.
- # Use a sneaky little hack to make it print nicely.
- &pretty_print_rule ('', '', @objects, ':', '$(ANSI2KNR)');
- }
-}
-
sub lang_vala_finish_target ($$)
{
my ($self, $name) = @_;
@@ -6309,8 +6074,6 @@ sub register_language (%)
my (%option) = @_;
# Set the defaults.
- $option{'ansi'} = 0
- unless defined $option{'ansi'};
$option{'autodep'} = 'no'
unless defined $option{'autodep'};
$option{'linker'} = ''
diff --git a/doc/automake.texi b/doc/automake.texi
index 09d1716..ec7d409 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -233,7 +233,6 @@ Building Programs and Libraries
* Java Support:: Compiling Java sources
* Vala Support:: Compiling Vala sources
* Support for Other Languages:: Compiling other languages
-* ANSI:: Automatic de-ANSI-fication (deprecated, soon
to be removed)
* Dependencies:: Automatic dependency tracking
* EXEEXT:: Support for executable extensions
@@ -2260,12 +2259,6 @@ source in case you need more recent versions.
This is a wrapper primarily for the Microsoft lib archiver, to make
it more POSIX-like.
address@hidden ansi2knr.c
address@hidden ansi2knr.1
-These two files are used for de-ANSI-fication support (they are
-deprecated now, and @emph{will be removed} in the next major Automake
-release; @pxref{ANSI}).
-
@item compile
This is a wrapper for compilers that do not accept options @option{-c}
and @option{-o} at the same time. It is only used when absolutely
@@ -3063,11 +3056,6 @@ this way, e.g., @code{AC_PATH_XTRA} defines
@code{X_CFLAGS} and
@code{$(X_CFLAGS)} and @code{$(X_LIBS)} in any @file{Makefile.am}
if @code{AC_PATH_XTRA} is called.
address@hidden AM_C_PROTOTYPES
-This is required when using the deprecated de-ANSI-fication feature;
address@hidden @emph{It will be removed} in the next major Automake
-release.
-
@item AM_CONDITIONAL
This introduces an Automake conditional (@pxref{Conditionals}).
@@ -4023,17 +4011,6 @@ automatically (@pxref{autoupdate Invocation, , Using
Autoconf Manual}).
@table @code
address@hidden AM_C_PROTOTYPES
address@hidden AM_C_PROTOTYPES
address@hidden ANSI2KNR
address@hidden U
-Check to see if function prototypes are understood by the compiler. If
-so, define @samp{PROTOTYPES} and set the output variables @code{U} and
address@hidden to the empty string. Otherwise, set @code{U} to
address@hidden and @code{ANSI2KNR} to @samp{./ansi2knr}. Automake used these
-values to implement the deprecated de-ANSI-fication feature; however,
-support for @emph{that feature will be removed} in the next major Automake
-release, and then @emph{these macros and variables will go away as well}.
@item AM_CONFIG_HEADER
@acindex AM_CONFIG_HEADER
@@ -4645,7 +4622,6 @@ to build programs and libraries.
* Java Support:: Compiling Java sources
* Vala Support:: Compiling Vala sources
* Support for Other Languages:: Compiling other languages
-* ANSI:: Automatic de-ANSI-fication (deprecated, soon
to be removed)
* Dependencies:: Automatic dependency tracking
* EXEEXT:: Support for executable extensions
@end menu
@@ -6824,85 +6800,6 @@ languages, support for which will be improved based on
user demand.
Some limited support for adding your own languages is available via the
suffix rule handling (@pxref{Suffixes}).
-
address@hidden ANSI
address@hidden Automatic de-ANSI-fication (deprecated, soon to be removed)
-
address@hidden de-ANSI-fication, defined
-
address@hidden features described in this section are deprecated; you must
-not use any of them in new code, and remove their use from older but
-still maintained code: they will be withdrawn in the next major
-Automake release.}
-
-When the C language was standardized in 1989, there was a long
-transition period where package developers needed to worry about
-porting to older systems that did not support ANSI C by default.
-These older systems are no longer in practical use and are no longer
-supported by their original suppliers, so developers need not worry
-about this problem any more.
-
-Automake allows you to write packages that are portable to K&R C by
address@hidden each source file before the actual compilation takes
-place.
-
address@hidden AUTOMAKE_OPTIONS
address@hidden ansi2knr
-
-If the @file{Makefile.am} variable @code{AUTOMAKE_OPTIONS}
-(@pxref{Options}) contains the option @option{ansi2knr} then code to
-handle de-ANSI-fication is inserted into the generated
address@hidden
-
-This causes each C source file in the directory to be treated as ANSI
address@hidden
-If an ANSI C compiler is available, it is used. If no ANSI C compiler
-is available, the @command{ansi2knr} program is used to convert the source
-files into K&R C, which is then compiled.
-
-The @command{ansi2knr} program is simple-minded. It assumes the source
-code will be formatted in a particular way; see the @command{ansi2knr} man
-page for details.
-
address@hidden AM_C_PROTOTYPES
-Support for the obsolete de-ANSI-fication feature
-requires the source files @file{ansi2knr.c}
-and @file{ansi2knr.1} to be in the same package as the ANSI C source;
-these files are distributed with Automake. Also, the package
address@hidden must call the macro @code{AM_C_PROTOTYPES}
-(@pxref{Macros}).
-
-Automake also handles finding the @command{ansi2knr} support files in some
-other directory in the current package. This is done by prepending the
-relative path to the appropriate directory to the @command{ansi2knr}
-option. For instance, suppose the package has ANSI C code in the
address@hidden and @file{lib} subdirectories. The files @file{ansi2knr.c} and
address@hidden appear in @file{lib}. Then this could appear in
address@hidden/Makefile.am}:
-
address@hidden
-AUTOMAKE_OPTIONS = ../lib/ansi2knr
address@hidden example
-
-If no directory prefix is given, the files are assumed to be in the
-current directory.
-
-Note that automatic de-ANSI-fication will not work when the package is
-being built for a different host architecture. That is because
address@hidden currently has no way to build @command{ansi2knr}
-for the build machine.
-
address@hidden FIXME: this paragraph might be better moved to an `upgrading'
section.
address@hidden @code{LTLIBOBJS} and @code{ansi2knr}
address@hidden @code{LIBOBJS} and @code{ansi2knr}
address@hidden @code{ansi2knr} and @code{LTLIBOBJS}
address@hidden @code{ansi2knr} and @code{LIBOBJS}
-Using @code{LIBOBJS} with source de-ANSI-fication used to require
-hand-crafted code in @file{configure} to append @samp{$U} to basenames
-in @code{LIBOBJS}. This is no longer true today. Starting with version
-2.54, Autoconf takes care of rewriting @code{LIBOBJS} and
address@hidden (@pxref{AC_LIBOBJ vs LIBOBJS, , @code{AC_LIBOBJ}
-vs.@: @code{LIBOBJS}, autoconf, The Autoconf Manual})
-
@node Dependencies
@section Automatic dependency tracking
@@ -9258,20 +9155,6 @@ then @samp{portability} warnings will be @emph{disabled}
in
Set the strictness as appropriate. The @option{gnits} option also
implies options @option{readme-alpha} and @option{check-news}.
address@hidden @option{ansi2knr}
address@hidden @address@hidden/ansi2knr}
address@hidden Option, @option{ansi2knr}
address@hidden ansi2knr
-Turn on the deprecated de-ANSI-fication feature (@pxref{ANSI}). Note
-that that feature and this option @emph{will be removed} in the next
-major Automake release.
-
-If preceded by a
-path, the generated @file{Makefile.in} will look in the specified
-directory to find the @file{ansi2knr} program. The path should be a
-relative path to another directory in the same distribution (Automake
-does not check this).
-
@item @option{check-news}
@cindex Option, @option{check-news}
@opindex check-news
@@ -13501,7 +13384,7 @@ parentheses is the number of generated test cases.
@c LocalWords: xs emph FIXME ref vindex pkglibdir pkgincludedir pkgdatadir mt
@c LocalWords: pkg libdir cpio bindir sbindir rmt pax sbin zar zardir acindex
@c LocalWords: HTML htmldir html noinst TEXINFOS nodist nobase strudel CFLAGS
address@hidden LocalWords: libmumble CC YFLAGS ansi knr itemx de fication
config url comp
address@hidden LocalWords: libmumble CC YFLAGS itemx de fication config url
comp
@c LocalWords: depcomp elisp sh mdate mkinstalldirs mkdir py tex dvi ps pdf
@c LocalWords: ylwrap zardoz INIT gettext acinclude mv FUNCS LIBOBJS LDADD fr
@c LocalWords: uref featureful dnl src LINGUAS es ko nl pl sl sv PROG ISC doc
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index e8765fd..6836157 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -71,8 +71,7 @@ F<Makefile.am>s.
=cut
-# Values are the Automake::Location of the definition, except
-# for 'ansi2knr' whose value is a pair [filename, Location].
+# Values are the Automake::Location of the definition.
use vars '%_options'; # From AUTOMAKE_OPTIONS
use vars '%_global_options'; # from AM_INIT_AUTOMAKE or the command line.
@@ -269,14 +268,9 @@ sub _process_option_list (\%@)
}
elsif (/^(.*\/)?ansi2knr$/)
{
- # This feature is deprecated, will be removed in the next
- # Automake major release.
- msg 'obsolete', $where,
- "automatic de-ANSI-fication support is deprecated\n";
- # An option like "../lib/ansi2knr" is allowed. With no
- # path prefix, we assume the required programs are in this
- # directory. We save the actual option for later.
- $options->{'ansi2knr'} = [$_, $where];
+ # Obsolete (and now removed) de-ANSI-fication support.
+ error ($where,
+ "automatic de-ANSI-fication support has been removed");
}
elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo'
|| $_ eq 'dist-shar' || $_ eq 'dist-zip'
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index 24d8be0..cd57877 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -156,7 +156,6 @@ my %_gen_varname_n = ();
# Macros accessible via aclocal.
my %_am_macro_for_var =
(
- ANSI2KNR => 'AM_C_PROTOTYPES',
CCAS => 'AM_PROG_AS',
CCASFLAGS => 'AM_PROG_AS',
EMACS => 'AM_PATH_LISPDIR',
@@ -169,7 +168,6 @@ my %_am_macro_for_var =
pyexecdir => 'AM_PATH_PYTHON',
PYTHON => 'AM_PATH_PYTHON',
pythondir => 'AM_PATH_PYTHON',
- U => 'AM_C_PROTOTYPES',
);
# Macros shipped with Autoconf.
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 5bdc02e..f5e91c0 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -2,8 +2,8 @@
## Makefile for Automake lib.
-# Copyright (C) 2001, 2003, 2004, 2009, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001, 2003, 2004, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,8 +20,7 @@
SUBDIRS = Automake am
-dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
- config-ml.in
+dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex config-ml.in
## These must all be executable when installed. However, if we use
## _SCRIPTS, then the program transform will be applied, which is not
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 91e9bae..54de126 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -15,8 +15,8 @@
@SET_MAKE@
-# Copyright (C) 2001, 2003, 2004, 2009, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001, 2003, 2004, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -52,9 +52,9 @@ build_triplet = @build@
subdir = lib
DIST_COMMON = $(dist_pkgvdata_DATA) $(dist_script_DATA) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING INSTALL \
- ansi2knr.1 ansi2knr.c ar-lib compile config.guess config.sub \
- depcomp elisp-comp install-sh mdate-sh missing mkinstalldirs \
- py-compile texinfo.tex ylwrap
+ ar-lib compile config.guess config.sub depcomp elisp-comp \
+ install-sh mdate-sh missing mkinstalldirs py-compile \
+ texinfo.tex ylwrap
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
$(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \
@@ -236,9 +236,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = Automake am
-dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
- config-ml.in
-
+dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex config-ml.in
scriptdir = $(pkgvdatadir)
dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile \
diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am
index a255f70..037a4ae 100644
--- a/lib/am/Makefile.am
+++ b/lib/am/Makefile.am
@@ -3,7 +3,7 @@
## Makefile for Automake lib/am.
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004, 2008,
-# 2009 Free Software Foundation, Inc.
+# 2009, 2011 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@
amdir = $(pkgvdatadir)/am
dist_am_DATA = \
-ansi2knr.am \
check.am \
check2.am \
clean-hdr.am \
diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in
index 674d4bf..f31c27f 100644
--- a/lib/am/Makefile.in
+++ b/lib/am/Makefile.in
@@ -16,7 +16,7 @@
@SET_MAKE@
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004, 2008,
-# 2009 Free Software Foundation, Inc.
+# 2009, 2011 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -194,7 +194,6 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
amdir = $(pkgvdatadir)/am
dist_am_DATA = \
-ansi2knr.am \
check.am \
check2.am \
clean-hdr.am \
diff --git a/lib/am/ansi2knr.am b/lib/am/ansi2knr.am
deleted file mode 100644
index c4e1990..0000000
--- a/lib/am/ansi2knr.am
+++ /dev/null
@@ -1,77 +0,0 @@
-## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 2001, 2003, 2008, 2009
-## Free Software Foundation, Inc.
-
-## This program is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2, or (at your option)
-## any later version.
-
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-
-## You should have received a copy of the GNU General Public License
-## along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-## %ANSI2KNR-DIR% is the directory where ansi2knr is, `' if
-## is the current directory.
-
-
-## ---------- ##
-## ansi2knr. ##
-## ---------- ##
-
-if %?ANSI2KNR-DIR%
-
-ANSI2KNR = %ANSI2KNR-DIR%/ansi2knr
-%ANSI2KNR-DIR%/ansi2knr:
- $(am__cd) %ANSI2KNR-DIR% && $(MAKE) $(AM_MAKEFLAGS) ./ansi2knr
-.MAKE: %ANSI2KNR-DIR%/ansi2knr
-
-else !%?ANSI2KNR-DIR%
-
-## Substitution from AM_C_PROTOTYPES. This makes it be built only when
-## necessary.
-ANSI2KNR = @ANSI2KNR@
-./ansi2knr: ansi2knr.$(OBJEXT)
- $(LINK) ansi2knr.$(OBJEXT) $(LIBS)
-ansi2knr.$(OBJEXT): $(CONFIG_HEADER)
-
-endif !%?ANSI2KNR-DIR%
-
-
-## ------------------- ##
-## Cleaning ansi2knr. ##
-## ------------------- ##
-
-
-if !%?ANSI2KNR-DIR%
-.PHONY: clean-krextra
-
-clean-am: clean-krextra
-clean-krextra:
-## Why `clean' and not somewhere else? Not `mostlyclean' because
-## people usually don't want to recompile this file. And not
-## `distclean' because of our informal rule: if `make' built it, then
-## `clean' should delete it; if `configure' built it, then `distclean'
-## should remove it (and if the maintainer built it, then
-## maintainer-clean should remove it).
- -rm -f ansi2knr
-endif !%?ANSI2KNR-DIR%
-
-
-
-## --------------------------------- ##
-## Cleaning the output of ansi2knr. ##
-## --------------------------------- ##
-
-.PHONY: mostlyclean-kr
-
-mostlyclean-am: mostlyclean-kr
-mostlyclean-kr:
-## Only delete *_.c when ansi2knr is actually in use, so as to avoid
-## deleting sources that happen to end in "_" after being truncated on a DOS
-## 8.3 filesystem with srcdir==builddir.
- -test "$U" = "" || rm -f *_.c
diff --git a/lib/ansi2knr.1 b/lib/ansi2knr.1
deleted file mode 100644
index f9ee5a6..0000000
--- a/lib/ansi2knr.1
+++ /dev/null
@@ -1,36 +0,0 @@
-.TH ANSI2KNR 1 "19 Jan 1996"
-.SH NAME
-ansi2knr \- convert ANSI C to Kernighan & Ritchie C
-.SH SYNOPSIS
-.I ansi2knr
-[--varargs] input_file [output_file]
-.SH DESCRIPTION
-If no output_file is supplied, output goes to stdout.
-.br
-There are no error messages.
-.sp
-.I ansi2knr
-recognizes function definitions by seeing a non-keyword identifier at the left
-margin, followed by a left parenthesis, with a right parenthesis as the last
-character on the line, and with a left brace as the first token on the
-following line (ignoring possible intervening comments). It will recognize a
-multi-line header provided that no intervening line ends with a left or right
-brace or a semicolon. These algorithms ignore whitespace and comments, except
-that the function name must be the first thing on the line.
-.sp
-The following constructs will confuse it:
-.br
- - Any other construct that starts at the left margin and follows the
-above syntax (such as a macro or function call).
-.br
- - Some macros that tinker with the syntax of the function header.
-.sp
-The --varargs switch is obsolete, and is recognized only for
-backwards compatibility. The present version of
-.I ansi2knr
-will always attempt to convert a ... argument to va_alist and va_dcl.
-.SH AUTHOR
-L. Peter Deutsch <address@hidden> wrote the original ansi2knr and
-continues to maintain the current version; most of the code in the current
-version is his work. ansi2knr also includes contributions by Francois
-Pinard <address@hidden> and Jim Avera <address@hidden>.
diff --git a/lib/ansi2knr.c b/lib/ansi2knr.c
deleted file mode 100644
index e84c210..0000000
--- a/lib/ansi2knr.c
+++ /dev/null
@@ -1,739 +0,0 @@
-/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. */
-
-/*$Id: ansi2knr.c,v 1.14 2003/09/06 05:36:56 eggert Exp $*/
-/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
-
-/*
-ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY. No author or distributor accepts responsibility to anyone for the
-consequences of using it or for whether it serves any particular purpose or
-works at all, unless he says so in writing. Refer to the GNU General Public
-License (the "GPL") for full details.
-
-Everyone is granted permission to copy, modify and redistribute ansi2knr,
-but only under the conditions described in the GPL. A copy of this license
-is supposed to have been given to you along with ansi2knr so you can know
-your rights and responsibilities. It should be in a file named COPYLEFT,
-or, if there is no file named COPYLEFT, a file named COPYING. Among other
-things, the copyright notice and this notice must be preserved on all
-copies.
-
-We explicitly state here what we believe is already implied by the GPL: if
-the ansi2knr program is distributed as a separate set of sources and a
-separate executable file which are aggregated on a storage medium together
-with another program, this in itself does not bring the other program under
-the GPL, nor does the mere fact that such a program or the procedures for
-constructing it invoke the ansi2knr executable bring any other part of the
-program under the GPL.
-*/
-
-/*
- * Usage:
- ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]
- * --filename provides the file name for the #line directive in the output,
- * overriding input_file (if present).
- * If no input_file is supplied, input is read from stdin.
- * If no output_file is supplied, output goes to stdout.
- * There are no error messages.
- *
- * ansi2knr recognizes function definitions by seeing a non-keyword
- * identifier at the left margin, followed by a left parenthesis, with a
- * right parenthesis as the last character on the line, and with a left
- * brace as the first token on the following line (ignoring possible
- * intervening comments and/or preprocessor directives), except that a line
- * consisting of only
- * identifier1(identifier2)
- * will not be considered a function definition unless identifier2 is
- * the word "void", and a line consisting of
- * identifier1(identifier2, <<arbitrary>>)
- * will not be considered a function definition.
- * ansi2knr will recognize a multi-line header provided that no intervening
- * line ends with a left or right brace or a semicolon. These algorithms
- * ignore whitespace, comments, and preprocessor directives, except that
- * the function name must be the first thing on the line. The following
- * constructs will confuse it:
- * - Any other construct that starts at the left margin and
- * follows the above syntax (such as a macro or function call).
- * - Some macros that tinker with the syntax of function headers.
- */
-
-/*
- * The original and principal author of ansi2knr is L. Peter Deutsch
- * <address@hidden>. Other authors are noted in the change history
- * that follows (in reverse chronological order):
-
- lpd 2000-04-12 backs out Eggert's changes because of bugs:
- - concatlits didn't declare the type of its bufend argument;
- - concatlits didn't recognize when it was inside a comment;
- - scanstring could scan backward past the beginning of the string; when
- - the check for \ + newline in scanstring was unnecessary.
-
- 2000-03-05 Paul Eggert <address@hidden>
-
- Add support for concatenated string literals.
- * ansi2knr.c (concatlits): New decl.
- (main): Invoke concatlits to concatenate string literals.
- (scanstring): Handle backslash-newline correctly. Work with
- character constants. Fix bug when scanning backwards through
- backslash-quote. Check for unterminated strings.
- (convert1): Parse character constants, too.
- (appendline, concatlits): New functions.
- * ansi2knr.1: Document this.
-
- lpd 1999-08-17 added code to allow preprocessor directives
- wherever comments are allowed
- lpd 1999-04-12 added minor fixes from Pavel Roskin
- <address@hidden> for clean compilation with
- gcc -W -Wall
- lpd 1999-03-22 added hack to recognize lines consisting of
- identifier1(identifier2, xxx) as *not* being procedures
- lpd 1999-02-03 made indentation of preprocessor commands consistent
- lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an
- endless loop; quoted strings within an argument list
- confused the parser
- lpd 1999-01-24 added a check for write errors on the output,
- suggested by Jim Meyering <address@hidden>
- lpd 1998-11-09 added further hack to recognize identifier(void)
- as being a procedure
- lpd 1998-10-23 added hack to recognize lines consisting of
- identifier1(identifier2) as *not* being procedures
- lpd 1997-12-08 made input_file optional; only closes input and/or
- output file if not stdin or stdout respectively; prints
- usage message on stderr rather than stdout; adds
- --filename switch (changes suggested by
- <address@hidden>)
- lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with
- compilers that don't understand void, as suggested by
- Tom Lane
- lpd 1996-01-15 changed to require that the first non-comment token
- on the line following a function header be a left brace,
- to reduce sensitivity to macros, as suggested by Tom Lane
- <address@hidden>
- lpd 1995-06-22 removed #ifndefs whose sole purpose was to define
- undefined preprocessor symbols as 0; changed all #ifdefs
- for configuration symbols to #ifs
- lpd 1995-04-05 changed copyright notice to make it clear that
- including ansi2knr in a program does not bring the entire
- program under the GPL
- lpd 1994-12-18 added conditionals for systems where ctype macros
- don't handle 8-bit characters properly, suggested by
- Francois Pinard <address@hidden>;
- removed --varargs switch (this is now the default)
- lpd 1994-10-10 removed CONFIG_BROKETS conditional
- lpd 1994-07-16 added some conditionals to help GNU `configure',
- suggested by Francois Pinard <address@hidden>;
- properly erase prototype args in function parameters,
- contributed by Jim Avera <address@hidden>;
- correct error in writeblanks (it shouldn't erase EOLs)
- lpd 1989-xx-xx original version
- */
-
-/* Most of the conditionals here are to make ansi2knr work with */
-/* or without the GNU configure machinery. */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-#include <ctype.h>
-
-#if HAVE_CONFIG_H
-
-/*
- For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h).
- This will define HAVE_CONFIG_H and so, activate the following lines.
- */
-
-# if STDC_HEADERS || HAVE_STRING_H
-# include <string.h>
-# else
-# include <strings.h>
-# endif
-
-#else /* not HAVE_CONFIG_H */
-
-/* Otherwise do it the hard way */
-
-# ifdef BSD
-# include <strings.h>
-# else
-# ifdef VMS
- extern int strlen(), strncmp();
-# else
-# include <string.h>
-# endif
-# endif
-
-#endif /* not HAVE_CONFIG_H */
-
-#if STDC_HEADERS
-# include <stdlib.h>
-#else
-/*
- malloc and free should be declared in stdlib.h,
- but if you've got a K&R compiler, they probably aren't.
- */
-# ifdef MSDOS
-# include <malloc.h>
-# else
-# ifdef VMS
- extern char *malloc();
- extern void free();
-# else
- extern char *malloc();
- extern int free();
-# endif
-# endif
-
-#endif
-
-/* Define NULL (for *very* old compilers). */
-#ifndef NULL
-# define NULL (0)
-#endif
-
-/*
- * The ctype macros don't always handle 8-bit characters correctly.
- * Compensate for this here.
- */
-#ifdef isascii
-# undef HAVE_ISASCII /* just in case */
-# define HAVE_ISASCII 1
-#else
-#endif
-#if STDC_HEADERS || !HAVE_ISASCII
-# define is_ascii(c) 1
-#else
-# define is_ascii(c) isascii(c)
-#endif
-
-#define is_space(c) (is_ascii(c) && isspace(c))
-#define is_alpha(c) (is_ascii(c) && isalpha(c))
-#define is_alnum(c) (is_ascii(c) && isalnum(c))
-
-/* Scanning macros */
-#define isidchar(ch) (is_alnum(ch) || (ch) == '_')
-#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
-
-/* Forward references */
-char *ppdirforward();
-char *ppdirbackward();
-char *skipspace();
-char *scanstring();
-int writeblanks();
-int test1();
-int convert1();
-
-/* The main program */
-int
-main(argc, argv)
- int argc;
- char *argv[];
-{ FILE *in = stdin;
- FILE *out = stdout;
- char *filename = 0;
- char *program_name = argv[0];
- char *output_name = 0;
-#define bufsize 5000 /* arbitrary size */
- char *buf;
- char *line;
- char *more;
- char *usage =
- "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n";
- /*
- * In previous versions, ansi2knr recognized a --varargs switch.
- * If this switch was supplied, ansi2knr would attempt to convert
- * a ... argument to va_alist and va_dcl; if this switch was not
- * supplied, ansi2knr would simply drop any such arguments.
- * Now, ansi2knr always does this conversion, and we only
- * check for this switch for backward compatibility.
- */
- int convert_varargs = 1;
- int output_error;
-
- while ( argc > 1 && argv[1][0] == '-' ) {
- if ( !strcmp(argv[1], "--varargs") ) {
- convert_varargs = 1;
- argc--;
- argv++;
- continue;
- }
- if ( !strcmp(argv[1], "--filename") && argc > 2 ) {
- filename = argv[2];
- argc -= 2;
- argv += 2;
- continue;
- }
- fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name,
- argv[1]);
- fprintf(stderr, usage);
- exit(1);
- }
- switch ( argc )
- {
- default:
- fprintf(stderr, usage);
- exit(0);
- case 3:
- output_name = argv[2];
- out = fopen(output_name, "w");
- if ( out == NULL ) {
- fprintf(stderr, "%s: Cannot open output file %s\n",
- program_name, output_name);
- exit(1);
- }
- /* falls through */
- case 2:
- in = fopen(argv[1], "r");
- if ( in == NULL ) {
- fprintf(stderr, "%s: Cannot open input file %s\n",
- program_name, argv[1]);
- exit(1);
- }
- if ( filename == 0 )
- filename = argv[1];
- /* falls through */
- case 1:
- break;
- }
- if ( filename )
- fprintf(out, "#line 1 \"%s\"\n", filename);
- buf = malloc(bufsize);
- if ( buf == NULL )
- {
- fprintf(stderr, "Unable to allocate read buffer!\n");
- exit(1);
- }
- line = buf;
- while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
- {
-test: line += strlen(line);
- switch ( test1(buf) )
- {
- case 2: /* a function header */
- convert1(buf, out, 1, convert_varargs);
- break;
- case 1: /* a function */
- /* Check for a { at the start of the next line. */
- more = ++line;
-f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
- goto wl;
- if ( fgets(line, (unsigned)(buf + bufsize - line), in)
== NULL )
- goto wl;
- switch ( *skipspace(ppdirforward(more), 1) )
- {
- case '{':
- /* Definitely a function header. */
- convert1(buf, out, 0, convert_varargs);
- fputs(more, out);
- break;
- case 0:
- /* The next line was blank or a comment: */
- /* keep scanning for a non-comment. */
- line += strlen(line);
- goto f;
- default:
- /* buf isn't a function header, but */
- /* more might be. */
- fputs(buf, out);
- strcpy(buf, more);
- line = buf;
- goto test;
- }
- break;
- case -1: /* maybe the start of a function */
- if ( line != buf + (bufsize - 1) ) /* overflow check */
- continue;
- /* falls through */
- default: /* not a function */
-wl: fputs(buf, out);
- break;
- }
- line = buf;
- }
- if ( line != buf )
- fputs(buf, out);
- free(buf);
- if ( output_name ) {
- output_error = ferror(out);
- output_error |= fclose(out);
- } else { /* out == stdout */
- fflush(out);
- output_error = ferror(out);
- }
- if ( output_error ) {
- fprintf(stderr, "%s: error writing to %s\n", program_name,
- (output_name ? output_name : "stdout"));
- exit(1);
- }
- if ( in != stdin )
- fclose(in);
- return 0;
-}
-
-/*
- * Skip forward or backward over one or more preprocessor directives.
- */
-char *
-ppdirforward(p)
- char *p;
-{
- for (; *p == '#'; ++p) {
- for (; *p != '\r' && *p != '\n'; ++p)
- if (*p == 0)
- return p;
- if (*p == '\r' && p[1] == '\n')
- ++p;
- }
- return p;
-}
-char *
-ppdirbackward(p, limit)
- char *p;
- char *limit;
-{
- char *np = p;
-
- for (;; p = --np) {
- if (*np == '\n' && np[-1] == '\r')
- --np;
- for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np)
- if (np[-1] == 0)
- return np;
- if (*np != '#')
- return p;
- }
-}
-
-/*
- * Skip over whitespace, comments, and preprocessor directives,
- * in either direction.
- */
-char *
-skipspace(p, dir)
- char *p;
- int dir; /* 1 for forward, -1 for backward */
-{
- for ( ; ; ) {
- while ( is_space(*p) )
- p += dir;
- if ( !(*p == '/' && p[dir] == '*') )
- break;
- p += dir; p += dir;
- while ( !(*p == '*' && p[dir] == '/') ) {
- if ( *p == 0 )
- return p; /* multi-line comment?? */
- p += dir;
- }
- p += dir; p += dir;
- }
- return p;
-}
-
-/* Scan over a quoted string, in either direction. */
-char *
-scanstring(p, dir)
- char *p;
- int dir;
-{
- for (p += dir; ; p += dir)
- if (*p == '"' && p[-dir] != '\\')
- return p + dir;
-}
-
-/*
- * Write blanks over part of a string.
- * Don't overwrite end-of-line characters.
- */
-int
-writeblanks(start, end)
- char *start;
- char *end;
-{ char *p;
- for ( p = start; p < end; p++ )
- if ( *p != '\r' && *p != '\n' )
- *p = ' ';
- return 0;
-}
-
-/*
- * Test whether the string in buf is a function definition.
- * The string may contain and/or end with a newline.
- * Return as follows:
- * 0 - definitely not a function definition;
- * 1 - definitely a function definition;
- * 2 - definitely a function prototype (NOT USED);
- * -1 - may be the beginning of a function definition,
- * append another line and look again.
- * The reason we don't attempt to convert function prototypes is that
- * Ghostscript's declaration-generating macros look too much like
- * prototypes, and confuse the algorithms.
- */
-int
-test1(buf)
- char *buf;
-{ char *p = buf;
- char *bend;
- char *endfn;
- int contin;
-
- if ( !isidfirstchar(*p) )
- return 0; /* no name at left margin */
- bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1);
- switch ( *bend )
- {
- case ';': contin = 0 /*2*/; break;
- case ')': contin = 1; break;
- case '{': return 0; /* not a function */
- case '}': return 0; /* not a function */
- default: contin = -1;
- }
- while ( isidchar(*p) )
- p++;
- endfn = p;
- p = skipspace(p, 1);
- if ( *p++ != '(' )
- return 0; /* not a function */
- p = skipspace(p, 1);
- if ( *p == ')' )
- return 0; /* no parameters */
- /* Check that the apparent function name isn't a keyword. */
- /* We only need to check for keywords that could be followed */
- /* by a left parenthesis (which, unfortunately, is most of them). */
- { static char *words[] =
- { "asm", "auto", "case", "char", "const", "double",
- "extern", "float", "for", "if", "int", "long",
- "register", "return", "short", "signed", "sizeof",
- "static", "switch", "typedef", "unsigned",
- "void", "volatile", "while", 0
- };
- char **key = words;
- char *kp;
- unsigned len = endfn - buf;
-
- while ( (kp = *key) != 0 )
- { if ( strlen(kp) == len && !strncmp(kp, buf, len) )
- return 0; /* name is a keyword */
- key++;
- }
- }
- {
- char *id = p;
- int len;
- /*
- * Check for identifier1(identifier2) and not
- * identifier1(void), or identifier1(identifier2, xxxx).
- */
-
- while ( isidchar(*p) )
- p++;
- len = p - id;
- p = skipspace(p, 1);
- if (*p == ',' ||
- (*p == ')' && (len != 4 || strncmp(id, "void", 4)))
- )
- return 0; /* not a function */
- }
- /*
- * If the last significant character was a ), we need to count
- * parentheses, because it might be part of a formal parameter
- * that is a procedure.
- */
- if (contin > 0) {
- int level = 0;
-
- for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1))
- level += (*p == '(' ? 1 : *p == ')' ? -1 : 0);
- if (level > 0)
- contin = -1;
- }
- return contin;
-}
-
-/* Convert a recognized function definition or header to K&R syntax. */
-int
-convert1(buf, out, header, convert_varargs)
- char *buf;
- FILE *out;
- int header; /* Boolean */
- int convert_varargs; /* Boolean */
-{ char *endfn;
- char *p;
- /*
- * The breaks table contains pointers to the beginning and end
- * of each argument.
- */
- char **breaks;
- unsigned num_breaks = 2; /* for testing */
- char **btop;
- char **bp;
- char **ap;
- char *vararg = 0;
-
- /* Pre-ANSI implementations don't agree on whether strchr */
- /* is called strchr or index, so we open-code it here. */
- for ( endfn = buf; *(endfn++) != '('; )
- ;
-top: p = endfn;
- breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
- if ( breaks == NULL )
- { /* Couldn't allocate break table, give up */
- fprintf(stderr, "Unable to allocate break table!\n");
- fputs(buf, out);
- return -1;
- }
- btop = breaks + num_breaks * 2 - 2;
- bp = breaks;
- /* Parse the argument list */
- do
- { int level = 0;
- char *lp = NULL;
- char *rp = NULL;
- char *end = NULL;
-
- if ( bp >= btop )
- { /* Filled up break table. */
- /* Allocate a bigger one and start over. */
- free((char *)breaks);
- num_breaks <<= 1;
- goto top;
- }
- *bp++ = p;
- /* Find the end of the argument */
- for ( ; end == NULL; p++ )
- { switch(*p)
- {
- case ',':
- if ( !level ) end = p;
- break;
- case '(':
- if ( !level ) lp = p;
- level++;
- break;
- case ')':
- if ( --level < 0 ) end = p;
- else rp = p;
- break;
- case '/':
- if (p[1] == '*')
- p = skipspace(p, 1) - 1;
- break;
- case '"':
- p = scanstring(p, 1) - 1;
- break;
- default:
- ;
- }
- }
- /* Erase any embedded prototype parameters. */
- if ( lp && rp )
- writeblanks(lp + 1, rp);
- p--; /* back up over terminator */
- /* Find the name being declared. */
- /* This is complicated because of procedure and */
- /* array modifiers. */
- for ( ; ; )
- { p = skipspace(p - 1, -1);
- switch ( *p )
- {
- case ']': /* skip array dimension(s) */
- case ')': /* skip procedure args OR name */
- { int level = 1;
- while ( level )
- switch ( *--p )
- {
- case ']': case ')':
- level++;
- break;
- case '[': case '(':
- level--;
- break;
- case '/':
- if (p > buf && p[-1] == '*')
- p = skipspace(p, -1) + 1;
- break;
- case '"':
- p = scanstring(p, -1) + 1;
- break;
- default: ;
- }
- }
- if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
- { /* We found the name being declared */
- while ( !isidfirstchar(*p) )
- p = skipspace(p, 1) + 1;
- goto found;
- }
- break;
- default:
- goto found;
- }
- }
-found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
- { if ( convert_varargs )
- { *bp++ = "va_alist";
- vararg = p-2;
- }
- else
- { p++;
- if ( bp == breaks + 1 ) /* sole argument */
- writeblanks(breaks[0], p);
- else
- writeblanks(bp[-1] - 1, p);
- bp--;
- }
- }
- else
- { while ( isidchar(*p) ) p--;
- *bp++ = p+1;
- }
- p = end;
- }
- while ( *p++ == ',' );
- *bp = p;
- /* Make a special check for 'void' arglist */
- if ( bp == breaks+2 )
- { p = skipspace(breaks[0], 1);
- if ( !strncmp(p, "void", 4) )
- { p = skipspace(p+4, 1);
- if ( p == breaks[2] - 1 )
- { bp = breaks; /* yup, pretend arglist is
empty */
- writeblanks(breaks[0], p + 1);
- }
- }
- }
- /* Put out the function name and left parenthesis. */
- p = buf;
- while ( p != endfn ) putc(*p, out), p++;
- /* Put out the declaration. */
- if ( header )
- { fputs(");", out);
- for ( p = breaks[0]; *p; p++ )
- if ( *p == '\r' || *p == '\n' )
- putc(*p, out);
- }
- else
- { for ( ap = breaks+1; ap < bp; ap += 2 )
- { p = *ap;
- while ( isidchar(*p) )
- putc(*p, out), p++;
- if ( ap < bp - 1 )
- fputs(", ", out);
- }
- fputs(") ", out);
- /* Put out the argument declarations */
- for ( ap = breaks+2; ap <= bp; ap += 2 )
- (*ap)[-1] = ';';
- if ( vararg != 0 )
- { *vararg = 0;
- fputs(breaks[0], out); /* any prior args */
- fputs("va_dcl", out); /* the final arg */
- fputs(bp[0], out);
- }
- else
- fputs(breaks[0], out);
- }
- free((char *)breaks);
- return 0;
-}
diff --git a/m4/depout.m4 b/m4/depout.m4
index 80a3926..3e046cd 100644
--- a/m4/depout.m4
+++ b/m4/depout.m4
@@ -44,15 +44,13 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
diff --git a/m4/protos.m4 b/m4/protos.m4
index f710293..32a5616 100644
--- a/m4/protos.m4
+++ b/m4/protos.m4
@@ -1,31 +1,16 @@
-## ------------------------------- ## -*- Autoconf -*-
-## Check for function prototypes. ##
-## From Franc,ois Pinard ##
-## ------------------------------- ##
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006
+# -*- Autoconf -*-
+# Obsolete (and now removed) automatic de-ANSI-fiction support.
+#
+# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006, 2011
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
+# serial 6
AC_DEFUN([AM_C_PROTOTYPES],
-[AC_REQUIRE([AC_C_PROTOTYPES])
-AC_DIAGNOSE([obsolete],
- [$0: automatic de-ANSI-fication support is deprecated])
-if test "$ac_cv_prog_cc_stdc" != no; then
- U= ANSI2KNR=
-else
- U=_ ANSI2KNR=./ansi2knr
-fi
-# Ensure some checks needed by ansi2knr itself.
-AC_REQUIRE([AC_HEADER_STDC])
-AC_CHECK_HEADERS([string.h])
-AC_SUBST([U])dnl
-AC_SUBST([ANSI2KNR])dnl
-_AM_SUBST_NOTMAKE([ANSI2KNR])dnl
-])
+ [AC_FATAL([automatic de-ANSI-fication support has been removed])])
AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index de63c29..a2b7b16 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -154,18 +154,7 @@ amopt.test \
amopts-location.test \
amopts-variable-expansion.test \
amsubst.test \
-ansi2knr-deprecation.test \
-ansi.test \
-ansi2.test \
-ansi3.test \
-ansi3b.test \
-ansi4.test \
-ansi5.test \
-ansi6.test \
-ansi7.test \
-ansi8.test \
-ansi9.test \
-ansi10.test \
+ansi2knr-no-more.test \
ar-lib.test \
ar.test \
ar2.test \
@@ -355,7 +344,6 @@ cscope2.test \
cscope3.test \
cxx.test \
cxx2.test \
-cxxansi.test \
cxxcpp.test \
cxxlibobj.test \
cxxlink.test \
@@ -570,7 +558,6 @@ libobj3.test \
libobj4.test \
libobj5.test \
libobj7.test \
-libobj8.test \
libobj10.test \
libobj12.test \
libobj13.test \
@@ -670,6 +657,7 @@ mkinst3.test \
mmode.test \
mmodely.test \
multlib.test \
+no-extra-makefile-code.test \
no-outdir-option.test \
nobase.test \
nobase-libtool.test \
@@ -926,7 +914,6 @@ subcond2.test \
subcond3.test \
subobj.test \
subobj2.test \
-subobj3.test \
subobj4.test \
subobj5.test \
subobj6.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 976ed4f..9819306 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -427,18 +427,7 @@ amopt.test \
amopts-location.test \
amopts-variable-expansion.test \
amsubst.test \
-ansi2knr-deprecation.test \
-ansi.test \
-ansi2.test \
-ansi3.test \
-ansi3b.test \
-ansi4.test \
-ansi5.test \
-ansi6.test \
-ansi7.test \
-ansi8.test \
-ansi9.test \
-ansi10.test \
+ansi2knr-no-more.test \
ar-lib.test \
ar.test \
ar2.test \
@@ -628,7 +617,6 @@ cscope2.test \
cscope3.test \
cxx.test \
cxx2.test \
-cxxansi.test \
cxxcpp.test \
cxxlibobj.test \
cxxlink.test \
@@ -843,7 +831,6 @@ libobj3.test \
libobj4.test \
libobj5.test \
libobj7.test \
-libobj8.test \
libobj10.test \
libobj12.test \
libobj13.test \
@@ -943,6 +930,7 @@ mkinst3.test \
mmode.test \
mmodely.test \
multlib.test \
+no-extra-makefile-code.test \
no-outdir-option.test \
nobase.test \
nobase-libtool.test \
@@ -1199,7 +1187,6 @@ subcond2.test \
subcond3.test \
subobj.test \
subobj2.test \
-subobj3.test \
subobj4.test \
subobj5.test \
subobj6.test \
diff --git a/tests/ansi.test b/tests/ansi.test
deleted file mode 100755
index fa79a8c..0000000
--- a/tests/ansi.test
+++ /dev/null
@@ -1,51 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2010, 2011
-# Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Test for bug where ansi2knr.c is not included in distribution.
-# From François Pinard.
-
-. ./defs || Exit 1
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr
-.PHONY: test1 test2
-test1:
- echo ' $(DISTFILES) ' | grep ' ansi2knr\.c '
- echo ' $(DISTFILES) ' | grep ' ansi2knr\.1 '
-test2: distdir
- test -f $(distdir)/ansi2knr.c
- test -f $(distdir)/ansi2knr.1
-END
-
-cat >> configure.in << 'END'
-AM_C_PROTOTYPES
-AC_OUTPUT
-END
-
-: > ansi2knr.c
-: > ansi2knr.1
-
-$ACLOCAL
-$AUTOCONF -Wno-obsolete
-$AUTOMAKE -Wno-obsolete
-
-./configure
-
-$MAKE test1
-$MAKE test2
-
-:
diff --git a/tests/ansi10.test b/tests/ansi10.test
deleted file mode 100755
index 9334f09..0000000
--- a/tests/ansi10.test
+++ /dev/null
@@ -1,72 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002, 2006, 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Make sure ansi2knr works with $(LIBOBJS).
-
-required=gcc
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AC_PROG_CC_STDC
-AM_C_PROTOTYPES
-AC_PROG_RANLIB
-AC_LIBOBJ([hello])
-AC_CONFIG_FILES([dir/Makefile])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-SUBDIRS = dir
-END
-
-mkdir dir
-
-cat > dir/Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr
-noinst_LIBRARIES = liblib.a
-liblib_a_SOURCES =
-liblib_a_LIBADD = $(LIBOBJS)
-END
-
-cat > dir/hello.c << 'END'
-#include <stdio.h>
-
-int
-main (int argc, char **argv)
-{
- printf ("hello\n");
-}
-END
-
-$ACLOCAL
-$AUTOCONF -Wno-obsolete
-$AUTOMAKE -Wno-obsolete -a
-
-# Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
-test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
-
-./configure ac_cv_prog_cc_stdc=no
-$MAKE
-test -f dir/hello_.c
-$MAKE distclean
-test ! -f dir/hello_.c
-
-# Also run without forcing ansi2knr, so we make sure the
-# rules work with ANSI compilers.
-./configure
-$MAKE
-test ! -f dir/hello_.c
diff --git a/tests/ansi2.test b/tests/ansi2.test
deleted file mode 100755
index 72bc758..0000000
--- a/tests/ansi2.test
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996, 1997, 1998, 2001, 2002, 2010, 2011 Free Software
-# Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Test to make sure ansi2knr built at the right time.
-
-. ./defs || Exit 1
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr
-bin_PROGRAMS = joe
-END
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AM_C_PROTOTYPES
-END
-
-: > ansi2knr.c
-: > ansi2knr.1
-
-$ACLOCAL
-$AUTOMAKE -Wno-obsolete
-
-grep '^all[-a-z]*:.*ANSI2KNR' Makefile.in
diff --git a/tests/ansi2knr-deprecation.test b/tests/ansi2knr-deprecation.test
deleted file mode 100755
index 543d9c6..0000000
--- a/tests/ansi2knr-deprecation.test
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Check that the use of automatic de-ANSI-fication feature is deprecated.
-# That feature will be removed in the next major Automake release.
-
-. ./defs || Exit 1
-
-set -e
-
-warn_rx='automatic de-ANSI-fication.*deprecated'
-
-cat >> configure.in <<'END'
-AC_PROG_CC
-AM_C_PROTOTYPES
-END
-
-$ACLOCAL
-
-$AUTOCONF -Wall -Werror -Wno-obsolete
-$AUTOCONF -Wnone -Wobsolete -Werror 2>stderr && { cat stderr >&2; Exit 1; }
-cat stderr >&2
-grep "^configure\\.in:5:.* AM_C_PROTOTYPES:.*$warn_rx" stderr
-
-sed '/AM_C_PROTOTYPES/d' configure.in > config.stub
-diff configure.in config.stub && fatal_ "failed to edit configure.in"
-rm -f configure.in
-
-cat > Makefile.stub <<'END'
-ANSI2KNR = :
-U =
-END
-
-for opt in ansi2knr lib/ansi2knr; do
- # ansi2knr option in Makefile.am
- cp config.stub configure.in
- cp Makefile.stub Makefile.am
- echo "AUTOMAKE_OPTIONS = $opt" >> Makefile.am
- cat Makefile.am # For debugging.
- $AUTOMAKE -Wno-obsolete
- AUTOMAKE_fails
- grep "^Makefile\.am:3:.*$warn_rx" stderr
- AUTOMAKE_fails -Wnone -Wobsolete
- grep "^Makefile\.am:3:.*$warn_rx" stderr
- # ansi2knr option in configure.in
- cp Makefile.stub Makefile.am
- sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([$opt])|" config.stub > configure.in
- cat configure.in # For debugging.
- $AUTOMAKE -Wno-obsolete
- AUTOMAKE_fails
- grep "^configure\.in:2:.*$warn_rx" stderr
- AUTOMAKE_fails -Wnone -Wobsolete
- grep "^configure\.in:2:.*$warn_rx" stderr
-done
-
-:
diff --git a/tests/ansi2knr-no-more.test b/tests/ansi2knr-no-more.test
new file mode 100755
index 0000000..0d405fe
--- /dev/null
+++ b/tests/ansi2knr-no-more.test
@@ -0,0 +1,56 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check that any attempt to use the obsolete de-ANSI-fication support
+# is diagnosed.
+
+. ./defs || Exit 1
+
+warn_rx='automatic de-ANSI-fication.*removed'
+
+echo AC_PROG_CC >> configure.in
+$ACLOCAL
+mv aclocal.m4 aclocal.sav
+cp configure.in configure.sav
+
+echo AM_C_PROTOTYPES >> configure.in
+
+$ACLOCAL -Wnone 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep "^configure\\.in:5:.*$warn_rx" stderr
+
+cat aclocal.sav "$top_testsrcdir"/m4/protos.m4 > aclocal.m4
+$AUTOCONF -Wnone 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep "^configure\\.in:5:.*$warn_rx" stderr
+
+for opt in ansi2knr lib/ansi2knr; do
+ # ansi2knr option in Makefile.am
+ cp configure.sav configure.in
+ echo "AUTOMAKE_OPTIONS = $opt" > Makefile.am
+ rm -rf autom4te*.cache
+ AUTOMAKE_fails -Wnone
+ grep "^Makefile\.am:1:.*$warn_rx" stderr
+ # ansi2knr option in configure.in
+ echo > Makefile.am # `echo', not `:', for Solaris /bin/sh.
+ sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([$opt])|" configure.sav >configure.in
+ cat configure.in # For debugging.
+ rm -rf autom4te*.cache
+ AUTOMAKE_fails -Wnone
+ grep "^configure\.in:2:.*$warn_rx" stderr
+done
+
+:
diff --git a/tests/ansi3.test b/tests/ansi3.test
deleted file mode 100755
index 23d8194..0000000
--- a/tests/ansi3.test
+++ /dev/null
@@ -1,58 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998, 1999, 2001, 2002, 2003, 2010, 2011 Free Software
-# Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Actual test of ansi2knr functionality. Relies on existence
-# of working gcc.
-
-required=gcc
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AM_C_PROTOTYPES
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr no-dependencies
-bin_PROGRAMS = hello
-END
-
-cat > hello.c << 'END'
-#include <stdio.h>
-int
-main (int argc, char *argv[])
-{
- printf ("yeah, yeah\n");
- return 0;
-}
-END
-
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
-$ACLOCAL
-$AUTOCONF -Wno-obsolete
-$AUTOMAKE -Wno-obsolete -a 2>stderr || { cat stderr >&2; Exit 1; }
-cat stderr >&2
-grep 'Makefile.am:1:.*ansi2knr\.c' stderr
-CC='gcc' ./configure
-ANSI2KNR=./ansi2knr U=_ $MAKE -e
-./hello
diff --git a/tests/ansi3b.test b/tests/ansi3b.test
deleted file mode 100755
index 5b8f472..0000000
--- a/tests/ansi3b.test
+++ /dev/null
@@ -1,59 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998, 1999, 2001, 2002, 2003, 2010, 2011 Free Software
-# Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Actual test of ansi2knr functionality. Relies on existence
-# of working gcc. Same as ansi3.test, but with AUTOMAKE_OPTIONS
-# defined in configure.in.
-
-required=gcc
-. ./defs || Exit 1
-
-cat > configure.in << 'END'
-AC_INIT([hello], [0.24])
-AM_INIT_AUTOMAKE([ansi2knr no-dependencies])
-AC_PROG_CC
-AM_C_PROTOTYPES
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-END
-
-echo 'bin_PROGRAMS = hello' > Makefile.am
-
-cat > hello.c << 'END'
-#include <stdio.h>
-int
-main (int argc, char *argv[])
-{
- printf ("yeah, yeah\n");
- return 0;
-}
-END
-
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
-$ACLOCAL
-$AUTOCONF -Wno-obsolete
-$AUTOMAKE -Wno-obsolete -a 2>stderr || { cat stderr >&2; Exit 1; }
-cat stderr >&2
-grep 'configure.in:2:.*ansi2knr\.1' stderr
-CC='gcc' ./configure
-ANSI2KNR=./ansi2knr U=_ $MAKE -e
-./hello
diff --git a/tests/ansi4.test b/tests/ansi4.test
deleted file mode 100755
index 014c308..0000000
--- a/tests/ansi4.test
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2008, 2010, 2011 Free Software
-# Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Quoting regression. Test from Thomas Gagne.
-
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AM_C_PROTOTYPES
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr
-bin_PROGRAMS = hello
-hello_SOURCES = hello.c
-END
-
-: > ansi2knr.1
-: > ansi2knr.c
-: > hello.c
-
-$ACLOCAL
-$AUTOMAKE -Wno-obsolete
-
-$FGREP 'ansi2knr.$(' Makefile.in
diff --git a/tests/ansi5.test b/tests/ansi5.test
deleted file mode 100755
index c9c0d23..0000000
--- a/tests/ansi5.test
+++ /dev/null
@@ -1,89 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Test for ansi2knr in another directory.
-
-required=gcc
-. ./defs || Exit 1
-
-cat > configure.in << 'END'
-AC_INIT(one/joe.c)
-AM_INIT_AUTOMAKE(liver, 0.23)
-AC_PROG_CC
-AM_C_PROTOTYPES
-AC_OUTPUT(Makefile one/Makefile two/Makefile)
-END
-
-cat > Makefile.am << 'END'
-SUBDIRS = one two
-END
-
-mkdir one two
-
-cat > one/Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr
-bin_PROGRAMS = joe
-END
-
-cat > two/Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ../one/ansi2knr
-bin_PROGRAMS = maude
-END
-
-cat > one/joe.c << 'END'
-#include <stdio.h>
-int
-main (int argc, char *argv[])
-{
- printf ("joe\n");
- return 0;
-}
-END
-
-cat > two/maude.c << 'END'
-#include <stdio.h>
-int
-main (int argc, char *argv[])
-{
- printf ("maude\n");
- return 0;
-}
-END
-
-$ACLOCAL
-$AUTOCONF -Wno-obsolete
-$AUTOMAKE -Wno-obsolete -a
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-CC=gcc ./configure
-
-# This is ugly! If we set U at make time then the "wrong" file gets
-# included.
-find . -name '*.Po' -print \
-| while read file; do
- base="`echo $file | sed -e 's/\.Po//'`"
- mv $file ${base}_.Po
-done
-
-# So is this! If we set ANSI2KNR on the make command line then the
-# wrong value is passed to two's Makefile.
-mv one/Makefile one/Makefile.old
-sed -e 's,ANSI2KNR =,ANSI2KNR = ./ansi2knr,' < one/Makefile.old > one/Makefile
-
-U=_ $MAKE -e
-./one/joe
-./two/maude
diff --git a/tests/ansi6.test b/tests/ansi6.test
deleted file mode 100755
index 5b1eb0a..0000000
--- a/tests/ansi6.test
+++ /dev/null
@@ -1,83 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002, 2006, 2008, 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Check ansi2knr on a source file in subdirectory.
-# From Kevin Ryde.
-
-required=gcc
-. ./defs || Exit 1
-
-cat > configure.in << 'END'
-AC_INIT(ansi6, 1.0)
-AM_INIT_AUTOMAKE
-AC_PROG_CC
-AC_PROG_CC_STDC
-AM_C_PROTOTYPES
-AC_CONFIG_FILES(Makefile)
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr
-bin_PROGRAMS = hello
-hello_SOURCES = hello.c sub/dir.c
-END
-
-cat > hello.c << 'END'
-#include <stdio.h>
-
-extern int foo ();
-
-int
-main (int argc, char **argv)
-{
- printf ("%d\n", foo ());
-}
-END
-
-mkdir sub
-
-cat > sub/dir.c << 'END'
-int
-foo ()
-{
- return 23;
-}
-END
-
-$ACLOCAL
-$AUTOCONF -Wno-obsolete
-$AUTOMAKE -Wno-obsolete -a
-
-# Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
-test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
-
-./configure ac_cv_prog_cc_stdc=no
-$MAKE
-
-test -f hello_.c
-test -f dir_.c # Must be in current directory.
-test ! -f sub/dir_.c
-$MAKE distclean
-test ! -f hello_.c
-test ! -f dir_.c
-
-# Also run without forcing ansi2knr, so we make sure the
-# rules work with ANSI compilers.
-# Report from Andreas Schwab.
-
-./configure
-$MAKE
diff --git a/tests/ansi7.test b/tests/ansi7.test
deleted file mode 100755
index 966a860..0000000
--- a/tests/ansi7.test
+++ /dev/null
@@ -1,85 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002, 2008, 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Check ansi2knr on a source file in subdirectory.
-# ansi6.test is the same test without subdir-objects.
-# From Kevin Ryde.
-
-required=gcc
-. ./defs || Exit 1
-
-cat > configure.in << 'END'
-AC_INIT(ansi6, 1.0)
-AM_INIT_AUTOMAKE
-AC_PROG_CC
-AC_PROG_CC_STDC
-AM_PROG_CC_C_O
-AM_C_PROTOTYPES
-AC_CONFIG_FILES(Makefile)
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr subdir-objects
-bin_PROGRAMS = hello
-hello_SOURCES = hello.c sub/dir.c
-END
-
-cat > hello.c << 'END'
-#include <stdio.h>
-
-extern int foo ();
-
-int
-main (int argc, char **argv)
-{
- printf ("%d\n", foo ());
-}
-END
-
-mkdir sub
-
-cat > sub/dir.c << 'END'
-int
-foo ()
-{
- return 23;
-}
-END
-
-$ACLOCAL
-$AUTOCONF -Wno-obsolete
-$AUTOMAKE -Wno-obsolete -a
-
-# Sanity check: make sure it's ok to set ac_cv_prog_cc_stdc as we do.
-test `grep -c ac_cv_prog_cc_stdc configure` -gt 1
-
-./configure ac_cv_prog_cc_stdc=no
-$MAKE
-
-test -f hello_.c
-test -f sub/dir_.c # Must be in sub directory, unlike ansi6.test.
-test ! -f dir_.c
-$MAKE distclean
-test ! -f hello_.c
-test ! -f sub/dir_.c
-
-# Also run without forcing ansi2knr, so we make sure the
-# rules work with ANSI compilers.
-# Report from Andreas Schwab.
-
-./configure
-$MAKE
diff --git a/tests/ansi8.test b/tests/ansi8.test
deleted file mode 100755
index 815a9ae..0000000
--- a/tests/ansi8.test
+++ /dev/null
@@ -1,28 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Check that AM_C_PROTOTYPES is required by ansi2knr
-
-. ./defs || Exit 1
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr
-bin_PROGRAMS = hello
-END
-
-$ACLOCAL
-AUTOMAKE_fails -Wno-obsolete -a
-grep AM_C_PROTOTYPES stderr
diff --git a/tests/ansi9.test b/tests/ansi9.test
deleted file mode 100755
index d1a1a0d..0000000
--- a/tests/ansi9.test
+++ /dev/null
@@ -1,60 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Check that subdir sources, and file compiled using per-target flags
-# can still be deansified.
-# Report from Paul D. Smith.
-
-required=gcc
-. ./defs || Exit 1
-
-cat >>configure.in <<EOF
-AC_PROG_CC
-AM_PROG_CC_C_O
-AM_C_PROTOTYPES
-AC_OUTPUT
-EOF
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr subdir-objects
-noinst_PROGRAMS = loadavg sub/sub
-loadavg_SOURCES = loadavg.c
-loadavg_CFLAGS = -DTEST
-sub_sub_SOURCES = sub/sub.c
-END
-
-cat > loadavg.c << 'END'
-int
-main ()
-{
- return 0;
-}
-END
-
-mkdir sub
-cp loadavg.c sub/sub.c
-
-$ACLOCAL
-$AUTOCONF -Wno-obsolete
-$AUTOMAKE --add-missing -Wno-override -Wno-obsolete
-
-$FGREP 'loadavg-loadavg$U.o: loadavg$U.c' Makefile.in
-# The following rule should not exist, because the
-# default .o.c: inference rule is enough.
-$FGREP 'sub/sub$U.o: sub/sub$U.c' Makefile.in && Exit 1
-# Force ansi2knr's use, regardless of the compiler.
-./configure ac_cv_prog_cc_stdc=no
-$MAKE sub/sub_.c
diff --git a/tests/cxxansi.test b/tests/cxxansi.test
deleted file mode 100755
index 49b4a7e..0000000
--- a/tests/cxxansi.test
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2001, 2002, 2010, 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Test to make sure ansi2knr doesn't use `$U' for C++.
-# Report from Robert Boehne.
-
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CXX
-AM_C_PROTOTYPES
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr
-sbin_PROGRAMS = anonymous
-anonymous_SOURCES = doe.c jane.C
-END
-
-: > ansi2knr.c
-: > ansi2knr.1
-
-: > doe.C
-: > jane.C
-
-$ACLOCAL
-$AUTOMAKE -Wno-obsolete
-
-$FGREP 'jane$U' Makefile.in && Exit 1
-$FGREP 'doe$U' Makefile.in
-
-Exit 0
diff --git a/tests/depacl2.test b/tests/depacl2.test
index 86af8c1..a5c3be9 100755
--- a/tests/depacl2.test
+++ b/tests/depacl2.test
@@ -20,14 +20,9 @@
. ./defs || Exit 1
-cat >> configure.in << 'END'
-AM_C_PROTOTYPES
-FOO
-END
+echo 'AM_FOO' >> configure.in
+echo 'AC_DEFUN([AM_FOO], [AC_REQUIRE([AC_HEADER_STDC])])' > AM_FOO.m4
-cat > AM_C_PROTOTYPES.m4 << 'END'
-AC_DEFUN([AM_C_PROTOTYPES], [AC_REQUIRE([AC_HEADER_STDC])])
-END
-
-# Our --acdir overrides the one in $ACLOCAL.
$ACLOCAL -I .
+
+:
diff --git a/tests/libobj8.test b/tests/libobj8.test
deleted file mode 100755
index 0745f61..0000000
--- a/tests/libobj8.test
+++ /dev/null
@@ -1,51 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998, 2000, 2001, 2002, 2006, 2010, 2011 Free Software
-# Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Test to make sure `_.c' dependencies are generated for LIBOBJS
-# objects.
-
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_PROG_CC
-AC_PROG_CC_STDC
-AC_PROG_RANLIB
-AC_REPLACE_FUNCS(basename dirname strsignal)
-AM_C_PROTOTYPES
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr
-noinst_LIBRARIES = libtu.a
-libtu_a_SOURCES =
-libtu_a_LIBADD = @LIBOBJS@
-END
-
-: > basename.c
-: > dirname.c
-: > strsignal.c
-
-: > ansi2knr.1
-: > ansi2knr.c
-
-$ACLOCAL
-$AUTOMAKE -Wno-obsolete
-
-$FGREP 'strsignal_.c:' Makefile.in
-
-:
diff --git a/tests/acoutbs.test b/tests/no-extra-makefile-code.test
similarity index 63%
copy from tests/acoutbs.test
copy to tests/no-extra-makefile-code.test
index 232267d..73d5458 100755
--- a/tests/acoutbs.test
+++ b/tests/no-extra-makefile-code.test
@@ -15,28 +15,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test for bug reported by François Pinard.
-# If \ is in AC_OUTPUT, automake barfs.
+# Check that we don't emit harmless but useless code in the generated
+# Makefile.in when the project does not use compiled languages. Motivated
+# by a regression caused by removal of automatic de-ANSI-fication support:
+# <http://lists.gnu.org/archive/html/automake-patches/2011-08/msg00200.html>
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile \
-zot)
-END
+echo AC_OUTPUT >> configure.in
: > Makefile.am
-: > zot.in
+
+rm -f depcomp compile
$ACLOCAL
-$AUTOCONF
$AUTOMAKE
-./configure
-
-test -f zot || Exit 1
-ls -a | grep '\\' && Exit 1
+$EGREP 'DEFAULT_INCLUDES|@am__isrc@|-compile|\$\(OBJEXT\)|tab\.[ch]' \
+ Makefile.in && Exit 1
:
diff --git a/tests/subobj3.test b/tests/subobj3.test
deleted file mode 100755
index 5ba999c..0000000
--- a/tests/subobj3.test
+++ /dev/null
@@ -1,66 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2010, 2011
-# Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Test of subdir objects with C++.
-
-required=gcc
-. ./defs || Exit 1
-
-cat > configure.in << END
-AC_INIT([$me], [1.0])
-dnl Prevent automake from looking in .. and ../..
-AC_CONFIG_AUX_DIR([.])
-AM_INIT_AUTOMAKE
-AC_PROG_CC
-AC_PROG_CC_STDC
-AM_PROG_CC_C_O
-AM_C_PROTOTYPES
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects
-bin_PROGRAMS = hello
-hello_SOURCES = sub/hello.c
-END
-
-mkdir sub
-cat > sub/hello.c << 'END'
-#include <stdio.h>
-int
-main (int argc, char *argv[])
-{
- printf ("yeah, yeah\n");
- return 0;
-}
-END
-
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
-
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-./configure
-ANSI2KNR=./ansi2knr U=_ $MAKE -e
-./hello
-
-:
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-952-gf1652f6,
Stefano Lattarini <=