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

Last change on this file since 522 was 521, checked in by david, 10 years ago

-add libgeos, libcgal checking

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