root/spike/wktraster/configure.ac

Revision 5713, 20.6 KB (checked in by jorgearevalo, 2 years ago)

Added copyright and CREDITS information.

  • Property svn:keywords set to
    Id
    Revision
Line 
1dnl **********************************************************************
2dnl * $Id$
3dnl *
4dnl * PostGIS - Spatial Types for PostgreSQL
5dnl * WKTRaster - RASTER type support for PostGIS
6dnl *
7dnl * http://postgis.refractions.net
8dnl * Copyright 2008 Mark Cave-Ayland
9dnl *
10dnl * http://www.deimos-space.com
11dnl * http://www.espanavirtual.org/?q=en
12dnl * Contributions made by Jorge Arevalo
13dnl *
14dnl * This is free software; you can redistribute and/or modify it under
15dnl * the terms of the GNU General Public Licence. See the COPYING file.
16dnl *
17dnl **********************************************************************
18
19AC_INIT()
20AC_CONFIG_HEADERS([wktraster_config.h])
21AC_CONFIG_MACRO_DIR([macros])
22
23dnl Invoke libtool: we do this as it is the easiest way to find the PIC
24dnl flags required to build the libs
25AC_PROG_LIBTOOL
26
27dnl
28dnl Compilers
29dnl
30AC_PROG_CC
31AC_PROG_CPP
32AC_PROG_CXX
33
34dnl
35dnl Define PIC flags in PICFLAGS
36dnl (note: this variable is set as part of libtool initialisation above)
37dnl
38PICFLAGS="$lt_prog_compiler_pic"
39AC_SUBST([PICFLAGS])
40
41dnl
42dnl For GCC enable additional warning flags
43dnl -Wall and -Wmissing-prototypes (using macro included with libtool)
44dnl
45WARNFLAGS=""
46AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wall],
47    [dummy_cv_Wall], [-Wall], [], [WARNFLAGS="$WARNFLAGS -Wall"], [])
48AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wmissing-prototypes],
49    [dummy_cv_Wmissing_prototypes], [-Wmissing-prototypes], [],
50    [WARNFLAGS="$WARNFLAGS -Wmissing-prototypes"], [])
51AC_SUBST([WARNFLAGS])
52
53dnl
54dnl Define executable suffix for use with the loader Makefiles
55dnl
56EXESUFFIX="$ac_cv_exeext"
57AC_SUBST([EXESUFFIX])
58
59dnl
60dnl Version Information imported from Version.config
61dnl
62POSTGIS_RASTER_MAJOR_VERSION=`cat Version.config | grep POSTGIS_RASTER_MAJOR_VERSION | sed 's/[[^=]]*=\([[0-9]]\)/\1/g'`
63POSTGIS_RASTER_MINOR_VERSION=`cat Version.config | grep POSTGIS_RASTER_MINOR_VERSION | sed 's/[[^=]]*=\([[0-9]]\)/\1/g'`
64POSTGIS_RASTER_MICRO_VERSION=`cat Version.config | grep POSTGIS_RASTER_MICRO_VERSION | sed 's/[[^=]]*=\([[0-9]]\)/\1/g'`
65
66AC_DEFINE_UNQUOTED([POSTGIS_RASTER_MAJOR_VERSION], ["$POSTGIS_RASTER_MAJOR_VERSION"], [WKTRaster major version])
67AC_DEFINE_UNQUOTED([POSTGIS_RASTER_MINOR_VERSION], ["$POSTGIS_RASTER_MINOR_VERSION"], [WKTRaster minor version])
68AC_DEFINE_UNQUOTED([POSTGIS_RASTER_MICRO_VERSION], ["$POSTGIS_RASTER_MICRO_VERSION"], [WKTRaster micro version])
69
70AC_SUBST([POSTGIS_RASTER_MAJOR_VERSION])
71AC_SUBST([POSTGIS_RASTER_MINOR_VERSION])
72AC_SUBST([POSTGIS_RASTER_MICRO_VERSION])
73
74dnl
75dnl Search for flex/bison to build the parser
76dnl
77AC_PROG_LEX
78AC_PROG_YACC
79AC_SUBST([LEX])
80AC_SUBST([YACC])
81
82
83dnl ===========================================================================
84dnl Find components needed to build documentation
85dnl ===========================================================================
86dnl
87dnl Search for xsltproc which is required for building documentation
88dnl
89
90AC_PATH_PROG([XSLTPROC], [xsltproc], [])
91if test "x$XSLTPROC" = "x"; then
92    AC_MSG_WARN([xsltproc is not installed so documentation cannot be built])
93fi
94
95dnl
96dnl Search for db2pdf which is required for building PDF documentation
97dnl
98
99AC_PATH_PROG([DB2PDF], [db2pdf], [])
100if test "x$DB2PDF" = "x"; then
101    AC_MSG_WARN([db2pdf is not installed so PDF documentation cannot be built])
102fi
103
104dnl
105dnl Search for dblatex which is required for building PDF documentation
106dnl
107
108AC_PATH_PROG([DBLATEX], [dblatex], [])
109if test "x$DBLATEX" = "x"; then
110    AC_MSG_WARN([dblatex is not installed so PDF documentation cannot be built])
111fi
112
113dnl
114dnl Allow the user to specify the location of the html/docbook.xsl stylesheet
115dnl
116
117AC_ARG_WITH([xsldir],
118    [AS_HELP_STRING([--with-xsldir=PATH], [specify the directory containing the docbook.xsl stylesheet])],
119    [XSLBASE="$withval"], [XSLBASE=""])
120
121XSLBASE_AUTO=""
122if test "x$XSLBASE" = "x"; then
123    dnl If the user did not specify a directory for the docbook
124    dnl stylesheet, choose the first directory
125    dnl that matches from the following list
126    SEARCHPATH="
127        /usr/share/sgml/docbook/xsl-stylesheets
128        /usr/share/xml/docbook/stylesheet/nwalsh
129        /usr/share/sgml/docbook/stylesheet/xsl/nwalsh
130        "
131    for p in ${SEARCHPATH}; do
132        if test -r "${p}"/html/docbook.xsl; then
133            XSLBASE_AUTO="${p}"
134            break
135        fi
136    done
137
138    dnl Check to see if the automatically searched paths above located a
139    dnl valid Docbook stylesheet
140    if test "x$XSLBASE_AUTO" = "x"; then
141        AC_MSG_WARN([could not locate Docbook stylesheets required to build the documentation])
142    fi
143else
144    dnl The user specified an alternate directory so make sure everything
145    dnl looks sensible
146    if test ! -d "$XSLBASE"; then
147        AC_MSG_ERROR([the docbook stylesheet directory specified using --with-xsldir does not exist])
148    fi
149
150    if test ! -f "$XSLBASE/html/docbook.xsl"; then
151        AC_MSG_ERROR([the docbook stylesheet directory specified using --with-xsldir does not contain the html/docbook.xsl file])
152    fi
153fi
154
155dnl
156dnl If XSLBASE has been set then at this point we know it must be
157dnl valid and so we can just use it. If XSLBASE_AUTO has been set, and XSLBASE
158dnl is empty then a valid stylesheet was found in XSLBASE_AUTO so we
159dnl should use that. Otherwise just continue silently with a blank XSLBASE
160dnl variable which will trigger the error message in the documentation Makefile
161dnl
162
163if test "x$XSLBASE" = "x"; then
164    if test ! "x$XSLBASE_AUTO" = "x"; then
165        XSLBASE="$XSLBASE_AUTO"
166    fi
167fi
168
169AC_SUBST([XSLBASE])
170
171dnl ===========================================================================
172dnl Detect if various RT DEBUG modes requested
173dnl ===========================================================================
174
175POSTGIS_RASTER_API_DEBUG_CFLAGS=""
176POSTGIS_RASTER_PG_DEBUG_CFLAGS=""
177rt_debug_msg=""
178
179AC_MSG_CHECKING([for low-level RASTER API debug mode])
180AC_ARG_ENABLE([rtapi-debug],
181    AC_HELP_STRING([--enable-rtapi-debug=@<:@yes|no@:>@],
182        [enable to debug low-level RASTER API @<:@default=no@:>@]
183    ),
184    [
185        if test "x$enableval" = "xyes"; then
186            rt_api_debug=1
187            AC_DEFINE_UNQUOTED([POSTGIS_RASTER_API_DEBUG], [$rt_api_debug], [debug low-level RASTER API])
188            POSTGIS_RASTER_API_DEBUG_CFLAGS="-DPOSTGIS_RASTER_API_DEBUG=$rt_api_debug"
189            rt_debug_msg="enabled"
190        else
191            rt_debug_msg="disabled"
192        fi
193    ],
194    [rt_debug_msg="disabled"]
195)
196AC_MSG_RESULT([$rt_debug_msg])
197
198AC_MSG_CHECKING([for PostGIS RASTER activity debug mode])
199AC_ARG_ENABLE([rtpg-debug],
200    AC_HELP_STRING([--enable-rtpg-debug=@<:@yes|no@:>@],
201        [enable to debug PostGIS RASTER activity @<:@default=no@:>@]
202    ),
203    [
204        if test "x$enableval" = "xyes"; then
205            rt_pg_debug=1
206            AC_DEFINE_UNQUOTED([POSTGIS_RASTER_PG_DEBUG], [$rt_pg_debug], [debug PostGIS RASTER activity])
207            POSTGIS_RASTER_PG_DEBUG_CFLAGS="$POSTGIS_RASTER_PG_DEBUG_CFLAGS -DPOSTGIS_RASTER_PG_DEBUG=$rt_pg_debug"
208            rt_debug_msg="enabled"
209        else
210            rt_debug_msg="disabled"
211        fi
212    ],
213    [rt_debug_msg="disabled"]
214)
215AC_MSG_RESULT([$rt_debug_msg])
216
217AC_MSG_CHECKING([for PostGIS RASTER memory activity debug mode])
218AC_ARG_ENABLE([rtpgmem-debug],
219    AC_HELP_STRING([--enable-rtpgmem-debug=@<:@yes|no@:>@],
220        [enable to debug PostGIS RASTER memory activity @<:@default=no@:>@]
221    ),
222    [
223        if test "x$enableval" = "xyes"; then
224            rt_pgmem_debug=1
225            AC_DEFINE_UNQUOTED([POSTGIS_RASTER_PG_DEBUG_MEM], [$POSTGIS_RASTER_PG_DEBUG_MEM], [debug PostGIS RASTER memory activity])
226            POSTGIS_RASTER_PG_DEBUG_CFLAGS="$POSTGIS_RASTER_PG_DEBUG_CFLAGS -DPOSTGIS_RASTER_PG_DEBUG_MEM=$rt_pgmem_debug"
227            rt_debug_msg="enabled"
228        else
229            rt_debug_msg="disabled"
230        fi
231    ],
232    [rt_debug_msg="disabled"]
233)
234AC_MSG_RESULT([$rt_debug_msg])
235
236AC_SUBST([POSTGIS_RASTER_API_DEBUG_CFLAGS])
237AC_SUBST([POSTGIS_RASTER_PG_DEBUG_CFLAGS])
238
239dnl ===========================================================================
240dnl Detect CUnit if it is installed (used for unit testing)
241dnl
242dnl Note that we pass any specified CPPFLAGS and LDFLAGS into the Makefile
243dnl as CUnit is the only compile-time dependency that cannot obtain any
244dnl specialised flags using a --with-X parameter, and so we allow this
245dnl information to be passed in if required.
246dnl ===========================================================================
247
248CUNIT_LDFLAGS=""
249AC_CHECK_HEADER([CUnit/CUnit.h], [
250    CUNIT_CPPFLAGS="$CPPFLAGS"
251    AC_CHECK_LIB([cunit], [CU_initialize_registry], [CUNIT_LDFLAGS="$LDFLAGS -lcunit"], [AC_MSG_WARN([could not locate CUnit required for liblwgeom unit tests])])
252    ],
253    [
254    AC_MSG_WARN([could not locate CUnit required for liblwgeom unit tests])
255    ])
256   
257AC_SUBST([CUNIT_CPPFLAGS])
258AC_SUBST([CUNIT_LDFLAGS])
259
260
261dnl ===========================================================================
262dnl Detect iconv if it is installed (used for shp2pgsql encoding conversion
263dnl if available)
264dnl ===========================================================================
265
266HAVE_ICONV_H=0
267AC_CHECK_HEADER([iconv.h], [HAVE_ICONV_H=1], [])
268
269dnl If we find the header file, try and link against the library
270if test "x$HAVE_ICONV_H" != "x0"; then
271    dnl Check for iconv includes as part of libc
272    AC_CHECK_LIB([c], [iconv_open], [ICONV_LDFLAGS=-lc HAVE_ICONV=1], [])
273    if test "x$HAVE_ICONV" = "x"; then
274        dnl If not found, check for iconv included as part of libiconv
275        AC_CHECK_LIB([iconv], [iconv_open], [ICONV_LDFLAGS=-liconv HAVE_ICONV=1], [])
276        if test "x$HAVE_ICONV" = "x"; then
277            dnl If not found, check for Win32 iconv (some of them use a lib prefix for functions within the iconv DLLs)
278            AC_CHECK_LIB([iconv], [libiconv_open], [ICONV_LDFLAGS=-liconv HAVE_ICONV=1], [])
279            if test "x$HAVE_ICONV" = "x"; then
280                dnl No iconv library was found; issue a warning to the console
281                AC_MSG_WARN([could not find iconv library: no support for encoding conversion will be included])
282            fi
283        fi 
284    fi
285else
286    dnl No iconv header was found; issue a warning to the console
287    AC_MSG_WARN([could not find iconv.h header: no support for encoding conversion will be included])
288fi
289
290
291dnl Only define HAVE_ICONV in postgis_config.h if we detect iconv sucessfully
292if test "x$HAVE_ICONV" != "x"; then
293    AC_DEFINE_UNQUOTED([HAVE_ICONV], [$HAVE_ICONV], [Defined if libiconv headers and library are present])
294fi
295
296AC_SUBST([ICONV_LDFLAGS])
297
298
299dnl ===========================================================================
300dnl Detect the version of PostgreSQL installed on the system
301dnl ===========================================================================
302
303AC_ARG_WITH([pgconfig],
304    [AS_HELP_STRING([--with-pgconfig=FILE], [specify an alternative pg_config file])],
305    [PGCONFIG="$withval"], [PGCONFIG=""])
306
307if test "x$PGCONFIG" = "x"; then
308    dnl PGCONFIG was not specified, so search within the current path
309    AC_PATH_PROG([PGCONFIG], [pg_config])
310
311    dnl If we couldn't find pg_config, display an error
312    if test "x$PGCONFIG" = "x"; then
313        AC_MSG_ERROR([could not find pg_config within the current path. You may need to try re-running configure with a --with-pgconfig parameter.])
314    fi
315else
316    dnl PGCONFIG was specified; display a message to the user
317    if test "x$PGCONFIG" = "xyes"; then
318        AC_MSG_ERROR([you must specify a parameter to --with-pgconfig, e.g. --with-pgconfig=/path/to/pg_config])
319    else
320        if test -f $PGCONFIG; then
321            AC_MSG_RESULT([Using user-specified pg_config file: $PGCONFIG])
322        else
323            AC_MSG_ERROR([the user-specified pg_config file $PGCONFIG does not exist])
324        fi
325    fi
326fi
327
328
329dnl ===========================================================================
330dnl Ensure that $PG_CONFIG --pgxs points to a valid file. This is because some
331dnl distributions such as Debian also include pg_config as part of libpq-dev
332dnl packages, but don't install the Makefile it points to unless
333dnl the postgresql-server-dev packages are installed :)
334dnl ===========================================================================
335
336PGXS=`$PGCONFIG --pgxs`
337if test ! -f $PGXS; then
338    AC_MSG_ERROR([the PGXS Makefile $PGXS cannot be found. Please install the PostgreSQL server development packages and re-run configure.])
339fi
340
341AC_SUBST([PGXS])
342
343
344dnl Extract the version information from pg_config
345dnl Note: we extract the major & minor separately, ensure they are numeric, and then combine to give
346dnl the final version. This is to guard against user error...
347PGSQL_MAJOR_VERSION=`$PGCONFIG --version | sed 's/[[A-Za-z ]]*//' | cut -d. -f1 | sed 's/[[^0-9]]//g'` 
348PGSQL_MINOR_VERSION=`$PGCONFIG --version | sed 's/[[A-Za-z ]]*//' | cut -d. -f2 | sed 's/[[^0-9]]//g'` 
349POSTGIS_RASTER_PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"
350
351dnl Ensure that we are using PostgreSQL >= 8.3
352if test ! "$PGSQL_MAJOR_VERSION" -ge 8; then
353    AC_MSG_ERROR([WKTRaster requires PostgreSQL >= 8.3])
354else
355    if test "$PGSQL_MAJOR_VERSION" -eq 8; then
356        if test ! "$PGSQL_MINOR_VERSION" -ge 3; then
357            AC_MSG_ERROR([WKTRaster requires PostgreSQL >= 8.3])
358        fi 
359    fi
360fi 
361
362dnl Note: We don't need the server-side LDFLAGS or CPPFLAGS because we get these from PGXS
363
364dnl Extract the linker and include flags for the frontend (for programs that use libpq)
365PGSQL_FE_LDFLAGS=-L`$PGCONFIG --libdir`" -lpq"
366PGSQL_FE_CPPFLAGS=-I`$PGCONFIG --includedir`
367
368AC_SUBST([PGSQL_FE_LDFLAGS])
369AC_SUBST([PGSQL_FE_CPPFLAGS])
370
371dnl Extract the documentation and man page directories
372PGSQL_DOCDIR=`$PGCONFIG --docdir`
373PGSQL_MANDIR=`$PGCONFIG --mandir`
374
375AC_SUBST([PGSQL_DOCDIR])
376AC_SUBST([PGSQL_MANDIR])
377
378dnl Extract the executable directory
379PGSQL_BINDIR=`$PGCONFIG --bindir`
380
381AC_SUBST([PGSQL_BINDIR])
382
383
384dnl Ensure that we can parse libpq-fe.h
385CPPFLAGS_SAVE="$CPPFLAGS"
386CPPFLAGS="$PGSQL_FE_CPPFLAGS"
387AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([could not find libpq-fe.h])])
388CPPFLAGS="$CPPFLAGS_SAVE"
389
390dnl Ensure we can link against libpq
391LIBS_SAVE="$LIBS"
392LIBS="$PGSQL_FE_LDFLAGS"
393AC_CHECK_LIB([pq], [PQserverVersion],
394    [],
395    [AC_MSG_ERROR([could not find libpq])],
396    [])
397LIBS="$LIBS_SAVE"
398
399AC_DEFINE_UNQUOTED([POSTGIS_RASTER_PGSQL_VERSION], [$POSTGIS_RASTER_PGSQL_VERSION], [PostgreSQL server version])   
400AC_SUBST([POSTGIS_RASTER_PGSQL_VERSION])
401
402dnl ========================================================================
403dnl Determine in ENABLE_DEVELOPMENT must be set or not. This enviroment
404dnl var activates the build of some experimental functions.
405dnl
406dnl Another good way of doing this is creating an experimental branch in
407dnl repository...
408dnl ========================================================================
409ENABLE_DEVELOPMENT_CFLAGS=""
410enable_development_msg=""
411
412AC_MSG_CHECKING([for development mode])
413AC_ARG_ENABLE([development],
414    AC_HELP_STRING([--enable-development=@<:@yes|no@:>@],
415        [enable to allow development options @<:@default=no@:>@]
416    ),
417    [
418        if test "x$enableval" = "xyes"; then
419            enable_development=1
420            AC_DEFINE_UNQUOTED([ENABLE_DEVELOPMENT], [$enable_development], [Enable development variable])
421            ENABLE_DEVELOPMENT_CFLAGS="-g -O0"
422            enable_development_msg="enabled"
423        else
424            enable_development_msg="disabled"
425        fi
426    ],
427    [enable_development_msg="disabled"]
428)
429AC_MSG_RESULT([$enable_development_msg]
430AC_SUBST([ENABLE_DEVELOPMENT_CFLAGS]))
431
432dnl ========================================================================
433dnl Determine GDAL Support
434dnl
435dnl TODO: Now, --with-gdal can have only 1 value: path to gdal-config. It
436dnl could be useful to allow path to GDAL tree, because the cflags and the
437dnl libs can be obtained from GDAL tree too, apart from gdal-config
438dnl How to get cflags and libs from GDAL tree?
439dnl
440dnl LIBGDAL_CFLAGS="-I$with_gdal/port -I$with_gdal/ogr -I$with_gdal/alg -I$with_gdal/gcore -I$with_gdal/frmts "
441dnl LIBGDAL_LDFLAGS="-L${with_gdal}/.libs -lgdal -L${with_gdal}/ -lgdal"
442dnl ========================================================================
443dnl not used right now
444USE_GDAL_SOURCE_TREE="no"
445LIBGDAL_CFLAGS=""
446LIBGDAL_LDFLAGS=""
447
448AC_MSG_CHECKING([for GDAL])
449AC_ARG_WITH([gdal],
450        AC_HELP_STRING([--with-gdal=@<:@ARG@:>@],[specify location of gdal-config (ARG=path)]),
451        [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""])
452
453dnl If GDAL_CONFIG path not provided, try to find it
454if test "$GDAL_CONFIG" = ""; then
455    GDAL_CONFIG_TMP=`which gdal-config`
456    if test "`basename xx/${GDAL_CONFIG_TMP}`" = "gdal-config" ; then
457        AC_MSG_RESULT([yes])
458        GDAL_CONFIG=${GDAL_CONFIG_TMP}
459    else
460        AC_MSG_ERROR([gdal-config not found. Try --with-gdal=<path to gdal-config>])
461    fi
462fi
463
464dnl Check for GDAL options
465AC_MSG_CHECKING([for GDAL version])
466GDAL_VERSION=`$GDAL_CONFIG --version`
467AC_MSG_RESULT([$GDAL_VERSION])
468LIBGDAL_CFLAGS=`$GDAL_CONFIG --cflags`
469LIBGDAL_LDFLAGS=`$GDAL_CONFIG --libs`
470AC_SUBST([LIBGDAL_CFLAGS])
471AC_SUBST([LIBGDAL_LDFLAGS])
472
473dnl ===========================================================================
474dnl Find postgis sources, as we rely on liblwgeom
475dnl ===========================================================================
476
477POSTGIS_SRCDIR=""
478LIBLWGEOM_CFLAGS=""
479LIBLWGEOM_LDFLAGS=""
480AC_ARG_WITH([postgis-sources],
481    AC_HELP_STRING([--with-postgis-sources=DIR],
482                    [specify location of postgis sources]),
483    [POSTGIS_SRCDIR="$withval"], [POSTGIS_SRCDIR=""])
484
485if test -f "$POSTGIS_SRCDIR/liblwgeom/liblwgeom.h"; then
486    LIBLWGEOM_CFLAGS="-I${POSTGIS_SRCDIR}/liblwgeom"
487    LIBLWGEOM_LDFLAGS="${POSTGIS_SRCDIR}/liblwgeom/liblwgeom.a"
488else
489    AC_MSG_ERROR([${POSTGIS_SRCDIR} does not contain liblwgeom/liblwgeom.h or lwgeom/liblwgeom.h, try --with-postgis-sources=DIR (requires postgis svn version)])
490fi
491
492AC_SUBST([LIBLWGEOM_CFLAGS])
493AC_SUBST([LIBLWGEOM_LDFLAGS])
494AC_SUBST([POSTGIS_SRCDIR])
495
496
497dnl ===========================================================================
498dnl Detect the version of GEOS installed on the system
499dnl ===========================================================================
500
501AC_ARG_WITH([geos],
502    AS_HELP_STRING([--with-geos=@<:@ARG@:>@],
503                    [specify location of geos-config (ARG=path)]),
504    [GEOS_CONFIG="$withval"], [GEOS_CONFIG=""])
505
506if test "x$GEOS_CONFIG" = "x"; then
507    dnl GEOS_CONFIG was not specified, so search within the current path
508    AC_PATH_PROG([GEOS_CONFIG], [geos-config])
509
510    dnl If we couldn't find geos-config, display an error
511    if test "x$GEOS_CONFIG" = "x"; then
512        AC_MSG_ERROR([could not find geos-config within the current path. You may need to try re-running configure with a --with-geos parameter.])
513    fi
514else
515    dnl GEOS_CONFIG was specified; display a message to the user
516    if test "x$GEOS_CONFIG" = "xyes"; then
517        AC_MSG_ERROR([you must specify a parameter to --with-geos, e.g. --with-geos=/path/to/geos-config])
518    else
519        if test -f $GEOS_CONFIG; then
520            AC_MSG_RESULT([Using user-specified geos-config file: $GEOS_CONFIG])
521        else
522            AC_MSG_ERROR([the user-specified geos-config file $GEOS_CONFIG does not exist])
523        fi 
524    fi
525fi
526
527dnl ===========================================================================
528dnl Define version macros
529dnl
530
531POSTGIS_RASTER_VERSION="$POSTGIS_RASTER_MAJOR_VERSION.$POSTGIS_RASTER_MINOR_VERSION"
532POSTGIS_RASTER_LIB_VERSION="$POSTGIS_RASTER_MAJOR_VERSION.$POSTGIS_RASTER_MINOR_VERSION.$POSTGIS_RASTER_MICRO_VERSION"
533POSTGIS_RASTER_BUILD_DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
534POSTGIS_RASTER_SCRIPTS_VERSION="$POSTGIS_RASTER_LIB_VERSION"
535
536AC_DEFINE_UNQUOTED([POSTGIS_RASTER_VERSION], ["$POSTGIS_RASTER_VERSION"], [WKTRaster version])
537AC_DEFINE_UNQUOTED([POSTGIS_RASTER_LIB_VERSION], ["$POSTGIS_RASTER_LIB_VERSION"], [WKTRaster library version])
538AC_DEFINE_UNQUOTED([POSTGIS_RASTER_BUILD_DATE], ["$POSTGIS_RASTER_BUILD_DATE"], [WKTRaster build date])
539AC_DEFINE_UNQUOTED([POSTGIS_RASTER_SCRIPTS_VERSION], ["$POSTGIS_RASTER_SCRIPTS_VERSION"], [WKTRaster scripts version])
540
541AC_SUBST([POSTGIS_RASTER_VERSION])
542AC_SUBST([POSTGIS_RASTER_LIB_VERSION])
543AC_SUBST([POSTGIS_RASTER_BUILD_DATE])
544AC_SUBST([POSTGIS_RASTER_SCRIPTS_VERSION])
545
546
547dnl ===========================================================================
548dnl Other parameters
549dnl
550
551CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $PROJ_CPPFLAGS"
552dnl AC_MSG_RESULT([CPPFLAGS: $CPPFLAGS])
553
554SHLIB_LINK="$PGSQL_LDFLAGS"
555AC_SUBST([SHLIB_LINK])
556dnl AC_MSG_RESULT([SHLIB_LINK: $SHLIB_LINK])
557
558dnl Output the relevant files
559AC_OUTPUT([
560rt_core/Makefile
561rt_pg/Makefile
562test/Makefile
563test/core/Makefile
564test/regress/Makefile
565scripts/Makefile
566])
567
568dnl ===========================================================================
569echo
570echo "Version: ${POSTGIS_RASTER_LIB_VERSION}"
571echo "Build date: ${POSTGIS_RASTER_BUILD_DATE}"
572echo
573echo "Run make to build WKT Raster extension"
Note: See TracBrowser for help on using the browser.