GNOME Bugzilla – Bug 134332
CFLAGS must not include -L/-l flags
Last modified: 2004-12-22 21:47:04 UTC
The configure script in at-spi adds the value of X_LIBS to CFLAGS. This is wrong from a conceptual point of view, since these flags are only passed to the compiler (not the linker). But this also breaks the build. Libtool 1.5.x breaks when -L/-l flags are passed on the command line at the end of it. Consider the following: $ libtool --mode=compile gcc -c foo.c -lm libtool: compile: cannot determine name of library object from `-lm' Even though, this works: $ libtool --mode=compile gcc -lm -c foo.c It is very risky to assume it will always work. Therefore, those flags must be removed from the CFLAGS variable. I've done it, and at-spi builds without problems. I don't know why that line was added to configure.in. But even if it is there to fix something, there must be a better way to do the same by setting LDFLAGS and/or LIBS.
Created attachment 24387 [details] [review] Patch for configure.in
We currently use libtool 1.5.X without incident.
This is working for you because this depends on the order of the arguments. And this is a very delicate thing and subject to break... Here in pkgsrc, the order changes because there are compiler wrappers to help in many other things, and when they rewrite the call, some flags get moved from their original place. But anyway, this could happen by other reasons and in other systems. May I ask why that line is in configure? It seems to not be needed.
Hi Julio: Offhand I don't know why X_LIBS is added to CFLAGS instead of added elsewhere. But I feel pretty confident that removing it will break _someone's_ build :-/ I agree that it doesn't look quite right.
I see now. That line was added on revision 1.61 of configure, to fix bug #105836. Although, from what I read there, the same thing could be achieved by adding X_LIBS to LIBS (or LDFLAGS), not CFLAGS, since autoconf's test compilations automatically use their values...
I'd prefer to fix this in 2.6.1 unless some serious build gurus go over it closely.
Created attachment 25917 [details] [review] proposed patch for this issue please test the attached patch to confirm that it works for you. Thanks!
*** Bug 132234 has been marked as a duplicate of this bug. ***
Please reopen if this does not work for you. Fixed in CVS.