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