This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Debugging flags


Hiho!

 I don't know exactly how but my defined CFLAGS are overridden by
 the made Makefiles in gcc and subdirs. Behause of the inheritance of
 variables that are defined in Makefiles it should be enough to define
 them in the topdir of the tree but they are defined in every single subdir.

 Further we have a nice autoconfig screict which figures out what
 options to use to compile the whole thing. But they will be only used
 if we substitute all CFLAGS and CXXFLAGS with @CFLAGS@ and
 @CXXFLAGS@. This will also allow to remove the whole debugging
 thing simply by a added option to the autoconf script which will follow
 in the next days. 
 But first here's the patch to remove hardcoded CFLAGS:

 *** libstdc++/Makefile.in.temp	Wed Jun 24 14:24:17 1998
--- libstdc++/Makefile.in	Wed Jun 24 14:24:57 1998
***************
*** 54,61 ****
  CLEAN_JUNK = $(LIBS)
  
  # Remove these for public releases.
! CXXFLAGS = -g -O -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -Weffc++
! CFLAGS = -g -O -Wpointer-arith -Wnested-externs
  
  .PHONY: libs
  libs: $(LIBS)
--- 54,61 ----
  CLEAN_JUNK = $(LIBS)
  
  # Remove these for public releases.
! CXXFLAGS = @CXXFLAGS@ -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -Weffc++
! CFLAGS = @CFLAGS@ -Wpointer-arith -Wnested-externs
  
  .PHONY: libs
  libs: $(LIBS)
*** gcc/Makefile.in.temp	Wed Jun 24 14:27:01 1998
--- gcc/Makefile.in	Wed Jun 24 14:29:43 1998
***************
*** 61,67 ****
  # TCFLAGS is used for compilations with the GCC just built.
  XCFLAGS =
  TCFLAGS =
! CFLAGS = -g
  BOOT_CFLAGS = -O2 $(CFLAGS)
  WARN_CFLAGS = -W -Wall
  # These exists to be overridden by the x-* and t-* files, respectively.
--- 61,67 ----
  # TCFLAGS is used for compilations with the GCC just built.
  XCFLAGS =
  TCFLAGS =
! CFLAGS = @CFLAGS@
  BOOT_CFLAGS = -O2 $(CFLAGS)
  WARN_CFLAGS = -W -Wall
  # These exists to be overridden by the x-* and t-* files, respectively.
*** gcc/cp/Makefile.in.temp	Wed Jun 24 14:33:11 1998
--- gcc/cp/Makefile.in	Wed Jun 24 14:33:24 1998
***************
*** 45,51 ****
  # to the stage2 and stage3 compilations
  # XCFLAGS is used for most compilations but not when using the GCC just built.
  XCFLAGS =
! CFLAGS = -g
  BOOT_CFLAGS = -O $(CFLAGS)
  # These exists to be overridden by the x-* and t-* files, respectively.
  X_CFLAGS =
--- 45,51 ----
  # to the stage2 and stage3 compilations
  # XCFLAGS is used for most compilations but not when using the GCC just built.
  XCFLAGS =
! CFLAGS = @CFLAGS@
  BOOT_CFLAGS = -O $(CFLAGS)
  # These exists to be overridden by the x-* and t-* files, respectively.
  X_CFLAGS =
*** libio/dbz/Makefile.in.temp	Sat Sep 27 04:06:59 1997
--- libio/dbz/Makefile.in	Wed Jun 24 14:37:02 1998
***************
*** 1,5 ****
  srcdir = .
! CFLAGS = -g
  C_FLAGS = $(CFLAGS) -I$(srcdir) -I.. -I$(srcdir)/.. -DDBZ_FINISH='_IO_flush_all()'
  CC = `if [ -f ../../../gcc/gcc ] ; \
  	then echo ../../../gcc/gcc -B../../../gcc/ ; \
--- 1,5 ----
  srcdir = .
! CFLAGS = @CFLAGS@
  C_FLAGS = $(CFLAGS) -I$(srcdir) -I.. -I$(srcdir)/.. -DDBZ_FINISH='_IO_flush_all()'
  CC = `if [ -f ../../../gcc/gcc ] ; \
  	then echo ../../../gcc/gcc -B../../../gcc/ ; \
*** libio/testsuite/Makefile.in.temp	Tue Aug 26 18:28:23 1997
--- libio/testsuite/Makefile.in	Wed Jun 24 14:38:42 1998
***************
*** 17,25 ****
  
  srcdir = libio.tests
  
! CFLAGS = -g
  C_FLAGS = $(CFLAGS) -I. -I.. -I$(srcdir) -I$(srcdir)/..
! CXXFLAGS = -g
  CC = gcc
  CXX = gcc
  
--- 17,25 ----
  
  srcdir = libio.tests
  
! CFLAGS = @CFLAGS@
  C_FLAGS = $(CFLAGS) -I. -I.. -I$(srcdir) -I$(srcdir)/..
! CXXFLAGS = @CXXFLAGS@
  CC = gcc
  CXX = gcc
  
*** Makefile.in.temp	Mon Jun 22 21:22:02 1998
--- Makefile.in	Wed Jun 24 14:40:04 1998
***************
*** 70,77 ****
  HOST_PREFIX_1 = loser-
  
  # These flag values are normally overridden by the configure script.
! CFLAGS = -g
! CXXFLAGS = -g -O2
  
  LIBCFLAGS = $(CFLAGS)
  CFLAGS_FOR_TARGET = $(CFLAGS)
--- 70,77 ----
  HOST_PREFIX_1 = loser-
  
  # These flag values are normally overridden by the configure script.
! CFLAGS = @CFLAGS@
! CXXFLAGS = @CXXFLAGS@
  
  LIBCFLAGS = $(CFLAGS)
  CFLAGS_FOR_TARGET = $(CFLAGS)
 


--

Servus,
       Daniel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]