source: trunk/zoo-kernel/configure.ac @ 19

Last change on this file since 19 was 15, checked in by david, 14 years ago

-ajout support perl

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

Search

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