source: branches/PublicaMundi_David_integration_01-devel/zoo-project/zoo-kernel/configure.ac @ 672

Last change on this file since 672 was 652, checked in by djay, 10 years ago

Better concurrency gesture for asynchronous requests, add db backend support for status informations.

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