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

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