[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: subdir-objects & depcomp trouble
From: |
Stepan Kasal |
Subject: |
Re: subdir-objects & depcomp trouble |
Date: |
Mon, 3 Oct 2005 21:02:26 +0200 |
User-agent: |
Mutt/1.4.1i |
Hello again,
in a private mail, Patrick pointed out some problems in my answer:
On Mon, Oct 03, 2005 at 02:15:29PM +0200, Stepan Kasal wrote:
> You should use a relative path, ie. in lib/Makefile.am you should use:
>
> libmylib_la_SOURCES = ../src/myfile.cc
I should have said _literal_ relative path. The reason is that the shell
code for the "depfile commands" which comes from depout.m4 and get's executed
near the end of ./configure, does't interpret '$(top_srcdir)'.
This means that my suggestion:
> libmylib_la_SOURCES = $(top_builddir)/src/myfile.cc
wouldn't work with current Automake. It can be fixed, though.
(There are two ways to fix it: top_builddir can be interpreted in depout.m4,
or it can be replaced by automake; a patch implementing the latter is
attached below--but I don't know whether this is The Right Way.)
But I still believe that I was right that
> > libmylib_la_SOURCES = $(top_srcdir)/src/myfile.cc
is wrong. I think Automake should issue an error if SOURCES contains
$(srcdir) or $(top_srcdir).
But I don't know how to implement it. Alexandre, help us, please!
Have a nice day,
Stepan
2005-10-03 Stepan Kasal <address@hidden>
* automake.in (handle_languages): Expand $(top_builddir) in the
path to the dependency file.
Index: automake.in
===================================================================
RCS file: /cvsroot/automake/automake/automake.in,v
retrieving revision 1.1612
diff -u -r1.1612 automake.in
--- automake.in 13 Sep 2005 20:16:33 -0000 1.1612
+++ automake.in 3 Oct 2005 18:57:47 -0000
@@ -1307,6 +1307,9 @@
my $output_flag = $lang->output_flag || '-o';
my $depbase = dirname ($obj);
+ # Expand $(top_builddir), because _AM_OUTPUT_DEPENDENCY_COMMANDS
+ # doesn't do it.
+ $depbase =~ s/\$\(top_builddir\)/backname($relative_dir)/e;
$depbase = ''
if $depbase eq '.';
$depbase .= '/'