| 1 | AC_INIT() |
|---|
| 2 | AC_CHECK_FUNCS() |
|---|
| 3 | |
|---|
| 4 | dnl --------------------------------------------------------------------- |
|---|
| 5 | dnl Look for libxml2 |
|---|
| 6 | dnl --------------------------------------------------------------------- |
|---|
| 7 | |
|---|
| 8 | AC_ARG_WITH(xml2-config, |
|---|
| 9 | [ --with-xml2-config=PATH Specify path to xml2-config.],,) |
|---|
| 10 | |
|---|
| 11 | if test "$with_xml2_config" = "no" ; then |
|---|
| 12 | AC_MSG_ERROR([LibXML2 support is a need to TinyOWS !]) |
|---|
| 13 | fi |
|---|
| 14 | |
|---|
| 15 | if test "`basename xx/$with_xml2_config`" = "xml2-config" ; then |
|---|
| 16 | LIBXML2_CONFIG="$with_xml2_config" |
|---|
| 17 | if ! test -f "$LIBXML2_CONFIG" -a -x "$LIBXML2_CONFIG" ; then |
|---|
| 18 | AC_MSG_ERROR(['$LIBXML2_CONFIG' is not an executable. Make sure you use --with-xml2-config=/path/to/xml2-config]) |
|---|
| 19 | fi |
|---|
| 20 | else |
|---|
| 21 | AC_PATH_PROG(LIBXML2_CONFIG, xml2-config, no) |
|---|
| 22 | fi |
|---|
| 23 | |
|---|
| 24 | if test "$LIBXML2_CONFIG" = "no" ; then |
|---|
| 25 | AC_MSG_ERROR([couldn't find xml2-config, try using --with-xml2-config=PATH]) |
|---|
| 26 | fi |
|---|
| 27 | |
|---|
| 28 | XML2_VER=`$LIBXML2_CONFIG --version` |
|---|
| 29 | AC_MSG_RESULT([checking for libxml2 version... $XML2_VER]) |
|---|
| 30 | |
|---|
| 31 | xml2_vers=`$LIBXML2_CONFIG --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` |
|---|
| 32 | if test "$xml2_vers" -lt 2006020 ; then |
|---|
| 33 | AC_MSG_ERROR([You need at least libxml 2.6.20]) |
|---|
| 34 | fi |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | XML2_INC=`$LIBXML2_CONFIG --cflags` |
|---|
| 39 | XML2_LIB=`$LIBXML2_CONFIG --libs` |
|---|
| 40 | |
|---|
| 41 | AC_SUBST(XML2_INC) |
|---|
| 42 | AC_SUBST(XML2_LIB) |
|---|
| 43 | |
|---|
| 44 | dnl --------------------------------------------------------------------------- |
|---|
| 45 | dnl PostgreSQL / PostGIS support |
|---|
| 46 | dnl --------------------------------------------------------------------------- |
|---|
| 47 | |
|---|
| 48 | AC_ARG_WITH(pg_config,[ --with-pg_config[[=ARG]] Include PostGIS Support (ARG=yes/path to pg_config)],,) |
|---|
| 49 | |
|---|
| 50 | if test "$with_pg_config" = "no" ; then |
|---|
| 51 | AC_MSG_ERROR([PostGIS support is a need to TinyOWS !]) |
|---|
| 52 | elif test "$with_pg_config" = "yes" -o "$with_pg_config" = "" ; then |
|---|
| 53 | AC_PATH_PROG(PG_CONFIG, pg_config, no) |
|---|
| 54 | else |
|---|
| 55 | AC_MSG_RESULT(yes) |
|---|
| 56 | PG_CONFIG=$with_pg_config |
|---|
| 57 | fi |
|---|
| 58 | |
|---|
| 59 | if ! test -f "$PG_CONFIG" -a -x "$PG_CONFIG" ; then |
|---|
| 60 | AC_MSG_ERROR(['$PG_CONFIG' is not an executable. Make sure you use --with-pg_config=/path/to/pg_config]) |
|---|
| 61 | fi |
|---|
| 62 | |
|---|
| 63 | PG_VER=`$PG_CONFIG --version` |
|---|
| 64 | AC_MSG_RESULT([checking for PostgreSQL version... $PG_VER]) |
|---|
| 65 | |
|---|
| 66 | pg_vers=`$PG_CONFIG --version | sed 's/PostgreSQL //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` |
|---|
| 67 | if test "$pg_vers" -lt 8001000 ; then |
|---|
| 68 | AC_MSG_ERROR([You need at least PostgreSQL 8.1.0]) |
|---|
| 69 | fi |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | POSTGIS_LIB="-L`$PG_CONFIG --libdir` -lpq" |
|---|
| 73 | POSTGIS_INC="-I`$PG_CONFIG --includedir`" |
|---|
| 74 | POSTGIS_SHARE=`$PG_CONFIG --sharedir` |
|---|
| 75 | POSTGIS_BIN=`$PG_CONFIG --bindir` |
|---|
| 76 | |
|---|
| 77 | AC_SUBST(POSTGIS_INC) |
|---|
| 78 | AC_SUBST(POSTGIS_LIB) |
|---|
| 79 | AC_SUBST(POSTGIS_SHARE) |
|---|
| 80 | AC_SUBST(POSTGIS_BIN) |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | dnl --------------------------------------------------------------------------- |
|---|
| 84 | dnl FastCGI |
|---|
| 85 | dnl --------------------------------------------------------------------------- |
|---|
| 86 | |
|---|
| 87 | USE_FCGI=0 |
|---|
| 88 | AC_ARG_WITH(fastcgi, |
|---|
| 89 | [ --with-fastcgi[[=ARG]] Include FastCGI support: recommanded (ARG=no/path to fastcgi dir)], |
|---|
| 90 | [FCGI_PATH="$withval"], [FCGI_PATH=""]) |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | if test "x$FCGI_PATH" != "x"; then |
|---|
| 94 | AC_MSG_RESULT([checking user-specified fast-cgi location: $FCGI_PATH]) |
|---|
| 95 | FCGI_INC="-I$LIBICONV_PATH/include" |
|---|
| 96 | FCGI_LIB="-L$LIBICONV_PATH/lib" |
|---|
| 97 | fi |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | if test "x$FCGI_PATH" != "xno"; then |
|---|
| 101 | AC_CHECK_LIB(fcgi, FCGI_Accept, [ |
|---|
| 102 | AC_CHECK_HEADERS([fcgi_config.h fcgi_stdio.h],[ |
|---|
| 103 | USE_FCGI=1 |
|---|
| 104 | ]) |
|---|
| 105 | ]) |
|---|
| 106 | fi |
|---|
| 107 | |
|---|
| 108 | if test "$USE_FCGI" = "0" ; then |
|---|
| 109 | AC_MSG_WARN([No FastCGI support. Performances will be strongly reduced !]) |
|---|
| 110 | else |
|---|
| 111 | FCGI_LIB="$FCGI_LIB -lfcgi" |
|---|
| 112 | fi |
|---|
| 113 | |
|---|
| 114 | AC_SUBST(FCGI_INC) |
|---|
| 115 | AC_SUBST(FCGI_LIB) |
|---|
| 116 | AC_SUBST(USE_FCGI) |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | |
|---|
| 120 | AC_OUTPUT(Makefile src/ows_define.h demo/config.xml demo/install.sh test/config.xml test/install.sh) |
|---|
| 121 | |
|---|
| 122 | rm -rf autom4te.cache |
|---|
| 123 | rm -f config.log config.status |
|---|
| 124 | |
|---|
| 125 | echo "------------------------" |
|---|
| 126 | echo "This TinyOWS version will need at least PostGIS 1.5.x" |
|---|
| 127 | echo "------------------------" |
|---|