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

Last change on this file since 464 was 459, checked in by djay, 10 years ago

Initial introduction of Value and Range in AllowedValues?, update zcfg documentation. Return valid Status code when returning ExceptionRepport?.

File size: 16.0 KB
Line 
1AC_INIT([ZOO Kernel], [1.4.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 fastcgi is available
71# ===========================================================================
72
73AC_ARG_WITH([fastcgi],
74        [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])],
75        [FCGIPATH="$withval"], [FCGIPATH=""])
76
77# Extract the linker and include flags
78FCGI_LDFLAGS="-L$FCGIPATH/lib"
79FCGI_CPPFLAGS="-I$FCGIPATH/include"
80
81# Check headers file
82CPPFLAGS_SAVE="$CPPFLAGS"
83CPPFLAGS="$FCGI_CPPFLAGS"
84AC_CHECK_HEADERS([fcgi_stdio.h],
85                 [], [AC_MSG_ERROR([could not find headers include related to fastcgi])])
86
87AC_SUBST([FCGI_CPPFLAGS])
88AC_SUBST([FCGI_LDFLAGS])
89
90# ===========================================================================
91# Detect if proj is installed
92# ===========================================================================
93
94AC_ARG_WITH([proj],
95        [AS_HELP_STRING([--with-proj=PATH], [specify an alternative location for PROJ4 setup])],
96        [PROJPATH="$withval"], [PROJPATH=""])
97
98# Extract the linker and include flags
99PROJ_LDFLAGS="-L$PROJPATH/lib"
100PROJ_CPPFLAGS="-I$PROJPATH/include"
101
102# Check headers file
103CPPFLAGS_SAVE="$CPPFLAGS"
104CPPFLAGS="$PROJ_CPPFLAGS"
105AC_CHECK_HEADERS([proj_api.h],
106                 [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
107
108AC_SUBST([PROJ_CPPFLAGS])
109AC_SUBST([PROJ_LDFLAGS])
110
111# ===========================================================================
112# Detect if libxml2 is installed
113# ===========================================================================
114
115AC_ARG_WITH([xml2config],
116        [AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])],
117        [XML2CONFIG="$withval"], [XML2CONFIG=""])
118
119if test "x$XML2CONFIG" = "x"; then
120        # XML2CONFIG was not specified, so search within the current path
121        AC_PATH_PROG([XML2CONFIG], [xml2-config])
122
123        # If we couldn't find xml2-config, display a warning
124        if test "x$XML2CONFIG" = "x"; then
125                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.])
126        fi
127else
128        # XML2CONFIG was specified; display a message to the user
129        if test "x$XML2CONFIG" = "xyes"; then
130                AC_MSG_ERROR([you must specify a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config])
131        else
132                if test -f $XML2CONFIG; then
133                        AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
134                else
135                        AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
136                fi     
137        fi
138fi
139
140# Extract the linker and include flags
141XML2_LDFLAGS=`$XML2CONFIG --libs`
142XML2_CPPFLAGS=`$XML2CONFIG --cflags`
143
144# Check headers file
145CPPFLAGS_SAVE="$CPPFLAGS"
146CPPFLAGS="$XML2_CPPFLAGS"
147AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
148                 [], [AC_MSG_ERROR([could not find headers include related to libxml2])])
149
150# Ensure we can link against libxml2
151LIBS_SAVE="$LIBS"
152LIBS="$XML2_LDFLAGS"
153AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
154
155AC_SUBST([XML2_CPPFLAGS])
156AC_SUBST([XML2_LDFLAGS])
157
158#============================================================================
159# Detect if mapserver is installed
160#============================================================================
161
162AC_ARG_WITH([mapserver],
163       [AS_HELP_STRING([--with-mapserver=PATH], [specify the path for MapServer compiled source tree])],
164       [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""])
165
166if test -z $MS_SRC_PATH;
167then
168        MS_CPPFLAGS=""
169        MS_LDFLAGS=""
170else
171       if test "x$MS_SRC_PATH" = "xmacos";
172       then
173               MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl"
174               MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver "
175               AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree])
176               AC_MSG_RESULT([Using MacOS X Framework for MapServer])
177       else
178               if test -d $MS_SRC_PATH; then
179                       MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`"
180                       MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH "
181               
182                       AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
183               else
184                       AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist])
185               fi
186       fi
187       MS_FILE="service_internal_ms.o"
188fi
189
190MS_CFLAGS="$MS_CPPFLAGS"
191MS_LIBS="$MS_LDFLAGS"
192
193AC_SUBST([MS_CFLAGS])
194AC_SUBST([MS_LIBS])
195AC_SUBST([MS_FILE])
196
197# ===========================================================================
198# Detect if ruby is installed
199# ===========================================================================
200AC_ARG_WITH([ruby],
201        [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation,  disabled by default])],
202        [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""])
203
204AC_ARG_WITH([rvers],
205        [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])],
206        [RUBY_VERS="$withval"], [RUBY_VERS=""])
207
208
209if test -z "$RUBY_ENABLED"
210then
211        RUBY_FILE=""
212else
213        RUBY_FILE="service_internal_ruby.o"
214
215        # Extract the linker and include flags
216        RUBY_LDFLAGS="-lruby"
217        RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS"
218
219        # Check headers file
220        CPPFLAGS_SAVE="$CPPFLAGS"
221        CPPFLAGS="$RUBY_CPPFLAGS"
222        AC_CHECK_HEADERS([ruby.h],
223                 [], [AC_MSG_ERROR([could not find headers include related to libruby])])
224
225        # Ensure we can link against libphp
226        LIBS_SAVE="$LIBS"
227        LIBS="$RUBY_LDFLAGS"
228        # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
229        AC_SUBST([RUBY_CPPFLAGS])
230        AC_SUBST([RUBY_LDFLAGS])
231fi
232
233AC_SUBST([RUBY_ENABLED])
234AC_SUBST([RUBY_FILE])
235
236# ===========================================================================
237# Detect if python is installed
238# ===========================================================================
239
240AC_ARG_WITH([python],
241        [AS_HELP_STRING([--with-python=PATH], [To enable python support or specify an alternative directory for python installation,  disabled by default])],
242        [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""])
243
244AC_ARG_WITH([pyvers],
245        [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])],
246        [PYTHON_VERS="$withval"], [PYTHON_VERS=""])
247
248
249if test -z "$PYTHON_ENABLED"
250then
251        PYTHON_FILE=""
252else
253        PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
254        PYTHON_FILE="service_internal_python.o"
255        if test  "$PYTHON_PATH" = "yes"
256        then
257                # PHP was not specified, so search within the current path
258                PYTHONCFG_PATH=`which python${PYTHON_VERS}-config`
259                if test -z "${PYTHONCFG_PATH}" ; then
260                AC_PATH_PROG([PYTHONCONFIG], [python-config-${PYTHON_VERS}])
261                else
262                AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config])
263                fi
264        else
265                PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
266        fi
267
268        # Extract the linker and include flags
269        PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
270        PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes`
271
272        # Check headers file
273        CPPFLAGS_SAVE="$CPPFLAGS"
274        CPPFLAGS="$PYTHON_CPPFLAGS"
275        AC_CHECK_HEADERS([Python.h],
276                 [], [AC_MSG_ERROR([could not find headers include related to libpython])])
277
278        # Ensure we can link against libphp
279        LIBS_SAVE="$LIBS"
280        LIBS="$PYTHON_LDFLAGS"
281        PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
282        AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
283        AC_SUBST([PYTHON_CPPFLAGS])
284        AC_SUBST([PYTHON_LDFLAGS])
285fi
286
287AC_SUBST([PYTHON_ENABLED])
288AC_SUBST([PYTHON_FILE])
289
290# ===========================================================================
291# Detect if php is installed
292# ===========================================================================
293
294AC_ARG_WITH([php],
295        [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation,  disabled by default])],
296        [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
297
298
299if test -z "$PHP_ENABLED"
300then
301        PHP_FILE=""
302else
303        PHPCONFIG="$PHP_PATH/bin/php-config"
304        PHP_FILE="service_internal_php.o"
305        if test  "$PHP_PATH" = "yes"
306        then
307                # PHP was not specified, so search within the current path
308                AC_PATH_PROG([PHPCONFIG], [php-config])
309        else
310                PHPCONFIG="$PHP_PATH/bin/php-config"
311        fi
312
313        # Extract the linker and include flags
314        PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
315        PHP_CPPFLAGS=`$PHPCONFIG --includes`
316
317        # Check headers file
318        CPPFLAGS_SAVE="$CPPFLAGS"
319        CPPFLAGS="$PHP_CPPFLAGS"
320        AC_CHECK_HEADERS([sapi/embed/php_embed.h],
321                 [], [AC_MSG_ERROR([could not find headers include related to libphp])])
322
323        # Ensure we can link against libphp
324        LIBS_SAVE="$LIBS"
325        LIBS="$PHP_LDFLAGS"
326        # Shouldn't we get php here rather than php5 :) ??
327        AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
328        AC_SUBST([PHP_CPPFLAGS])
329        AC_SUBST([PHP_LDFLAGS])
330fi
331
332AC_SUBST([PHP_ENABLED])
333AC_SUBST([PHP_FILE])
334
335# ===========================================================================
336# Detect if perl is installed
337# ===========================================================================
338
339AC_ARG_WITH([perl],
340        [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation,  disabled by default])],
341        [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
342
343
344if test -z "$PERL_ENABLED"
345then
346        PERL_FILE=""
347else
348        PERL_FILE="service_internal_perl.o"
349        if test  "$PERL_PATH" = "yes"
350        then
351                # Perl was not specified, so search within the current path
352                AC_PATH_PROG([PERLCONFIG], [perl])
353        else
354                PERLCONFIG="$PERL_PATH/bin/perl"
355        fi
356
357        # Extract the linker and include flags
358        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
359        PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts`
360
361        # Check headers file
362        CPPFLAGS_SAVE="$CPPFLAGS"
363        CPPFLAGS="$PERL_CPPFLAGS"
364        AC_CHECK_HEADERS([EXTERN.h],
365                 [], [AC_MSG_ERROR([could not find headers include related to libperl])])
366
367        AC_SUBST([PERL_CPPFLAGS])
368        AC_SUBST([PERL_LDFLAGS])
369fi
370
371AC_SUBST([PERL_ENABLED])
372AC_SUBST([PERL_FILE])
373
374# ===========================================================================
375# Detect if java is installed
376# ===========================================================================
377
378AC_ARG_WITH([java],
379        [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME,  disabled by default])],
380        [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
381
382if test -z "$JAVA_ENABLED"
383then
384        JAVA_FILE=""
385else
386        JAVA_FILE="service_internal_java.o"
387        if test "x$JDKHOME" = "x";
388        then
389                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.])
390        fi      # JAVA was specified; display a message to the user
391        if test "x$JDKHOME" = "xyes";
392        then
393                AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
394        fi
395
396        # Extract the linker and include flags
397        if test "x$JDKHOME" = "xmacos";
398        then
399                JAVA_LDFLAGS="-framework JavaVM"
400                JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
401        else
402                if test -d "$JDKHOME/jre/lib/i386";
403                then
404                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/client/ -ljvm -lpthread"
405                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
406                else
407                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/client/ -ljvm -lpthread"
408                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
409                fi
410        fi
411
412        # Check headers file (second time we check that in fact)
413        CPPFLAGS_SAVE="$CPPFLAGS"
414        CPPFLAGS="$JAVA_CPPFLAGS"
415        AC_CHECK_HEADERS([jni.h],
416                         [], [AC_MSG_ERROR([could not find headers include related to libjava])])
417
418        # Ensure we can link against libjava
419        LIBS_SAVE="$LIBS"
420        LIBS="$JAVA_LDFLAGS"
421        if test "x$JDKHOME" != "xmacos";
422        then
423                AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjava])], [])
424        fi
425
426        AC_SUBST([JAVA_CPPFLAGS])
427        AC_SUBST([JAVA_LDFLAGS])
428fi
429
430AC_SUBST([JAVA_ENABLED])
431AC_SUBST([JAVA_FILE])
432
433# ===========================================================================
434# Detect if spidermonkey is installed
435# ===========================================================================
436
437AC_ARG_WITH([js],
438        [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 ])],
439        [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""])
440
441if test -z "$JS_ENABLED"
442then
443        JS_FILE=""
444else
445        JS_FILE="service_internal_js.o"
446        if test "$JSHOME" = "yes"
447        then
448
449                #on teste si on est sous debian like
450                if test -f "/usr/bin/dpkg"
451                then
452                        if test -n "`dpkg -l | grep libmozjs185-dev`"
453                        then
454                                JS_CPPFLAGS="-I/usr/include/js/"
455                                JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm"
456                                JS_LIB="mozjs185"
457                        else
458                                XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`"
459                                if test -n "$XUL_VERSION"
460                                then
461                                        JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION"
462                                        JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm"
463                                        JS_LIB="mozjs"
464                                else
465                                        AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ])
466                                fi
467                        fi
468                else
469                        AC_MSG_ERROR([You must  specify your custom install of libmozjs185])
470                fi
471        else
472                JS_CPPFLAGS="-I$JSHOME/include/js/"
473                JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm"
474                JS_LIB="mozjs185"
475
476        fi
477        CPPFLAGS_SAVE="$CPPFLAGS"
478        CPPFLAGS="$JS_CPPFLAGS"
479
480        #AC_CHECK_HEADERS([jsapi.h],
481        #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
482
483       
484        LIBS_SAVE="$LIBS"
485        LIBS="$JS_LDFLAGS"
486
487        AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
488                       
489        AC_SUBST([JS_CPPFLAGS])
490        AC_SUBST([JS_LDFLAGS])
491fi
492
493AC_SUBST([JS_ENABLED])
494AC_SUBST([JS_FILE])
495
496AC_CONFIG_FILES([Makefile])
497AC_CONFIG_FILES([ZOOMakefile.opts])
498AC_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