1AC_INIT() 2AC_CHECK_FUNCS() 3 4dnl --------------------------------------------------------------------- 5dnl Look for libxml2 6dnl --------------------------------------------------------------------- 7 8AC_ARG_WITH(xml2-config, 9[ --with-xml2-config=PATH Specify path to xml2-config.],,) 10 11if test "$with_xml2_config" = "no" ; then 12 AC_MSG_ERROR([LibXML2 support is a need to TinyOWS !]) 13fi 14 15if 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 20else 21 AC_PATH_PROG(LIBXML2_CONFIG, xml2-config, no) 22fi 23 24if test "$LIBXML2_CONFIG" = "no" ; then 25 AC_MSG_ERROR([couldn't find xml2-config, try using --with-xml2-config=PATH]) 26fi 27 28XML2_VER=`$LIBXML2_CONFIG --version` 29AC_MSG_RESULT([checking for libxml2 version... $XML2_VER]) 30 31xml2_vers=`$LIBXML2_CONFIG --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` 32if test "$xml2_vers" -lt 2008000 ; then 33 AC_MSG_ERROR([You need at least libxml 2.8.0]) 34fi 35 36 37 38XML2_INC=`$LIBXML2_CONFIG --cflags` 39XML2_LIB=`$LIBXML2_CONFIG --libs` 40 41AC_SUBST(XML2_INC) 42AC_SUBST(XML2_LIB) 43 44 45dnl --------------------------------------------------------------------- 46dnl Debug 47dnl --------------------------------------------------------------------- 48 49AC_ARG_ENABLE(debug, 50[ --enable-debug enable debug mode], TINYOWS_DEBUG=1, TINYOWS_DEBUG=0) 51AC_SUBST(TINYOWS_DEBUG) 52 53 54dnl --------------------------------------------------------------------------- 55dnl Git 56dnl --------------------------------------------------------------------------- 57AC_CHECK_PROG(git, git, yes) 58if test "$git" = "yes" -a -d ".git"; then 59 GIT_FLAGS='"-D TINYOWS_GIT_COMMIT=\"$(shell git log --abbrev-commit -n 1 HEAD | grep commit)\""' 60 AC_SUBST(GIT_FLAGS) 61fi 62 63 64dnl --------------------------------------------------------------------------- 65dnl PostgreSQL / PostGIS support 66dnl --------------------------------------------------------------------------- 67 68AC_ARG_WITH(pg_config,[ --with-pg_config[[=ARG]] Include PostGIS Support (ARG=yes/path to pg_config)],,) 69 70if test "$with_pg_config" = "no" ; then 71 AC_MSG_ERROR([PostGIS support is a need to TinyOWS !]) 72elif test "$with_pg_config" = "yes" -o "$with_pg_config" = "" ; then 73 AC_PATH_PROG(PG_CONFIG, pg_config, no) 74else 75 AC_MSG_RESULT(yes) 76 PG_CONFIG=$with_pg_config 77fi 78 79if ! test -f "$PG_CONFIG" -a -x "$PG_CONFIG" ; then 80 AC_MSG_ERROR(['$PG_CONFIG' is not an executable. Make sure you use --with-pg_config=/path/to/pg_config]) 81fi 82 83PG_VER=`$PG_CONFIG --version` 84AC_MSG_RESULT([checking for PostgreSQL version... $PG_VER]) 85 86pg_vers=`$PG_CONFIG --version | sed 's/PostgreSQL //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` 87if test "$pg_vers" -lt 8001000 ; then 88 AC_MSG_ERROR([You need at least PostgreSQL 8.1.0]) 89fi 90 91 92POSTGIS_LIB="-L`$PG_CONFIG --libdir` -lpq" 93POSTGIS_INC="-I`$PG_CONFIG --includedir`" 94POSTGIS_SHARE=`$PG_CONFIG --sharedir` 95POSTGIS_BIN=`$PG_CONFIG --bindir` 96 97AC_SUBST(POSTGIS_INC) 98AC_SUBST(POSTGIS_LIB) 99AC_SUBST(POSTGIS_SHARE) 100AC_SUBST(POSTGIS_BIN) 101 102 103dnl --------------------------------------------------------------------------- 104dnl Shp2PgSQL 105dnl --------------------------------------------------------------------------- 106AC_ARG_WITH(shp2pgsql,[ --with-shp2pgsql[[=ARG]] shp2pgsql directory Support (ARG=path to shp2pgsql)],,) 107 108if test "$with_shp2gpsql" = "no" ; then 109 AC_MSG_ERROR([shp2pgsql is a need to TinyOWS !]) 110elif test "$with_shp2pgsql" = "yes" -o "$with_shp2pgsql" = "" ; then 111 AC_PATH_PROG(SHP2PGSQL, shp2pgsql, no) 112else 113 AC_MSG_RESULT(yes) 114 SHP2PGSQL=$with_shp2pgsql 115fi 116 117if ! test -f "$SHP2PGSQL" -a -x "$SHP2PGSQL" ; then 118 AC_MSG_ERROR(['$SHP2PGSQL' is not an executable. Make sure you use --with-shp2pgsql=/path/to/shp2pgsql]) 119fi 120 121AC_SUBST(SHP2PGSQL) 122 123 124dnl --------------------------------------------------------------------------- 125dnl Flex check 126dnl --------------------------------------------------------------------------- 127AC_PROG_LEX 128if test "$LEX" != flex; then 129 AC_MSG_ERROR("TinyOWS: Need flex to compile") 130fi 131 132dnl --------------------------------------------------------------------------- 133dnl FastCGI 134dnl --------------------------------------------------------------------------- 135 136USE_FCGI=0 137AC_ARG_WITH(fastcgi, 138 [ --with-fastcgi[[=ARG]] Include FastCGI support: recommanded (ARG=no/path to fastcgi dir)], 139 [FCGI_PATH="$withval"], [FCGI_PATH=""]) 140 141 142if test "x$FCGI_PATH" != "x"; then 143 AC_MSG_RESULT([checking user-specified fast-cgi location: $FCGI_PATH]) 144 FCGI_INC="-I$FCGI_PATH/include" 145 FCGI_LIB="-L$FCGI_PATH/lib" 146fi 147 148 149if test "x$FCGI_PATH" != "xno"; then 150 AC_CHECK_LIB(fcgi, FCGI_Accept, [ 151 AC_CHECK_HEADERS([fcgi_config.h fcgi_stdio.h],[ 152 USE_FCGI=1 153 ]) 154 ]) 155 156 dnl Some platforms use fastcgi subdir in include 157 if test "$USE_FCGI" = "0" ; then 158 echo "checking now FCGI in alternate fastcgi include dir" 159 AC_CHECK_LIB(fcgi, FCGI_Accept, [ 160 AC_CHECK_HEADERS([fastcgi/fcgi_config.h fastcgi/fcgi_stdio.h],[ 161 USE_FCGI=1 162 ]) 163 ]) 164 if test "x$FCGI_PATH" != "x"; then 165 FCGI_INC="-I$FCGI_PATH/include/fastcgi" 166 else 167 FCGI_INC="-I/usr/include/fastcgi" 168 fi 169 fi 170fi 171 172 173 174if test "$USE_FCGI" = "0" ; then 175 AC_MSG_WARN([\n\nNo FastCGI support. Performances will be strongly reduced !\n]) 176else 177 FCGI_LIB="$FCGI_LIB -lfcgi" 178fi 179 180AC_SUBST(FCGI_INC) 181AC_SUBST(FCGI_LIB) 182AC_SUBST(USE_FCGI) 183 184 185 186AC_OUTPUT(Makefile src/ows_define.h demo/tinyows.xml demo/install.sh test/wfs_100/config_wfs_100.xml test/wfs_110/config_wfs_110.xml test/wfs_100/install_wfs_100.sh test/wfs_110/install_wfs_110.sh) 187 188rm -rf autom4te.cache 189rm -f config.log config.status 190 191echo "------------------------" 192echo "NOTA: This TinyOWS version will need at least PostGIS 1.5.x" 193echo "------------------------" 194