This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Debugging flags
- To: Daniel dot Egger at t-online dot de
- Subject: Re: Debugging flags
- From: Manfred Hollstein <manfred at s-direktnet dot de>
- Date: Thu, 25 Jun 1998 14:35:27 +0200 (MET DST)
- Cc: egcs at cygnus dot com
- References: <98062416490700.07595@z2.n2480.f898.fidonet.org>
- Reply-To: manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de
On Wed, 24 June 1998, 16:17:17, Daniel.Egger@t-online.de wrote:
> 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.
But, it doesn't hurt, as they are passed down via FLAGS_TO_PASS. You
could even re-define CFLAGS/CXXFLAGS on the "make ..." command line.
>
> 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.
This is not true. If you actually look at the configure machinery (I
admit it's quite complicated ;-), you'll see that the "hardcoded"
*FLAGS will be substituted using sed by whatever you've defined when
calling configure.
If your only intention is to avoid `-g' in CFLAGS and probably want
stripped executables by default, simply do it this way:
$ env CC="{your_preferred_C_compiler}" CFLAGS="-O2" LDFLAGS=-s \
${path_to_egcs_directory}/configure ...
and then simply call:
$ make bootstrap; make check; make install
It's really that simple. And, don't omit `-g' from CXXFLAGS as this
will prevent you from being able to use your favourite debugger
looking at C++ objects whose type definitions originate from one of
those C++ libs.
> But first here's the patch to remove hardcoded CFLAGS:
>
[patch removed as it is not necessary]
manfred