1 | AC_INIT([ZOO Kernel], [1.4.0], [bugs@zoo-project.org]) |
---|
2 | |
---|
3 | # Checks for programs. |
---|
4 | AC_PROG_YACC |
---|
5 | AC_PROG_CC |
---|
6 | AC_PROG_LEX |
---|
7 | AC_PROG_CXX |
---|
8 | AC_PROG_SED |
---|
9 | |
---|
10 | # Checks for libraries. |
---|
11 | AC_CHECK_LIB([cgic], [cgiMain]) |
---|
12 | AC_CHECK_LIB([curl], [curl_easy_init curl_easy_setopt curl_easy_cleanup curl_easy_perform]) |
---|
13 | AC_CHECK_LIB([dl], [dlopen dlsym dlerror dlclose]) |
---|
14 | AC_CHECK_LIB([fl], [main]) |
---|
15 | AC_CHECK_LIB([pthread], [main]) |
---|
16 | AC_CHECK_LIB([fcgi], [main]) |
---|
17 | AC_CHECK_LIB([ssl], [main]) |
---|
18 | |
---|
19 | # Checks for header files. |
---|
20 | AC_FUNC_ALLOCA |
---|
21 | AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h malloc.h stddef.h stdlib.h string.h unistd.h]) |
---|
22 | |
---|
23 | # Checks for typedefs, structures, and compiler characteristics. |
---|
24 | AC_HEADER_STDBOOL |
---|
25 | AC_TYPE_INT16_T |
---|
26 | AC_TYPE_INT32_T |
---|
27 | AC_TYPE_INT8_T |
---|
28 | AC_TYPE_PID_T |
---|
29 | AC_TYPE_SIZE_T |
---|
30 | AC_TYPE_UINT16_T |
---|
31 | AC_TYPE_UINT32_T |
---|
32 | AC_TYPE_UINT8_T |
---|
33 | |
---|
34 | # Checks for library functions. |
---|
35 | AC_FUNC_FORK |
---|
36 | AC_FUNC_MALLOC |
---|
37 | AC_FUNC_REALLOC |
---|
38 | AC_CHECK_FUNCS([dup2 getcwd memset setenv strdup strstr]) |
---|
39 | |
---|
40 | #============================================================================ |
---|
41 | # Detect if gdal is installed |
---|
42 | #============================================================================ |
---|
43 | |
---|
44 | AC_ARG_WITH([gdal-config], |
---|
45 | [AS_HELP_STRING([--with-gdal-config=FILE], [specify an alternative gdal-config file])], |
---|
46 | [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""]) |
---|
47 | if test -z $GDAL_CONFIG; |
---|
48 | then |
---|
49 | AC_PATH_PROG([GDAL_CONFIG], [gdal-config]) |
---|
50 | if test -z $GDAL_CONFIG; |
---|
51 | then |
---|
52 | 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.]) |
---|
53 | fi |
---|
54 | |
---|
55 | else |
---|
56 | if test -f $GDAL_CONFIG; then |
---|
57 | AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG]) |
---|
58 | else |
---|
59 | AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist]) |
---|
60 | fi |
---|
61 | fi |
---|
62 | |
---|
63 | GDAL_CFLAGS="`$GDAL_CONFIG --cflags`" |
---|
64 | GDAL_LIBS="`$GDAL_CONFIG --libs`" |
---|
65 | |
---|
66 | AC_SUBST([GDAL_CFLAGS]) |
---|
67 | AC_SUBST([GDAL_LIBS]) |
---|
68 | |
---|
69 | # =========================================================================== |
---|
70 | # Detect if fastcgi is available |
---|
71 | # =========================================================================== |
---|
72 | |
---|
73 | AC_ARG_WITH([fastcgi], |
---|
74 | [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])], |
---|
75 | [FCGIPATH="$withval"], [FCGIPATH=""]) |
---|
76 | |
---|
77 | # Extract the linker and include flags |
---|
78 | FCGI_LDFLAGS="-L$FCGIPATH/lib" |
---|
79 | FCGI_CPPFLAGS="-I$FCGIPATH/include" |
---|
80 | |
---|
81 | # Check headers file |
---|
82 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
83 | CPPFLAGS="$FCGI_CPPFLAGS" |
---|
84 | AC_CHECK_HEADERS([fcgi_stdio.h], |
---|
85 | [], [AC_MSG_ERROR([could not find headers include related to fastcgi])]) |
---|
86 | |
---|
87 | AC_SUBST([FCGI_CPPFLAGS]) |
---|
88 | AC_SUBST([FCGI_LDFLAGS]) |
---|
89 | |
---|
90 | # =========================================================================== |
---|
91 | # Detect if proj is installed |
---|
92 | # =========================================================================== |
---|
93 | |
---|
94 | AC_ARG_WITH([proj], |
---|
95 | [AS_HELP_STRING([--with-proj=PATH], [specify an alternative location for PROJ4 setup])], |
---|
96 | [PROJPATH="$withval"], [PROJPATH=""]) |
---|
97 | |
---|
98 | # Extract the linker and include flags |
---|
99 | PROJ_LDFLAGS="-L$PROJPATH/lib" |
---|
100 | PROJ_CPPFLAGS="-I$PROJPATH/include" |
---|
101 | |
---|
102 | # Check headers file |
---|
103 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
104 | CPPFLAGS="$PROJ_CPPFLAGS" |
---|
105 | AC_CHECK_HEADERS([proj_api.h], |
---|
106 | [], [AC_MSG_ERROR([could not find headers include related to PROJ4])]) |
---|
107 | |
---|
108 | AC_SUBST([PROJ_CPPFLAGS]) |
---|
109 | AC_SUBST([PROJ_LDFLAGS]) |
---|
110 | |
---|
111 | # =========================================================================== |
---|
112 | # Detect if libxml2 is installed |
---|
113 | # =========================================================================== |
---|
114 | |
---|
115 | AC_ARG_WITH([xml2config], |
---|
116 | [AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])], |
---|
117 | [XML2CONFIG="$withval"], [XML2CONFIG=""]) |
---|
118 | |
---|
119 | if test "x$XML2CONFIG" = "x"; then |
---|
120 | # XML2CONFIG was not specified, so search within the current path |
---|
121 | AC_PATH_PROG([XML2CONFIG], [xml2-config]) |
---|
122 | |
---|
123 | # If we couldn't find xml2-config, display a warning |
---|
124 | if test "x$XML2CONFIG" = "x"; then |
---|
125 | 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.]) |
---|
126 | fi |
---|
127 | else |
---|
128 | # XML2CONFIG was specified; display a message to the user |
---|
129 | if test "x$XML2CONFIG" = "xyes"; then |
---|
130 | AC_MSG_ERROR([you must specify a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config]) |
---|
131 | else |
---|
132 | if test -f $XML2CONFIG; then |
---|
133 | AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG]) |
---|
134 | else |
---|
135 | AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist]) |
---|
136 | fi |
---|
137 | fi |
---|
138 | fi |
---|
139 | |
---|
140 | # Extract the linker and include flags |
---|
141 | XML2_LDFLAGS=`$XML2CONFIG --libs` |
---|
142 | XML2_CPPFLAGS=`$XML2CONFIG --cflags` |
---|
143 | |
---|
144 | # Check headers file |
---|
145 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
146 | CPPFLAGS="$XML2_CPPFLAGS" |
---|
147 | AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h], |
---|
148 | [], [AC_MSG_ERROR([could not find headers include related to libxml2])]) |
---|
149 | |
---|
150 | # Ensure we can link against libxml2 |
---|
151 | LIBS_SAVE="$LIBS" |
---|
152 | LIBS="$XML2_LDFLAGS" |
---|
153 | AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], []) |
---|
154 | |
---|
155 | AC_SUBST([XML2_CPPFLAGS]) |
---|
156 | AC_SUBST([XML2_LDFLAGS]) |
---|
157 | |
---|
158 | #============================================================================ |
---|
159 | # Detect if mapserver is installed |
---|
160 | #============================================================================ |
---|
161 | |
---|
162 | AC_ARG_WITH([mapserver], |
---|
163 | [AS_HELP_STRING([--with-mapserver=PATH], [specify the path for MapServer compiled source tree])], |
---|
164 | [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""]) |
---|
165 | |
---|
166 | if test -z $MS_SRC_PATH; |
---|
167 | then |
---|
168 | MS_CPPFLAGS="" |
---|
169 | MS_LDFLAGS="" |
---|
170 | else |
---|
171 | if test "x$MS_SRC_PATH" = "xmacos"; |
---|
172 | then |
---|
173 | MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl" |
---|
174 | MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver " |
---|
175 | AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree]) |
---|
176 | AC_MSG_RESULT([Using MacOS X Framework for MapServer]) |
---|
177 | else |
---|
178 | if test -d $MS_SRC_PATH; then |
---|
179 | MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`" |
---|
180 | MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH " |
---|
181 | |
---|
182 | AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH]) |
---|
183 | else |
---|
184 | AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist]) |
---|
185 | fi |
---|
186 | fi |
---|
187 | MS_FILE="service_internal_ms.o" |
---|
188 | fi |
---|
189 | |
---|
190 | MS_CFLAGS="$MS_CPPFLAGS" |
---|
191 | MS_LIBS="$MS_LDFLAGS" |
---|
192 | |
---|
193 | AC_SUBST([MS_CFLAGS]) |
---|
194 | AC_SUBST([MS_LIBS]) |
---|
195 | AC_SUBST([MS_FILE]) |
---|
196 | |
---|
197 | # =========================================================================== |
---|
198 | # Detect if ruby is installed |
---|
199 | # =========================================================================== |
---|
200 | AC_ARG_WITH([ruby], |
---|
201 | [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation, disabled by default])], |
---|
202 | [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""]) |
---|
203 | |
---|
204 | AC_ARG_WITH([rvers], |
---|
205 | [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])], |
---|
206 | [RUBY_VERS="$withval"], [RUBY_VERS=""]) |
---|
207 | |
---|
208 | |
---|
209 | if test -z "$RUBY_ENABLED" |
---|
210 | then |
---|
211 | RUBY_FILE="" |
---|
212 | else |
---|
213 | RUBY_FILE="service_internal_ruby.o" |
---|
214 | |
---|
215 | # Extract the linker and include flags |
---|
216 | RUBY_LDFLAGS="-lruby" |
---|
217 | RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS" |
---|
218 | |
---|
219 | # Check headers file |
---|
220 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
221 | CPPFLAGS="$RUBY_CPPFLAGS" |
---|
222 | AC_CHECK_HEADERS([ruby.h], |
---|
223 | [], [AC_MSG_ERROR([could not find headers include related to libruby])]) |
---|
224 | |
---|
225 | # Ensure we can link against libphp |
---|
226 | LIBS_SAVE="$LIBS" |
---|
227 | LIBS="$RUBY_LDFLAGS" |
---|
228 | # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) |
---|
229 | AC_SUBST([RUBY_CPPFLAGS]) |
---|
230 | AC_SUBST([RUBY_LDFLAGS]) |
---|
231 | fi |
---|
232 | |
---|
233 | AC_SUBST([RUBY_ENABLED]) |
---|
234 | AC_SUBST([RUBY_FILE]) |
---|
235 | |
---|
236 | # =========================================================================== |
---|
237 | # Detect if python is installed |
---|
238 | # =========================================================================== |
---|
239 | |
---|
240 | AC_ARG_WITH([python], |
---|
241 | [AS_HELP_STRING([--with-python=PATH], [To enable python support or specify an alternative directory for python installation, disabled by default])], |
---|
242 | [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""]) |
---|
243 | |
---|
244 | AC_ARG_WITH([pyvers], |
---|
245 | [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])], |
---|
246 | [PYTHON_VERS="$withval"], [PYTHON_VERS=""]) |
---|
247 | |
---|
248 | |
---|
249 | if test -z "$PYTHON_ENABLED" |
---|
250 | then |
---|
251 | PYTHON_FILE="" |
---|
252 | else |
---|
253 | PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config" |
---|
254 | PYTHON_FILE="service_internal_python.o" |
---|
255 | if test "$PYTHON_PATH" = "yes" |
---|
256 | then |
---|
257 | # PHP was not specified, so search within the current path |
---|
258 | PYTHONCFG_PATH=`which python${PYTHON_VERS}-config` |
---|
259 | if test -z "${PYTHONCFG_PATH}" ; then |
---|
260 | AC_PATH_PROG([PYTHONCONFIG], [python-config-${PYTHON_VERS}]) |
---|
261 | else |
---|
262 | AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config]) |
---|
263 | fi |
---|
264 | else |
---|
265 | PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config" |
---|
266 | fi |
---|
267 | |
---|
268 | # Extract the linker and include flags |
---|
269 | PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags` |
---|
270 | PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes` |
---|
271 | |
---|
272 | # Check headers file |
---|
273 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
274 | CPPFLAGS="$PYTHON_CPPFLAGS" |
---|
275 | AC_CHECK_HEADERS([Python.h], |
---|
276 | [], [AC_MSG_ERROR([could not find headers include related to libpython])]) |
---|
277 | |
---|
278 | # Ensure we can link against libphp |
---|
279 | LIBS_SAVE="$LIBS" |
---|
280 | LIBS="$PYTHON_LDFLAGS" |
---|
281 | PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'` |
---|
282 | AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) |
---|
283 | AC_SUBST([PYTHON_CPPFLAGS]) |
---|
284 | AC_SUBST([PYTHON_LDFLAGS]) |
---|
285 | fi |
---|
286 | |
---|
287 | AC_SUBST([PYTHON_ENABLED]) |
---|
288 | AC_SUBST([PYTHON_FILE]) |
---|
289 | |
---|
290 | # =========================================================================== |
---|
291 | # Detect if php is installed |
---|
292 | # =========================================================================== |
---|
293 | |
---|
294 | AC_ARG_WITH([php], |
---|
295 | [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation, disabled by default])], |
---|
296 | [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""]) |
---|
297 | |
---|
298 | |
---|
299 | if test -z "$PHP_ENABLED" |
---|
300 | then |
---|
301 | PHP_FILE="" |
---|
302 | else |
---|
303 | PHPCONFIG="$PHP_PATH/bin/php-config" |
---|
304 | PHP_FILE="service_internal_php.o" |
---|
305 | if test "$PHP_PATH" = "yes" |
---|
306 | then |
---|
307 | # PHP was not specified, so search within the current path |
---|
308 | AC_PATH_PROG([PHPCONFIG], [php-config]) |
---|
309 | else |
---|
310 | PHPCONFIG="$PHP_PATH/bin/php-config" |
---|
311 | fi |
---|
312 | |
---|
313 | # Extract the linker and include flags |
---|
314 | PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5" |
---|
315 | PHP_CPPFLAGS=`$PHPCONFIG --includes` |
---|
316 | |
---|
317 | # Check headers file |
---|
318 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
319 | CPPFLAGS="$PHP_CPPFLAGS" |
---|
320 | AC_CHECK_HEADERS([sapi/embed/php_embed.h], |
---|
321 | [], [AC_MSG_ERROR([could not find headers include related to libphp])]) |
---|
322 | |
---|
323 | # Ensure we can link against libphp |
---|
324 | LIBS_SAVE="$LIBS" |
---|
325 | LIBS="$PHP_LDFLAGS" |
---|
326 | # Shouldn't we get php here rather than php5 :) ?? |
---|
327 | AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], []) |
---|
328 | AC_SUBST([PHP_CPPFLAGS]) |
---|
329 | AC_SUBST([PHP_LDFLAGS]) |
---|
330 | fi |
---|
331 | |
---|
332 | AC_SUBST([PHP_ENABLED]) |
---|
333 | AC_SUBST([PHP_FILE]) |
---|
334 | |
---|
335 | # =========================================================================== |
---|
336 | # Detect if perl is installed |
---|
337 | # =========================================================================== |
---|
338 | |
---|
339 | AC_ARG_WITH([perl], |
---|
340 | [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation, disabled by default])], |
---|
341 | [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""]) |
---|
342 | |
---|
343 | |
---|
344 | if test -z "$PERL_ENABLED" |
---|
345 | then |
---|
346 | PERL_FILE="" |
---|
347 | else |
---|
348 | PERL_FILE="service_internal_perl.o" |
---|
349 | if test "$PERL_PATH" = "yes" |
---|
350 | then |
---|
351 | # Perl was not specified, so search within the current path |
---|
352 | AC_PATH_PROG([PERLCONFIG], [perl]) |
---|
353 | else |
---|
354 | PERLCONFIG="$PERL_PATH/bin/perl" |
---|
355 | fi |
---|
356 | |
---|
357 | # Extract the linker and include flags |
---|
358 | PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts` |
---|
359 | PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts` |
---|
360 | |
---|
361 | # Check headers file |
---|
362 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
363 | CPPFLAGS="$PERL_CPPFLAGS" |
---|
364 | AC_CHECK_HEADERS([EXTERN.h], |
---|
365 | [], [AC_MSG_ERROR([could not find headers include related to libperl])]) |
---|
366 | |
---|
367 | AC_SUBST([PERL_CPPFLAGS]) |
---|
368 | AC_SUBST([PERL_LDFLAGS]) |
---|
369 | fi |
---|
370 | |
---|
371 | AC_SUBST([PERL_ENABLED]) |
---|
372 | AC_SUBST([PERL_FILE]) |
---|
373 | |
---|
374 | # =========================================================================== |
---|
375 | # Detect if java is installed |
---|
376 | # =========================================================================== |
---|
377 | |
---|
378 | AC_ARG_WITH([java], |
---|
379 | [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME, disabled by default])], |
---|
380 | [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""]) |
---|
381 | |
---|
382 | if test -z "$JAVA_ENABLED" |
---|
383 | then |
---|
384 | JAVA_FILE="" |
---|
385 | else |
---|
386 | JAVA_FILE="service_internal_java.o" |
---|
387 | if test "x$JDKHOME" = "x"; |
---|
388 | then |
---|
389 | 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.]) |
---|
390 | fi # JAVA was specified; display a message to the user |
---|
391 | if test "x$JDKHOME" = "xyes"; |
---|
392 | then |
---|
393 | AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java]) |
---|
394 | fi |
---|
395 | |
---|
396 | # Extract the linker and include flags |
---|
397 | if test "x$JDKHOME" = "xmacos"; |
---|
398 | then |
---|
399 | JAVA_LDFLAGS="-framework JavaVM" |
---|
400 | JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/" |
---|
401 | else |
---|
402 | if test -d "$JDKHOME/jre/lib/i386"; |
---|
403 | then |
---|
404 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/client/ -ljvm -lpthread" |
---|
405 | JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux" |
---|
406 | else |
---|
407 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/client/ -ljvm -lpthread" |
---|
408 | JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux" |
---|
409 | fi |
---|
410 | fi |
---|
411 | |
---|
412 | # Check headers file (second time we check that in fact) |
---|
413 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
414 | CPPFLAGS="$JAVA_CPPFLAGS" |
---|
415 | AC_CHECK_HEADERS([jni.h], |
---|
416 | [], [AC_MSG_ERROR([could not find headers include related to libjava])]) |
---|
417 | |
---|
418 | # Ensure we can link against libjava |
---|
419 | LIBS_SAVE="$LIBS" |
---|
420 | LIBS="$JAVA_LDFLAGS" |
---|
421 | if test "x$JDKHOME" != "xmacos"; |
---|
422 | then |
---|
423 | AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjava])], []) |
---|
424 | fi |
---|
425 | |
---|
426 | AC_SUBST([JAVA_CPPFLAGS]) |
---|
427 | AC_SUBST([JAVA_LDFLAGS]) |
---|
428 | fi |
---|
429 | |
---|
430 | AC_SUBST([JAVA_ENABLED]) |
---|
431 | AC_SUBST([JAVA_FILE]) |
---|
432 | |
---|
433 | # =========================================================================== |
---|
434 | # Detect if spidermonkey is installed |
---|
435 | # =========================================================================== |
---|
436 | |
---|
437 | AC_ARG_WITH([js], |
---|
438 | [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 ])], |
---|
439 | [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""]) |
---|
440 | |
---|
441 | if test -z "$JS_ENABLED" |
---|
442 | then |
---|
443 | JS_FILE="" |
---|
444 | else |
---|
445 | JS_FILE="service_internal_js.o" |
---|
446 | if test "$JSHOME" = "yes" |
---|
447 | then |
---|
448 | |
---|
449 | #on teste si on est sous debian like |
---|
450 | if test -f "/usr/bin/dpkg" |
---|
451 | then |
---|
452 | if test -n "`dpkg -l | grep libmozjs185-dev`" |
---|
453 | then |
---|
454 | JS_CPPFLAGS="-I/usr/include/js/" |
---|
455 | JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm" |
---|
456 | JS_LIB="mozjs185" |
---|
457 | else |
---|
458 | XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`" |
---|
459 | if test -n "$XUL_VERSION" |
---|
460 | then |
---|
461 | JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION" |
---|
462 | JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm" |
---|
463 | JS_LIB="mozjs" |
---|
464 | else |
---|
465 | AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ]) |
---|
466 | fi |
---|
467 | fi |
---|
468 | else |
---|
469 | AC_MSG_ERROR([You must specify your custom install of libmozjs185]) |
---|
470 | fi |
---|
471 | else |
---|
472 | JS_CPPFLAGS="-I$JSHOME/include/js/" |
---|
473 | JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm" |
---|
474 | JS_LIB="mozjs185" |
---|
475 | |
---|
476 | fi |
---|
477 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
478 | CPPFLAGS="$JS_CPPFLAGS" |
---|
479 | |
---|
480 | #AC_CHECK_HEADERS([jsapi.h], |
---|
481 | # [], [AC_MSG_ERROR([could not find headers include related to libjs])]) |
---|
482 | |
---|
483 | |
---|
484 | LIBS_SAVE="$LIBS" |
---|
485 | LIBS="$JS_LDFLAGS" |
---|
486 | |
---|
487 | AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], []) |
---|
488 | |
---|
489 | AC_SUBST([JS_CPPFLAGS]) |
---|
490 | AC_SUBST([JS_LDFLAGS]) |
---|
491 | fi |
---|
492 | |
---|
493 | AC_SUBST([JS_ENABLED]) |
---|
494 | AC_SUBST([JS_FILE]) |
---|
495 | |
---|
496 | AC_CONFIG_FILES([Makefile]) |
---|
497 | AC_CONFIG_FILES([ZOOMakefile.opts]) |
---|
498 | AC_OUTPUT |
---|