GNOME Bugzilla – Bug 87888
./configure-time $LDFLAGS ignored
Last modified: 2011-02-04 16:10:07 UTC
Other packages pass the contents of the environment variable $LDFLAGS to the linker, but gtk+ doesn't. Automake normally takes care of it, but gtk+ sets LDFLAGS in several of the Makefile.am's, overriding automake's default behavior. The result is that it is impossible to pass flags to the linker, as far as I have been able to figure out. One solution is to add @LDFLAGS@ to the flags set in the Makefile.am's. (Another is to use AM_LDFLAGS, but that requires automake >= 1.5.)
Can you create a patch and test it, using the approach in: http://mail.gnome.org/archives/gtk-devel-list/2002-July/msg00052.html ? I rather have a tested patch instead of just hoping that I found everywhere that the addition was needed.
Ok. I made these changes and it worked for me. Index: gdk/Makefile.am =================================================================== RCS file: /cvs/gnome/gtk+/gdk/Makefile.am,v retrieving revision 1.89 diff -u -r1.89 Makefile.am --- gdk/Makefile.am 1 Aug 2002 15:28:28 -0000 1.89 +++ gdk/Makefile.am 3 Aug 2002 23:45:16 -0000 @@ -68,7 +68,7 @@ # libtool stuff: set version and export symbols for resolving # since automake doesn't support conditionalized libsomething_la_LDFLAGS # we use the general approach here -LDFLAGS = @STRIP_BEGIN@ \ +LDFLAGS = @LDFLAGS@ @STRIP_BEGIN@ \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -export-dynamic \ -rpath $(libdir) \ Index: gdk/linux-fb/Makefile.am =================================================================== RCS file: /cvs/gnome/gtk+/gdk/linux-fb/Makefile.am,v retrieving revision 1.19 diff -u -r1.19 Makefile.am --- gdk/linux-fb/Makefile.am 25 Jun 2001 23:01:36 -0000 1.19 +++ gdk/linux-fb/Makefile.am 3 Aug 2002 23:45:16 -0000 @@ -19,7 +19,7 @@ @GTK_DEBUG_FLAGS@ \ @STRIP_END@ -LDFLAGS = @STRIP_BEGIN@ \ +LDFLAGS = @LDFLAGS@ @STRIP_BEGIN@ \ @GDK_DEP_LIBS@ \ -lm \ @STRIP_END@ Index: gtk/Makefile.am =================================================================== RCS file: /cvs/gnome/gtk+/gtk/Makefile.am,v retrieving revision 1.214 diff -u -r1.214 Makefile.am --- gtk/Makefile.am 14 May 2002 22:04:45 -0000 1.214 +++ gtk/Makefile.am 3 Aug 2002 23:45:16 -0000 @@ -64,7 +64,7 @@ # since automake doesn't support conditionalized libsomething_la_LDFLAGS # we use the general approach here libgtkincludedir = $(includedir)/gtk-2.0/gtk -LDFLAGS = @STRIP_BEGIN@ \ +LDFLAGS = @LDFLAGS@ @STRIP_BEGIN@ \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -export-dynamic \ -rpath $(libdir) \
Was fixed a while ago, but apparently forgot to close the bug. Mon Aug 5 17:01:30 2002 Owen Taylor <otaylor@redhat.com> * gdk/Makefile.am (LDFLAGS): When overriding LDFLAGS, include @LDFLAGS@, otherwise LDFLAGS the users passes to configure don't get used. (#89946, Noah Levitt, Albert Chin)