1 | AC_INIT([ZOO Kernel], [1.7.0], [bugs@zoo-project.org]) |
---|
2 | |
---|
3 | AC_CONFIG_MACRO_DIR([macros]) |
---|
4 | |
---|
5 | # Checks for programs. |
---|
6 | AC_PROG_YACC |
---|
7 | AC_PROG_CC |
---|
8 | AC_PROG_LEX |
---|
9 | AC_PROG_CXX |
---|
10 | AC_PROG_SED |
---|
11 | |
---|
12 | # Checks for libraries. |
---|
13 | AC_CHECK_LIB([curl], [curl_easy_init,curl_easy_setopt,curl_easy_cleanup,curl_easy_perform]) |
---|
14 | AC_CHECK_LIB([dl], [dlopen,dlsym,dlerror,dlclose]) |
---|
15 | AC_CHECK_LIB([crypto], [EVP_DigestInit,EVP_md5,EVP_DigestUpdate,BIO_f_base64,BIO_new]) |
---|
16 | |
---|
17 | DEFAULT_LIBS="$LIBS" |
---|
18 | AC_SUBST([DEFAULT_LIBS]) |
---|
19 | |
---|
20 | |
---|
21 | # Checks for header files. |
---|
22 | AC_FUNC_ALLOCA |
---|
23 | AC_CHECK_HEADERS([fcntl.h inttypes.h malloc.h stddef.h stdlib.h string.h unistd.h]) |
---|
24 | |
---|
25 | # Checks for typedefs, structures, and compiler characteristics. |
---|
26 | AC_HEADER_STDBOOL |
---|
27 | AC_TYPE_INT16_T |
---|
28 | AC_TYPE_INT32_T |
---|
29 | AC_TYPE_INT8_T |
---|
30 | AC_TYPE_PID_T |
---|
31 | AC_TYPE_SIZE_T |
---|
32 | AC_TYPE_UINT16_T |
---|
33 | AC_TYPE_UINT32_T |
---|
34 | AC_TYPE_UINT8_T |
---|
35 | |
---|
36 | # Checks for library functions. |
---|
37 | AC_FUNC_FORK |
---|
38 | AC_FUNC_MALLOC |
---|
39 | AC_FUNC_REALLOC |
---|
40 | AC_CHECK_FUNCS([dup2 getcwd memset setenv strdup strstr]) |
---|
41 | |
---|
42 | #============================================================================ |
---|
43 | # Detect if uuid is available |
---|
44 | #============================================================================ |
---|
45 | |
---|
46 | AC_ARG_WITH([uuid], |
---|
47 | [AS_HELP_STRING([--with-uuid=PATH], [Specifies an alternative location for the ossp-uuid library])], |
---|
48 | [UUID_DIR="$withval"], [UUID_DIR="/usr/"]) |
---|
49 | UUID_CFLAGS="-I$UUID_DIR/include" |
---|
50 | UUID_LDFLAGS="-L$UUID_DIR/lib -luuid" |
---|
51 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
52 | CPPFLAGS="$UUID_CFLAGS" |
---|
53 | LIBS_SAVE="$LIBS" |
---|
54 | LIBS="$UUID_LDFLAGS" |
---|
55 | AC_CHECK_HEADERS([uuid/uuid.h], |
---|
56 | [], [AC_MSG_ERROR([could not find header file uuid.h])]) |
---|
57 | AC_CHECK_LIB([uuid], [uuid_generate_time], |
---|
58 | [], [AC_MSG_ERROR([could not find function in uuid library])]) |
---|
59 | CPPFLAGS="$CPPFLAGS_SAVE" |
---|
60 | AC_SUBST([UUID_CFLAGS]) |
---|
61 | AC_SUBST([UUID_LDFLAGS]) |
---|
62 | |
---|
63 | #============================================================================ |
---|
64 | # Detect if json-c is available |
---|
65 | #============================================================================ |
---|
66 | |
---|
67 | AC_ARG_WITH([callback], |
---|
68 | [AS_HELP_STRING([--with-callback=yes], [Activate callback invocation during HPC execution])], |
---|
69 | [CALLBACK_ACTIVATED="$withval"], [CALLBACK_ACTIVATED="no"]) |
---|
70 | |
---|
71 | AC_ARG_WITH([json], |
---|
72 | [AS_HELP_STRING([--with-json=PATH], [Specifies an alternative location for the json-c library])], |
---|
73 | [JSON_DIR="$withval"], [JSON_DIR="/usr/"]) |
---|
74 | if test "x$JSON_DIR" != "x" && test "x$CALLBACK_ACTIVATED" == "xyes" |
---|
75 | then |
---|
76 | JSON_CPPFLAGS="-I$JSON_DIR/include/json-c/" |
---|
77 | JSON_LDFLAGS="-L$JSON_DIR/lib -ljson-c" |
---|
78 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
79 | CPPFLAGS="$JSON_CPPFLAGS" |
---|
80 | LIBS_SAVE="$LIBS" |
---|
81 | LIBS="$JSON_LDFLAGS" |
---|
82 | AC_CHECK_HEADERS([json_object.h], |
---|
83 | [], [AC_MSG_ERROR([could not find header file json_object.h])]) |
---|
84 | AC_CHECK_LIB([json-c], [json_object_new_object], |
---|
85 | [], [AC_MSG_ERROR([could not find function in json-c library])]) |
---|
86 | CPPFLAGS="$CPPFLAGS_SAVE" |
---|
87 | JSON_FILE="service_json.o" |
---|
88 | JSON_ENABLED="-DJSON" |
---|
89 | CALLBACK_FILE="service_callback.o" |
---|
90 | CALLBACK_USE="-DUSE_CALLBACK" |
---|
91 | fi |
---|
92 | AC_SUBST([JSON_CPPFLAGS]) |
---|
93 | AC_SUBST([JSON_LDFLAGS]) |
---|
94 | AC_SUBST([JSON_FILE]) |
---|
95 | AC_SUBST([JSON_ENABLED]) |
---|
96 | AC_SUBST([CALLBACK_FILE]) |
---|
97 | AC_SUBST([CALLBACK_USE]) |
---|
98 | |
---|
99 | #============================================================================ |
---|
100 | # Detect if openssl is available |
---|
101 | #============================================================================ |
---|
102 | |
---|
103 | AC_ARG_WITH([openssl], |
---|
104 | [AS_HELP_STRING([--with-openssl=PATH], [Specifies an alternative location for the openssl library])], |
---|
105 | [OPENSSL_DIR="$withval"], [OPENSSL_DIR="/usr/"]) |
---|
106 | OPENSSL_CFLAGS="-I$OPENSSL_DIR/include" |
---|
107 | OPENSSL_LDFLAGS="-lcrypto -L$OPENSSL_DIR/lib -lssl" |
---|
108 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
109 | CPPFLAGS="$OPENSSL_CFLAGS" |
---|
110 | LIBS_SAVE="$LIBS" |
---|
111 | LIBS="$OPENSSL_LDFLAGS" |
---|
112 | AC_CHECK_HEADERS([openssl/md5.h openssl/hmac.h openssl/evp.h openssl/bio.h openssl/buffer.h], |
---|
113 | [], [AC_MSG_ERROR([could not find header file $i related to openssl])]) |
---|
114 | AC_CHECK_LIB(crypto, BIO_f_base64, |
---|
115 | [], [AC_MSG_ERROR([could not find $i function in openssl library])]) |
---|
116 | CPPFLAGS="$CPPFLAGS_SAVE" |
---|
117 | AC_SUBST([OPENSSL_CFLAGS]) |
---|
118 | AC_SUBST([OPENSSL_LDFLAGS]) |
---|
119 | |
---|
120 | #============================================================================ |
---|
121 | # Detect if gettext is available |
---|
122 | #============================================================================ |
---|
123 | |
---|
124 | #AC_ARG_WITH([gettext], |
---|
125 | # [AS_HELP_STRING([--with-gettext=PATH], [Specifies an alternative location for the openssl library])], |
---|
126 | # [GETTEXT_DIR="$withval"], [GETTEXT_DIR="/usr/"]) |
---|
127 | |
---|
128 | #GETTEXT_CFLAGS="-I$GETTEXT_DIR/include" |
---|
129 | #GETTEXT_LDFLAGS="-L$GETTEXT_DIR/lib -lintl" |
---|
130 | #CFLAGS_SAVE="$CFLAGS" |
---|
131 | #CFLAGS="$GETTEXT_CFLAGS" |
---|
132 | #LIBS_SAVE="$LIBS" |
---|
133 | #LIBS="$GETTEXT_LDFLAGS" |
---|
134 | #AM_GNU_GETTEXT([external], [], []) |
---|
135 | #AC_CHECK_LIB(intl, |
---|
136 | # [dgettext], [] , [AC_MSG_ERROR([could not find $i function in gettext library])]) |
---|
137 | #AC_SUBST([GETTEXT_CFLAGS]) |
---|
138 | #AC_SUBST([GETTEXT_LDFLAGS]) |
---|
139 | |
---|
140 | #============================================================================ |
---|
141 | # Detect if run on debian / ubuntu |
---|
142 | #============================================================================ |
---|
143 | if test -f "/usr/bin/dpkg" |
---|
144 | then |
---|
145 | DEB_DEF=-DDEB |
---|
146 | fi |
---|
147 | AC_SUBST([DEB_DEF]) |
---|
148 | |
---|
149 | AC_ARG_WITH([etc-dir], |
---|
150 | [AS_HELP_STRING([--with-etc-dir=PATH], [Specifies an alternative path to store the main.cfg file ( default: ZOO-Kernel location) ])], |
---|
151 | [ETC_DEF="#define ETC_DIR \\\"${sysconfdir}\\\""], [ETC_DEF=""]) |
---|
152 | AC_SUBST([ETC_DEF]) |
---|
153 | |
---|
154 | AC_ARG_WITH([cgi-dir], |
---|
155 | [AS_HELP_STRING([--with-cgi-dir=PATH], [Specifies an alternative cgi directory path ( default: /usr/lib/cgi-bin) ])], |
---|
156 | [CGI_DIR="$withval"], [CGI_DIR="/usr/lib/cgi-bin"]) |
---|
157 | AC_SUBST([CGI_DIR]) |
---|
158 | |
---|
159 | AC_ARG_WITH([db-backend], |
---|
160 | [AS_HELP_STRING([--with-db-backend], [Relies on a database for storing status messages and response files ])], |
---|
161 | [RELY_ON_DB="-DRELY_ON_DB"], [RELY_ON_DB=""]) |
---|
162 | AC_SUBST([RELY_ON_DB]) |
---|
163 | |
---|
164 | |
---|
165 | # =========================================================================== |
---|
166 | # Detect if libyaml is available |
---|
167 | # =========================================================================== |
---|
168 | |
---|
169 | AC_ARG_WITH([yaml], |
---|
170 | [AS_HELP_STRING([--with-yaml=PATH], [Specifies an alternative location for the yaml library])], |
---|
171 | [YAMLPATH="$withval"], [YAMLPATH=""]) |
---|
172 | |
---|
173 | if test -z "$YAMLPATH" |
---|
174 | then |
---|
175 | YAML_LDFLAGS="" |
---|
176 | YAML_CPPFLAGS="" |
---|
177 | YAML_FILE="" |
---|
178 | YAML_FILE1="" |
---|
179 | else |
---|
180 | |
---|
181 | # Extract the linker and include flags |
---|
182 | YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml" |
---|
183 | YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML" |
---|
184 | YAML_FILE="service_yaml.o" |
---|
185 | YAML_FILE1="zcfg2yaml" |
---|
186 | |
---|
187 | # Check headers file |
---|
188 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
189 | CPPFLAGS="$YAML_CPPFLAGS" |
---|
190 | LIBS_SAVE="$LIBS" |
---|
191 | LIBS="$YAML_LDFLAGS" |
---|
192 | AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan]) |
---|
193 | AC_CHECK_HEADERS([yaml.h], |
---|
194 | [], [AC_MSG_ERROR([could not find headers include related to YAML])]) |
---|
195 | LIBS="$LIBS_SAVE" |
---|
196 | fi |
---|
197 | AC_SUBST([YAML_CPPFLAGS]) |
---|
198 | AC_SUBST([YAML_LDFLAGS]) |
---|
199 | AC_SUBST([YAML_FILE]) |
---|
200 | AC_SUBST([YAML_FILE1]) |
---|
201 | |
---|
202 | # =========================================================================== |
---|
203 | # Detect if fastcgi is available |
---|
204 | # =========================================================================== |
---|
205 | |
---|
206 | AC_ARG_WITH([fastcgi], |
---|
207 | [AS_HELP_STRING([--with-fastcgi=PATH], [Specifies an alternative location for the fastcgi library])], |
---|
208 | [FCGIPATH="$withval"], [FCGIPATH="/usr"]) |
---|
209 | |
---|
210 | # Extract the linker and include flags |
---|
211 | FCGI_LDFLAGS="-L$FCGIPATH/lib -lfcgi" |
---|
212 | FCGI_CPPFLAGS="-I$FCGIPATH/include" |
---|
213 | |
---|
214 | # Check headers file |
---|
215 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
216 | CPPFLAGS="$FCGI_CPPFLAGS" |
---|
217 | LIBS_SAVE="$LIBS" |
---|
218 | LIBS="$FCGI_LDFLAGS" |
---|
219 | AC_CHECK_LIB([fcgi], [main]) |
---|
220 | AC_CHECK_HEADERS([fcgi_stdio.h], |
---|
221 | [], [AC_MSG_ERROR([could not find headers include related to fastcgi])]) |
---|
222 | LIBS="$LIBS_SAVE" |
---|
223 | AC_SUBST([FCGI_CPPFLAGS]) |
---|
224 | AC_SUBST([FCGI_LDFLAGS]) |
---|
225 | |
---|
226 | AC_ARG_WITH([metadb], |
---|
227 | [AS_HELP_STRING([--with-metadb=yes], [Activates the metadata database support])], |
---|
228 | [WITHMETADB="$withval"], [WITHMETADB=""]) |
---|
229 | |
---|
230 | if test "x$WITHMETADB" = "xyes"; then |
---|
231 | METADB="-DMETA_DB" |
---|
232 | METADB_FILE="meta_sql.o sqlapi.o" |
---|
233 | else |
---|
234 | METADB="" |
---|
235 | METADB_FILE="" |
---|
236 | fi |
---|
237 | |
---|
238 | AC_SUBST([METADB]) |
---|
239 | AC_SUBST([METADB_FILE]) |
---|
240 | |
---|
241 | AC_ARG_WITH([hpc], |
---|
242 | [AS_HELP_STRING([--with-hpc=yes], [Specifies if you need to activate HPC support])], |
---|
243 | [HPCWITH="$withval"], [HPCWITH="no"]) |
---|
244 | |
---|
245 | |
---|
246 | AC_ARG_WITH([ssh2], |
---|
247 | [AS_HELP_STRING([--with-ssh2=PATH], [Specifies an alternative location for the ssh2 library])], |
---|
248 | [SSH2PATH="$withval"], [SSH2PATH="/usr"]) |
---|
249 | |
---|
250 | if test "x$HPCWITH" = "xyes"; then |
---|
251 | HPC_FILES="service_internal_hpc.o sshapi.o" |
---|
252 | HPC_ENABLED="-DUSE_HPC" |
---|
253 | HPC_CPPFLAGS="" |
---|
254 | HPC_LDFLAGS="" |
---|
255 | # Extract the linker and include flags |
---|
256 | SSH2_LDFLAGS="-L$SSH2PATH/lib -lssh2" |
---|
257 | SSH2_CPPFLAGS="-I$SSH2PATH/include" |
---|
258 | # Check headers file |
---|
259 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
260 | CPPFLAGS="$SSH2_CPPFLAGS" |
---|
261 | LIBS_SAVE="$LIBS" |
---|
262 | LIBS="$SSH2_LDFLAGS" |
---|
263 | |
---|
264 | AC_CHECK_HEADERS([libssh2.h], |
---|
265 | [], [AC_MSG_ERROR([could not find headers related to libssh2])]) |
---|
266 | AC_CHECK_LIB([ssh2], [libssh2_session_init]) |
---|
267 | |
---|
268 | LIBS="$LIBS_SAVE" |
---|
269 | fi |
---|
270 | |
---|
271 | AC_SUBST([HPC_CPPFLAGS]) |
---|
272 | AC_SUBST([HPC_LDFLAGS]) |
---|
273 | AC_SUBST([HPC_ENABLED]) |
---|
274 | AC_SUBST([HPC_FILES]) |
---|
275 | |
---|
276 | AC_SUBST([SSH2_CPPFLAGS]) |
---|
277 | AC_SUBST([SSH2_LDFLAGS]) |
---|
278 | |
---|
279 | # =========================================================================== |
---|
280 | # Detect if libxml2 is installed |
---|
281 | # =========================================================================== |
---|
282 | |
---|
283 | AC_ARG_WITH([xml2config], |
---|
284 | [AS_HELP_STRING([--with-xml2config=FILE], [Specifies an alternative xml2-config file])], |
---|
285 | [XML2CONFIG="$withval"], [XML2CONFIG=""]) |
---|
286 | |
---|
287 | if test "x$XML2CONFIG" = "x"; then |
---|
288 | # XML2CONFIG was not specified, so search within the current path |
---|
289 | AC_PATH_PROG([XML2CONFIG], [xml2-config]) |
---|
290 | |
---|
291 | # If we couldn't find xml2-config, display a warning |
---|
292 | if test "x$XML2CONFIG" = "x"; then |
---|
293 | 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.]) |
---|
294 | fi |
---|
295 | else |
---|
296 | # XML2CONFIG was specified; display a message to the user |
---|
297 | if test "x$XML2CONFIG" = "xyes"; then |
---|
298 | AC_MSG_ERROR([you must Specifies a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config]) |
---|
299 | else |
---|
300 | if test -f $XML2CONFIG; then |
---|
301 | AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG]) |
---|
302 | else |
---|
303 | AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist]) |
---|
304 | fi |
---|
305 | fi |
---|
306 | fi |
---|
307 | |
---|
308 | # Extract the linker and include flags |
---|
309 | XML2_LDFLAGS=`$XML2CONFIG --libs` |
---|
310 | XML2_CPPFLAGS=`$XML2CONFIG --cflags` |
---|
311 | |
---|
312 | # Check headers file |
---|
313 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
314 | CPPFLAGS="$XML2_CPPFLAGS" |
---|
315 | AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h], |
---|
316 | [], [AC_MSG_ERROR([could not find headers include related to libxml2])]) |
---|
317 | |
---|
318 | # Ensure we can link against libxml2 |
---|
319 | LIBS_SAVE="$LIBS" |
---|
320 | LIBS="$XML2_LDFLAGS" |
---|
321 | AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], []) |
---|
322 | |
---|
323 | AC_SUBST([XML2_CPPFLAGS]) |
---|
324 | AC_SUBST([XML2_LDFLAGS]) |
---|
325 | LIBS="$LIBS_SAVE" |
---|
326 | |
---|
327 | |
---|
328 | # =========================================================================== |
---|
329 | # Detect if libxslt is installed |
---|
330 | # =========================================================================== |
---|
331 | |
---|
332 | AC_ARG_WITH([xsltconfig], |
---|
333 | [AS_HELP_STRING([--with-xsltconfig=FILE], [Specifies an alternative xslt-config file])], |
---|
334 | [XSLTCONFIG="$withval"], [XSLTCONFIG=""]) |
---|
335 | |
---|
336 | if test "x$XSLTCONFIG" = "x"; then |
---|
337 | # XSLTCONFIG was not specified, so search within the current path |
---|
338 | AC_PATH_PROG([XSLTCONFIG], [xslt-config]) |
---|
339 | |
---|
340 | # If we couldn't find xslt-config, display a warning |
---|
341 | if test "x$XSLTCONFIG" = "x"; then |
---|
342 | 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.]) |
---|
343 | fi |
---|
344 | else |
---|
345 | # XSLTCONFIG was specified; display a message to the user |
---|
346 | if test "x$XSLTCONFIG" = "xyes"; then |
---|
347 | AC_MSG_ERROR([you must Specifies a parameter to --with-xsltconfig, e.g. --with-xsltconfig=/path/to/xslt-config]) |
---|
348 | else |
---|
349 | if test -f $XSLTCONFIG; then |
---|
350 | AC_MSG_RESULT([Using user-specified xslt-config file: $XSLTCONFIG]) |
---|
351 | else |
---|
352 | AC_MSG_ERROR([the user-specified xslt-config file $XSLTCONFIG does not exist]) |
---|
353 | fi |
---|
354 | fi |
---|
355 | fi |
---|
356 | |
---|
357 | # Extract the linker and include flags |
---|
358 | XSLT_LDFLAGS=`$XSLTCONFIG --libs` |
---|
359 | XSLT_CPPFLAGS=`$XSLTCONFIG --cflags` |
---|
360 | |
---|
361 | # Check headers file |
---|
362 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
363 | CPPFLAGS="$XSLT_CPPFLAGS" |
---|
364 | AC_CHECK_HEADERS([libxslt/xslt.h libxslt/xsltInternals.h libxslt/transform.h libxslt/xsltutils.h], |
---|
365 | [], [AC_MSG_ERROR([could not find headers include related to libxlst])]) |
---|
366 | |
---|
367 | AC_SUBST([XSLT_CPPFLAGS]) |
---|
368 | AC_SUBST([XSLT_LDFLAGS]) |
---|
369 | |
---|
370 | #============================================================================ |
---|
371 | # Detect if gdal is installed |
---|
372 | #============================================================================ |
---|
373 | |
---|
374 | AC_ARG_WITH([gdal-config], |
---|
375 | [AS_HELP_STRING([--with-gdal-config=FILE], [Specifies an alternative gdal-config file])], |
---|
376 | [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""]) |
---|
377 | if test -z $GDAL_CONFIG; |
---|
378 | then |
---|
379 | AC_PATH_PROG([GDAL_CONFIG], [gdal-config]) |
---|
380 | if test -z $GDAL_CONFIG; |
---|
381 | then |
---|
382 | 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.]) |
---|
383 | fi |
---|
384 | |
---|
385 | else |
---|
386 | if test -f $GDAL_CONFIG; then |
---|
387 | AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG]) |
---|
388 | else |
---|
389 | AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist]) |
---|
390 | fi |
---|
391 | fi |
---|
392 | |
---|
393 | GDAL_CFLAGS="`$GDAL_CONFIG --cflags`" |
---|
394 | GDAL_LIBS="`$GDAL_CONFIG --libs`" |
---|
395 | |
---|
396 | AC_SUBST([GDAL_CFLAGS]) |
---|
397 | AC_SUBST([GDAL_LIBS]) |
---|
398 | |
---|
399 | # =========================================================================== |
---|
400 | # Detect if proj is installed |
---|
401 | # =========================================================================== |
---|
402 | |
---|
403 | AC_ARG_WITH([proj], |
---|
404 | [AS_HELP_STRING([--with-proj=PATH], [Specifies an alternative location for PROJ4 setup])], |
---|
405 | [PROJPATH="$withval"], [PROJPATH=""]) |
---|
406 | |
---|
407 | # Extract the linker and include flags |
---|
408 | PROJ_LDFLAGS="-L$PROJPATH/lib" |
---|
409 | PROJ_CPPFLAGS="-I$PROJPATH/include" |
---|
410 | |
---|
411 | # Check headers file |
---|
412 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
413 | CPPFLAGS="$PROJ_CPPFLAGS" |
---|
414 | AC_CHECK_HEADERS([proj_api.h], |
---|
415 | [], [AC_MSG_ERROR([could not find headers include related to PROJ4])]) |
---|
416 | |
---|
417 | AC_SUBST([PROJ_CPPFLAGS]) |
---|
418 | AC_SUBST([PROJ_LDFLAGS]) |
---|
419 | |
---|
420 | # =========================================================================== |
---|
421 | # Detect if libgeos is installed |
---|
422 | # =========================================================================== |
---|
423 | |
---|
424 | AC_ARG_WITH([geosconfig], |
---|
425 | [AS_HELP_STRING([--with-geosconfig=FILE], [Specifies an alternative geos-config file])], |
---|
426 | [GEOSCONFIG="$withval"], [GEOSCONFIG=""]) |
---|
427 | |
---|
428 | if test "x$GEOSCONFIG" = "x"; then |
---|
429 | # GEOSCONFIG was not specified, so search within the current path |
---|
430 | AC_PATH_PROG([GEOSCONFIG], [geos-config]) |
---|
431 | |
---|
432 | # If we couldn't find geos-config, display a warning |
---|
433 | if test "x$GEOSCONFIG" = "x"; then |
---|
434 | 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.]) |
---|
435 | fi |
---|
436 | else |
---|
437 | # GEOSCONFIG was specified; display a message to the user |
---|
438 | if test "x$GEOSCONFIG" = "xyes"; then |
---|
439 | AC_MSG_WARN([you must Specifies a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config]) |
---|
440 | else |
---|
441 | if test -f $GEOSCONFIG; then |
---|
442 | AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG]) |
---|
443 | else |
---|
444 | AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist]) |
---|
445 | fi |
---|
446 | fi |
---|
447 | fi |
---|
448 | |
---|
449 | GEOS_LDFLAGS=`$GEOSCONFIG --libs` |
---|
450 | GEOS_CPPFLAGS=`$GEOSCONFIG --cflags` |
---|
451 | |
---|
452 | # Check headers file |
---|
453 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
454 | CPPFLAGS="$GEOS_CPPFLAGS" |
---|
455 | AC_CHECK_HEADERS([geos_c.h], |
---|
456 | [], [AC_MSG_WARN([could not find headers include related to libgeos])]) |
---|
457 | |
---|
458 | AC_SUBST([GEOS_CPPFLAGS]) |
---|
459 | AC_SUBST([GEOS_LDFLAGS]) |
---|
460 | |
---|
461 | |
---|
462 | # =========================================================================== |
---|
463 | # Detect if cgal is installed |
---|
464 | # =========================================================================== |
---|
465 | |
---|
466 | AC_ARG_WITH([cgal], |
---|
467 | [AS_HELP_STRING([--with-cgal=PATH], [Specifies an alternative location for CGAL setup])], |
---|
468 | [CGALPATH="$withval"], [CGALPATH="/usr"]) |
---|
469 | |
---|
470 | |
---|
471 | # Check headers file |
---|
472 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
473 | CGAL_CPPFLAGS="-I$CGALPATH/include" |
---|
474 | CPPFLAGS="$CGAL_CPPFLAGS" |
---|
475 | AC_CHECK_HEADERS([CGAL/Delaunay_triangulation_2.h], |
---|
476 | [], [AC_MSG_WARN([could not find headers include related to libCGAL])]) |
---|
477 | |
---|
478 | # Extract the linker and include flags |
---|
479 | CGAL_LDFLAGS="-L$CGALPATH/lib" |
---|
480 | CGAL_CPPFLAGS="-I$CGALPATH/include" |
---|
481 | |
---|
482 | |
---|
483 | AC_SUBST([CGAL_CPPFLAGS]) |
---|
484 | AC_SUBST([CGAL_LDFLAGS]) |
---|
485 | #============================================================================ |
---|
486 | # Detect if mapserver is installed |
---|
487 | #============================================================================ |
---|
488 | |
---|
489 | AC_ARG_WITH([mapserver], |
---|
490 | [AS_HELP_STRING([--with-mapserver=PATH], [Specifies the path for MapServer compiled source tree])], |
---|
491 | [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""]) |
---|
492 | |
---|
493 | AC_ARG_WITH([ms-version], |
---|
494 | [AS_HELP_STRING([--with-ms-version=VERSION], [Specifies the MapServer version to build against])], |
---|
495 | [MS_VERSION="$withval"], [MS_VERSION=""]) |
---|
496 | |
---|
497 | if test -z $MS_SRC_PATH; |
---|
498 | then |
---|
499 | MS_CPPFLAGS="" |
---|
500 | MS_LDFLAGS="" |
---|
501 | else |
---|
502 | if test "x$MS_SRC_PATH" = "xmacos"; |
---|
503 | then |
---|
504 | MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl" |
---|
505 | MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver " |
---|
506 | AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree]) |
---|
507 | AC_MSG_RESULT([Using MacOS X Framework for MapServer]) |
---|
508 | else |
---|
509 | if test "x$MS_VERSION" = "x7"; |
---|
510 | then |
---|
511 | MS_LDFLAGS="-L$MS_SRC_PATH/lib -lmapserver" |
---|
512 | MS_CPPFLAGS="-DUSE_MS -I$MS_SRC_PATH/include/mapserver " |
---|
513 | AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH]) |
---|
514 | else |
---|
515 | if test -d $MS_SRC_PATH; then |
---|
516 | MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`" |
---|
517 | MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH " |
---|
518 | |
---|
519 | AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH]) |
---|
520 | else |
---|
521 | AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist]) |
---|
522 | fi |
---|
523 | fi |
---|
524 | fi |
---|
525 | MS_FILE="service_internal_ms.o" |
---|
526 | fi |
---|
527 | |
---|
528 | MS_CFLAGS="$MS_CPPFLAGS" |
---|
529 | MS_LIBS="$MS_LDFLAGS" |
---|
530 | |
---|
531 | AC_SUBST([MS_CFLAGS]) |
---|
532 | AC_SUBST([MS_LIBS]) |
---|
533 | AC_SUBST([MS_FILE]) |
---|
534 | AC_SUBST([MS_VERSION]) |
---|
535 | |
---|
536 | # =========================================================================== |
---|
537 | # Detect if R is installed |
---|
538 | # =========================================================================== |
---|
539 | |
---|
540 | AC_ARG_WITH([r], |
---|
541 | [AS_HELP_STRING([--with-r=PATH], [To enable python support or Specifies an alternative directory for R installation, disabled by default])], |
---|
542 | [R_PATH="$withval"; R_ENABLED="-DUSE_R"], [R_ENABLED=""]) |
---|
543 | |
---|
544 | if test -z "$R_ENABLED" |
---|
545 | then |
---|
546 | R_FILE="" |
---|
547 | else |
---|
548 | R_FILE="service_internal_r.o" |
---|
549 | # Extract the linker and include flags |
---|
550 | R_LDFLAGS="-L$R_PATH/lib/ -lR" |
---|
551 | R_CPPFLAGS="-I$R_PATH/include/" |
---|
552 | |
---|
553 | # Check headers file |
---|
554 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
555 | CPPFLAGS="$R_CPPFLAGS" |
---|
556 | AC_CHECK_HEADERS([Rinternals.h], |
---|
557 | [], [AC_MSG_ERROR([could not find headers include related to R])]) |
---|
558 | |
---|
559 | # Ensure we can link against libphp |
---|
560 | #LIBS_SAVE="$LIBS" |
---|
561 | #LIBS="$R_LDFLAGS" |
---|
562 | #AC_CHECK_LIB([$LIBS], [R_tryEval], [], [AC_MSG_ERROR([could not find libR])], []) |
---|
563 | #LIBS="$LIBS_SAVE" |
---|
564 | fi |
---|
565 | |
---|
566 | AC_SUBST([R_CPPFLAGS]) |
---|
567 | AC_SUBST([R_LDFLAGS]) |
---|
568 | AC_SUBST([R_ENABLED]) |
---|
569 | AC_SUBST([R_FILE]) |
---|
570 | |
---|
571 | |
---|
572 | # =========================================================================== |
---|
573 | # Detect if python is installed |
---|
574 | # =========================================================================== |
---|
575 | |
---|
576 | AC_ARG_WITH([python], |
---|
577 | [AS_HELP_STRING([--with-python=PATH], [To enable python support or Specifies an alternative directory for python installation, disabled by default])], |
---|
578 | [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""]) |
---|
579 | |
---|
580 | AC_ARG_WITH([pyvers], |
---|
581 | [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])], |
---|
582 | [PYTHON_VERS="$withval"], [PYTHON_VERS=""]) |
---|
583 | |
---|
584 | |
---|
585 | if test -z "$PYTHON_ENABLED" |
---|
586 | then |
---|
587 | PYTHON_FILE="" |
---|
588 | else |
---|
589 | PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config" |
---|
590 | PYTHON_FILE="service_internal_python.o" |
---|
591 | if test "$PYTHON_PATH" = "yes" |
---|
592 | then |
---|
593 | # PYTHON was not specified, so search within the current path |
---|
594 | PYTHONCFG_PATH=`which python${PYTHON_VERS}-config` |
---|
595 | if test -z "${PYTHONCFG_PATH}" ; then |
---|
596 | AC_PATH_PROG([PYTHONCONFIG], [python-config-${PYTHON_VERS}]) |
---|
597 | else |
---|
598 | AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config]) |
---|
599 | fi |
---|
600 | else |
---|
601 | PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config" |
---|
602 | fi |
---|
603 | |
---|
604 | # Extract the linker and include flags |
---|
605 | PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags` |
---|
606 | PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes` |
---|
607 | |
---|
608 | # Check headers file |
---|
609 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
610 | CPPFLAGS="$PYTHON_CPPFLAGS" |
---|
611 | AC_CHECK_HEADERS([Python.h], |
---|
612 | [], [AC_MSG_ERROR([could not find headers include related to libpython])]) |
---|
613 | |
---|
614 | # Ensure we can link against libphp |
---|
615 | LIBS_SAVE="$LIBS" |
---|
616 | LIBS="$PYTHON_LDFLAGS" |
---|
617 | PY_LIB=`$PYTHONCONFIG --libs | sed \ |
---|
618 | -e 's/.*\(python[[0-9]]\.[[0-9]]\).*/\1/'` |
---|
619 | AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) |
---|
620 | LIBS="$LIBS_SAVE" |
---|
621 | fi |
---|
622 | |
---|
623 | AC_SUBST([PYTHON_CPPFLAGS]) |
---|
624 | AC_SUBST([PYTHON_LDFLAGS]) |
---|
625 | AC_SUBST([PYTHON_ENABLED]) |
---|
626 | AC_SUBST([PYTHON_FILE]) |
---|
627 | |
---|
628 | # =========================================================================== |
---|
629 | # Detect if spidermonkey is installed |
---|
630 | # =========================================================================== |
---|
631 | |
---|
632 | AC_ARG_WITH([js], |
---|
633 | [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 ])], |
---|
634 | [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""]) |
---|
635 | |
---|
636 | if test -z "$JS_ENABLED" |
---|
637 | then |
---|
638 | JS_FILE="" |
---|
639 | else |
---|
640 | JS_FILE="service_internal_js.o" |
---|
641 | if test "$JSHOME" = "yes" |
---|
642 | then |
---|
643 | |
---|
644 | #on teste si on est sous debian like |
---|
645 | if test -f "/usr/bin/dpkg" |
---|
646 | then |
---|
647 | if test -n "`dpkg -l | grep libmozjs185-dev`" |
---|
648 | then |
---|
649 | JS_CPPFLAGS="-I/usr/include/js/" |
---|
650 | JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm" |
---|
651 | JS_LIB="mozjs185" |
---|
652 | else |
---|
653 | XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`" |
---|
654 | if test -n "$XUL_VERSION" |
---|
655 | then |
---|
656 | JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION" |
---|
657 | JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm" |
---|
658 | JS_LIB="mozjs" |
---|
659 | else |
---|
660 | AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ]) |
---|
661 | fi |
---|
662 | fi |
---|
663 | else |
---|
664 | AC_MSG_ERROR([You must specify your custom install of libmozjs185]) |
---|
665 | fi |
---|
666 | else |
---|
667 | JS_CPPFLAGS="-I$JSHOME/include/js/" |
---|
668 | JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm" |
---|
669 | JS_LIB="mozjs185" |
---|
670 | |
---|
671 | fi |
---|
672 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
673 | CPPFLAGS="$JS_CPPFLAGS" |
---|
674 | AC_LANG_PUSH([C++]) |
---|
675 | AC_CHECK_HEADERS([jsapi.h], |
---|
676 | [], [AC_MSG_ERROR([could not find headers include related to libjs])]) |
---|
677 | |
---|
678 | AC_LANG_POP([C++]) |
---|
679 | LIBS_SAVE="$LIBS" |
---|
680 | LIBS="$JS_LDFLAGS" |
---|
681 | |
---|
682 | AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], []) |
---|
683 | LIBS="$LIBS_SAVE" |
---|
684 | |
---|
685 | AC_SUBST([JS_CPPFLAGS]) |
---|
686 | AC_SUBST([JS_LDFLAGS]) |
---|
687 | fi |
---|
688 | |
---|
689 | AC_SUBST([JS_ENABLED]) |
---|
690 | AC_SUBST([JS_FILE]) |
---|
691 | |
---|
692 | # =========================================================================== |
---|
693 | # Detect if php is installed |
---|
694 | # =========================================================================== |
---|
695 | |
---|
696 | AC_ARG_WITH([php], |
---|
697 | [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation, disabled by default])], |
---|
698 | [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""]) |
---|
699 | |
---|
700 | AC_ARG_WITH([php-version], |
---|
701 | [AS_HELP_STRING([--with-phpvers=NUM], [To use a specific php version])], |
---|
702 | [PHP_VERS="$withval"], [PHP_VERS=""]) |
---|
703 | |
---|
704 | |
---|
705 | if test -z "$PHP_ENABLED" |
---|
706 | then |
---|
707 | PHP_FILE="" |
---|
708 | else |
---|
709 | PHPCONFIG="$PHP_PATH/bin/php-config" |
---|
710 | if test "x$PHP_VERS" = "x7" |
---|
711 | then |
---|
712 | PHP_FILE="service_internal_php7.o" |
---|
713 | else |
---|
714 | PHP_FILE="service_internal_php.o" |
---|
715 | fi |
---|
716 | if test "$PHP_PATH" = "yes" |
---|
717 | then |
---|
718 | # PHP was not specified, so search within the current path |
---|
719 | AC_PATH_PROG([PHPCONFIG], [php-config]) |
---|
720 | else |
---|
721 | PHPCONFIG="$PHP_PATH/bin/php-config" |
---|
722 | fi |
---|
723 | |
---|
724 | # Extract the linker and include flags |
---|
725 | if test "x$PHP_VERS" = "x7" |
---|
726 | then |
---|
727 | PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib64 -lphp7" |
---|
728 | else |
---|
729 | PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5" |
---|
730 | fi |
---|
731 | PHP_CPPFLAGS=`$PHPCONFIG --includes` |
---|
732 | |
---|
733 | # Check headers file |
---|
734 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
735 | CPPFLAGS="$PHP_CPPFLAGS" |
---|
736 | AC_CHECK_HEADERS([sapi/embed/php_embed.h], |
---|
737 | [], [AC_MSG_ERROR([could not find headers include related to libphp])]) |
---|
738 | |
---|
739 | # Ensure we can link against libphp |
---|
740 | LIBS_SAVE="$LIBS" |
---|
741 | LIBS="$PHP_LDFLAGS" |
---|
742 | # Shouldn't we get php here rather than php5 :) ?? |
---|
743 | if test "x$PHP_VERS" = "x7" |
---|
744 | then |
---|
745 | echo $LIBS |
---|
746 | #AC_CHECK_LIB([php7], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], []) |
---|
747 | else |
---|
748 | AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], []) |
---|
749 | fi |
---|
750 | LIBS="$LIBS_SAVE" |
---|
751 | AC_SUBST([PHP_CPPFLAGS]) |
---|
752 | AC_SUBST([PHP_LDFLAGS]) |
---|
753 | fi |
---|
754 | |
---|
755 | AC_SUBST([PHP_ENABLED]) |
---|
756 | AC_SUBST([PHP_FILE]) |
---|
757 | |
---|
758 | # =========================================================================== |
---|
759 | # Detect if java is installed |
---|
760 | # =========================================================================== |
---|
761 | |
---|
762 | AC_ARG_WITH([java], |
---|
763 | [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME, disabled by default])], |
---|
764 | [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""]) |
---|
765 | |
---|
766 | AC_ARG_WITH([java-rpath], |
---|
767 | [AS_HELP_STRING([--with-java-rpath=yes], [To set rpath for java support, disabled by default])], |
---|
768 | [JAVA_RPATH="$withval"], [JAVA_RPATH=""]) |
---|
769 | |
---|
770 | if test -z "$JAVA_ENABLED" |
---|
771 | then |
---|
772 | JAVA_FILE="" |
---|
773 | else |
---|
774 | JAVA_FILE="service_internal_java.o" |
---|
775 | if test "x$JDKHOME" = "x"; |
---|
776 | then |
---|
777 | 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.]) |
---|
778 | fi # JAVA was specified; display a message to the user |
---|
779 | if test "x$JDKHOME" = "xyes"; |
---|
780 | then |
---|
781 | AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java]) |
---|
782 | fi |
---|
783 | |
---|
784 | # Extract the linker and include flags |
---|
785 | if test "x$JDKHOME" = "xmacos"; |
---|
786 | then |
---|
787 | JAVA_LDFLAGS="-framework JavaVM" |
---|
788 | for i in `ls /Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/`; do |
---|
789 | JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/$i/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/" |
---|
790 | done |
---|
791 | else |
---|
792 | if test -d "$JDKHOME/jre/lib/i386"; |
---|
793 | then |
---|
794 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/server/ -ljvm -lpthread" |
---|
795 | JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux" |
---|
796 | if test x$JAVA_RPATH = "xyes"; then |
---|
797 | JAVA_LDFLAGS="$JAVA_LDFLAGS -Wl,-rpath,$JDKHOME/jre/lib/i386/server/" |
---|
798 | fi |
---|
799 | else |
---|
800 | if test -d "$JDKHOME/jre/lib/amd64"; then |
---|
801 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread" |
---|
802 | JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux" |
---|
803 | if test x$JAVA_RPATH = "xyes"; then |
---|
804 | JAVA_LDFLAGS="$JAVA_LDFLAGS -Wl,-rpath,$JDKHOME/jre/lib/amd64/server/" |
---|
805 | fi |
---|
806 | else |
---|
807 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/server/ -ljvm -lpthread" |
---|
808 | JAVA_CPPFLAGS="-I$JDKHOME/include/ -I$JDKHOME/include/darwin" |
---|
809 | if test x$JAVA_RPATH = "xyes"; then |
---|
810 | JAVA_LDFLAGS="$JAVA_LDFLAGS -Wl,-rpath,$JDKHOME/jre/lib/server/" |
---|
811 | fi |
---|
812 | fi |
---|
813 | fi |
---|
814 | fi |
---|
815 | |
---|
816 | AC_LANG([C++]) |
---|
817 | #echo $JAVA_CPPFLAGS |
---|
818 | # Check headers file (second time we check that in fact) |
---|
819 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
820 | CPPFLAGS="$JAVA_CPPFLAGS" |
---|
821 | AC_CHECK_HEADERS([jni.h], |
---|
822 | [], [AC_MSG_ERROR([could not find jni.h file])]) |
---|
823 | CPPFLAGS="$CPPFLAGS_SAVE" |
---|
824 | # Ensure we can link against libjava |
---|
825 | LIBS_SAVE="$LIBS" |
---|
826 | LIBS="$JAVA_LDFLAGS" |
---|
827 | if test "x$JDKHOME" != "xmacos"; |
---|
828 | then |
---|
829 | AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjvm])], []) |
---|
830 | fi |
---|
831 | LIBS="$LIBS_SAVE" |
---|
832 | |
---|
833 | AC_SUBST([JAVA_CPPFLAGS]) |
---|
834 | AC_SUBST([JAVA_LDFLAGS]) |
---|
835 | fi |
---|
836 | |
---|
837 | AC_SUBST([JAVA_ENABLED]) |
---|
838 | AC_SUBST([JAVA_FILE]) |
---|
839 | |
---|
840 | # =========================================================================== |
---|
841 | # Detect if mono is installed |
---|
842 | # =========================================================================== |
---|
843 | |
---|
844 | AC_ARG_WITH([mono], |
---|
845 | [AS_HELP_STRING([--with-mono=PATH], [To enable mono support, specify the path to find pkg-config, disabled by default])], |
---|
846 | [MONOHOME="$withval"; MONO_ENABLED="-DUSE_MONO"], [MONO_ENABLED=""]) |
---|
847 | |
---|
848 | if test -z "$MONO_ENABLED" |
---|
849 | then |
---|
850 | MONO_FILE="" |
---|
851 | else |
---|
852 | MONO_FILE="service_internal_mono.o" |
---|
853 | if test "x$MONOHOME" = "x"; |
---|
854 | then |
---|
855 | MONOHOME="/usr" |
---|
856 | fi |
---|
857 | if test "x$MONOHOME" = "xyes"; |
---|
858 | then |
---|
859 | MONOHOME="/usr" |
---|
860 | fi |
---|
861 | |
---|
862 | # Extract the linker and include flags |
---|
863 | MONO_CFLAGS=`$MONOHOME/bin/pkg-config --cflags mono-2` |
---|
864 | MONO_LDFLAGS=`$MONOHOME/bin/pkg-config --libs mono-2` |
---|
865 | |
---|
866 | AC_LANG([C++]) |
---|
867 | #echo $JAVA_CPPFLAGS |
---|
868 | # Check headers file (second time we check that in fact) |
---|
869 | CPPFLAGS_SAVE="$CFLAGS" |
---|
870 | CPPFLAGS="$MONO_CFLAGS" |
---|
871 | AC_CHECK_HEADERS([mono/jit/jit.h], |
---|
872 | [], [AC_MSG_ERROR([could not find jit.h file])]) |
---|
873 | CPPFLAGS="$CPPFLAGS_SAVE" |
---|
874 | # Ensure we can link against libmono-2.0 |
---|
875 | LIBS_SAVE="$LIBS" |
---|
876 | LIBS="$MONO_LDFLAGS" |
---|
877 | AC_CHECK_LIB([mono-2.0], [mono_runtime_invoke], [], [AC_MSG_ERROR([could not find libmono])], []) |
---|
878 | LIBS="$LIBS_SAVE" |
---|
879 | |
---|
880 | AC_SUBST([MONO_CFLAGS]) |
---|
881 | AC_SUBST([MONO_LDFLAGS]) |
---|
882 | fi |
---|
883 | |
---|
884 | AC_SUBST([MONO_ENABLED]) |
---|
885 | AC_SUBST([MONO_FILE]) |
---|
886 | |
---|
887 | # =========================================================================== |
---|
888 | # Detect if ruby is installed |
---|
889 | # =========================================================================== |
---|
890 | AC_ARG_WITH([ruby], |
---|
891 | [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation, disabled by default])], |
---|
892 | [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""]) |
---|
893 | |
---|
894 | AC_ARG_WITH([rvers], |
---|
895 | [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])], |
---|
896 | [RUBY_VERS="$withval"], [RUBY_VERS=""]) |
---|
897 | |
---|
898 | |
---|
899 | if test -z "$RUBY_ENABLED" |
---|
900 | then |
---|
901 | RUBY_FILE="" |
---|
902 | else |
---|
903 | RUBY_FILE="service_internal_ruby.o" |
---|
904 | |
---|
905 | # Extract the linker and include flags |
---|
906 | RUBY_LDFLAGS="-lruby" |
---|
907 | RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS" |
---|
908 | |
---|
909 | # Check headers file |
---|
910 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
911 | CPPFLAGS="$RUBY_CPPFLAGS" |
---|
912 | AC_CHECK_HEADERS([ruby.h], |
---|
913 | [], [AC_MSG_ERROR([could not find headers include related to libruby])]) |
---|
914 | |
---|
915 | # Ensure we can link against libphp |
---|
916 | LIBS_SAVE="$LIBS" |
---|
917 | LIBS="$RUBY_LDFLAGS" |
---|
918 | # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) |
---|
919 | LIBS="$LIBS_SAVE" |
---|
920 | AC_SUBST([RUBY_CPPFLAGS]) |
---|
921 | AC_SUBST([RUBY_LDFLAGS]) |
---|
922 | fi |
---|
923 | |
---|
924 | AC_SUBST([RUBY_ENABLED]) |
---|
925 | AC_SUBST([RUBY_FILE]) |
---|
926 | |
---|
927 | # =========================================================================== |
---|
928 | # Detect if perl is installed |
---|
929 | # =========================================================================== |
---|
930 | |
---|
931 | AC_ARG_WITH([perl], |
---|
932 | [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation, disabled by default])], |
---|
933 | [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""]) |
---|
934 | |
---|
935 | |
---|
936 | if test -z "$PERL_ENABLED" |
---|
937 | then |
---|
938 | PERL_FILE="" |
---|
939 | else |
---|
940 | PERL_FILE="service_internal_perl.o" |
---|
941 | if test "$PERL_PATH" = "yes" |
---|
942 | then |
---|
943 | # Perl was not specified, so search within the current path |
---|
944 | AC_PATH_PROG([PERLCONFIG], [perl]) |
---|
945 | else |
---|
946 | PERLCONFIG="$PERL_PATH/bin/perl" |
---|
947 | fi |
---|
948 | |
---|
949 | # Extract the linker and include flags |
---|
950 | PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts` |
---|
951 | PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts` |
---|
952 | |
---|
953 | # Check headers file |
---|
954 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
955 | CPPFLAGS="$PERL_CPPFLAGS" |
---|
956 | AC_CHECK_HEADERS([EXTERN.h], |
---|
957 | [], [AC_MSG_ERROR([could not find headers include related to libperl])]) |
---|
958 | |
---|
959 | AC_SUBST([PERL_CPPFLAGS]) |
---|
960 | AC_SUBST([PERL_LDFLAGS]) |
---|
961 | fi |
---|
962 | |
---|
963 | AC_SUBST([PERL_ENABLED]) |
---|
964 | AC_SUBST([PERL_FILE]) |
---|
965 | |
---|
966 | # =========================================================================== |
---|
967 | # Detect if otb is available |
---|
968 | # =========================================================================== |
---|
969 | |
---|
970 | AC_ARG_WITH([itk], |
---|
971 | [AS_HELP_STRING([--with-itk=PATH], [Specifies an alternative location for the itk library])], |
---|
972 | [ITKPATH="$withval"], [ITKPATH=""]) |
---|
973 | |
---|
974 | AC_ARG_WITH([itk-version], |
---|
975 | [AS_HELP_STRING([--with-itk-version=VERSION], [Specifies an alternative version for the itk library])], |
---|
976 | [ITKVERS="$withval"], [ITKVERS=""]) |
---|
977 | |
---|
978 | AC_ARG_WITH([otb], |
---|
979 | [AS_HELP_STRING([--with-otb=PATH], [Specifies an alternative location for the otb library])], |
---|
980 | [OTBPATH="$withval"], [OTBPATH=""]) |
---|
981 | |
---|
982 | AC_ARG_WITH([otb-version], |
---|
983 | [AS_HELP_STRING([--with-otb-version=PATH], [Specifies an alternative location for the otb library])], |
---|
984 | [OTBVERS="$withval"], [OTBVERS=""]) |
---|
985 | |
---|
986 | if test -z "$OTBPATH" |
---|
987 | then |
---|
988 | OTB_LDFLAGS="" |
---|
989 | OTB_CPPFLAGS="" |
---|
990 | OTB_FILE="" |
---|
991 | OTB_ENABLED="" |
---|
992 | else |
---|
993 | if test -z "$ITKVERS" |
---|
994 | then |
---|
995 | ITKVERS="4.5" |
---|
996 | fi |
---|
997 | OTB_ENABLED="-DUSE_OTB" |
---|
998 | IVERS="$(echo -e '4.10\n$ITKVERS' | sort -r | head -n1)" |
---|
999 | if test "$IVERS" == "$ITKVERS"; then |
---|
1000 | ITK_LDFLAGS="-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 -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS" |
---|
1001 | else |
---|
1002 | ITK_LDFLAGS="-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 -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS" |
---|
1003 | fi |
---|
1004 | |
---|
1005 | if test -a "${OTBPATH}/include/OTB-${OTBVERS}" ; then |
---|
1006 | OTB_RPATH="$OTBPATH/include/OTB-${OTBVERS}/" |
---|
1007 | OTB_CPPFLAGS="-I${OTB_RPATH}ApplicationEngine -I$OTB_RPATH/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTB_RPATH/Utilities/ITK -I$OTB_RPATH/ -I$OTB_RPATH/IO -I$OTB_RPATH/UtilitiesAdapters/OssimAdapters -I$OTB_RPATH/UtilitiesAdapters/CurlAdapters -I$OTB_RPATH/Utilities/BGL -I$OTB_RPATH/UtilitiesAdapters/ITKPendingPatches -I$OTB_RPATH/Utilities/otbconfigfile $GDAL_CFLAGS" |
---|
1008 | OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib $ITK_LDFLAGS" |
---|
1009 | else |
---|
1010 | 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" |
---|
1011 | OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib $ITK_LDFLAGS" |
---|
1012 | |
---|
1013 | fi |
---|
1014 | OTB_FILE="otbZooWatcher.o service_internal_otb.o" |
---|
1015 | |
---|
1016 | AC_LANG_PUSH([C++]) |
---|
1017 | # Check headers file |
---|
1018 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
1019 | CPPFLAGS="$OTB_CPPFLAGS" |
---|
1020 | LDFLAGS_SAVE="$LDFLAGS" |
---|
1021 | LIBS="$LIBS_SAVE $OTB_LDFLAGS" |
---|
1022 | #echo $OTB_CPPFLAGS |
---|
1023 | AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h], |
---|
1024 | [], [AC_MSG_ERROR([could not find header file $i related to OTB])]) |
---|
1025 | LDFLAGS_SAVE="$LDFLAGS" |
---|
1026 | LDFLAGS="$OTB_LDFLAGS" |
---|
1027 | #echo $OTB_LDFLAGS |
---|
1028 | #UVERS="$(echo -e '5.8\n$OTBVERS' | sort -r | head -n1)" |
---|
1029 | #if test "$OTBVERS" == "$UVERS" ; then |
---|
1030 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplicationRegistry.h"]],[[std::vector<std::string> list = otb::Wrapper::ApplicationRegistry::GetAvailableApplications();]])], |
---|
1031 | [AC_MSG_RESULT([checking for GetAvailableApplications... yes])],[AC_MSG_ERROR([checking for GetAvailableApplications... failed])]) |
---|
1032 | #else |
---|
1033 | # AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"]],[[std::vector<std::string> list = otb::Wrapper::ApplicationRegistry::GetAvailableApplication();]])], |
---|
1034 | # [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])]) |
---|
1035 | #fi |
---|
1036 | |
---|
1037 | LDFLAGS="$LDFLAGS_SAVE" |
---|
1038 | AC_LANG_POP([C++]) |
---|
1039 | AC_LANG(C++) |
---|
1040 | |
---|
1041 | fi |
---|
1042 | AC_SUBST([OTB_CPPFLAGS]) |
---|
1043 | AC_SUBST([OTB_LDFLAGS]) |
---|
1044 | AC_SUBST([OTB_FILE]) |
---|
1045 | AC_SUBST([OTB_ENABLED]) |
---|
1046 | |
---|
1047 | # =========================================================================== |
---|
1048 | # Detect if saga-gis is available |
---|
1049 | # =========================================================================== |
---|
1050 | |
---|
1051 | AC_ARG_WITH([wx-config], |
---|
1052 | [AS_HELP_STRING([--with-wx-config=PATH], [Specifies an alternative path for the wx-config tool])], |
---|
1053 | [WXCFG="$withval"], [WXCFG=""]) |
---|
1054 | |
---|
1055 | AC_ARG_WITH([saga], |
---|
1056 | [AS_HELP_STRING([--with-saga=PATH], [Specifies an alternative location for the SAGA-GIS library])], |
---|
1057 | [SAGAPATH="$withval"], [SAGAPATH=""]) |
---|
1058 | |
---|
1059 | AC_ARG_WITH([saga-version], |
---|
1060 | [AS_HELP_STRING([--with-saga-version=VERSION], [Specifies the SAGA-GIS version number])], |
---|
1061 | [SAGAVERS="$withval"], [SAGAVERS="2"]) |
---|
1062 | |
---|
1063 | if test -z "$SAGAPATH" |
---|
1064 | then |
---|
1065 | SAGA_LDFLAGS="" |
---|
1066 | SAGA_CPPFLAGS="" |
---|
1067 | SAGA_FILE="" |
---|
1068 | SAGA_ENABLED="" |
---|
1069 | else |
---|
1070 | if test -z "$WXCFG" ; then |
---|
1071 | WXCFG="$(which wx-config)" |
---|
1072 | fi |
---|
1073 | if test "`$WXCFG --list | grep unicode`" == "" ; then |
---|
1074 | AC_MSG_ERROR(SAGA requires a unicode build of wxGTK) |
---|
1075 | fi |
---|
1076 | WX_ISSUE="-D_WX_WXCRTVARARG_H_" |
---|
1077 | SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\"" |
---|
1078 | SAGA_CPPFLAGS="-DSAGA_VERSION=${SAGAVERS} -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE" |
---|
1079 | SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api" |
---|
1080 | SAGA_ENABLED="-DUSE_SAGA" |
---|
1081 | SAGA_FILE="service_internal_saga.o" |
---|
1082 | |
---|
1083 | AC_LANG_PUSH([C++]) |
---|
1084 | # Check headers file |
---|
1085 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
1086 | CPPFLAGS="$SAGA_CPPFLAGS" |
---|
1087 | LIBS_SAVE="$LIBS" |
---|
1088 | LIBS="$SAGA_LDFLAGS" |
---|
1089 | if test "$SAGAVERS" == "2"; then |
---|
1090 | AC_CHECK_HEADERS([module_library.h], |
---|
1091 | [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])]) |
---|
1092 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])], |
---|
1093 | [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])]) |
---|
1094 | else |
---|
1095 | AC_CHECK_HEADERS([tool_library.h], |
---|
1096 | [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])]) |
---|
1097 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "tool_library.h"],[SG_Get_Tool_Library_Manager();]])], |
---|
1098 | [AC_MSG_RESULT([checking for SG_Get_Tool_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Tool_Library_Manager... failed])]) |
---|
1099 | fi |
---|
1100 | |
---|
1101 | LIBS="$LIBS_SAVE" |
---|
1102 | AC_LANG_POP([C++]) |
---|
1103 | fi |
---|
1104 | AC_SUBST([SAGA_CPPFLAGS]) |
---|
1105 | AC_SUBST([SAGA_LDFLAGS]) |
---|
1106 | AC_SUBST([SAGA_FILE]) |
---|
1107 | AC_SUBST([SAGA_ENABLED]) |
---|
1108 | |
---|
1109 | AC_CONFIG_FILES([Makefile]) |
---|
1110 | AC_CONFIG_FILES([ZOOMakefile.opts]) |
---|
1111 | AC_CONFIG_FILES([main.cfg]) |
---|
1112 | AC_OUTPUT |
---|