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

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

Search

Context Navigation

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