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

Last change on this file since 685 was 675, checked in by djay, 10 years ago

Small fixes in configure.ac

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