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

Last change on this file since 649 was 640, checked in by djay, 10 years ago

First version including zoo_service shared library

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