[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Libtool head: standalone.at test should use $(CFLAGS)
From: |
Ralf Wildenhues |
Subject: |
Re: Libtool head: standalone.at test should use $(CFLAGS) |
Date: |
Thu, 25 Aug 2005 14:20:33 +0200 |
User-agent: |
Mutt/1.4.1i |
Hi Peter,
* Peter Ekberg wrote on Thu, Aug 25, 2005 at 11:05:40AM CEST:
>
> I discovered a linking problem in the testsuite with my MSVC
> patch, and have found the attached solution...
>
> 2005-08-25 Peter Ekberg <address@hidden>
>
> * tests/standalone.at: (without autotools): Add
> $(CFLAGS) to LTCOMPILE and LTLINK.
OK, but I see the need for even more changes: we want $(INCLUDES)
earlier, and we want --tag=CC as well, similar to what Autoconf emits:
LTCOMPILE = $(LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile \
$(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
> Also, another comment on this test, regarding the following
> exchange from the past between me and Ralf:
>
> P: So, the only way to use -TP and -TC is to always compile first
> P: (with -c switch) and then link. I think libtool always does it
> P: this way so that may not be a problem?
>
> R: Yes, libtool requires separated modes for compilation and
> R: linking.
Ouch. I hope I did not lie there.. (looks at documentation again)
nope, we don't document
libtool --mode=link $CC -o a.out source.c
and while it may happen to work by chance, I don't think it'll work
in all cases.
I've thought about -TP/-TC again, by the way. It's basically a very
similar problem as with the different Fortran dialects, so the Right
Fix[tm] would be to add macros to Autoconf to find out whether -Tp
(yes, -Tp not -TP) is necessary, and then use that in a variable
$(CXXFLAGS_cc) or so. Automake then needs the same adjustment that it
also still needs for $(FC). Any volunteers? :)
> Isn't the following Makefile snippet from tests/standalone.at
> in violation, as it compiles main.c and links ltdldemo in one
> go?
I believe so. Could you be bothered to produce a fix?
> ltdldemo: $(LIBTOOL) module.la libltdl/libltdlc.la main.c
> $(LTLINK) -o ltdldemo main.c -dlopen module.la
> ./libltdl/libltdlc.la
Thanks,
Ralf