automake-patches
[Top][All Lists]
Advanced

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

Patch: fix AM_CFLAGS bug


From: Tom Tromey
Subject: Patch: fix AM_CFLAGS bug
Date: 14 Jun 2001 19:40:27 -0600

I'm checking this in.

2001-06-14  Tom Tromey  <address@hidden>

        Fix for bug reported by Steve M. Robbins:
        * automake.in (handle_single_transform_list): When building a file
        from a subdirectory, continue to use `AM_' prefix.
        * tests/Makefile.am (TESTS): Added subobj7.test.
        * tests/subobj7.test: New file.

Tom

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1138
diff -u -r1.1138 automake.in
--- automake.in 2001/06/15 01:10:24     1.1138
+++ automake.in 2001/06/15 01:24:04
@@ -1846,8 +1846,22 @@
             {
                 my $obj_sans_ext = substr ($object, 0,
                                           - length ($this_obj_ext));
-                push (@{$lang_specific_files{$lang->name}},
-                     "$derived $full $obj_sans_ext");
+               my $val = "$full $obj_sans_ext";
+
+               # If we renamed the object then we want to use the
+               # per-executable flag name.  But if this is simply a
+               # subdir build then we still want to use the AM_ flag
+               # name.
+               if ($renamed)
+               {
+                   $val = "$derived $val";
+               }
+               else
+               {
+                   $val = "AM $val";
+               }
+
+                push (@{$lang_specific_files{$lang->name}}, $val);
             }
         }
         elsif ($extension eq 'o')
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.309
diff -u -r1.309 Makefile.am
--- Makefile.am 2001/06/15 01:10:25     1.309
+++ Makefile.am 2001/06/15 01:24:04
@@ -256,6 +256,7 @@
 subobj4.test \
 subobj5.test \
 subobj6.test \
+subobj7.test \
 subst.test \
 suffix.test \
 suffix2.test \
Index: tests/subobj7.test
===================================================================
RCS file: subobj7.test
diff -N subobj7.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ subobj7.test        Thu Jun 14 18:24:04 2001
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+# Test to make sure AM_CFLAGS appears in subdir compilation rule.
+# Report from Steve M. Robbins.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT(f)
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AM_PROG_CC_C_O
+AC_PROG_CC
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = wish
+wish_SOURCES = foo.c generic/a.c
+END
+
+$ACLOCAL || exit 1
+$AUTOMAKE || exit 1
+
+grep wish_CFLAGS Makefile.in && exit 1
+exit 0



reply via email to

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