[geos-devel] C/C++ Standards, switches ordering
strk at keybit.net
Fri Jun 18 09:13:59 EDT 2010
Alright, as of r3006 AM_XXXX is used.
This means that you can finally override the CFLAGS
yourself w/out loosing the important ones (-ffloat-store,
-DGEOS_INLINE, -DNDEBUG). The first one is mandatory,
the second two are controlled trough ./configure switches
But also you won't loose the -pedantic -Wall -ansi -Wno-long-long,
which might be not what we want (ie: how does a user asks for
a build w/out those flags ? -no-flag ?).
I kindly ask anyone to test their build with their existing
configure scripts to catch any problem with the current
On Fri, Jun 18, 2010 at 11:59:04AM +0200, strk wrote:
> So, -ansi is equivalent to -std=c89
> Using -std=c99 works fine.
> Now, the problem is that GEOS's ./configure script
> is setting CFLAGS, which it shouldn't.
> CFLAGS is always added last as it is considered
> the user-defined one.
> Doing so (as we do) will drop our own flags when
> user specifies others (I think, to be tested).
> Instead, configure is fine to set 'AM_' variables
> which are used to replace whatever_CFLAGS when they
> are not needed, and to properly position $(AM_xxx)
> when in need for overrides.
> Currently, only CAPI and SWIG dirs do use overrides
> of whatever_CFLAGS.
> I'll see how to sort this all out.
> On Fri, Jun 18, 2010 at 11:26:35AM +0200, strk wrote:
> > I've started hand-crafting PHP bindings for the GEOS C-API.
> > Currently in the process of merging into trunk for proper
> > build scripts.
> > One obstacle I found is that -ansi, which is added to
> > CFLAGS by ./configure, won't accept Zend (PHP engine)
> > headers, so that switch must be removed when building
> > the PHP module.
> > Does anyone know how to override the cflags for just
> > one dir ? Or ideally, only drop the -ansi switch ?
> > Here's the relevant annotation from configure.in:
> > 2533 mloskot AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ansi], [dum
> > my_cv_ansi], [-ansi], , [WARNFLAGS="$WARNFLAGS -ansi"], )
> > --strk;
> > () Free GIS & Flash consultant/developer
> > /\ http://strk.keybit.net/services.html
> () Free GIS & Flash consultant/developer
> /\ http://strk.keybit.net/services.html
> geos-devel mailing list
> geos-devel at lists.osgeo.org
() Free GIS & Flash consultant/developer
More information about the geos-devel