From 4b3ff93c358f4ab201eb361a309c845617de3e1b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 23 Mar 1998 18:00:22 +0000 Subject: [PATCH] ansi2knr fix from jim meyering --- ChangeLog | 4 ++++ automake.in | 13 +++++++++++++ tests/ChangeLog | 4 ++++ tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- tests/libobj8.test | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 59 insertions(+), 2 deletions(-) create mode 100755 tests/libobj8.test diff --git a/ChangeLog b/ChangeLog index db5a4c2b0..8bc308945 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ Mon Mar 23 07:55:04 1998 Tom Tromey + * automake.in (handle_yacc_lex_cxx): Push lib sources onto + de_ansi_files before generating ._c dependencies. Test + libobj8.test. + * m4/mktime.m4: New version from Jim Meyering. * aclocal.in (usage): Document --print-ac-dir. diff --git a/automake.in b/automake.in index aec2b2f06..2b49d4729 100755 --- a/automake.in +++ b/automake.in @@ -983,6 +983,19 @@ sub handle_yacc_lex_cxx # # Handle some ansi2knr cleanup. # + + # 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. This is moderately lame. FIXME. + local ($file); + foreach $file (keys %libsources) + { + if ($file =~ /^(.*)\.[cly]$/ && -f "$relative_dir/$file") + { + $de_ansi_files{$1} = 1; + } + } + if (defined $options{'ansi2knr'} && keys %de_ansi_files) { # Make all _.c files depend on their corresponding .c files. diff --git a/tests/ChangeLog b/tests/ChangeLog index bec14b6a4..846304e7d 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +Mon Mar 23 10:52:36 1998 Tom Tromey + + * libobj8.test: New file. + Fri Mar 20 00:32:16 1998 Tom Tromey * lex2.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index 9fb4766fd..e5f602204 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,7 +30,7 @@ install.test libobj7.test objc.test cond3.test cxxcpp.test \ aclocal.test alpha.test whoami.test unused.test condman.test \ texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test \ java.test sinclude.test javaprim.test javasubst.test aclocalii.test \ -lex2.test +lex2.test libobj8.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index dd1732495..9b7d61d58 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -93,7 +93,7 @@ install.test libobj7.test objc.test cond3.test cxxcpp.test \ aclocal.test alpha.test whoami.test unused.test condman.test \ texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test \ java.test sinclude.test javaprim.test javasubst.test aclocalii.test \ -lex2.test +lex2.test libobj8.test EXTRA_DIST = defs $(TESTS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/tests/libobj8.test b/tests/libobj8.test new file mode 100755 index 000000000..a4b40907b --- /dev/null +++ b/tests/libobj8.test @@ -0,0 +1,36 @@ +#! /bin/sh + +# Test to make sure `_.c' dependencies are generated for LIBOBJS +# objects. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_RANLIB +AC_REPLACE_FUNCS(basename dirname strsignal) +AM_C_PROTOTYPES +AC_OUTPUT(Makefile) +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 + +$AUTOMAKE || exit 1 + +grep 'strsignal_.c:' Makefile.in -- 2.47.2