]> sourceware.org Git - automake.git/commitdiff
Fix for bug reported by Steve M. Robbins:
authorTom Tromey <tromey@redhat.com>
Fri, 15 Jun 2001 01:25:11 +0000 (01:25 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 15 Jun 2001 01:25:11 +0000 (01:25 +0000)
* 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.

ChangeLog
automake.in
tests/Makefile.am
tests/Makefile.in
tests/subobj7.test [new file with mode: 0755]

index aa5b704ae3957b3c0c2850c8b751accc4a85c3fe..5bfaa4513f34dc01a9a5c9bde54834ef34403615 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2001-06-14  Tom Tromey  <tromey@redhat.com>
 
+       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.
+
        * lib/am/configure.am ($(top_builddir)/config.status): Added
        $(top_builddir) prefix to work around problems with some vendor
        makes.  From Nicholas Joly.
index 32f06b73fe1a75b845a2f3497eb2bba1711c697a..83ac74af89720aecf49039fb7e42aa3c9a5443b3 100755 (executable)
@@ -1846,8 +1846,22 @@ sub handle_single_transform_list ($$$@)
             {
                 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 2fe2cfbe53e05d025370082719fb7de710115f83..108216dec0a484073606b6f6b9396db42d8585cd 100644 (file)
@@ -256,6 +256,7 @@ subobj3.test \
 subobj4.test \
 subobj5.test \
 subobj6.test \
+subobj7.test \
 subst.test \
 suffix.test \
 suffix2.test \
index 986520d4b45a53e84045a0afc0b106d95deba4ee..420a16fd14818f29473f46ef1ce96f8e17151ed9 100644 (file)
@@ -322,6 +322,7 @@ subobj3.test \
 subobj4.test \
 subobj5.test \
 subobj6.test \
+subobj7.test \
 subst.test \
 suffix.test \
 suffix2.test \
diff --git a/tests/subobj7.test b/tests/subobj7.test
new file mode 100755 (executable)
index 0000000..c5388fb
--- /dev/null
@@ -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
This page took 0.035786 seconds and 5 git commands to generate.