# Required initializer AC_INIT(Makefile.inc.in) # don't let AC_PROG_CC force "-g -O2" : ${CFLAGS="-Wall"} AC_PROG_CC dnl --------------------------------------------------------------------- dnl Checks for header files. dnl --------------------------------------------------------------------- AC_HEADER_STDC dnl --------------------------------------------------------------------- dnl Add -fPIC to compiler flags dnl --------------------------------------------------------------------- CFLAGS="$CFLAGS -fPIC" AC_CHECK_FUNC(symlink,[CFLAGS="$CFLAGS -DHAVE_SYMLINK"]) TARGETS= AC_SUBST(MISC_ENABLED) # macro that is used to parse a --with-apxs parameter AC_DEFUN([APXS_CHECK],[ AC_SUBST(APXS) AC_ARG_WITH( apxs, [ --with-apxs[=/path/to/apxs] Apache 2 apxs tool location], , [with_apxs="yes"] ) if test "$with_apxs" = "yes"; then AC_PATH_PROG(APXS, apxs2) if test -z "$APXS"; then AC_PATH_PROG(APXS, apxs) fi elif test "$with_apxs" = "no"; then AC_MSG_ERROR(apxs is required and cannot be disabled) else AC_MSG_CHECKING(for apxs usability in $with_apxs) if test -x "$with_apxs"; then APXS=$with_apxs AC_MSG_RESULT(yes) else AC_MSG_ERROR($with_apxs not found or not executable) fi fi if test -z "$APXS"; then AC_MSG_ERROR(apxs utility not found. use --with-apxs to specify its location.) fi AC_SUBST(APXS) APACHE_SBINDIR=`$APXS -q SBINDIR` APACHE_BINDIR=`$APXS -q BINDIR` AC_SUBST(APACHE_SBINDIR) AC_SUBST(APACHE_BINDIR) AC_MSG_CHECKING([for apachectl utility]) APACHECTL= if test -x "$APACHE_SBINDIR/apachectl" ; then APACHECTL="$APACHE_SBINDIR/apachectl" else if test -x "$APACHE_SBINDIR/apache2ctl" ; then APACHECTL="$APACHE_SBINDIR/apache2ctl" else AC_PATH_PROG(APACHECTL,apachectl) if test -z "$APACHECTL"; then AC_PATH_PROG(APACHECTL,apache2ctl) fi fi fi if test -z "$APACHECTL"; then AC_MSG_RESULT([Unable to find apachectl utility, you will not be able to restart and install module with the created Makefile]) else AC_MSG_RESULT([$APACHECTL]) fi AC_SUBST(APACHECTL) AC_SUBST(APXS_INC,-I`$APXS -q INCLUDEDIR`) AC_SUBST(APXS_LIBS,`$APXS -q LIBS`) AC_SUBST(APXS_LDFLAGS,`$APXS -q LDFLAGS`) SBINDIR=`$APXS -q SBINDIR` TARGET=`$APXS -q TARGET` HTTPD="$SBINDIR/$TARGET" AC_SUBST(HTTPD,"$HTTPD") ]) AC_DEFUN([CURL_CHECK],[ AC_SUBST(CURLCONFIG) AC_ARG_WITH(curl_config, AC_HELP_STRING([--with-curl-config], [path to curl-config program]), , [with_curl_config=yes] ) if test "$with_curl_config" = "yes"; then AC_PATH_PROG(CURLCONFIG, curl-config) elif test "$with_curl_config" = "no"; then AC_MSG_ERROR(curl-config is required and cannot be disabled) else AC_MSG_CHECKING(for curl-config usability in $with_curl_config) if test -x "$with_curl_config"; then CURLCONFIG=$with_curl_config AC_MSG_RESULT(yes) else AC_MSG_ERROR($with_curl_config not found or not executable) fi fi if test -z "$CURLCONFIG"; then AC_MSG_ERROR(curl-config utility not found. use --with-curl-config to specify its location.) fi AC_SUBST(CURLCONFIG) AC_SUBST(CURL_CFLAGS,`$CURLCONFIG --cflags`) AC_SUBST(CURL_LIBS,`$CURLCONFIG --libs`) ]) AC_DEFUN([PKGCONFIG_CHECK],[ AC_SUBST(PKGCONFIG) AC_ARG_WITH(pkg-config, AC_HELP_STRING([--with-pkg-config[=PATH]],[path to pkg-config)]), , [with_pkg_config=yes]) if test "$with_pkg_config" = "no"; then AC_MSG_CHECKING(for pkg-config usability) AC_MSG_RESULT(disabled by request) else if test "$with_pkg_config" = "yes" ; then AC_PATH_PROG(PKGCONFIG, pkg-config) else AC_MSG_CHECKING(for pkg-config usability in $with_pkg_config) if test -x "$with_pkg_config"; then PKGCONFIG=$with_pkg_config AC_MSG_RESULT(yes) else AC_MSG_ERROR($with_pkg_config not found or not executable) fi fi if test -z "$PKGCONFIG"; then AC_MSG_ERROR(pkg-config utility not found. use --with-pkg-config to specify its location.) fi fi AC_SUBST(PKGCONFIG) ]) AC_DEFUN([CAIRO_CHECK],[ AC_ARG_WITH(cairo, AC_HELP_STRING([--with-cairo[[=ARG]]],[Include Cairo Support (ARG=yes/no/path to cairo.pc)]), , [with_cairo=yes]) if test "$with_cairo" = "no" -o "$with_cairo" = "" ; then AC_MSG_RESULT(no) CAIRO_CONFIG="no" else if test -z "$PKGCONFIG"; then AC_MSG_ERROR([cairo support requested, but pkg-config not found/configured]) fi if test "$with_cairo" = "yes" ; then AC_MSG_CHECKING(for cairo pkg-config entry) `$PKGCONFIG --silence-errors -- cairo >> /dev/null` if test $? -eq 0 ; then AC_MSG_RESULT(found) CAIRO_CONFIG="cairo" else AC_MSG_ERROR([cairo support requested, but not found.Try installing the cairo development headers]) fi else CAIRO_CONFIG=$with_cairo fi fi if test "$CAIRO_CONFIG" = "no" ; then AC_MSG_WARN([cairo support has been disabled or could not be configured. full WMS support cannot be enabled on the resulting build]) CAIRO_ENABLED= CAIRO_INC= CAIRO_LIB= else CAIRO_ENABLED="-DUSE_CAIRO" CAIRO_LIB=`$PKGCONFIG --libs $CAIRO_CONFIG` CAIRO_INC=`$PKGCONFIG --cflags $CAIRO_CONFIG` fi AC_SUBST(CAIRO_ENABLED,$CAIRO_ENABLED) AC_SUBST(CAIRO_INC,$CAIRO_INC) AC_SUBST(CAIRO_LIB,$CAIRO_LIB) ]) AC_DEFUN([PIXMAN_CHECK],[ AC_ARG_WITH(pixman, AC_HELP_STRING([--with-pixman[[=ARG]]],[Include Pixman Support (ARG=yes/no/path to pixman.pc)]), , [with_pixman=yes]) AC_MSG_CHECKING(for Pixman) if test "$with_pixman" = "no" -o "$with_pixman" = "" ; then AC_MSG_RESULT(disabled) PIXMAN_CONFIG="no" else if test -z "$PKGCONFIG"; then AC_MSG_ERROR([pixman support requested, but pkg-config not found/configured]) fi if test "$with_pixman" = "yes" ; then AC_MSG_RESULT(searching default locations) AC_MSG_CHECKING(for pixman pkg-config entry) `$PKGCONFIG --silence-errors -- pixman >> /dev/null` if test $? -eq 0 ; then AC_MSG_RESULT(found) PIXMAN_CONFIG="pixman" else `$PKGCONFIG --silence-errors -- pixman-1 >> /dev/null` if test $? -eq 0 ; then AC_MSG_RESULT(found) PIXMAN_CONFIG="pixman-1" else AC_MSG_ERROR([pixman support requested, but not found.Try installing the pixman development headers]) fi fi else `$PKGCONFIG $with_pixman` if test $? -eq 0 ; then AC_MSG_RESULT([using supplied pkg-config definition $with_pixman]) PIXMAN_CONFIG=$with_pixman else AC_MSG_ERROR([failed to use $with_pixman]) fi fi fi if test "$PIXMAN_CONFIG" = "no" ; then AC_MSG_WARN([pixman support has been disabled or could not be configured. full WMS will use the internal (usually slower) image merging functions]) PIXMAN_ENABLED= PIXMAN_INC= PIXMAN_LIB= else AC_MSG_CHECKING([if pixman version is >= 0.13.2]) PIXMAN_VERSION=`$PKGCONFIG --modversion -- "$PIXMAN_CONFIG"` AC_MSG_RESULT([$PIXMAN_VERSION]) `$PKGCONFIG --silence-errors -- "$PIXMAN_CONFIG >= 0.13.2" >> /dev/null` if test $? -eq 0 ; then PIXMAN_ENABLED="-DUSE_PIXMAN" PIXMAN_LIB=`$PKGCONFIG --libs $PIXMAN_CONFIG` PIXMAN_INC=`$PKGCONFIG --cflags $PIXMAN_CONFIG` else AC_MSG_WARN([pixman support has been disabled because your version is too old. full WMS will use the internal (usually slower) image merging functions]) PIXMAN_ENABLED= PIXMAN_INC= PIXMAN_LIB= fi fi AC_SUBST(PIXMAN_ENABLED,$PIXMAN_ENABLED) AC_SUBST(PIXMAN_INC,$PIXMAN_INC) AC_SUBST(PIXMAN_LIB,$PIXMAN_LIB) ]) AC_DEFUN([MEMCACHE_CHECK],[ AC_ARG_ENABLE(memcache, AC_HELP_STRING([--enable-memcache],[Enable memcache backend]), , [enable_memcache=yes] ) AC_SUBST(MEMCACHE_ENABLED) if test "$enable_memcache" == "yes"; then AC_SUBST(MEMCACHE_ENABLED) if test -z "$APUCONFIG"; then AC_MSG_ERROR(memcache check failed: apu-config utility not found) fi OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS `$APUCONFIG --ldflags --libs --link-ld`" OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS `$APUCONFIG --includes`" #check we can link against the memcache functions (i.e. is apr-util recent enough) AC_CHECK_LIB(aprutil-1, apr_memcache_hash,[MEMCACHE_ENABLED=[-DUSE_MEMCACHE]],) if test -z "$APU_LIBS"; then AC_CHECK_LIB(aprutil, apr_memcache_hash,[MEMCACHE_ENABLED=[-DUSE_MEMCACHE]],) fi if test -n "$MEMCACHE_ENABLED"; then #we managed to link against the memcache functions. are the headers available? AC_CHECK_HEADER([apr_memcache.h],, [ AC_MSG_WARN([apr-util contains memcache functions, but the headers where not found. memcache cache backend disabled]) MEMCACHE_ENABLED="" ]) else AC_MSG_WARN([supplied apr-util does not contain memcache functions. memcache cache backend disabled]) fi CPPFLAGS="$OLDCPPFLAGS" LDFLAGS="$OLDLDFLAGS" AC_SUBST(MEMCACHE_ENABLED) fi ]) AC_DEFUN([APU_CHECK],[ AC_SUBST(APUCONFIG) AC_SUBST(MEMCACHE_ENABLED) AC_ARG_WITH(apu_config, AC_HELP_STRING([--with-apu-config], [path to apu-config program]), , [with_apu_config=yes] ) if test "$with_apu_config" = "yes"; then AC_MSG_CHECKING(for apu-config in default locations) if test -n "$APXS"; then APXSFULL=`which "$APXS"` APXSDIR=`dirname "$APXSFULL"` if test -x "$APXSDIR/apu-config"; then APUCONFIG="$APXSDIR/apu-config" elif test -x "$APACHE_SBINDIR/apu-config"; then APUCONFIG="$APACHE_SBINDIR/apu-config" elif test -x "$APACHE_BINDIR/apu-config"; then APUCONFIG="$APACHE_BINDIR/apu-config" elif test -x "$APXSDIR/apu-1-config"; then APUCONFIG="$APXSDIR/apu-1-config" elif test -x "$APACHE_SBINDIR/apu-1-config"; then APUCONFIG="$APACHE_SBINDIR/apu-1-config" elif test -x "$APACHE_BINDIR/apu-1-config"; then APUCONFIG="$APACHE_BINDIR/apu-1-config" fi fi if test -z "$APUCONFIG"; then AC_PATH_PROG(APUCONFIG, apu-config) fi if test -z "$APUCONFIG"; then AC_PATH_PROG(APUCONFIG, apu-1-config) fi if test -n "$APUCONFIG"; then AC_MSG_RESULT([using $APUCONFIG, use --with-apu-config=/path/to/apu-(1-)config to modify]) else AC_MSG_RESULT([not found]) fi else AC_MSG_CHECKING(for apu-config usability in $with_apu_config) if test -x "$with_apu_config"; then APUCONFIG=$with_apu_config AC_MSG_RESULT(yes) else AC_MSG_ERROR($with_apu_config not found or not executable) fi fi if test -z "$APUCONFIG"; then AC_MSG_ERROR(apu-config utility not found) else APU_LIBS=`$APUCONFIG --link-libtool` APU_INC=`$APUCONFIG --includes` fi AC_SUBST(APUCONFIG) AC_SUBST(APU_INC) AC_SUBST(APU_LIBS) ]) AC_DEFUN([APR_CHECK],[ AC_SUBST(APRCONFIG) AC_ARG_WITH(apr_config, AC_HELP_STRING([--with-apr-config], [path to apr-config program]), , [with_apr_config=yes] ) if test "$with_apr_config" = "yes"; then AC_MSG_CHECKING(for apr-config in default locations) if test -n "$APXS"; then APXSFULL=`which "$APXS"` APXSDIR=`dirname "$APXSFULL"` if test -x "$APXSDIR/apr-config"; then APRCONFIG="$APXSDIR/apr-config" elif test -x "$APACHE_SBINDIR/apr-config"; then APRCONFIG="$APACHE_SBINDIR/apr-config" elif test -x "$APACHE_BINDIR/apr-config"; then APRCONFIG="$APACHE_BINDIR/apr-config" elif test -x "$APXSDIR/apr-1-config"; then APRCONFIG="$APXSDIR/apr-1-config" elif test -x "$APACHE_SBINDIR/apr-1-config"; then APRCONFIG="$APACHE_SBINDIR/apr-1-config" elif test -x "$APACHE_BINDIR/apr-1-config"; then APRCONFIG="$APACHE_BINDIR/apr-1-config" fi fi if test -z "$APRCONFIG"; then AC_PATH_PROG(APRCONFIG, apr-config) fi if test -z "$APRCONFIG"; then AC_PATH_PROG(APRCONFIG, apr-1-config) fi if test -n "$APRCONFIG"; then AC_MSG_RESULT([using $APRCONFIG, use --with-apr-config=/path/to/apr-(1-)config to modify]) else AC_MSG_RESULT([not found]) fi elif test "$with_apr_config" = "no"; then AC_MSG_ERROR(apr-config is required and cannot be disabled) else AC_MSG_CHECKING(for apr-config usability in $with_apr_config) if test -x "$with_apr_config"; then APRCONFIG=$with_apr_config AC_MSG_RESULT(yes) else AC_MSG_ERROR($with_apr_config not found or not executable) fi fi if test -z "$APRCONFIG"; then AC_MSG_ERROR(apr-config utility not found. use --with-apr-config to specify its location.) fi AC_SUBST(APRCONFIG) AC_SUBST(APR_CFLAGS,`$APRCONFIG --cppflags --cflags`) AC_SUBST(APR_INC,`$APRCONFIG --includes`) AC_SUBST(APR_LIBS,`$APRCONFIG --link-libtool`) AC_SUBST(LIBTOOL, `$APRCONFIG --apr-libtool`) ]) AC_DEFUN([PCRE_CHECK],[ PCRE_LIBS='' PCRE_CFLAGS='' AC_MSG_CHECKING([for pcre library inclusion]) AC_ARG_WITH(pcre, [ --with-pcre[[=prefix]] use pcre instead of posix regular expressions],, with_pcre="yes") if test "x$with_pcre" = "xno" ; then AC_MSG_RESULT([disabled by request]) else if test "x$with_pcre" = "xyes" ; then AC_MSG_RESULT([in system locations]) AC_CHECK_LIB(pcre, pcre_compile,PCRE_LIBS=[-lpcre], [AC_MSG_WARN([pcre library not found, will fall back to posix regular expressions which are less powerfull])]) if test -n "$PCRE_LIBS"; then AC_CHECK_HEADER([pcre.h],PCRE_ENABLED=[-DUSE_PCRE],[AC_MSG_WARN([pcre.h not found, will fall back to posix regular expressions which are less powerfull])]) fi else OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$with_pcre/lib" OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$with_pcre/include" AC_CHECK_LIB(pcre, pcre_compile,PCRE_LIBS="-L$with_pcre/lib -lpcre", [AC_MSG_WARN([pcre library not found in $with_pcre/lib, will fall back to posix regular expressions which are less powerfull])]) CPPFLAGS="$OLDCPPFLAGS" LDFLAGS="$OLDLDFLAGS" if test -n "$PCRE_LIBS"; then test -f $with_pcre/include/pcre.h && PCRE_CFLAGS="-I$with_pcre/include" test -f $with_pcre/lib/pcre.h && PCRE_CFLAGS="-I$with_pcre/lib" test -f $with_pcre/pcre.h && PCRE_CFLAGS="-I$with_pcre" if test -z $PCRE_CFLAGS; then AC_MSG_WARN([pcre.h not found, will fall back to posix regular expressions which are less powerfull]) else PCRE_ENABLED="-DUSE_PCRE" fi fi fi fi AC_SUBST([PCRE_ENABLED]) AC_SUBST([PCRE_LIBS]) AC_SUBST([PCRE_CFLAGS]) ]) AC_DEFUN([MAPSERVER_CHECK],[ AC_ARG_ENABLE(mapserver, AC_HELP_STRING([--enable-mapserver],[Enable mapserver sources (experimental)]), , [enable_mapserver=no] ) if test "$enable_mapserver" == "yes"; then AC_SUBST(MAPSERVER_ENABLED,"-DUSE_MAPSERVER") MAPSERVER_LIB=`../mapserver-config --libs` MAPSERVER_LIB="$MAPSERVER_LIB ../../libmapserver.a" AC_SUBST(MAPSERVER_LIB,$MAPSERVER_LIB) fi ]) AC_DEFUN([DEBUG_CHECK],[ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[Enable debug build]), , [enable_debug=no] ) if test "$enable_debug" == "yes"; then CFLAGS="$CFLAGS -g -O0 -DDEBUG" else CFLAGS="-O2 $CFLAGS -DNDEBUG" fi AC_SUBST(CFLAGS,$CFLAGS) ]) AC_DEFUN([AC_EXPAND_PATH],[ if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then $2="$1" else $2="`pwd`/$1" fi ]) AC_DEFUN([GDAL_CHECK],[ AC_ARG_WITH(gdal, AC_HELP_STRING([--with-gdal], [path to gdal-config program]), , [with_gdal=yes] ) GDALCONFIG="" if test "$with_gdal" = "no"; then AC_MSG_WARN("gdal support disabled by request: advanced seeding options will not be available") else if test "$with_gdal" = "yes"; then AC_PATH_PROG(GDALCONFIG, gdal-config) else AC_MSG_CHECKING(for gdal-config usability in $with_gdal) if test -x "$with_gdal"; then GDALCONFIG=$with_gdal AC_MSG_RESULT(ok) else AC_MSG_ERROR($with_gdal not found or not executable) fi fi if test -n "$GDALCONFIG"; then GDAL_ENABLED="-DUSE_GDAL" GDAL_CFLAGS=`$GDALCONFIG --cflags --includes` GDAL_LIBS=`$GDALCONFIG --libs` OGR_ENABLED=`$GDALCONFIG --ogr-enabled` fi fi if test "x$OGR_ENABLED" == "xyes"; then OGR_ENABLED="-DUSE_OGR" fi AC_SUBST(OGR_ENABLED,$OGR_ENABLED) AC_SUBST(GDAL_ENABLED,$GDAL_ENABLED) AC_SUBST(GDAL_INC,$GDAL_CFLAGS) AC_SUBST(GDAL_LIB,$GDAL_LIBS) ]) AC_DEFUN([GEOS_CHECK],[ AC_ARG_WITH(geos, AC_HELP_STRING([--with-geos], [path to geos-config program]), , [with_geos=yes] ) GEOSCONFIG="" if test "$with_geos" = "no"; then AC_MSG_WARN("geos support disabled by request: advanced seeding options will not be available") else if test "$with_geos" = "yes"; then AC_PATH_PROG(GEOSCONFIG, geos-config) else AC_MSG_CHECKING(for geos-config usability in $with_geos) if test -x "$with_geos"; then GEOSCONFIG=$with_geos AC_MSG_RESULT(yes) else AC_MSG_ERROR($with_geos not found or not executable) fi fi if test -n "$GEOSCONFIG"; then GEOS_CFLAGS=`$GEOSCONFIG --cflags` GEOS_LIBS="`$GEOSCONFIG --ldflags` -lgeos_c" GEOS_ENABLED="-DUSE_GEOS" fi fi AC_SUBST(GEOS_ENABLED,$GEOS_ENABLED) AC_SUBST(GEOS_INC,$GEOS_CFLAGS) AC_SUBST(GEOS_LIB,$GEOS_LIBS) ]) AC_DEFUN([FASTCGI_CHECK],[ AC_ARG_WITH(fastcgi, AC_HELP_STRING([--with-fastcgi=DIR],[Specify where FASTCGI is installed]), ,[with_fastcgi=no]) AC_MSG_CHECKING(whether to enable FASTCGI) FASTCGI_LIB='' FASTCGI_INC='' FASTCGI_ENABLED='' if test x"$with_fastcgi" == "xno"; then AC_MSG_RESULT([not requested. use --with-fastcgi[=dir] to enable]) else if test x"$with_fastcgi" != "xyes"; then FASTCGI_DIR="$with_fastcgi" AC_EXPAND_PATH($FASTCGI_DIR, FASTCGI_DIR) test -f $FASTCGI_DIR/lib/libfcgi.a -o -f $FASTCGI_DIR/lib/libfcgi.so -o -f $FASTCGI_DIR/lib/libfcgi.sl -o -f $FASTCGI_DIR/lib/libfcgi.dylib && FASTCGI_LIBDIR="$FASTCGI_DIR/lib" test -f $FASTCGI_DIR/lib64/libfcgi.a -o -f $FASTCGI_DIR/lib64/libfcgi.so -o -f $FASTCGI_DIR/lib64/libfcgi.sl -o -f $FASTCGI_DIR/libfcgi.dylib && FASTCGI_LIBDIR="$FASTCGI_DIR/lib64" test -f $FASTCGI_DIR/libfcgi.a -o -f $FASTCGI_DIR/libfcgi.so -o -f $FASTCGI_DIR/libfcgi.sl -o -f $FASTCGI_DIR/libfcgi.dylib && FASTCGI_LIBDIR="$FASTCGI_DIR" test -f $FASTCGI_DIR/include/fcgiapp.h && FASTCGI_INCLUDE="$FASTCGI_DIR/include" test -f $FASTCGI_DIR/lib/fcgiapp.h && FASTCGI_INCLUDE="$FASTCGI_DIR/lib" test -f $FASTCGI_DIR/fcgiapp.h && FASTCGI_INCLUDE="$FASTCGI_DIR" if test -n "$FASTCGI_LIBDIR" ; then FASTCGI_LIB="-L$FASTCGI_LIBDIR -lfcgi" AC_MSG_RESULT([using libfastcgi from $FASTCGI_LIB]) else AC_MSG_ERROR([cannot find fastcgi lib in $FASTCGI_DIR]) fi if test -n "$FASTCGI_INCLUDE" ; then FASTCGI_INC=-I$FASTCGI_INCLUDE FASTCGI_ENABLED="-DUSE_FASTCGI" else AC_MSG_ERROR([cannot find fastcgi header fcgiapp.h in $FASTCGI_DIR]) fi else dnl check for fastcgi in system locations AC_CHECK_LIB(fcgi, FCGI_Accept, FASTCGI_LIB="-lfcgi",[AC_MSG_ERROR([cannot find fastcgi lib in system path])],) AC_CHECK_HEADER([fcgi_stdio.h],, [AC_MSG_ERROR([cannot find fastcgi headers in system path])]) FASTCGI_ENABLED="-DUSE_FASTCGI" fi fi AC_SUBST(FASTCGI_INC,$FASTCGI_INC) AC_SUBST(FASTCGI_LIB,$FASTCGI_LIB) AC_SUBST(FASTCGI_ENABLED,$FASTCGI_ENABLED) ]) AC_DEFUN([TIFF_CHECK],[ AC_ARG_WITH(tiff, AC_HELP_STRING([--with-tiff=DIR],[Specify where TIFF is installed]), TIFF_DIR=$withval,TIFF_DIR='') AC_EXPAND_PATH($TIFF_DIR, TIFF_DIR) AC_CHECKING(where TIFF is installed) TIFF_LIB='' TIFF_INC='' TIFF_FOUND='no' TIFF_ENABLED="-DUSE_TIFF" if test -n "$TIFF_DIR" -a x$withval != "xno" -a x$withval != "xyes"; then test -f $TIFF_DIR/lib/libtiff.a -o -f $TIFF_DIR/lib/libtiff.so -o -f $TIFF_DIR/lib/libtiff.sl -o -f $TIFF_DIR/lib/libtiff.dylib && TIFF_LIBDIR="$TIFF_DIR/lib" test -f $TIFF_DIR/lib64/libtiff.a -o -f $TIFF_DIR/lib64/libtiff.so -o -f $TIFF_DIR/lib64/libtiff.sl -o -f $TIFF_DIR/libtiff.dylib && TIFF_LIBDIR="$TIFF_DIR/lib64" test -f $TIFF_DIR/libtiff.a -o -f $TIFF_DIR/libtiff.so -o -f $TIFF_DIR/libtiff.sl -o -f $TIFF_DIR/libtiff.dylib && TIFF_LIBDIR="$TIFF_DIR" test -f $TIFF_DIR/include/tiffio.h && TIFF_INCLUDE="$TIFF_DIR/include" test -f $TIFF_DIR/lib/tiffio.h && TIFF_INCLUDE="$TIFF_DIR/lib" test -f $TIFF_DIR/tiffio.h && TIFF_INCLUDE="$TIFF_DIR" if test -n "$TIFF_LIBDIR" ; then TIFF_LIB="-L$TIFF_LIBDIR -ltiff" AC_MSG_RESULT([ using libtiff from $TIFF_LIB]) else AC_MSG_WARN([cannot find tiff lib in $TIFF_DIR]) TIFF_ENABLED="" fi if test -n "$TIFF_INCLUDE" ; then AC_CHECK_HEADER([$TIFF_INCLUDE/tiffio.h],TIFF_INC=-I$TIFF_INCLUDE, [ AC_MSG_WARN([cannot find tiff headers]) TIFF_ENABLED="" ]) else AC_MSG_WARN([cannot find tiff headers in $TIFF_DIR]) TIFF_ENABLED="" fi else if test x$withval != "xno"; then dnl check for tiff in system locations AC_CHECK_LIB(tiff, TIFFReadScanline, TIFF_LIB="-ltiff",,) AC_CHECK_HEADER([tiffio.h],, [ AC_MSG_WARN([cannot find tiff headers in system path]) TIFF_ENABLED="" ]) if test -n "$TIFF_LIB" ; then AC_MSG_RESULT([using libtiff from system libs.]) else AC_MSG_WARN([TIFF (libtiff) library cannot be found. install or reconfigure with --with-tiff=DIR]) TIFF_ENABLED="" fi else TIFF_ENABLED="" fi fi if test -n $TIFF_ENABLED; then AC_ARG_ENABLE(tiff_write_support, AC_HELP_STRING([--enable-tiff-write-support],[Enable tiff cache write support (experimental)]), , [enable_tiff_write_support=no] ) if test "$enable_tiff_write_support" == "yes"; then TIFF_ENABLED="$TIFF_ENABLED -DUSE_TIFF_WRITE" fi fi AC_SUBST(TIFF_INC,$TIFF_INC) AC_SUBST(TIFF_LIB,$TIFF_LIB) AC_SUBST(TIFF_ENABLED,$TIFF_ENABLED) ]) AC_DEFUN([PNG_CHECK],[ AC_ARG_WITH(png, AC_HELP_STRING([--with-png=DIR],[Specify where PNG is installed]), PNG_DIR=$withval,PNG_DIR='') AC_EXPAND_PATH($PNG_DIR, PNG_DIR) AC_CHECKING(where PNG is installed) PNG_LIB='' PNG_INC='' PNG_FOUND='no' if test -n "$PNG_DIR" ; then test -f $PNG_DIR/lib/libpng.a -o -f $PNG_DIR/lib/libpng.so -o -f $PNG_DIR/lib/libpng.sl -o -f $PNG_DIR/lib/libpng.dylib && PNG_LIBDIR="$PNG_DIR/lib" test -f $PNG_DIR/lib64/libpng.a -o -f $PNG_DIR/lib64/libpng.so -o -f $PNG_DIR/lib64/libpng.sl -o -f $PNG_DIR/libpng.dylib && PNG_LIBDIR="$PNG_DIR/lib64" test -f $PNG_DIR/libpng.a -o -f $PNG_DIR/libpng.so -o -f $PNG_DIR/libpng.sl -o -f $PNG_DIR/libpng.dylib && PNG_LIBDIR="$PNG_DIR" test -f $PNG_DIR/include/png.h && PNG_INCLUDE="$PNG_DIR/include" test -f $PNG_DIR/lib/png.h && PNG_INCLUDE="$PNG_DIR/lib" test -f $PNG_DIR/png.h && PNG_INCLUDE="$PNG_DIR" if test -n "$PNG_LIBDIR" ; then PNG_LIB="-L$PNG_LIBDIR -lpng" AC_MSG_RESULT([ using libpng from $PNG_LIB]) else AC_MSG_ERROR([cannot find png lib in $PNG_DIR]) fi if test -n "$PNG_INCLUDE" ; then AC_CHECK_HEADER([$PNG_INCLUDE/png.h],PNG_INC=-I$PNG_INCLUDE, [AC_MSG_ERROR([cannot find png headers])]) else AC_MSG_ERROR([cannot find png headers in $PNG_DIR]) fi else dnl check for png in system locations AC_CHECK_LIB(png, png_init_io, PNG_LIB="-lpng",, $ZLIB_LIB) AC_CHECK_HEADER([png.h],, [AC_MSG_ERROR([cannot find png headers in system path])]) if test -n "$PNG_LIB" ; then AC_MSG_RESULT([using libpng from system libs.]) else AC_MSG_ERROR([PNG (libpng) library cannot be found. install or reconfigure with --with-png=DIR]) fi fi AC_CHECK_HEADER([setjmp.h],,[AC_MSG_ERROR([setjmp.h is required with libpng])]) AC_SUBST(PNG_INC,$PNG_INC) AC_SUBST(PNG_LIB,$PNG_LIB) ]) AC_DEFUN([SQLITE_CHECK],[ AC_ARG_WITH(sqlite, AC_HELP_STRING([--with-sqlite], [path to sqlite-config program]), , [with_sqlite=yes] ) SQLITE_DIR="" if test x"$with_sqlite" != "xyes" -a x"$with_sqlite" != "xno"; then AC_EXPAND_PATH($with_sqlite, SQLITE_DIR) fi SQLITE_LIB='' SQLITE_INC='' SQLITE_ENABLED='' if test -n "$SQLITE_DIR" ; then test -f $SQLITE_DIR/lib/libsqlite3.a -o -f $SQLITE_DIR/lib/libsqlite3.so -o -f $SQLITE_DIR/lib/libsqlite3.sl -o -f $SQLITE_DIR/lib/libsqlite3.dylib && SQLITE_LIBDIR="$SQLITE_DIR/lib" test -f $SQLITE_DIR/lib64/libsqlite.a -o -f $SQLITE_DIR/lib64/libsqlite3.so -o -f $SQLITE_DIR/lib64/libsqlite3.sl -o -f $SQLITE_DIR/libsqlite3.dylib && SQLITE_LIBDIR="$SQLITE_DIR/lib64" test -f $SQLITE_DIR/libsqlite3.a -o -f $SQLITE_DIR/libsqlite3.so -o -f $SQLITE_DIR/libsqlite3.sl -o -f $SQLITE_DIR/libsqlite3.dylib && SQLITE_LIBDIR="$SQLITE_DIR" test -f $SQLITE_DIR/include/sqlite3.h && SQLITE_INCLUDE="$SQLITE_DIR/include" test -f $SQLITE_DIR/include/sqlite/sqlite3.h && SQLITE_INCLUDE="$SQLITE_DIR/include/sqlite" test -f $SQLITE_DIR/lib/sqlite3.h && SQLITE_INCLUDE="$SQLITE_DIR/lib" test -f $SQLITE_DIR/sqlite3.h && SQLITE_INCLUDE="$SQLITE_DIR" if test -n "$SQLITE_LIBDIR" ; then OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$SQLITE_LIBDIR -lsqlite3" AC_CHECK_LIB(sqlite3, sqlite3_open_v2, SQLITE_LIB="-L$SQLITE_LIBDIR -lsqlite3",,) if test -z "$SQLITE_LIB" ; then AC_CHECK_LIB(sqlite3, sqlite3_open, AC_MSG_ERROR([SQLITE library found but is too old. Need at least 3.5.0]), AC_MSG_ERROR([SQLITE (libsqlite3) library cannot be found. install or reconfigure with --with-sqlite=DIR]), ) fi LDFLAGS="$OLDLDFLAGS" else AC_MSG_ERROR([cannot find sqlite lib in $SQLITE_DIR]) fi if test -n "$SQLITE_INCLUDE" ; then AC_CHECK_HEADER([$SQLITE_INCLUDE/sqlite3.h],SQLITE_INC=-I$SQLITE_INCLUDE, [AC_MSG_ERROR([cannot use sqlite3.h headers from $SQLITE_INCLUDE])]) else AC_MSG_ERROR([cannot find sqlite3.h]) fi SQLITE_ENABLED="-DUSE_SQLITE" AC_MSG_RESULT([using sqlite from $SQLITE_DIR]) elif test x"$with_sqlite" = "xyes"; then dnl check for sqlite in system locations AC_CHECK_HEADER([sqlite3.h],, [AC_MSG_ERROR([cannot find sqlite3.h header in system path])]) AC_CHECK_LIB(sqlite3, sqlite3_open_v2, SQLITE_LIB="-lsqlite3",,) if test -n "$SQLITE_LIB" ; then AC_MSG_RESULT([using libsqlite3 from system libs.]) SQLITE_ENABLED="-DUSE_SQLITE" else AC_CHECK_LIB(sqlite3, sqlite3_open, AC_MSG_ERROR([SQLITE library found but is too old. Need at least 3.5.0]), AC_MSG_ERROR([SQLITE (libsqlite3) library cannot be found. install or reconfigure with --with-sqlite=DIR]), ) fi else AC_MSG_RESULT([sqlite support disabled by request]) fi AC_SUBST(SQLITE_INC,$SQLITE_INC) AC_SUBST(SQLITE_LIB,$SQLITE_LIB) AC_SUBST(SQLITE_ENABLED,$SQLITE_ENABLED) ]) AC_DEFUN([JPEG_CHECK],[ AC_ARG_WITH(jpeg, AC_HELP_STRING([--with-jpeg=DIR],[Specify where JPEG is installed]), JPEG_DIR=$withval,JPEG_DIR='') AC_EXPAND_PATH($JPEG_DIR, JPEG_DIR) AC_CHECKING(where JPEG is installed) JPEG_LIB='' JPEG_INC='' JPEG_FOUND='no' if test -n "$JPEG_DIR" ; then test -f $JPEG_DIR/lib/libjpeg.a -o -f $JPEG_DIR/lib/libjpeg.so -o -f $JPEG_DIR/lib/libjpeg.sl -o -f $JPEG_DIR/lib/libjpeg.dylib && JPEG_LIBDIR="$JPEG_DIR/lib" test -f $JPEG_DIR/lib64/libjpeg.a -o -f $JPEG_DIR/lib64/libjpeg.so -o -f $JPEG_DIR/lib64/libjpeg.sl -o -f $JPEG_DIR/libjpeg.dylib && JPEG_LIBDIR="$JPEG_DIR/lib64" test -f $JPEG_DIR/libjpeg.a -o -f $JPEG_DIR/libjpeg.so -o -f $JPEG_DIR/libjpeg.sl -o -f $JPEG_DIR/libjpeg.dylib && JPEG_LIBDIR="$JPEG_DIR" test -f $JPEG_DIR/include/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR/include" test -f $JPEG_DIR/include/jpeg/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR/include/jpeg" test -f $JPEG_DIR/lib/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR/lib" test -f $JPEG_DIR/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR" if test -n "$JPEG_LIBDIR" ; then JPEG_LIB="-L$JPEG_LIBDIR -ljpeg" AC_MSG_RESULT([using libjpeg from $JPEG_LIB]) else AC_MSG_ERROR([cannot find jpeg lib in $JPEG_DIR]) fi if test -n "$JPEG_INCLUDE" ; then AC_CHECK_HEADER([$JPEG_INCLUDE/jpeglib.h],JPEG_INC=-I$JPEG_INCLUDE, [AC_MSG_ERROR([cannot find jpeg headers])]) else AC_MSG_ERROR([cannot find jpeg headers in $JPEG_DIR]) fi else dnl check for jpeg in system locations AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LIB="-ljpeg",,) AC_CHECK_HEADER([jpeglib.h],, [AC_MSG_ERROR([cannot find jpeg headers in system path])]) if test -n "$JPEG_LIB" ; then AC_MSG_RESULT([using libjpeg from system libs.]) else AC_MSG_ERROR([JPEG (libjpeg) library cannot be found. install or reconfigure with --with-jpeg=DIR]) fi fi AC_SUBST(JPEG_INC,$JPEG_INC) AC_SUBST(JPEG_LIB,$JPEG_LIB) ]) AC_DEFUN([LOCKMECH_CHECK],[ AC_ARG_WITH(lock_mechanism, AC_HELP_STRING([--with-lock-mechanism=file|semaphore],[Specify the locking mechanism to use, either file based or posix-semaphore based.]), ,with_lock_mechanism='file') if test "x$with_lock_mechanism" = "xsemaphore"; then AC_CHECK_HEADER([semaphore.h],,[AC_MSG_ERROR([cannot find semaphore.h])]) AC_CHECK_HEADER([fcntl.h],,[AC_MSG_ERROR([cannot find fcntl.h])]) MISC_ENABLED="-DUSE_SEMLOCK $MISC_ENABLED" else if test "x$with_lock_mechanism" != "xfile"; then AC_MSG_ERROR([lock mechanism can only be one of (file) or (semaphore). got $with_lock_mechanism]) fi fi ]) DEBUG_CHECK LOCKMECH_CHECK AC_ARG_ENABLE(version_string, AC_HELP_STRING([--enable-version-string],[add mod-mapcache version string to the apache server header]), , [enable_version_string=yes] ) if test "$enable_version_string" != "yes"; then MISC_ENABLED="-DDISABLE_VERSION_STRING $MISC_ENABLED" fi AC_ARG_ENABLE(module, AC_HELP_STRING([--enable-module],[Enable apache module building]), , [enable_module=yes] ) if test "$enable_module" == "yes"; then APXS_CHECK AC_SUBST(MODULE_TARGET,"mod_mapcache.la") else AC_SUBST(MODULE_TARGET,"") fi FASTCGI_CHECK APR_CHECK APU_CHECK MEMCACHE_CHECK SQLITE_CHECK PKGCONFIG_CHECK # CAIRO_CHECK PIXMAN_CHECK PNG_CHECK JPEG_CHECK TIFF_CHECK PCRE_CHECK GDAL_CHECK GEOS_CHECK MAPSERVER_CHECK AC_SUBST(MISC_ENABLED,$MISC_ENABLED) CURL_CHECK # Write config.status and the Makefile AC_CONFIG_FILES(Makefile.inc) AC_OUTPUT