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