automake-patches
[Top][All Lists]
Advanced

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

Patch: FYI: Follow-on fix for PR 288


From: Tom Tromey
Subject: Patch: FYI: Follow-on fix for PR 288
Date: 18 Jan 2002 15:33:17 -0700

I'm checking this in.

This fixes a lurking bug that is associated with PR 288.
Basically, we had problems with subdir-objects and de-ansi-fication.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>
        For PR automake/288:
        * automake.in (lang_c_rewrite): Don't prepend directory to base if
        directory is `.'.  Also, properly compute de_ansi_files entry in
        subdir-objects case
        * tests/Makefile.am (TESTS): Added ansi7.test.
        * tests/ansi7.test: New file.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1267
diff -u -r1.1267 automake.in
--- automake.in 2002/01/18 21:50:40 1.1267
+++ automake.in 2002/01/18 22:15:02
@@ -5153,7 +5153,8 @@
     if (defined $options{'subdir-objects'})
     {
        $r = $LANG_SUBDIR;
-       $base = $directory . '/' . $base;
+       $base = $directory . '/' . $base
+           unless $directory eq '.' || $directory eq '';
 
        if (! $seen_cc_c_o)
        {
@@ -5164,11 +5165,18 @@
        }
 
        require_conf_file ("$am_file.am", FOREIGN, 'compile');
+
+       # 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/");
     }
 
-    $de_ansi_files{$base} = (($directory eq '.' || $directory eq '')
-                            ? ''
-                            : "$directory/");
     return $r;
 }
 
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.372
diff -u -r1.372 Makefile.am
--- tests/Makefile.am 2002/01/14 00:29:17 1.372
+++ tests/Makefile.am 2002/01/18 22:15:03
@@ -25,6 +25,7 @@
 ansi4.test \
 ansi5.test \
 ansi6.test \
+ansi7.test \
 ar.test \
 asm.test \
 auxdir.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.482
diff -u -r1.482 Makefile.in
--- tests/Makefile.in 2002/01/16 19:05:47 1.482
+++ tests/Makefile.in 2002/01/18 22:15:03
@@ -1,7 +1,7 @@
 # Makefile.in generated by automake 1.5c from Makefile.am.
 # @configure_input@
 
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
 # Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -99,6 +99,7 @@
 ansi4.test \
 ansi5.test \
 ansi6.test \
+ansi7.test \
 ar.test \
 asm.test \
 auxdir.test \
Index: tests/ansi7.test
===================================================================
RCS file: ansi7.test
diff -N ansi7.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ tests/ansi7.test Fri Jan 18 14:15:03 2002
@@ -0,0 +1,56 @@
+#! /bin/sh
+
+# Check ansi2knr on a source file in subdirectory.
+# From Kevin Ryde.
+
+required=gcc
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT(ansi6, 1.0)
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_C_PROTOTYPES
+AC_EXEEXT
+AC_OBJEXT
+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
+
+set -e
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure am_cv_prog_cc_stdc=no
+$MAKE



reply via email to

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