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

Last change on this file since 554 was 551, checked in by djay, 10 years ago

Fix version number in configure.ac.

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