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