This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[sim] Use CFLAGS_FOR_BUILD
- From: Andreas Schwab <schwab at suse dot de>
- To: gdb-patches at sourceware dot org
- Date: Fri, 05 May 2006 17:22:53 +0200
- Subject: [sim] Use CFLAGS_FOR_BUILD
CC_FOR_BUILD should always be used together with CFLAGS_FOR_BUILD.
Andreas.
sim/:
* configure.ac (CFLAGS_FOR_BUILD): Set and substitute.
* configure: Regenerate
* Makefile.in (CFLAGS_FOR_BUILD): Define.
(CC_FOR_BUILD): Don't override.
(FLAGS_TO_PASS): Pass CFLAGS_FOR_BUILD.
sim/ppc/:
* configure.ac (CFLAGS_FOR_BUILD): Set and substitute it.
* configure: Regenerate
* Makefile.in (CFLAGS_FOR_BUILD): Define.
(BUILD_CFLAGS): Use it instead of hardcoding "-g -O".
(gentmap): Fix typo BUILD_FLAGS -> BUILD_CFLAGS.
Index: sim/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/Makefile.in,v
retrieving revision 1.6
diff -u -a -p -r1.6 Makefile.in
--- sim/Makefile.in 29 Jan 2005 00:53:13 -0000 1.6
+++ sim/Makefile.in 5 May 2006 15:13:15 -0000
@@ -56,6 +56,7 @@ AR_FLAGS = rc
CC = @CC@
CFLAGS = @CFLAGS@
CC_FOR_BUILD = @CC_FOR_BUILD@
+CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
MAKEINFO = makeinfo
RANLIB = @RANLIB@
@@ -65,10 +66,6 @@ INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
DEP = mkdep
-# compilers to use to create programs which must be run in the build
-# environment.
-CC_FOR_BUILD = $(CC)
-
#### Makefile fragments come in here.
# @target_makefile_frag@
###
@@ -93,6 +90,7 @@ FLAGS_TO_PASS = \
"CC=$(CC)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CFLAGS=$(CFLAGS)" \
+ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"RANLIB=$(RANLIB)" \
"MAKEINFO=$(MAKEINFO)" \
"INSTALL=$(INSTALL)" \
Index: sim/configure.ac
===================================================================
RCS file: /cvs/src/src/sim/configure.ac,v
retrieving revision 1.8
diff -u -a -p -r1.8 configure.ac
--- sim/configure.ac 23 Jan 2006 22:10:41 -0000 1.8
+++ sim/configure.ac 5 May 2006 15:13:16 -0000
@@ -23,6 +23,8 @@ else
CC_FOR_BUILD=gcc
fi
AC_SUBST(CC_FOR_BUILD)
+CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
+AC_SUBST(CFLAGS_FOR_BUILD)
# If a cpu ever has more than one simulator to choose from, use
# --enable-sim=... to choose.
Index: sim/ppc/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/ppc/Makefile.in,v
retrieving revision 1.20
diff -u -a -p -r1.20 Makefile.in
--- sim/ppc/Makefile.in 23 Apr 2006 14:54:42 -0000 1.20
+++ sim/ppc/Makefile.in 5 May 2006 15:13:16 -0000
@@ -63,6 +63,7 @@ AR_FLAGS = rc
CC = @CC@
CFLAGS = @CFLAGS@
CC_FOR_BUILD = @CC_FOR_BUILD@
+CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
BISON = bison
MAKEINFO = makeinfo
RANLIB = @RANLIB@
@@ -116,7 +117,7 @@ SIM_FPU_CFLAGS = @sim_fpu_cflags@
STD_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(SIM_FPU_CFLAGS)
-BUILD_CFLAGS = -g -O $(INCLUDES) $(WARNING_CFLAGS)
+BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARNING_CFLAGS)
BUILD_LDFLAGS =
@@ -627,7 +628,7 @@ mon.o: mon.c $(BASICS_H) $(CPU_H) $(MON_
# GDB after 4.16 expects the default_callback structure to be setup.
# As a kludge, build the common stuff here for now.
gentmap: ../common/gentmap.c Makefile targ-vals.def
- $(CC_FOR_BUILD) $(BUILD_FLAGS) -I. -I../common -I$(srcdir)/../common -o gentmap $< $(BUILD_LIBS)
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) -I. -I../common -I$(srcdir)/../common -o gentmap $< $(BUILD_LIBS)
targ-vals.def: $(srcdir)/../common/nltvals.def
rm -f targ-vals.def tmp-def
Index: sim/ppc/configure.ac
===================================================================
RCS file: /cvs/src/src/sim/ppc/configure.ac,v
retrieving revision 1.4
diff -u -a -p -r1.4 configure.ac
--- sim/ppc/configure.ac 28 Nov 2005 23:19:39 -0000 1.4
+++ sim/ppc/configure.ac 5 May 2006 15:13:16 -0000
@@ -12,6 +12,7 @@ if test "x$cross_compiling" = "xno"; the
else
CC_FOR_BUILD=gcc
fi
+CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
dnl We don't use gettext, but bfd does. So we do the appropriate checks
dnl to see if there are intl libraries we should link against.
@@ -747,6 +748,7 @@ dnl Check for exe extension
AC_EXEEXT
AC_SUBST(CC_FOR_BUILD)
+AC_SUBST(CFLAGS_FOR_BUILD)
AC_SUBST(CFLAGS)
AC_SUBST(HDEFINES)
AR=${AR-ar}
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."