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

Last change on this file since 751 was 740, checked in by djay, 9 years ago

Fix FASTCGI location using the --with-fastcgi option.

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 -lfcgi"
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 \
412                              -e 's/.*\(python[[0-9]]\.[[0-9]]\).*/\1/'`
413        AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
414        LIBS="$LIBS_SAVE"
415fi
416
417AC_SUBST([PYTHON_CPPFLAGS])
418AC_SUBST([PYTHON_LDFLAGS])
419AC_SUBST([PYTHON_ENABLED])
420AC_SUBST([PYTHON_FILE])
421
422# ===========================================================================
423# Detect if spidermonkey is installed
424# ===========================================================================
425
426AC_ARG_WITH([js],
427        [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 ])],
428        [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""])
429
430if test -z "$JS_ENABLED"
431then
432        JS_FILE=""
433else
434        JS_FILE="service_internal_js.o"
435        if test "$JSHOME" = "yes"
436        then
437
438                #on teste si on est sous debian like
439                if test -f "/usr/bin/dpkg"
440                then
441                        if test -n "`dpkg -l | grep libmozjs185-dev`"
442                        then
443                                JS_CPPFLAGS="-I/usr/include/js/"
444                                JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm"
445                                JS_LIB="mozjs185"
446                        else
447                                XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`"
448                                if test -n "$XUL_VERSION"
449                                then
450                                        JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION"
451                                        JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm"
452                                        JS_LIB="mozjs"
453                                else
454                                        AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ])
455                                fi
456                        fi
457                else
458                        AC_MSG_ERROR([You must  specify your custom install of libmozjs185])
459                fi
460        else
461                JS_CPPFLAGS="-I$JSHOME/include/js/"
462                JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm"
463                JS_LIB="mozjs185"
464
465        fi
466        CPPFLAGS_SAVE="$CPPFLAGS"
467        CPPFLAGS="$JS_CPPFLAGS"
468        AC_LANG_PUSH([C++])
469        AC_CHECK_HEADERS([jsapi.h],
470                        [], [AC_MSG_ERROR([could not find headers include related to libjs])])
471
472        AC_LANG_POP([C++])
473        LIBS_SAVE="$LIBS"
474        LIBS="$JS_LDFLAGS"
475
476        AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
477        LIBS="$LIBS_SAVE"
478       
479        AC_SUBST([JS_CPPFLAGS])
480        AC_SUBST([JS_LDFLAGS])
481fi
482
483AC_SUBST([JS_ENABLED])
484AC_SUBST([JS_FILE])
485
486# ===========================================================================
487# Detect if php is installed
488# ===========================================================================
489
490AC_ARG_WITH([php],
491        [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation,  disabled by default])],
492        [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
493
494
495if test -z "$PHP_ENABLED"
496then
497        PHP_FILE=""
498else
499        PHPCONFIG="$PHP_PATH/bin/php-config"
500        PHP_FILE="service_internal_php.o"
501        if test  "$PHP_PATH" = "yes"
502        then
503                # PHP was not specified, so search within the current path
504                AC_PATH_PROG([PHPCONFIG], [php-config])
505        else
506                PHPCONFIG="$PHP_PATH/bin/php-config"
507        fi
508
509        # Extract the linker and include flags
510        PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
511        PHP_CPPFLAGS=`$PHPCONFIG --includes`
512
513        # Check headers file
514        CPPFLAGS_SAVE="$CPPFLAGS"
515        CPPFLAGS="$PHP_CPPFLAGS"
516        AC_CHECK_HEADERS([sapi/embed/php_embed.h],
517                 [], [AC_MSG_ERROR([could not find headers include related to libphp])])
518
519        # Ensure we can link against libphp
520        LIBS_SAVE="$LIBS"
521        LIBS="$PHP_LDFLAGS"
522        # Shouldn't we get php here rather than php5 :) ??
523        AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
524        LIBS="$LIBS_SAVE"
525        AC_SUBST([PHP_CPPFLAGS])
526        AC_SUBST([PHP_LDFLAGS])
527fi
528
529AC_SUBST([PHP_ENABLED])
530AC_SUBST([PHP_FILE])
531
532# ===========================================================================
533# Detect if java is installed
534# ===========================================================================
535
536AC_ARG_WITH([java],
537        [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME,  disabled by default])],
538        [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
539
540if test -z "$JAVA_ENABLED"
541then
542        JAVA_FILE=""
543else
544        JAVA_FILE="service_internal_java.o"
545        if test "x$JDKHOME" = "x";
546        then
547                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.])
548        fi      # JAVA was specified; display a message to the user
549        if test "x$JDKHOME" = "xyes";
550        then
551                AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
552        fi
553
554        # Extract the linker and include flags
555        if test "x$JDKHOME" = "xmacos";
556        then
557                JAVA_LDFLAGS="-framework JavaVM"
558                JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
559        else
560                if test -d "$JDKHOME/jre/lib/i386";
561                then
562                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/server/ -ljvm -lpthread"
563                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
564                else
565                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread"
566                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
567                fi
568        fi
569
570        # Check headers file (second time we check that in fact)
571        CPPFLAGS_SAVE="$CPPFLAGS"
572        CPPFLAGS="$JAVA_CPPFLAGS"
573        AC_CHECK_HEADERS([jni.h],
574                         [], [AC_MSG_ERROR([could not find jni.h file])])
575
576        # Ensure we can link against libjava
577        LIBS_SAVE="$LIBS"
578        LIBS="$JAVA_LDFLAGS"
579        if test "x$JDKHOME" != "xmacos";
580        then
581                AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjvm])], [])
582        fi
583        LIBS="$LIBS_SAVE"
584
585        AC_SUBST([JAVA_CPPFLAGS])
586        AC_SUBST([JAVA_LDFLAGS])
587fi
588
589AC_SUBST([JAVA_ENABLED])
590AC_SUBST([JAVA_FILE])
591
592# ===========================================================================
593# Detect if ruby is installed
594# ===========================================================================
595AC_ARG_WITH([ruby],
596        [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation,  disabled by default])],
597        [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""])
598
599AC_ARG_WITH([rvers],
600        [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])],
601        [RUBY_VERS="$withval"], [RUBY_VERS=""])
602
603
604if test -z "$RUBY_ENABLED"
605then
606        RUBY_FILE=""
607else
608        RUBY_FILE="service_internal_ruby.o"
609
610        # Extract the linker and include flags
611        RUBY_LDFLAGS="-lruby"
612        RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS"
613
614        # Check headers file
615        CPPFLAGS_SAVE="$CPPFLAGS"
616        CPPFLAGS="$RUBY_CPPFLAGS"
617        AC_CHECK_HEADERS([ruby.h],
618                 [], [AC_MSG_ERROR([could not find headers include related to libruby])])
619
620        # Ensure we can link against libphp
621        LIBS_SAVE="$LIBS"
622        LIBS="$RUBY_LDFLAGS"
623        # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
624        LIBS="$LIBS_SAVE"
625        AC_SUBST([RUBY_CPPFLAGS])
626        AC_SUBST([RUBY_LDFLAGS])
627fi
628
629AC_SUBST([RUBY_ENABLED])
630AC_SUBST([RUBY_FILE])
631
632# ===========================================================================
633# Detect if perl is installed
634# ===========================================================================
635
636AC_ARG_WITH([perl],
637        [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation,  disabled by default])],
638        [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
639
640
641if test -z "$PERL_ENABLED"
642then
643        PERL_FILE=""
644else
645        PERL_FILE="service_internal_perl.o"
646        if test  "$PERL_PATH" = "yes"
647        then
648                # Perl was not specified, so search within the current path
649                AC_PATH_PROG([PERLCONFIG], [perl])
650        else
651                PERLCONFIG="$PERL_PATH/bin/perl"
652        fi
653
654        # Extract the linker and include flags
655        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
656        PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts`
657
658        # Check headers file
659        CPPFLAGS_SAVE="$CPPFLAGS"
660        CPPFLAGS="$PERL_CPPFLAGS"
661        AC_CHECK_HEADERS([EXTERN.h],
662                 [], [AC_MSG_ERROR([could not find headers include related to libperl])])
663
664        AC_SUBST([PERL_CPPFLAGS])
665        AC_SUBST([PERL_LDFLAGS])
666fi
667
668AC_SUBST([PERL_ENABLED])
669AC_SUBST([PERL_FILE])
670
671# ===========================================================================
672# Detect if otb is available
673# ===========================================================================
674
675AC_ARG_WITH([itk],
676        [AS_HELP_STRING([--with-itk=PATH], [Specifies an alternative location for the itk library])],
677        [ITKPATH="$withval"], [ITKPATH=""])
678
679AC_ARG_WITH([itk-version],
680        [AS_HELP_STRING([--with-itk-version=VERSION], [Specifies an alternative version for the itk library])],
681        [ITKVERS="$withval"], [ITKVERS=""])
682
683AC_ARG_WITH([otb],
684        [AS_HELP_STRING([--with-otb=PATH], [Specifies an alternative location for the otb library])],
685        [OTBPATH="$withval"], [OTBPATH=""])
686
687if test -z "$OTBPATH"
688then
689        OTB_LDFLAGS=""
690        OTB_CPPFLAGS=""
691        OTB_FILE=""
692        OTB_ENABLED=""
693else
694        if test -z "$ITKVERS"
695        then
696                ITKVERS="4.5"
697        fi
698        OTB_ENABLED="-DUSE_OTB"
699        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"
700        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"
701        OTB_FILE="otbZooWatcher.o service_internal_otb.o"
702       
703        AC_LANG_PUSH([C++])
704        # Check headers file
705        CPPFLAGS_SAVE="$CPPFLAGS"
706        CPPFLAGS="$OTB_CPPFLAGS"
707        LDFLAGS_SAVE="$LDFLAGS"
708        LIBS="$LIBS_SAVE $OTB_LDFLAGS"
709        AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h],
710                        [], [AC_MSG_ERROR([could not find header file $i related to OTB])])
711        AC_LANG_POP([C++])
712        AC_LANG(C++)
713        LDFLAGS_SAVE="$LDFLAGS"
714        LDFLAGS="$OTB_LDFLAGS"
715        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"],[std::vector<std::string> list = otb::Wrapwper::ApplicationRegistry::GetAvailableApplication();]])],
716                [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])])
717        LDFLAGS="$LDFLAGS_SAVE"
718                       
719fi
720AC_SUBST([OTB_CPPFLAGS])
721AC_SUBST([OTB_LDFLAGS])
722AC_SUBST([OTB_FILE])
723AC_SUBST([OTB_ENABLED])
724
725# ===========================================================================
726# Detect if saga-gis is available
727# ===========================================================================
728
729AC_ARG_WITH([wx-config],
730        [AS_HELP_STRING([--with-wx-config=PATH], [Specifies an alternative path for the wx-config tool])],
731        [WXCFG="$withval"], [WXCFG=""])
732
733AC_ARG_WITH([saga],
734        [AS_HELP_STRING([--with-saga=PATH], [Specifies an alternative location for the SAGA-GIS library])],
735        [SAGAPATH="$withval"], [SAGAPATH=""])
736
737if test -z "$SAGAPATH"
738then
739        SAGA_LDFLAGS=""
740        SAGA_CPPFLAGS=""
741        SAGA_FILE=""
742        SAGA_ENABLED=""
743else
744        if test -z "$WXCFG" ; then
745           WXCFG="$(which wx-config)"
746        fi
747        if test "`$WXCFG --list | grep unicode`" == "" ; then
748           AC_MSG_ERROR(SAGA requires a unicode build of wxGTK)
749        fi
750        WX_ISSUE="-D_WX_WXCRTVARARG_H_"
751        SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\""
752        SAGA_CPPFLAGS=" -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE"
753        SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api"
754        SAGA_ENABLED="-DUSE_SAGA"
755        SAGA_FILE="service_internal_saga.o"
756       
757        AC_LANG_PUSH([C++])
758        # Check headers file
759        CPPFLAGS_SAVE="$CPPFLAGS"
760        CPPFLAGS="$SAGA_CPPFLAGS"
761        LIBS_SAVE="$LIBS"
762        LIBS="$SAGA_LDFLAGS"
763        AC_CHECK_HEADERS([module_library.h],
764                        [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
765        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])],
766                [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])])
767        LIBS="$LIBS_SAVE"
768        AC_LANG_POP([C++])
769fi
770AC_SUBST([SAGA_CPPFLAGS])
771AC_SUBST([SAGA_LDFLAGS])
772AC_SUBST([SAGA_FILE])
773AC_SUBST([SAGA_ENABLED])
774
775AC_CONFIG_FILES([Makefile])
776AC_CONFIG_FILES([ZOOMakefile.opts])
777AC_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