Where to put compiler options?

Jacek Wojdel wojdel at chrysler.kbs.twi.tudelft.nl
Fri Mar 17 09:05:54 GMT 2000


On Thu, 16 Mar 2000, you wrote:
> Hello,
> 
> I've just finished an application which uses threads. Each source file
> must be compiled with "_REENTRANT" definied. This is no problem in
> KDevelop, but when I create the source tar ball, KDevelop forgets to put
> the additional compiler option into the Makefile.
> 
> I don't know autoconf etc. very well, so here's my question: In what file
> need I write the compiler option -D_REENTRANT ?

You can put:

CXXFLAGS="-D_REENTRANT"
AC_SUBST(CXXFLAGS)

in configure.in file. It is however customary to allow user a control over
CXXFLAGS via original environment variable - that's exactly how KDevelop does it
by issuing change in environment just before running automake/autoconf. You
should therefore consider something like this:

CXXFLAGS=${CXXFLAGS}" -D_REENTRANT"
AC_SUBST(CXXFLAGS)

Note that in case that CXXFAGS was not defined in user's environment, configure
will apply here some default value (like "-g -O2" for g++), so there's no need
to test for existence of this variable.
	Jacek

-- 
+-------------------------------------+
|from: J.C.Wojdel                     |
|      J.C.Wojdel at cs.tudelft.nl       |
+-------------------------------------+




More information about the KDevelop mailing list