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