automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: fix for ansi2knr and LIBOBJS


From: Alexandre Duret-Lutz
Subject: FYI: fix for ansi2knr and LIBOBJS
Date: Sun, 01 Dec 2002 19:14:22 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/20.7 (i386-debian-linux-gnu)

I'm checking this in on HEAD and branch-1-7.  This fixes a bug
that affects any package using LIBOBJS and ansi2knr.

For instance Coreutils 4.5.1's lib/Makefile.in contains

chown_.c: lib/chown.c $(ANSI2KNR)
        $(CPP) ... | $(ANSI2KNR) ...

instead of

chown_.c: chown.c $(ANSI2KNR)
        $(CPP) ... | $(ANSI2KNR) ...

(Jim, I'm surprised you haven't got any report about this.  There
are many occurences of such bogus rules, even in src/.)

2002-12-01  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (lang_c_finish): Do not fill de_ansi_files
        with subdirectory informations for %libsources files.
        This revers part of a change from 2002-01-13.
        * tests/ansi10.test: New file.
        * tests/Makefile.am (TESTS): Add ansi10.test.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.198.2.6
diff -u -r1.198.2.6 NEWS
--- NEWS        30 Nov 2002 20:41:38 -0000      1.198.2.6
+++ NEWS        1 Dec 2002 17:51:50 -0000
@@ -1,4 +1,5 @@
 Bugs fixed in 1.7.1a:
+* Fix ansi2knr rules for LIBOBJS sources.
 * Clean all known Texinfo index files, not only those which appear to
   be used, because we cannot know wich indexes are used in included files.
   (PR/375, Debian Bug #168671)
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1365.2.19
diff -u -r1.1365.2.19 automake.in
--- automake.in 1 Dec 2002 17:05:24 -0000       1.1365.2.19
+++ automake.in 1 Dec 2002 17:52:18 -0000
@@ -5604,9 +5604,7 @@
     {
        if ($file =~ /^(.*)\.[cly]$/ && -f "$relative_dir/$file")
        {
-           $de_ansi_files{$1} = (($relative_dir eq '.' || $relative_dir eq '')
-                                 ? ''
-                                 : "$relative_dir/");
+           $de_ansi_files{$1} = ''
        }
     }
 
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.443.2.10
diff -u -r1.443.2.10 Makefile.am
--- tests/Makefile.am   30 Nov 2002 19:45:57 -0000      1.443.2.10
+++ tests/Makefile.am   1 Dec 2002 17:52:18 -0000
@@ -31,6 +31,7 @@
 ansi7.test \
 ansi8.test \
 ansi9.test \
+ansi10.test \
 ar.test \
 asm.test \
 autoheader.test \
Index: tests/ansi10.test
===================================================================
RCS file: tests/ansi10.test
diff -N tests/ansi10.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/ansi10.test   1 Dec 2002 17:52:19 -0000
@@ -0,0 +1,74 @@
+#! /bin/sh
+# Copyright (C) 2002  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 autoconf; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure ansi2knr works with $(LIBOBJS).
+
+required=gcc
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+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
+$AUTOMAKE -a
+
+./configure am_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

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]