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

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

Fix in autotools.

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