From 1bc9e9b7f80fd8484ac3081b0bcf810fa3774302 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 13 May 2004 20:38:19 +0000 Subject: [PATCH] * automake.in (handle_source_transform): Also check for a $(srcdir)/old_source rule when computing the default source name. Propagate this $(srcdir) prefix in Automake variables. * tests/ltlibsrc.test (noinst_LTLIBRARIES): Explicitly refer to $(srcdir)/zoo_d_old2_la.c. This fixes another failure with BSD Make. --- ChangeLog | 8 ++++++++ automake.in | 13 ++++++++++++- tests/ltlibsrc.test | 4 ++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc3977b7e..d17df4529 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-05-13 Alexandre Duret-Lutz + + * automake.in (handle_source_transform): Also check for a + $(srcdir)/old_source rule when computing the default source name. + Propagate this $(srcdir) prefix in Automake variables. + * tests/ltlibsrc.test (noinst_LTLIBRARIES): Explicitly refer to + $(srcdir)/zoo_d_old2_la.c. This fixes another failure with BSD Make. + 2004-05-13 Paul Eggert * Makefile.am (fetch): Work even with FreeBSD "make", which diff --git a/automake.in b/automake.in index f782105fc..882e2888c 100755 --- a/automake.in +++ b/automake.in @@ -1917,7 +1917,10 @@ sub handle_source_transform ($$$$%) my $old_default_source = "$one_file.c"; (my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$,.c,; if ($old_default_source ne $default_source - && (rule $old_default_source || -f $old_default_source)) + && (rule $old_default_source + || rule '$(srcdir)/' . $old_default_source + || rule '${srcdir}/' . $old_default_source + || -f $old_default_source)) { my $loc = $where->clone; $loc->pop_context; @@ -1927,6 +1930,14 @@ sub handle_source_transform ($$$$%) . "backward compatibility.)"); $default_source = $old_default_source; } + # If a rule exists to build this source with a $(srcdir) + # prefix, use that prefix in our variables too. This is for + # the sake of BSD Make. + if (rule '$(srcdir)/' . $default_source + || rule '${srcdir}/' . $default_source) + { + $default_source = '$(srcdir)/' . $default_source; + } &define_variable ($one_file . "_SOURCES", $default_source, $where); push (@sources, $default_source); diff --git a/tests/ltlibsrc.test b/tests/ltlibsrc.test index 8c76b197b..dd7d33f70 100755 --- a/tests/ltlibsrc.test +++ b/tests/ltlibsrc.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -38,7 +38,7 @@ AM_LDFLAGS = -module pkglib_LTLIBRARIES = zoo.d/bar.la old.la noinst_LTLIBRARIES = foo.la zoo.d/old2.la -zoo_d_old2_la.c: $(srcdir)/old_la.c +$(srcdir)/zoo_d_old2_la.c: $(srcdir)/old_la.c cp $(srcdir)/old_la.c $@ END -- 2.47.2