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

Last change on this file since 761 was 753, checked in by djay, 9 years ago

Add the MapServer? 7.0.1 internal support. Add the ZOO-Client API reference in the official documentation. Add support for exotic openssl location.

File size: 27.7 KB
Line 
1AC_INIT([ZOO Kernel], [1.5.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([curl], [curl_easy_init,curl_easy_setopt,curl_easy_cleanup,curl_easy_perform])
12AC_CHECK_LIB([dl], [dlopen,dlsym,dlerror,dlclose])
13AC_CHECK_LIB([crypto], [EVP_DigestInit,EVP_md5,EVP_DigestUpdate,BIO_f_base64,BIO_new])
14AC_CHECK_LIB([uuid], [uuid_generate_time])
15
16DEFAULT_LIBS="$LIBS"
17AC_SUBST([DEFAULT_LIBS])
18
19
20# Checks for header files.
21AC_FUNC_ALLOCA
22AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h malloc.h stddef.h stdlib.h string.h unistd.h])
23
24# Checks for typedefs, structures, and compiler characteristics.
25AC_HEADER_STDBOOL
26AC_TYPE_INT16_T
27AC_TYPE_INT32_T
28AC_TYPE_INT8_T
29AC_TYPE_PID_T
30AC_TYPE_SIZE_T
31AC_TYPE_UINT16_T
32AC_TYPE_UINT32_T
33AC_TYPE_UINT8_T
34
35# Checks for library functions.
36AC_FUNC_FORK
37AC_FUNC_MALLOC
38AC_FUNC_REALLOC
39AC_CHECK_FUNCS([dup2 getcwd memset setenv strdup strstr])
40
41#============================================================================
42# Detect if openssl is available
43#============================================================================
44
45AC_ARG_WITH([openssl],
46    [AS_HELP_STRING([--with-openssl=PATH], [Specifies an alternative location for the openssl library])],
47    [OPENSSL_DIR="$withval"], [OPENSSL_DIR="/usr/"])
48OPENSSL_CFLAGS="-I$OPENSSL_DIR/include"
49OPENSSL_LDFLAGS="-lcrypto -L$OPENSSL_DIR/lib -lssl"
50CPPFLAGS_SAVE="$CPPFLAGS"
51CPPFLAGS="$OPENSSL_CFLAGS"
52LIBS_SAVE="$LIBS"
53LIBS="$OPENSSL_LDFLAGS"
54AC_CHECK_HEADERS([openssl/md5.h openssl/hmac.h openssl/evp.h openssl/bio.h openssl/buffer.h],
55                        [], [AC_MSG_ERROR([could not find header file $i related to openssl])])
56AC_CHECK_LIB(crypto, BIO_f_base64,
57                        [], [AC_MSG_ERROR([could not find $i function in openssl library])])
58AC_SUBST([OPENSSL_CFLAGS])
59AC_SUBST([OPENSSL_LDFLAGS])
60
61#============================================================================
62# Detect if run on debian / ubuntu
63#============================================================================
64if test -f "/usr/bin/dpkg"
65then
66        DEB_DEF=-DDEB
67fi
68AC_SUBST([DEB_DEF])
69
70AC_ARG_WITH([cgi-dir],
71    [AS_HELP_STRING([--with-cgi-dir=PATH], [Specifies an alternative cgi directory path ( default: /usr/lib/cgi-bin) ])],
72    [CGI_DIR="$withval"], [CGI_DIR="/usr/lib/cgi-bin"])
73AC_SUBST([CGI_DIR])
74
75AC_ARG_WITH([db-backend],
76    [AS_HELP_STRING([--with-db-backend], [Relies on a database for storing status messages and response files ])],
77    [RELY_ON_DB="-DRELY_ON_DB"], [RELY_ON_DB=""])
78AC_SUBST([RELY_ON_DB])
79
80
81# ===========================================================================
82# Detect if libyaml is available
83# ===========================================================================
84
85AC_ARG_WITH([yaml],
86        [AS_HELP_STRING([--with-yaml=PATH], [Specifies an alternative location for the yaml library])],
87        [YAMLPATH="$withval"], [YAMLPATH=""])
88
89if test -z "$YAMLPATH"
90then
91        YAML_LDFLAGS=""
92        YAML_CPPFLAGS=""
93        YAML_FILE=""
94        YAML_FILE1=""
95else
96
97        # Extract the linker and include flags
98        YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml"
99        YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML"
100        YAML_FILE="service_yaml.o"
101        YAML_FILE1="zcfg2yaml"
102       
103        # Check headers file
104        CPPFLAGS_SAVE="$CPPFLAGS"
105        CPPFLAGS="$YAML_CPPFLAGS"
106        LIBS_SAVE="$LIBS"
107        LIBS="$YAML_LDFLAGS"
108        AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan])
109        AC_CHECK_HEADERS([yaml.h],
110                 [], [AC_MSG_ERROR([could not find headers include related to YAML])])
111        LIBS="$LIBS_SAVE"
112fi
113AC_SUBST([YAML_CPPFLAGS])
114AC_SUBST([YAML_LDFLAGS])
115AC_SUBST([YAML_FILE])
116AC_SUBST([YAML_FILE1])
117
118# ===========================================================================
119# Detect if fastcgi is available
120# ===========================================================================
121
122AC_ARG_WITH([fastcgi],
123        [AS_HELP_STRING([--with-fastcgi=PATH], [Specifies an alternative location for the fastcgi library])],
124        [FCGIPATH="$withval"], [FCGIPATH="/usr"])
125
126# Extract the linker and include flags
127FCGI_LDFLAGS="-L$FCGIPATH/lib -lfcgi"
128FCGI_CPPFLAGS="-I$FCGIPATH/include"
129
130# Check headers file
131CPPFLAGS_SAVE="$CPPFLAGS"
132CPPFLAGS="$FCGI_CPPFLAGS"
133LIBS_SAVE="$LIBS"
134LIBS="$FCGI_LDFLAGS"
135AC_CHECK_LIB([fcgi], [main])
136AC_CHECK_HEADERS([fcgi_stdio.h],
137                 [], [AC_MSG_ERROR([could not find headers include related to fastcgi])])
138LIBS="$LIBS_SAVE"
139AC_SUBST([FCGI_CPPFLAGS])
140AC_SUBST([FCGI_LDFLAGS])
141
142# ===========================================================================
143# Detect if libxml2 is installed
144# ===========================================================================
145
146AC_ARG_WITH([xml2config],
147        [AS_HELP_STRING([--with-xml2config=FILE], [Specifies an alternative xml2-config file])],
148        [XML2CONFIG="$withval"], [XML2CONFIG=""])
149
150if test "x$XML2CONFIG" = "x"; then
151        # XML2CONFIG was not specified, so search within the current path
152        AC_PATH_PROG([XML2CONFIG], [xml2-config])
153
154        # If we couldn't find xml2-config, display a warning
155        if test "x$XML2CONFIG" = "x"; then
156                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.])
157        fi
158else
159        # XML2CONFIG was specified; display a message to the user
160        if test "x$XML2CONFIG" = "xyes"; then
161                AC_MSG_ERROR([you must Specifies a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config])
162        else
163                if test -f $XML2CONFIG; then
164                        AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
165                else
166                        AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
167                fi     
168        fi
169fi
170
171# Extract the linker and include flags
172XML2_LDFLAGS=`$XML2CONFIG --libs`
173XML2_CPPFLAGS=`$XML2CONFIG --cflags`
174
175# Check headers file
176CPPFLAGS_SAVE="$CPPFLAGS"
177CPPFLAGS="$XML2_CPPFLAGS"
178AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
179                 [], [AC_MSG_ERROR([could not find headers include related to libxml2])])
180
181# Ensure we can link against libxml2
182LIBS_SAVE="$LIBS"
183LIBS="$XML2_LDFLAGS"
184AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
185
186AC_SUBST([XML2_CPPFLAGS])
187AC_SUBST([XML2_LDFLAGS])
188LIBS="$LIBS_SAVE"
189
190
191# ===========================================================================
192# Detect if libxslt is installed
193# ===========================================================================
194
195AC_ARG_WITH([xsltconfig],
196        [AS_HELP_STRING([--with-xsltconfig=FILE], [Specifies an alternative xslt-config file])],
197        [XSLTCONFIG="$withval"], [XSLTCONFIG=""])
198
199if test "x$XSLTCONFIG" = "x"; then
200        # XSLTCONFIG was not specified, so search within the current path
201        AC_PATH_PROG([XSLTCONFIG], [xslt-config])
202
203        # If we couldn't find xslt-config, display a warning
204        if test "x$XSLTCONFIG" = "x"; then
205                AC_MSG_ERROR([could not find xslt-config from libxslt within the current path. You may need to try re-running configure with a --with-xtltconfig parameter.])
206        fi
207else
208        # XSLTCONFIG was specified; display a message to the user
209        if test "x$XSLTCONFIG" = "xyes"; then
210                AC_MSG_ERROR([you must Specifies a parameter to --with-xsltconfig, e.g. --with-xsltconfig=/path/to/xslt-config])
211        else
212                if test -f $XSLTCONFIG; then
213                        AC_MSG_RESULT([Using user-specified xslt-config file: $XSLTCONFIG])
214                else
215                        AC_MSG_ERROR([the user-specified xslt-config file $XSLTCONFIG does not exist])
216                fi     
217        fi
218fi
219
220# Extract the linker and include flags
221XSLT_LDFLAGS=`$XSLTCONFIG --libs`
222XSLT_CPPFLAGS=`$XSLTCONFIG --cflags`
223
224# Check headers file
225CPPFLAGS_SAVE="$CPPFLAGS"
226CPPFLAGS="$XSLT_CPPFLAGS"
227AC_CHECK_HEADERS([libxslt/xslt.h libxslt/xsltInternals.h libxslt/transform.h libxslt/xsltutils.h],
228                 [], [AC_MSG_ERROR([could not find headers include related to libxlst])])
229
230AC_SUBST([XSLT_CPPFLAGS])
231AC_SUBST([XSLT_LDFLAGS])
232
233#============================================================================
234# Detect if gdal is installed
235#============================================================================
236
237AC_ARG_WITH([gdal-config],
238        [AS_HELP_STRING([--with-gdal-config=FILE], [Specifies an alternative gdal-config file])],
239        [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""])
240if test -z $GDAL_CONFIG;
241then
242        AC_PATH_PROG([GDAL_CONFIG], [gdal-config])
243        if test -z $GDAL_CONFIG;
244        then
245                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.])
246        fi
247       
248else
249        if test -f $GDAL_CONFIG; then
250                AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG])
251        else
252                AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist])
253        fi
254fi
255
256GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
257GDAL_LIBS="`$GDAL_CONFIG --libs`"
258
259AC_SUBST([GDAL_CFLAGS])
260AC_SUBST([GDAL_LIBS])
261
262# ===========================================================================
263# Detect if proj is installed
264# ===========================================================================
265
266AC_ARG_WITH([proj],
267        [AS_HELP_STRING([--with-proj=PATH], [Specifies an alternative location for PROJ4 setup])],
268        [PROJPATH="$withval"], [PROJPATH=""])
269
270# Extract the linker and include flags
271PROJ_LDFLAGS="-L$PROJPATH/lib"
272PROJ_CPPFLAGS="-I$PROJPATH/include"
273
274# Check headers file
275CPPFLAGS_SAVE="$CPPFLAGS"
276CPPFLAGS="$PROJ_CPPFLAGS"
277AC_CHECK_HEADERS([proj_api.h],
278                 [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
279
280AC_SUBST([PROJ_CPPFLAGS])
281AC_SUBST([PROJ_LDFLAGS])
282
283# ===========================================================================
284# Detect if libgeos is installed
285# ===========================================================================
286
287AC_ARG_WITH([geosconfig],
288        [AS_HELP_STRING([--with-geosconfig=FILE], [Specifies an alternative geos-config file])],
289        [GEOSCONFIG="$withval"], [GEOSCONFIG=""])
290
291if test "x$GEOSCONFIG" = "x"; then
292        # GEOSCONFIG was not specified, so search within the current path
293        AC_PATH_PROG([GEOSCONFIG], [geos-config])
294
295        # If we couldn't find geos-config, display a warning
296        if test "x$GEOSCONFIG" = "x"; then
297                AC_MSG_WARN([could not find geos-config from libgeos within the current path. You may need to try re-running configure with a --with-geosconfig parameter.])
298        fi
299else
300        # GEOSCONFIG was specified; display a message to the user
301        if test "x$GEOSCONFIG" = "xyes"; then
302                AC_MSG_WARN([you must Specifies a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config])
303        else
304                if test -f $GEOSCONFIG; then
305                        AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG])
306                else
307                        AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist])
308                fi     
309        fi
310fi
311
312GEOS_LDFLAGS=`$GEOSCONFIG --libs`
313GEOS_CPPFLAGS=`$GEOSCONFIG --cflags`
314
315# Check headers file
316CPPFLAGS_SAVE="$CPPFLAGS"
317CPPFLAGS="$GEOS_CPPFLAGS"
318AC_CHECK_HEADERS([geos_c.h],
319                 [], [AC_MSG_WARN([could not find headers include related to libgeos])])
320
321AC_SUBST([GEOS_CPPFLAGS])
322AC_SUBST([GEOS_LDFLAGS])
323
324
325# ===========================================================================
326# Detect if cgal is installed
327# ===========================================================================
328
329AC_ARG_WITH([cgal],
330        [AS_HELP_STRING([--with-cgal=PATH], [Specifies an alternative location for CGAL setup])],
331        [CGALPATH="$withval"], [CGALPATH="/usr"])
332
333
334# Check headers file
335CPPFLAGS_SAVE="$CPPFLAGS"
336CPPFLAGS="$CGAL_CPPFLAGS"
337AC_CHECK_HEADERS([CGAL/Delaunay_triangulation_2.h],
338         [], [AC_MSG_WARN([could not find headers include related to libCGAL])])
339
340# Extract the linker and include flags
341CGAL_LDFLAGS="-L$CGALPATH/lib"
342CGAL_CPPFLAGS="-I$CGALPATH/include"
343
344
345AC_SUBST([CGAL_CPPFLAGS])
346AC_SUBST([CGAL_LDFLAGS])
347#============================================================================
348# Detect if mapserver is installed
349#============================================================================
350
351AC_ARG_WITH([mapserver],
352       [AS_HELP_STRING([--with-mapserver=PATH], [Specifies the path for MapServer compiled source tree])],
353       [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""])
354
355AC_ARG_WITH([ms-version],
356       [AS_HELP_STRING([--with-ms-version=VERSION], [Specifies the MapServer version to build against])],
357       [MS_VERSION="$withval"], [MS_VERSION=""])
358
359if test -z $MS_SRC_PATH;
360then
361        MS_CPPFLAGS=""
362        MS_LDFLAGS=""
363else
364       if test "x$MS_SRC_PATH" = "xmacos";
365       then
366               MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl"
367               MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver "
368               AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree])
369               AC_MSG_RESULT([Using MacOS X Framework for MapServer])
370       else
371        if test "x$MS_VERSION" = "x7";
372        then
373                MS_LDFLAGS="-L$MS_SRC_PATH/lib -lmapserver"
374                MS_CPPFLAGS="-DUSE_MS -I$MS_SRC_PATH/include/mapserver "
375                AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
376        else
377               if test -d $MS_SRC_PATH; then
378                       MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`"
379                       MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH "
380               
381                       AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
382               else
383                       AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist])
384               fi
385        fi
386       fi
387       MS_FILE="service_internal_ms.o"
388fi
389
390MS_CFLAGS="$MS_CPPFLAGS"
391MS_LIBS="$MS_LDFLAGS"
392
393AC_SUBST([MS_CFLAGS])
394AC_SUBST([MS_LIBS])
395AC_SUBST([MS_FILE])
396
397# ===========================================================================
398# Detect if python is installed
399# ===========================================================================
400
401AC_ARG_WITH([python],
402        [AS_HELP_STRING([--with-python=PATH], [To enable python support or Specifies an alternative directory for python installation,  disabled by default])],
403        [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""])
404
405AC_ARG_WITH([pyvers],
406        [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])],
407        [PYTHON_VERS="$withval"], [PYTHON_VERS=""])
408
409
410if test -z "$PYTHON_ENABLED"
411then
412        PYTHON_FILE=""
413else
414        PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
415        PYTHON_FILE="service_internal_python.o"
416        if test  "$PYTHON_PATH" = "yes"
417        then
418                # PHP was not specified, so search within the current path
419                PYTHONCFG_PATH=`which python${PYTHON_VERS}-config`
420                if test -z "${PYTHONCFG_PATH}" ; then
421                AC_PATH_PROG([PYTHONCONFIG], [python-config-${PYTHON_VERS}])
422                else
423                AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config])
424                fi
425        else
426                PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
427        fi
428
429        # Extract the linker and include flags
430        PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
431        PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes`
432
433        # Check headers file
434        CPPFLAGS_SAVE="$CPPFLAGS"
435        CPPFLAGS="$PYTHON_CPPFLAGS"
436        AC_CHECK_HEADERS([Python.h],
437                 [], [AC_MSG_ERROR([could not find headers include related to libpython])])
438
439        # Ensure we can link against libphp
440        LIBS_SAVE="$LIBS"
441        LIBS="$PYTHON_LDFLAGS"
442        PY_LIB=`$PYTHONCONFIG --libs | sed \
443                              -e 's/.*\(python[[0-9]]\.[[0-9]]\).*/\1/'`
444        AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
445        LIBS="$LIBS_SAVE"
446fi
447
448AC_SUBST([PYTHON_CPPFLAGS])
449AC_SUBST([PYTHON_LDFLAGS])
450AC_SUBST([PYTHON_ENABLED])
451AC_SUBST([PYTHON_FILE])
452
453# ===========================================================================
454# Detect if spidermonkey is installed
455# ===========================================================================
456
457AC_ARG_WITH([js],
458        [AS_HELP_STRING([--with-js=PATH], [Specifies --with-js=path-to-js to enable js support, specify --with-js on linux debian like, js support is disabled by default ])],
459        [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""])
460
461if test -z "$JS_ENABLED"
462then
463        JS_FILE=""
464else
465        JS_FILE="service_internal_js.o"
466        if test "$JSHOME" = "yes"
467        then
468
469                #on teste si on est sous debian like
470                if test -f "/usr/bin/dpkg"
471                then
472                        if test -n "`dpkg -l | grep libmozjs185-dev`"
473                        then
474                                JS_CPPFLAGS="-I/usr/include/js/"
475                                JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm"
476                                JS_LIB="mozjs185"
477                        else
478                                XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`"
479                                if test -n "$XUL_VERSION"
480                                then
481                                        JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION"
482                                        JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm"
483                                        JS_LIB="mozjs"
484                                else
485                                        AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ])
486                                fi
487                        fi
488                else
489                        AC_MSG_ERROR([You must  specify your custom install of libmozjs185])
490                fi
491        else
492                JS_CPPFLAGS="-I$JSHOME/include/js/"
493                JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm"
494                JS_LIB="mozjs185"
495
496        fi
497        CPPFLAGS_SAVE="$CPPFLAGS"
498        CPPFLAGS="$JS_CPPFLAGS"
499        AC_LANG_PUSH([C++])
500        AC_CHECK_HEADERS([jsapi.h],
501                        [], [AC_MSG_ERROR([could not find headers include related to libjs])])
502
503        AC_LANG_POP([C++])
504        LIBS_SAVE="$LIBS"
505        LIBS="$JS_LDFLAGS"
506
507        AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
508        LIBS="$LIBS_SAVE"
509       
510        AC_SUBST([JS_CPPFLAGS])
511        AC_SUBST([JS_LDFLAGS])
512fi
513
514AC_SUBST([JS_ENABLED])
515AC_SUBST([JS_FILE])
516
517# ===========================================================================
518# Detect if php is installed
519# ===========================================================================
520
521AC_ARG_WITH([php],
522        [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation,  disabled by default])],
523        [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
524
525
526if test -z "$PHP_ENABLED"
527then
528        PHP_FILE=""
529else
530        PHPCONFIG="$PHP_PATH/bin/php-config"
531        PHP_FILE="service_internal_php.o"
532        if test  "$PHP_PATH" = "yes"
533        then
534                # PHP was not specified, so search within the current path
535                AC_PATH_PROG([PHPCONFIG], [php-config])
536        else
537                PHPCONFIG="$PHP_PATH/bin/php-config"
538        fi
539
540        # Extract the linker and include flags
541        PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
542        PHP_CPPFLAGS=`$PHPCONFIG --includes`
543
544        # Check headers file
545        CPPFLAGS_SAVE="$CPPFLAGS"
546        CPPFLAGS="$PHP_CPPFLAGS"
547        AC_CHECK_HEADERS([sapi/embed/php_embed.h],
548                 [], [AC_MSG_ERROR([could not find headers include related to libphp])])
549
550        # Ensure we can link against libphp
551        LIBS_SAVE="$LIBS"
552        LIBS="$PHP_LDFLAGS"
553        # Shouldn't we get php here rather than php5 :) ??
554        AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
555        LIBS="$LIBS_SAVE"
556        AC_SUBST([PHP_CPPFLAGS])
557        AC_SUBST([PHP_LDFLAGS])
558fi
559
560AC_SUBST([PHP_ENABLED])
561AC_SUBST([PHP_FILE])
562
563# ===========================================================================
564# Detect if java is installed
565# ===========================================================================
566
567AC_ARG_WITH([java],
568        [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME,  disabled by default])],
569        [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
570
571if test -z "$JAVA_ENABLED"
572then
573        JAVA_FILE=""
574else
575        JAVA_FILE="service_internal_java.o"
576        if test "x$JDKHOME" = "x";
577        then
578                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.])
579        fi      # JAVA was specified; display a message to the user
580        if test "x$JDKHOME" = "xyes";
581        then
582                AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
583        fi
584
585        # Extract the linker and include flags
586        if test "x$JDKHOME" = "xmacos";
587        then
588                JAVA_LDFLAGS="-framework JavaVM"
589                JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
590        else
591                if test -d "$JDKHOME/jre/lib/i386";
592                then
593                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/server/ -ljvm -lpthread"
594                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
595                else
596                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread"
597                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
598                fi
599        fi
600
601        # Check headers file (second time we check that in fact)
602        CPPFLAGS_SAVE="$CPPFLAGS"
603        CPPFLAGS="$JAVA_CPPFLAGS"
604        AC_CHECK_HEADERS([jni.h],
605                         [], [AC_MSG_ERROR([could not find jni.h file])])
606
607        # Ensure we can link against libjava
608        LIBS_SAVE="$LIBS"
609        LIBS="$JAVA_LDFLAGS"
610        if test "x$JDKHOME" != "xmacos";
611        then
612                AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjvm])], [])
613        fi
614        LIBS="$LIBS_SAVE"
615
616        AC_SUBST([JAVA_CPPFLAGS])
617        AC_SUBST([JAVA_LDFLAGS])
618fi
619
620AC_SUBST([JAVA_ENABLED])
621AC_SUBST([JAVA_FILE])
622
623# ===========================================================================
624# Detect if ruby is installed
625# ===========================================================================
626AC_ARG_WITH([ruby],
627        [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation,  disabled by default])],
628        [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""])
629
630AC_ARG_WITH([rvers],
631        [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])],
632        [RUBY_VERS="$withval"], [RUBY_VERS=""])
633
634
635if test -z "$RUBY_ENABLED"
636then
637        RUBY_FILE=""
638else
639        RUBY_FILE="service_internal_ruby.o"
640
641        # Extract the linker and include flags
642        RUBY_LDFLAGS="-lruby"
643        RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS"
644
645        # Check headers file
646        CPPFLAGS_SAVE="$CPPFLAGS"
647        CPPFLAGS="$RUBY_CPPFLAGS"
648        AC_CHECK_HEADERS([ruby.h],
649                 [], [AC_MSG_ERROR([could not find headers include related to libruby])])
650
651        # Ensure we can link against libphp
652        LIBS_SAVE="$LIBS"
653        LIBS="$RUBY_LDFLAGS"
654        # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
655        LIBS="$LIBS_SAVE"
656        AC_SUBST([RUBY_CPPFLAGS])
657        AC_SUBST([RUBY_LDFLAGS])
658fi
659
660AC_SUBST([RUBY_ENABLED])
661AC_SUBST([RUBY_FILE])
662
663# ===========================================================================
664# Detect if perl is installed
665# ===========================================================================
666
667AC_ARG_WITH([perl],
668        [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation,  disabled by default])],
669        [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
670
671
672if test -z "$PERL_ENABLED"
673then
674        PERL_FILE=""
675else
676        PERL_FILE="service_internal_perl.o"
677        if test  "$PERL_PATH" = "yes"
678        then
679                # Perl was not specified, so search within the current path
680                AC_PATH_PROG([PERLCONFIG], [perl])
681        else
682                PERLCONFIG="$PERL_PATH/bin/perl"
683        fi
684
685        # Extract the linker and include flags
686        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
687        PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts`
688
689        # Check headers file
690        CPPFLAGS_SAVE="$CPPFLAGS"
691        CPPFLAGS="$PERL_CPPFLAGS"
692        AC_CHECK_HEADERS([EXTERN.h],
693                 [], [AC_MSG_ERROR([could not find headers include related to libperl])])
694
695        AC_SUBST([PERL_CPPFLAGS])
696        AC_SUBST([PERL_LDFLAGS])
697fi
698
699AC_SUBST([PERL_ENABLED])
700AC_SUBST([PERL_FILE])
701
702# ===========================================================================
703# Detect if otb is available
704# ===========================================================================
705
706AC_ARG_WITH([itk],
707        [AS_HELP_STRING([--with-itk=PATH], [Specifies an alternative location for the itk library])],
708        [ITKPATH="$withval"], [ITKPATH=""])
709
710AC_ARG_WITH([itk-version],
711        [AS_HELP_STRING([--with-itk-version=VERSION], [Specifies an alternative version for the itk library])],
712        [ITKVERS="$withval"], [ITKVERS=""])
713
714AC_ARG_WITH([otb],
715        [AS_HELP_STRING([--with-otb=PATH], [Specifies an alternative location for the otb library])],
716        [OTBPATH="$withval"], [OTBPATH=""])
717
718if test -z "$OTBPATH"
719then
720        OTB_LDFLAGS=""
721        OTB_CPPFLAGS=""
722        OTB_FILE=""
723        OTB_ENABLED=""
724else
725        if test -z "$ITKVERS"
726        then
727                ITKVERS="4.5"
728        fi
729        OTB_ENABLED="-DUSE_OTB"
730        OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkdouble-conversion-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS -litkzlib-$ITKVERS"
731        OTB_CPPFLAGS="-I$OTBPATH/include/otb/ApplicationEngine -I$OTBPATH/include/otb/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTBPATH/include/otb/Utilities/ITK -I$OTBPATH/include/otb/ -I$OTBPATH/include/otb/IO -I$OTBPATH/include/otb/UtilitiesAdapters/OssimAdapters -I$OTBPATH/include/otb/UtilitiesAdapters/CurlAdapters -I$OTBPATH/include/otb/Utilities/BGL -I$OTBPATH/include/otb/UtilitiesAdapters/ITKPendingPatches -I$OTBPATH/include/otb/Utilities/otbconfigfile $GDAL_CFLAGS"
732        OTB_FILE="otbZooWatcher.o service_internal_otb.o"
733       
734        AC_LANG_PUSH([C++])
735        # Check headers file
736        CPPFLAGS_SAVE="$CPPFLAGS"
737        CPPFLAGS="$OTB_CPPFLAGS"
738        LDFLAGS_SAVE="$LDFLAGS"
739        LIBS="$LIBS_SAVE $OTB_LDFLAGS"
740        AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h],
741                        [], [AC_MSG_ERROR([could not find header file $i related to OTB])])
742        AC_LANG_POP([C++])
743        AC_LANG(C++)
744        LDFLAGS_SAVE="$LDFLAGS"
745        LDFLAGS="$OTB_LDFLAGS"
746        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"],[std::vector<std::string> list = otb::Wrapwper::ApplicationRegistry::GetAvailableApplication();]])],
747                [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])])
748        LDFLAGS="$LDFLAGS_SAVE"
749                       
750fi
751AC_SUBST([OTB_CPPFLAGS])
752AC_SUBST([OTB_LDFLAGS])
753AC_SUBST([OTB_FILE])
754AC_SUBST([OTB_ENABLED])
755
756# ===========================================================================
757# Detect if saga-gis is available
758# ===========================================================================
759
760AC_ARG_WITH([wx-config],
761        [AS_HELP_STRING([--with-wx-config=PATH], [Specifies an alternative path for the wx-config tool])],
762        [WXCFG="$withval"], [WXCFG=""])
763
764AC_ARG_WITH([saga],
765        [AS_HELP_STRING([--with-saga=PATH], [Specifies an alternative location for the SAGA-GIS library])],
766        [SAGAPATH="$withval"], [SAGAPATH=""])
767
768if test -z "$SAGAPATH"
769then
770        SAGA_LDFLAGS=""
771        SAGA_CPPFLAGS=""
772        SAGA_FILE=""
773        SAGA_ENABLED=""
774else
775        if test -z "$WXCFG" ; then
776           WXCFG="$(which wx-config)"
777        fi
778        if test "`$WXCFG --list | grep unicode`" == "" ; then
779           AC_MSG_ERROR(SAGA requires a unicode build of wxGTK)
780        fi
781        WX_ISSUE="-D_WX_WXCRTVARARG_H_"
782        SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\""
783        SAGA_CPPFLAGS=" -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE"
784        SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api"
785        SAGA_ENABLED="-DUSE_SAGA"
786        SAGA_FILE="service_internal_saga.o"
787       
788        AC_LANG_PUSH([C++])
789        # Check headers file
790        CPPFLAGS_SAVE="$CPPFLAGS"
791        CPPFLAGS="$SAGA_CPPFLAGS"
792        LIBS_SAVE="$LIBS"
793        LIBS="$SAGA_LDFLAGS"
794        AC_CHECK_HEADERS([module_library.h],
795                        [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
796        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])],
797                [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])])
798        LIBS="$LIBS_SAVE"
799        AC_LANG_POP([C++])
800fi
801AC_SUBST([SAGA_CPPFLAGS])
802AC_SUBST([SAGA_LDFLAGS])
803AC_SUBST([SAGA_FILE])
804AC_SUBST([SAGA_ENABLED])
805
806AC_CONFIG_FILES([Makefile])
807AC_CONFIG_FILES([ZOOMakefile.opts])
808AC_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