source: trunk/zoo-project/zoo-kernel/configure.ac @ 303

Last change on this file since 303 was 297, checked in by djay, 13 years ago

Initial MapServer? W*S output support integration, pass version number to 1.3.0 in configure.ac.

File size: 13.5 KB
Line 
1AC_INIT([ZOO Kernel], [1.3.0], [bugs@zoo-project.org])
2
3# Checks for programs.
4AC_PROG_YACC
5AC_PROG_CC
6AC_PROG_LEX
7AC_PROG_CXX
8AC_PROG_SED
9
10# Checks for libraries.
11AC_CHECK_LIB([cgic], [cgiMain])
12AC_CHECK_LIB([curl], [curl_easy_init curl_easy_setopt curl_easy_cleanup curl_easy_perform])
13AC_CHECK_LIB([dl], [dlopen dlsym dlerror dlclose])
14AC_CHECK_LIB([fl], [main])
15AC_CHECK_LIB([pthread], [main])
16AC_CHECK_LIB([fcgi], [main])
17AC_CHECK_LIB([ssl], [main])
18
19# Checks for header files.
20AC_FUNC_ALLOCA
21AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h malloc.h stddef.h stdlib.h string.h unistd.h])
22
23# Checks for typedefs, structures, and compiler characteristics.
24AC_HEADER_STDBOOL
25AC_TYPE_INT16_T
26AC_TYPE_INT32_T
27AC_TYPE_INT8_T
28AC_TYPE_PID_T
29AC_TYPE_SIZE_T
30AC_TYPE_UINT16_T
31AC_TYPE_UINT32_T
32AC_TYPE_UINT8_T
33
34# Checks for library functions.
35AC_FUNC_FORK
36AC_FUNC_MALLOC
37AC_FUNC_REALLOC
38AC_CHECK_FUNCS([dup2 getcwd memset setenv strdup strstr])
39
40#============================================================================
41# Detect if gdal is installed
42#============================================================================
43
44AC_ARG_WITH([gdal-config],
45        [AS_HELP_STRING([--with-gdal-config=FILE], [specify an alternative gdal-config file])],
46        [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""])
47if test -z $GDAL_CONFIG;
48then
49        AC_PATH_PROG([GDAL_CONFIG], [gdal-config])
50        if test -z $GDAL_CONFIG;
51        then
52                AC_MSG_ERROR([could not find gdal-config from libgdal within the current path. You may need to try re-running configure with a --with-gdal-config parameter.])
53        fi
54       
55else
56        if test -f $GDAL_CONFIG; then
57                AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG])
58        else
59                AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist])
60        fi
61fi
62
63GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
64GDAL_LIBS="`$GDAL_CONFIG --libs`"
65
66AC_SUBST([GDAL_CFLAGS])
67AC_SUBST([GDAL_LIBS])
68
69# ===========================================================================
70# Detect if libxml2 is installed
71# ===========================================================================
72
73AC_ARG_WITH([xml2config],
74        [AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])],
75        [XML2CONFIG="$withval"], [XML2CONFIG=""])
76
77if test "x$XML2CONFIG" = "x"; then
78        # XML2CONFIG was not specified, so search within the current path
79        AC_PATH_PROG([XML2CONFIG], [xml2-config])
80
81        # If we couldn't find xml2-config, display a warning
82        if test "x$XML2CONFIG" = "x"; then
83                AC_MSG_ERROR([could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter.])
84        fi
85else
86        # XML2CONFIG was specified; display a message to the user
87        if test "x$XML2CONFIG" = "xyes"; then
88                AC_MSG_ERROR([you must specify a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config])
89        else
90                if test -f $XML2CONFIG; then
91                        AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
92                else
93                        AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
94                fi     
95        fi
96fi
97
98# Extract the linker and include flags
99XML2_LDFLAGS=`$XML2CONFIG --libs`
100XML2_CPPFLAGS=`$XML2CONFIG --cflags`
101
102# Check headers file
103CPPFLAGS_SAVE="$CPPFLAGS"
104CPPFLAGS="$XML2_CPPFLAGS"
105AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
106                 [], [AC_MSG_ERROR([could not find headers include related to libxml2])])
107
108# Ensure we can link against libxml2
109LIBS_SAVE="$LIBS"
110LIBS="$XML2_LDFLAGS"
111AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
112
113AC_SUBST([XML2_CPPFLAGS])
114AC_SUBST([XML2_LDFLAGS])
115
116#============================================================================
117# Detect if mapserver is installed
118#============================================================================
119
120AC_ARG_WITH([mapserver],
121       [AS_HELP_STRING([--with-mapserver=PATH], [specify the path for MapServer compiled source tree])],
122       [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""])
123if test -z $MS_SRC_PATH;
124then
125       AC_PATH_PROG([MS_SRC_PATH], [mapserver])
126       if test "x$MS_SRC_PATH" = "xmacos";
127       then
128               AC_MSG_RESULT([Using MacOSX Framework for MapServer])
129       else
130               if test -d $MS_SRC_PATH;
131               then
132                       AC_MSG_ERROR([could not find the MapServer source tree. You may need to try re-running configure with a --with-mapserver parameter.])
133               fi
134       fi     
135else
136       if test "x$MS_SRC_PATH" = "xmacos";
137       then
138               MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl"
139               MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver "
140               AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree])
141               AC_MSG_RESULT([Using MacOS X Framework for MapServer])
142       else
143               if test -d $MS_SRC_PATH; then
144                       MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`"
145                       MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH "
146               
147                       AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
148               else
149                       AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist])
150               fi
151       fi
152       MS_FILE="service_internal_ms.o"
153fi
154
155MS_CFLAGS="$MS_CPPFLAGS"
156MS_LIBS="$MS_LDFLAGS"
157
158AC_SUBST([MS_CFLAGS])
159AC_SUBST([MS_LIBS])
160AC_SUBST([MS_FILE])
161
162# ===========================================================================
163# Detect if python is installed
164# ===========================================================================
165
166AC_ARG_WITH([python],
167        [AS_HELP_STRING([--with-python=PATH], [To enable python support or specify an alternative directory for python installation,  disabled by default])],
168        [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""])
169
170AC_ARG_WITH([pyvers],
171        [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])],
172        [PYTHON_VERS="$withval"], [PYTHON_VERS=""])
173
174
175if test -z "$PYTHON_ENABLED"
176then
177        PYTHON_FILE=""
178else
179        PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
180        PYTHON_FILE="service_internal_python.o"
181        if test  "$PYTHON_PATH" = "yes"
182        then
183                # PHP was not specified, so search within the current path
184                AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config])
185        else
186                PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
187        fi
188
189        # Extract the linker and include flags
190        PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
191        PYTHON_CPPFLAGS=`$PYTHONCONFIG --cflags`
192
193        # Check headers file
194        CPPFLAGS_SAVE="$CPPFLAGS"
195        CPPFLAGS="$PYTHON_CPPFLAGS"
196        AC_CHECK_HEADERS([Python.h],
197                 [], [AC_MSG_ERROR([could not find headers include related to libpython])])
198
199        # Ensure we can link against libphp
200        LIBS_SAVE="$LIBS"
201        LIBS="$PYTHON_LDFLAGS"
202        PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
203        AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
204        AC_SUBST([PYTHON_CPPFLAGS])
205        AC_SUBST([PYTHON_LDFLAGS])
206fi
207
208AC_SUBST([PYTHON_ENABLED])
209AC_SUBST([PYTHON_FILE])
210
211# ===========================================================================
212# Detect if php is installed
213# ===========================================================================
214
215AC_ARG_WITH([php],
216        [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation,  disabled by default])],
217        [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
218
219
220if test -z "$PHP_ENABLED"
221then
222        PHP_FILE=""
223else
224        PHPCONFIG="$PHP_PATH/bin/php-config"
225        PHP_FILE="service_internal_php.o"
226        if test  "$PHP_PATH" = "yes"
227        then
228                # PHP was not specified, so search within the current path
229                AC_PATH_PROG([PHPCONFIG], [php-config])
230        else
231                PHPCONFIG="$PHP_PATH/bin/php-config"
232        fi
233
234        # Extract the linker and include flags
235        PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
236        PHP_CPPFLAGS=`$PHPCONFIG --includes`
237
238        # Check headers file
239        CPPFLAGS_SAVE="$CPPFLAGS"
240        CPPFLAGS="$PHP_CPPFLAGS"
241        AC_CHECK_HEADERS([sapi/embed/php_embed.h],
242                 [], [AC_MSG_ERROR([could not find headers include related to libphp])])
243
244        # Ensure we can link against libphp
245        LIBS_SAVE="$LIBS"
246        LIBS="$PHP_LDFLAGS"
247        # Shouldn't we get php here rather than php5 :) ??
248        AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
249        AC_SUBST([PHP_CPPFLAGS])
250        AC_SUBST([PHP_LDFLAGS])
251fi
252
253AC_SUBST([PHP_ENABLED])
254AC_SUBST([PHP_FILE])
255
256# ===========================================================================
257# Detect if perl is installed
258# ===========================================================================
259
260AC_ARG_WITH([perl],
261        [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation,  disabled by default])],
262        [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
263
264
265if test -z "$PERL_ENABLED"
266then
267        PERL_FILE=""
268else
269        PERL_FILE="service_internal_perl.o"
270        if test  "$PERL_PATH" = "yes"
271        then
272                # Perl was not specified, so search within the current path
273                AC_PATH_PROG([PERLCONFIG], [perl])
274        else
275                PERLCONFIG="$PERL_PATH/bin/perl"
276        fi
277
278        # Extract the linker and include flags
279        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
280        PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts`
281
282        # Check headers file
283        CPPFLAGS_SAVE="$CPPFLAGS"
284        CPPFLAGS="$PERL_CPPFLAGS"
285        AC_CHECK_HEADERS([EXTERN.h],
286                 [], [AC_MSG_ERROR([could not find headers include related to libperl])])
287
288        AC_SUBST([PERL_CPPFLAGS])
289        AC_SUBST([PERL_LDFLAGS])
290fi
291
292AC_SUBST([PERL_ENABLED])
293AC_SUBST([PERL_FILE])
294
295# ===========================================================================
296# Detect if java is installed
297# ===========================================================================
298
299AC_ARG_WITH([java],
300        [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME,  disabled by default])],
301        [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
302
303if test -z "$JAVA_ENABLED"
304then
305        JAVA_FILE=""
306else
307        JAVA_FILE="service_internal_java.o"
308        if test "x$JDKHOME" = "x";
309        then
310                AC_MSG_ERROR([could not find java installation path within the current path. You may need to try re-running configure with a --with-java parameter.])
311        fi      # JAVA was specified; display a message to the user
312        if test "x$JDKHOME" = "xyes";
313        then
314                AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
315        fi
316
317        # Extract the linker and include flags
318        if test "x$JDKHOME" = "xmacos";
319        then
320                JAVA_LDFLAGS="-framework JavaVM"
321                JAVA_CPPFLAGS="-I/Developer//SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
322        else
323                if test -d "$JDKHOME/jre/lib/i386";
324                then
325                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/client/ -ljvm -lpthread"
326                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
327                else
328                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/client/ -ljvm -lpthread"
329                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
330                fi
331        fi
332
333        # Check headers file (second time we check that in fact)
334        CPPFLAGS_SAVE="$CPPFLAGS"
335        CPPFLAGS="$JAVA_CPPFLAGS"
336        AC_CHECK_HEADERS([jni.h],
337                         [], [AC_MSG_ERROR([could not find headers include related to libjava])])
338
339        # Ensure we can link against libjava
340        LIBS_SAVE="$LIBS"
341        LIBS="$JAVA_LDFLAGS"
342        if test "x$JDKHOME" != "xmacos";
343        then
344                AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjava])], [])
345        fi
346
347        AC_SUBST([JAVA_CPPFLAGS])
348        AC_SUBST([JAVA_LDFLAGS])
349fi
350
351AC_SUBST([JAVA_ENABLED])
352AC_SUBST([JAVA_FILE])
353
354# ===========================================================================
355# Detect if spidermonkey is installed
356# ===========================================================================
357
358AC_ARG_WITH([js],
359        [AS_HELP_STRING([--with-js=PATH], [specify --with-js=path-to-js to enable js support, specify --with-js on linux debian like, js support is disabled by default ])],
360        [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""])
361
362if test -z "$JS_ENABLED"
363then
364        JS_FILE=""
365else
366        JS_FILE="service_internal_js.o"
367        if test "$JSHOME" = "yes"
368        then
369
370                #on teste si on est sous debian like
371                if test -f "/usr/bin/dpkg"
372                then
373                        if test -n "`dpkg -l | grep libmozjs185-dev`"
374                        then
375                                JS_CPPFLAGS="-I/usr/include/js/"
376                                JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm"
377                                JS_LIB="mozjs185"
378                        else
379                                XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`"
380                                if test -n "$XUL_VERSION"
381                                then
382                                        JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION"
383                                        JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm"
384                                        JS_LIB="mozjs"
385                                else
386                                        AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ])
387                                fi
388                        fi
389                else
390                        AC_MSG_ERROR([You must  specify your custom install of libmozjs185])
391                fi
392        else
393                JS_CPPFLAGS="-I$JSHOME/include/js/"
394                JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm"
395                JS_LIB="mozjs185"
396
397        fi
398        CPPFLAGS_SAVE="$CPPFLAGS"
399        CPPFLAGS="$JS_CPPFLAGS"
400
401        #AC_CHECK_HEADERS([jsapi.h],
402        #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
403
404       
405        LIBS_SAVE="$LIBS"
406        LIBS="$JS_LDFLAGS"
407
408        AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
409                       
410        AC_SUBST([JS_CPPFLAGS])
411        AC_SUBST([JS_LDFLAGS])
412fi
413
414AC_SUBST([JS_ENABLED])
415AC_SUBST([JS_FILE])
416
417AC_CONFIG_FILES([Makefile])
418AC_CONFIG_FILES([ZOOMakefile.opts])
419AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png