[geos-devel] C/C++ Standards, switches ordering

strk strk at keybit.net
Fri Jun 18 05:59:04 EDT 2010


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.

--strk;

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


More information about the geos-devel mailing list