Re: Compiling C++ without -g
On Sat, 3 Aug 2002, Matt Zimmerman wrote:
> On Sat, Aug 03, 2002 at 03:00:41PM +0100, Will Newton wrote:
>
> > Is there a way to prevent autoconf from appending "-g" to every g++ command
> > line? I really want to reduce the diskspace and CPU time required to build my
> > package, but autoconf seems to assume if you have g++ you have to have "-g"
> > also.
> >
> > e.g.
> > AC_PROG_CXX calls _AC_PROG_CXX_G which if successful unconditionally appends
> > "-g" to the command line.
>
> Try passing CFLAGS to configure, e.g. CFLAGS="-O2" ./configure...
And if that doesn't work, try CXXFLAGS (which applies to C++ code)...
although in some of my packages I've opted to override CXXFLAGS for the
subsequent make (make CXXFLAGS="...") rather than for the configure
(CXXFLAGS="..." ./configure), for some reason I can't remember.
Reply to: