automake-patches
[Top][All Lists]
Advanced

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

renamed objects and other languages


From: Florian Briegel at mpia-hd
Subject: renamed objects and other languages
Date: Tue, 1 May 2007 17:32:02 +0200
User-agent: KMail/1.9.6

Hi there,

this patch fixes a problem using foreign languages (Qt, Ice, ...) with renamed 
objects. E.g. you have the language .baz and want to include it into your 
c-program:

AUTOMAKE_OPTIONS = subdir-objects
SUFFIXES = .baz .c
# we fake here:
.baz.c:
        cp $< $@

bin_PROGRAMS = foo
foo_SOURCES = foo.c sub/bar.baz
foo_CFLAGS = -I.

The current automake produces this:

--- snip ----
sub/foo-bar.o: sub/bar.baz
@am__fastdepCC_TRUE@    $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(foo_CFLAGS) $(CFLAGS) -MT sub/foo-bar.o -M
D -MP -MF sub/$(DEPDIR)/foo-bar.Tpo -c -o sub/foo-bar.o 
`test -f 'sub/bar.baz' || echo '$(srcdir)/'`sub/bar.baz
@am__fastdepCC_TRUE@    mv -f sub/$(DEPDIR)/foo-bar.Tpo 
sub/$(DEPDIR)/foo-bar.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@       source='sub/bar.baz' 
object='sub/foo-bar.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(foo_CFLAGS) $(CFLAGS) -c -o sub/foo-bar.o
`test -f 'sub/bar.baz' || echo '$(srcdir)/'`sub/bar.baz
--- snip ----

Which is wrong.
The patch feeds the generated c-file to the c-compiler instead of the 
baz-file:

--- snip ----
sub/foo-bar.o: sub/bar.c
@am__fastdepCC_TRUE@    $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(foo_CFLAGS) $(CFLAGS) -MT sub/foo-bar.o -M
D -MP -MF sub/$(DEPDIR)/foo-bar.Tpo -c -o sub/foo-bar.o 
`test -f 'sub/bar.c' || echo '$(srcdir)/'`sub/bar.c
@am__fastdepCC_TRUE@    mv -f sub/$(DEPDIR)/foo-bar.Tpo 
sub/$(DEPDIR)/foo-bar.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@       source='sub/bar.c' 
object='sub/foo-bar.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(foo_CFLAGS) $(CFLAGS) -c -o sub/foo-bar.o
`test -f 'sub/bar.c' || echo '$(srcdir)/'`sub/bar.c
--- snip ----

I have also included a testscript suffix13.test. It is not in the diff, 
because "svn diff -u" has not included it in the diff file.

Cheers,
Florian

-- 
Suddenly, Professor Liebowitz realizes he has come to the seminar
without his duck ...

Attachment: automake.patch.cvs
Description: Text Data

Attachment: suffix13.test
Description: application/shellscript


reply via email to

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