This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
[PATCH] RE: GDB 6.5: LDFLAGS not passing through to subdirectory configure's.
- From: "Kaz Kylheku" <kaz at zeugmasystems dot com>
- To: <gdb at sourceware dot org>
- Cc: "Marc Kleine-Budde" <mkl at pengutronix dot de>
- Date: Tue, 24 Oct 2006 14:52:15 -0700
- Subject: [PATCH] RE: GDB 6.5: LDFLAGS not passing through to subdirectory configure's.
Marc Kleine-Budde sympathized:
> Kaz Kylheku wrote:
> > The reasons is that in gdb-6.5/Makefile.in, you have this:
> > LDFLAGS =
> > instead of
> > LDFLAGS = @LDFLAGS@
>
> I've noticed that too and filled out a bugreport. It's PR2175.
>
> Marc
The real fix is slightly deeper. The gdb-6.5/gdb/Makefile.in makes use
of LDFLAGS, but, alas, does not use CPPFLAGS at all.
With the following patch, my gdb now builds against an ncurses whose
includes and libs are in a nonstandard location, by setting LDFLAGS and
CPPFLAGS. The reason the libs are in a nonstandard location is that I'm
building a distro, and using a different install directory for each
package to keep them neatly separated.
Index: tools-src/gdb-6.5/Makefile.in
===================================================================
--- tools-src.orig/gdb-6.5/Makefile.in 2006-10-24 16:17:58.000000000
-0700
+++ tools-src/gdb-6.5/Makefile.in 2006-10-24 16:18:55.037046088
-0700
@@ -286,7 +286,7 @@
WINDRES = @WINDRES@
CFLAGS = @CFLAGS@
-LDFLAGS =
+LDFLAGS = @LDFLAGS@
LIBCFLAGS = $(CFLAGS)
CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
Index: tools-src/gdb-6.5/gdb/Makefile.in
===================================================================
--- tools-src.orig/gdb-6.5/gdb/Makefile.in 2006-10-24
16:17:58.751602776 -0700
+++ tools-src/gdb-6.5/gdb/Makefile.in 2006-10-24 16:46:29.819480920
-0700
@@ -347,7 +347,7 @@
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
INTERNAL_CFLAGS_BASE = \
- $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
+ $(CPPFLAGS) $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
$(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
$(BFD_CFLAGS) $(INCLUDE_CFLAGS) \
$(INTL_CFLAGS) $(ENABLE_CFLAGS)
@@ -357,6 +357,8 @@
# LDFLAGS is specifically reserved for setting from the command line
# when running make.
LDFLAGS = @LDFLAGS@
+CPPFLAGS = @CPPFLAGS@
+
# Profiling options need to go here to work.
# I think it's perfectly reasonable for a user to set -pg in CFLAGS
@@ -436,6 +438,7 @@
"AR_FLAGS=$(AR_FLAGS)" \
"CC=$(CC)" \
"CFLAGS=$(CFLAGS)" \
+ "CPPFLAGS=$(CPPFLAGS)" \
"CXX=$(CXX)" \
"CXXFLAGS=$(CXXFLAGS)" \
"DLLTOOL=$(DLLTOOL)" \
@@ -495,6 +498,7 @@
'CC=$$(CC_FOR_TARGET)' \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
"CFLAGS=$(CFLAGS)" \
+ "CPPFLAGS=$(CPPFLAGS)" \
'CXX=$$(CXX_FOR_TARGET)' \
"CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
"CXXFLAGS=$(CXXFLAGS)" \