Hi,

There used to be a bug in autoconf 2.13 related to the generation
of dependencies using the C/C++ compiler. This bug is still there in
autoconf 2.49a.

I am using the example project below:
http://www.murrayc.com/learning/linux/automake/helloworld_cc-0.2.tar.gz

The Sun WorkShop C/C++ compilers does not accept the -Wp,-MD,<file>
option. The -Wp option is used with GNU compilers to pass an option
to the preprocessor. The -MD <file> option is used to write the
dependency information in <file> in addition to compiling the file
as specified. Few compilers can do that. There should really be two
steps here, generating dependencies, then compiling a file. Use

%.o: %.c
        @echo '$(COMPILE) -c $<'; \
        $(COMPILE) -M $< > .deps/$(*F).pp ; \
        $(COMPILE) -c $<
        @-cp .deps/$(*F).pp .deps/$(*F).P; \

instead of

%.o: %.c
        @echo '$(COMPILE) -c $<'; \
        $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
        @-cp .deps/$(*F).pp .deps/$(*F).P; \

and

%.o: %.cc
        @echo '$(CXXCOMPILE) -c $<'; \
        $(CXXCOMPILE) -M $< > .deps/$(*F).pp ; \
        $(CXXCOMPILE) -c $<
        @-cp .deps/$(*F).pp .deps/$(*F).P; \

instead of

%.o: %.cc
        @echo '$(CXXCOMPILE) -c $<'; \
        $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
        @-cp .deps/$(*F).pp .deps/$(*F).P; \



make[3]: Entering directory `/home/papadopo/helloworld_cc-0.2/src/foofiles'
CC -DHAVE_CONFIG_H -I. -I. -I../..     -fast -c foo.cc
CC: Warning: Option -Wp,-MD,.deps/foo.pp passed to ld, if ld is invoked, ignored 
otherwise
"foo.cc", line 1: Warning: Last line in file "foo.h" is not terminated with a 
newline.
1 Warning(s) detected.
cp: cannot access .deps/foo.pp
/bin/sh: .deps/foo.pp: cannot open
.deps/foo.pp: No such file or directory
make[3]: [foo.o] Error 2 (ignored)


make[3]: Entering directory `/home/papadopo/helloworld_cc-0.2/src'
CC -DHAVE_CONFIG_H -I. -I. -I.. foofiles    -fast -c hello.cc
CC: Warning: Option -Wp,-MD,.deps/hello.pp passed to ld, if ld is invoked, 
ignored otherwise
CC: Invalid input file name foofiles, no output generated for this file.
"hello.cc", line 1: Warning: Last line in file "hello.h" is not terminated with 
a newline.
"hello.h", line 4: Warning: Last line in file "foofiles/foo.h" is not terminated 
with a newline.
2 Warning(s) detected.
cp: cannot access .deps/hello.pp
/bin/sh: .deps/hello.pp: cannot open
.deps/hello.pp: No such file or directory
make[3]: [hello.o] Error 2 (ignored)
CC -DHAVE_CONFIG_H -I. -I. -I.. foofiles    -fast -c main.cc
CC: Warning: Option -Wp,-MD,.deps/main.pp passed to ld, if ld is invoked, 
ignored otherwise
CC: Invalid input file name foofiles, no output generated for this file.
"main.cc", line 5: Warning: Last line in file "hello.h" is not terminated with a 
newline.
"hello.h", line 4: Warning: Last line in file "foofiles/foo.h" is not terminated 
with a newline.
2 Warning(s) detected.
cp: cannot access .deps/main.pp
/bin/sh: .deps/main.pp: cannot open
.deps/main.pp: No such file or directory
make[3]: [main.o] Error 2 (ignored)





Dimitri

Reply via email to