From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9996 invoked by alias); 5 May 2006 16:28:12 -0000 Received: (qmail 9988 invoked by uid 22791); 5 May 2006 16:28:11 -0000 X-Spam-Check-By: sourceware.org Received: from yosemite.airs.com (HELO yosemite.airs.com) (205.217.158.180) by sourceware.org (qpsmtpd/0.31) with SMTP; Fri, 05 May 2006 16:28:03 +0000 Received: (qmail 25263 invoked from network); 5 May 2006 15:28:01 -0000 Received: from ns1.suse.de (HELO mx1.suse.de) (195.135.220.2) by yosemite.airs.com with SMTP; 5 May 2006 15:28:01 -0000 Received: from Relay2.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 06A1EEF89 for ; Fri, 5 May 2006 17:22:55 +0200 (CEST) From: Andreas Schwab To: gdb-patches@sourceware.org Subject: [sim] Use CFLAGS_FOR_BUILD X-Yow: I am having a pleasant time!! Date: Fri, 05 May 2006 16:28:00 -0000 Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00064.txt.bz2 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."