[postgis-users] Problem compiling PostGIS2.0 with GEOS 1.3.3+

Sandro Santilli strk at keybit.net
Mon Jun 25 02:32:15 PDT 2012


On Mon, Jun 25, 2012 at 09:15:18AM +0200, Jan Hartmann wrote:
> 
> On 06/24/2012 05:43 PM, Sandro Santilli wrote:
> >On Sat, Jun 23, 2012 at 11:20:07AM +0200, Jan Hartmann wrote:
> >
> >I'd rather make sure -I<localdir> appears first.
> >Can you handle to do so by tweaking the Makefile.in files ?
> >
> >Would you file a ticket to handle this ? Thanks !
> >
> >
> I'm not sure that is the solution. I always compile to non-standard
> locations with
> 
> CFLAGS="-I/home/user/include" LDFLAGS="-L/home/user/lib" make
> 
> Those "home" directories will always come before whatever is in the
> Makefile. I guess this can be more generally a cause for problems
> with older versions, although I have never met one before. I'll
> think further about it, but if you have any suggestions, please say
> so.

Autotools do something like this:

DEFAULT_INCLUDES = -I. -I$(top_builddir)/include -I$(top_builddir)/include/geos
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)

Where DEFAULT_INCLUDES is automatically generated and $(CPPFLAGS) 
and $(CXXFLAGS) are the ones you eventually override.

In PostGIS we don't have this double definition so it won't work:

        $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<

I guess we could add a $(DEFAULT_INCLUDES) right before the CFLAGS.
Then you could use:

 make CFLAGS=...

Note that "CFLAGS=... make" has no effect on either PostGIS or GEOS
(autotools-based) for me.

--strk;

 Sent from our free software
 http://www.gnu.org/philosophy/free-sw.html



More information about the postgis-users mailing list