root/0.9.0/configure.in

Revision 251, 3.7 kB (checked in by ol, 21 months ago)

Add Fast Cgi? support

Line 
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 2006020 ; then
33        AC_MSG_ERROR([You need at least libxml 2.6.20])
34fi
35
36
37
38XML2_INC=`$LIBXML2_CONFIG --cflags`
39XML2_LIB=`$LIBXML2_CONFIG --libs`
40
41AC_SUBST(XML2_INC)
42AC_SUBST(XML2_LIB)
43
44dnl ---------------------------------------------------------------------------
45dnl PostgreSQL / PostGIS support
46dnl ---------------------------------------------------------------------------
47
48AC_ARG_WITH(pg_config,[  --with-pg_config[[=ARG]]  Include PostGIS Support (ARG=yes/path to pg_config)],,)
49
50if test "$with_pg_config" = "no" ; then
51  AC_MSG_ERROR([PostGIS support is a need to TinyOWS !])
52elif test "$with_pg_config" = "yes" -o "$with_pg_config" = "" ; then
53  AC_PATH_PROG(PG_CONFIG, pg_config, no)
54else
55  AC_MSG_RESULT(yes)
56  PG_CONFIG=$with_pg_config
57fi
58
59if ! 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])
61fi
62
63PG_VER=`$PG_CONFIG --version`
64AC_MSG_RESULT([checking for PostgreSQL version... $PG_VER])
65
66pg_vers=`$PG_CONFIG --version | sed 's/PostgreSQL //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
67if test "$pg_vers" -lt 8001000 ; then
68        AC_MSG_ERROR([You need at least PostgreSQL 8.1.0])
69fi
70
71
72POSTGIS_LIB="-L`$PG_CONFIG --libdir` -lpq"
73POSTGIS_INC="-I`$PG_CONFIG --includedir`"
74POSTGIS_SHARE=`$PG_CONFIG --sharedir`
75POSTGIS_BIN=`$PG_CONFIG --bindir`
76
77AC_SUBST(POSTGIS_INC)
78AC_SUBST(POSTGIS_LIB)
79AC_SUBST(POSTGIS_SHARE)
80AC_SUBST(POSTGIS_BIN)
81
82
83dnl ---------------------------------------------------------------------------
84dnl FastCGI
85dnl ---------------------------------------------------------------------------
86
87USE_FCGI=0
88AC_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
93if 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"
97fi
98
99
100if 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        ])
106fi
107
108if test "$USE_FCGI" = "0" ; then
109  AC_MSG_WARN([No FastCGI support. Performances will be strongly reduced !])
110else
111  FCGI_LIB="$FCGI_LIB -lfcgi"
112fi
113
114AC_SUBST(FCGI_INC)
115AC_SUBST(FCGI_LIB)
116AC_SUBST(USE_FCGI)
117
118
119
120AC_OUTPUT(Makefile src/ows_define.h demo/config.xml demo/install.sh test/config.xml test/install.sh)
121
122rm -rf autom4te.cache
123rm -f config.log config.status
124
125echo "------------------------"
126echo "This TinyOWS version will need at least PostGIS 1.5.x"
127echo "------------------------"
Note: See TracBrowser for help on using the browser.