source: branches/branch-1.2/zoo-kernel/configure.ac @ 764

Last change on this file since 764 was 301, checked in by djay, 13 years ago

Merge branch-1.2 r268:r296.

File size: 11.5 KB
Line 
1AC_INIT([ZOO Kernel], [1.2.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 python is installed
118# ===========================================================================
119
120AC_ARG_WITH([python],
121        [AS_HELP_STRING([--with-python=PATH], [To enable python support or specify an alternative directory for python installation,  disabled by default])],
122        [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""])
123
124AC_ARG_WITH([pyvers],
125        [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])],
126        [PYTHON_VERS="$withval"], [PYTHON_VERS=""])
127
128
129if test -z "$PYTHON_ENABLED"
130then
131        PYTHON_FILE=""
132else
133        PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
134        PYTHON_FILE="service_internal_python.o"
135        if test  "$PYTHON_PATH" = "yes"
136        then
137                # PHP was not specified, so search within the current path
138                AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config])
139        else
140                PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
141        fi
142
143        # Extract the linker and include flags
144        PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
145        PYTHON_CPPFLAGS=`$PYTHONCONFIG --cflags`
146
147        # Check headers file
148        CPPFLAGS_SAVE="$CPPFLAGS"
149        CPPFLAGS="$PYTHON_CPPFLAGS"
150        AC_CHECK_HEADERS([Python.h],
151                 [], [AC_MSG_ERROR([could not find headers include related to libpython])])
152
153        # Ensure we can link against libphp
154        LIBS_SAVE="$LIBS"
155        LIBS="$PYTHON_LDFLAGS"
156        PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
157        AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
158        AC_SUBST([PYTHON_CPPFLAGS])
159        AC_SUBST([PYTHON_LDFLAGS])
160fi
161
162AC_SUBST([PYTHON_ENABLED])
163AC_SUBST([PYTHON_FILE])
164
165# ===========================================================================
166# Detect if php is installed
167# ===========================================================================
168
169AC_ARG_WITH([php],
170        [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation,  disabled by default])],
171        [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
172
173
174if test -z "$PHP_ENABLED"
175then
176        PHP_FILE=""
177else
178        PHPCONFIG="$PHP_PATH/bin/php-config"
179        PHP_FILE="service_internal_php.o"
180        if test  "$PHP_PATH" = "yes"
181        then
182                # PHP was not specified, so search within the current path
183                AC_PATH_PROG([PHPCONFIG], [php-config])
184        else
185                PHPCONFIG="$PHP_PATH/bin/php-config"
186        fi
187
188        # Extract the linker and include flags
189        PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
190        PHP_CPPFLAGS=`$PHPCONFIG --includes`
191
192        # Check headers file
193        CPPFLAGS_SAVE="$CPPFLAGS"
194        CPPFLAGS="$PHP_CPPFLAGS"
195        AC_CHECK_HEADERS([sapi/embed/php_embed.h],
196                 [], [AC_MSG_ERROR([could not find headers include related to libphp])])
197
198        # Ensure we can link against libphp
199        LIBS_SAVE="$LIBS"
200        LIBS="$PHP_LDFLAGS"
201        # Shouldn't we get php here rather than php5 :) ??
202        AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
203        AC_SUBST([PHP_CPPFLAGS])
204        AC_SUBST([PHP_LDFLAGS])
205fi
206
207AC_SUBST([PHP_ENABLED])
208AC_SUBST([PHP_FILE])
209
210# ===========================================================================
211# Detect if perl is installed
212# ===========================================================================
213
214AC_ARG_WITH([perl],
215        [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation,  disabled by default])],
216        [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
217
218
219if test -z "$PERL_ENABLED"
220then
221        PERL_FILE=""
222else
223        PERL_FILE="service_internal_perl.o"
224        if test  "$PERL_PATH" = "yes"
225        then
226                # Perl was not specified, so search within the current path
227                AC_PATH_PROG([PERLCONFIG], [perl])
228        else
229                PERLCONFIG="$PERL_PATH/bin/perl"
230        fi
231
232        # Extract the linker and include flags
233        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
234        PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts`
235
236        # Check headers file
237        CPPFLAGS_SAVE="$CPPFLAGS"
238        CPPFLAGS="$PERL_CPPFLAGS"
239        AC_CHECK_HEADERS([EXTERN.h],
240                 [], [AC_MSG_ERROR([could not find headers include related to libperl])])
241
242        AC_SUBST([PERL_CPPFLAGS])
243        AC_SUBST([PERL_LDFLAGS])
244fi
245
246AC_SUBST([PERL_ENABLED])
247AC_SUBST([PERL_FILE])
248
249# ===========================================================================
250# Detect if java is installed
251# ===========================================================================
252
253AC_ARG_WITH([java],
254        [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME,  disabled by default])],
255        [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
256
257if test -z "$JAVA_ENABLED"
258then
259        JAVA_FILE=""
260else
261        JAVA_FILE="service_internal_java.o"
262        if test "x$JDKHOME" = "x";
263        then
264                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.])
265        fi      # JAVA was specified; display a message to the user
266        if test "x$JDKHOME" = "xyes";
267        then
268                AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
269        fi
270
271        # Extract the linker and include flags
272        if test "x$JDKHOME" = "xmacos";
273        then
274                JAVA_LDFLAGS="-framework JavaVM"
275                JAVA_CPPFLAGS="-I/Developer//SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
276        else
277                if test -d "$JDKHOME/jre/lib/i386";
278                then
279                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/client/ -ljvm -lpthread"
280                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
281                else
282                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/client/ -ljvm -lpthread"
283                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
284                fi
285        fi
286
287        # Check headers file (second time we check that in fact)
288        CPPFLAGS_SAVE="$CPPFLAGS"
289        CPPFLAGS="$JAVA_CPPFLAGS"
290        AC_CHECK_HEADERS([jni.h],
291                         [], [AC_MSG_ERROR([could not find headers include related to libjava])])
292
293        # Ensure we can link against libjava
294        LIBS_SAVE="$LIBS"
295        LIBS="$JAVA_LDFLAGS"
296        if test "x$JDKHOME" != "xmacos";
297        then
298                AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjava])], [])
299        fi
300
301        AC_SUBST([JAVA_CPPFLAGS])
302        AC_SUBST([JAVA_LDFLAGS])
303fi
304
305AC_SUBST([JAVA_ENABLED])
306AC_SUBST([JAVA_FILE])
307
308# ===========================================================================
309# Detect if spidermonkey is installed
310# ===========================================================================
311
312AC_ARG_WITH([js],
313        [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 ])],
314        [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""])
315
316if test -z "$JS_ENABLED"
317then
318        JS_FILE=""
319else
320        JS_FILE="service_internal_js.o"
321        if test "$JSHOME" = "yes"
322        then
323
324                #on teste si on est sous debian like
325                if test -f "/usr/bin/dpkg"
326                then
327                        if test -n "`dpkg -l | grep libmozjs185-dev`"
328                        then
329                                JS_CPPFLAGS="-I/usr/include/js/"
330                                JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm"
331                                JS_LIB="mozjs185"
332                        else
333                                XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`"
334                                if test -n "$XUL_VERSION"
335                                then
336                                        JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION"
337                                        JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm"
338                                        JS_LIB="mozjs"
339                                else
340                                        AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ])
341                                fi
342                        fi
343                else
344                        AC_MSG_ERROR([You must  specify your custom install of libmozjs185])
345                fi
346        else
347                JS_CPPFLAGS="-I$JSHOME/include/js/"
348                JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm"
349                JS_LIB="mozjs185"
350
351        fi
352        CPPFLAGS_SAVE="$CPPFLAGS"
353        CPPFLAGS="$JS_CPPFLAGS"
354
355        #AC_CHECK_HEADERS([jsapi.h],
356        #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
357
358       
359        LIBS_SAVE="$LIBS"
360        LIBS="$JS_LDFLAGS"
361
362        AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
363                       
364        AC_SUBST([JS_CPPFLAGS])
365        AC_SUBST([JS_LDFLAGS])
366fi
367
368AC_SUBST([JS_ENABLED])
369AC_SUBST([JS_FILE])
370
371AC_CONFIG_FILES([Makefile])
372AC_CONFIG_FILES([ZOOMakefile.opts])
373AC_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