[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. |
---|
[673] | 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]) |
---|
[675] | 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 | |
---|
[673] | 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 | |
---|
| 171 | # =========================================================================== |
---|
| 172 | # Detect if libxslt is installed |
---|
| 173 | # =========================================================================== |
---|
| 174 | |
---|
| 175 | AC_ARG_WITH([xsltconfig], |
---|
[652] | 176 | [AS_HELP_STRING([--with-xsltconfig=FILE], [Specifies an alternative xslt-config file])], |
---|
[640] | 177 | [XSLTCONFIG="$withval"], [XSLTCONFIG=""]) |
---|
| 178 | |
---|
| 179 | if test "x$XSLTCONFIG" = "x"; then |
---|
| 180 | # XSLTCONFIG was not specified, so search within the current path |
---|
| 181 | AC_PATH_PROG([XSLTCONFIG], [xslt-config]) |
---|
| 182 | |
---|
| 183 | # If we couldn't find xslt-config, display a warning |
---|
| 184 | if test "x$XSLTCONFIG" = "x"; then |
---|
| 185 | 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.]) |
---|
| 186 | fi |
---|
| 187 | else |
---|
| 188 | # XSLTCONFIG was specified; display a message to the user |
---|
| 189 | if test "x$XSLTCONFIG" = "xyes"; then |
---|
[652] | 190 | AC_MSG_ERROR([you must Specifies a parameter to --with-xsltconfig, e.g. --with-xsltconfig=/path/to/xslt-config]) |
---|
[640] | 191 | else |
---|
| 192 | if test -f $XSLTCONFIG; then |
---|
| 193 | AC_MSG_RESULT([Using user-specified xslt-config file: $XSLTCONFIG]) |
---|
| 194 | else |
---|
| 195 | AC_MSG_ERROR([the user-specified xslt-config file $XSLTCONFIG does not exist]) |
---|
| 196 | fi |
---|
| 197 | fi |
---|
| 198 | fi |
---|
| 199 | |
---|
| 200 | # Extract the linker and include flags |
---|
| 201 | XSLT_LDFLAGS=`$XSLTCONFIG --libs` |
---|
| 202 | XSLT_CPPFLAGS=`$XSLTCONFIG --cflags` |
---|
| 203 | |
---|
| 204 | # Check headers file |
---|
| 205 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 206 | CPPFLAGS="$XSLT_CPPFLAGS" |
---|
| 207 | AC_CHECK_HEADERS([libxslt/xslt.h libxslt/xsltInternals.h libxslt/transform.h libxslt/xsltutils.h], |
---|
| 208 | [], [AC_MSG_ERROR([could not find headers include related to libxlst])]) |
---|
| 209 | |
---|
| 210 | AC_SUBST([XSLT_CPPFLAGS]) |
---|
| 211 | AC_SUBST([XSLT_LDFLAGS]) |
---|
| 212 | |
---|
| 213 | #============================================================================ |
---|
| 214 | # Detect if gdal is installed |
---|
| 215 | #============================================================================ |
---|
| 216 | |
---|
| 217 | AC_ARG_WITH([gdal-config], |
---|
[652] | 218 | [AS_HELP_STRING([--with-gdal-config=FILE], [Specifies an alternative gdal-config file])], |
---|
[640] | 219 | [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""]) |
---|
| 220 | if test -z $GDAL_CONFIG; |
---|
| 221 | then |
---|
| 222 | AC_PATH_PROG([GDAL_CONFIG], [gdal-config]) |
---|
| 223 | if test -z $GDAL_CONFIG; |
---|
| 224 | then |
---|
| 225 | 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.]) |
---|
| 226 | fi |
---|
| 227 | |
---|
| 228 | else |
---|
| 229 | if test -f $GDAL_CONFIG; then |
---|
| 230 | AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG]) |
---|
| 231 | else |
---|
| 232 | AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist]) |
---|
| 233 | fi |
---|
| 234 | fi |
---|
| 235 | |
---|
| 236 | GDAL_CFLAGS="`$GDAL_CONFIG --cflags`" |
---|
| 237 | GDAL_LIBS="`$GDAL_CONFIG --libs`" |
---|
| 238 | |
---|
| 239 | AC_SUBST([GDAL_CFLAGS]) |
---|
| 240 | AC_SUBST([GDAL_LIBS]) |
---|
| 241 | |
---|
| 242 | # =========================================================================== |
---|
| 243 | # Detect if proj is installed |
---|
| 244 | # =========================================================================== |
---|
| 245 | |
---|
| 246 | AC_ARG_WITH([proj], |
---|
[652] | 247 | [AS_HELP_STRING([--with-proj=PATH], [Specifies an alternative location for PROJ4 setup])], |
---|
[640] | 248 | [PROJPATH="$withval"], [PROJPATH=""]) |
---|
| 249 | |
---|
| 250 | # Extract the linker and include flags |
---|
| 251 | PROJ_LDFLAGS="-L$PROJPATH/lib" |
---|
| 252 | PROJ_CPPFLAGS="-I$PROJPATH/include" |
---|
| 253 | |
---|
| 254 | # Check headers file |
---|
| 255 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 256 | CPPFLAGS="$PROJ_CPPFLAGS" |
---|
| 257 | AC_CHECK_HEADERS([proj_api.h], |
---|
| 258 | [], [AC_MSG_ERROR([could not find headers include related to PROJ4])]) |
---|
| 259 | |
---|
| 260 | AC_SUBST([PROJ_CPPFLAGS]) |
---|
| 261 | AC_SUBST([PROJ_LDFLAGS]) |
---|
| 262 | |
---|
| 263 | # =========================================================================== |
---|
| 264 | # Detect if libgeos is installed |
---|
| 265 | # =========================================================================== |
---|
| 266 | |
---|
| 267 | AC_ARG_WITH([geosconfig], |
---|
[652] | 268 | [AS_HELP_STRING([--with-geosconfig=FILE], [Specifies an alternative geos-config file])], |
---|
[640] | 269 | [GEOSCONFIG="$withval"], [GEOSCONFIG=""]) |
---|
| 270 | |
---|
| 271 | if test "x$GEOSCONFIG" = "x"; then |
---|
| 272 | # GEOSCONFIG was not specified, so search within the current path |
---|
| 273 | AC_PATH_PROG([GEOSCONFIG], [geos-config]) |
---|
| 274 | |
---|
| 275 | # If we couldn't find geos-config, display a warning |
---|
| 276 | if test "x$GEOSCONFIG" = "x"; then |
---|
| 277 | 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.]) |
---|
| 278 | fi |
---|
| 279 | else |
---|
| 280 | # GEOSCONFIG was specified; display a message to the user |
---|
| 281 | if test "x$GEOSCONFIG" = "xyes"; then |
---|
[652] | 282 | AC_MSG_WARN([you must Specifies a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config]) |
---|
[640] | 283 | else |
---|
| 284 | if test -f $GEOSCONFIG; then |
---|
| 285 | AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG]) |
---|
| 286 | else |
---|
| 287 | AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist]) |
---|
| 288 | fi |
---|
| 289 | fi |
---|
| 290 | fi |
---|
| 291 | |
---|
| 292 | GEOS_LDFLAGS=`$GEOSCONFIG --libs` |
---|
| 293 | GEOS_CPPFLAGS=`$GEOSCONFIG --cflags` |
---|
| 294 | |
---|
| 295 | # Check headers file |
---|
| 296 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 297 | CPPFLAGS="$GEOS_CPPFLAGS" |
---|
| 298 | AC_CHECK_HEADERS([geos_c.h], |
---|
| 299 | [], [AC_MSG_WARN([could not find headers include related to libgeos])]) |
---|
| 300 | |
---|
| 301 | AC_SUBST([GEOS_CPPFLAGS]) |
---|
| 302 | AC_SUBST([GEOS_LDFLAGS]) |
---|
| 303 | |
---|
| 304 | |
---|
| 305 | # =========================================================================== |
---|
| 306 | # Detect if cgal is installed |
---|
| 307 | # =========================================================================== |
---|
| 308 | |
---|
| 309 | AC_ARG_WITH([cgal], |
---|
[652] | 310 | [AS_HELP_STRING([--with-cgal=PATH], [Specifies an alternative location for CGAL setup])], |
---|
[640] | 311 | [CGALPATH="$withval"], [CGALPATH="/usr"]) |
---|
| 312 | |
---|
| 313 | |
---|
| 314 | # Check headers file |
---|
| 315 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 316 | CPPFLAGS="$CGAL_CPPFLAGS" |
---|
| 317 | AC_CHECK_HEADERS([CGAL/Delaunay_triangulation_2.h], |
---|
| 318 | [], [AC_MSG_WARN([could not find headers include related to libCGAL])]) |
---|
| 319 | |
---|
| 320 | # Extract the linker and include flags |
---|
| 321 | CGAL_LDFLAGS="-L$CGALPATH/lib" |
---|
| 322 | CGAL_CPPFLAGS="-I$CGALPATH/include" |
---|
| 323 | |
---|
| 324 | |
---|
| 325 | AC_SUBST([CGAL_CPPFLAGS]) |
---|
| 326 | AC_SUBST([CGAL_LDFLAGS]) |
---|
| 327 | #============================================================================ |
---|
| 328 | # Detect if mapserver is installed |
---|
| 329 | #============================================================================ |
---|
| 330 | |
---|
| 331 | AC_ARG_WITH([mapserver], |
---|
[652] | 332 | [AS_HELP_STRING([--with-mapserver=PATH], [Specifies the path for MapServer compiled source tree])], |
---|
[640] | 333 | [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""]) |
---|
| 334 | |
---|
| 335 | if test -z $MS_SRC_PATH; |
---|
| 336 | then |
---|
| 337 | MS_CPPFLAGS="" |
---|
| 338 | MS_LDFLAGS="" |
---|
| 339 | else |
---|
| 340 | if test "x$MS_SRC_PATH" = "xmacos"; |
---|
| 341 | then |
---|
| 342 | MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl" |
---|
| 343 | MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver " |
---|
| 344 | AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree]) |
---|
| 345 | AC_MSG_RESULT([Using MacOS X Framework for MapServer]) |
---|
| 346 | else |
---|
| 347 | if test -d $MS_SRC_PATH; then |
---|
| 348 | MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`" |
---|
| 349 | MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH " |
---|
| 350 | |
---|
| 351 | AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH]) |
---|
| 352 | else |
---|
| 353 | AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist]) |
---|
| 354 | fi |
---|
| 355 | fi |
---|
| 356 | MS_FILE="service_internal_ms.o" |
---|
| 357 | fi |
---|
| 358 | |
---|
| 359 | MS_CFLAGS="$MS_CPPFLAGS" |
---|
| 360 | MS_LIBS="$MS_LDFLAGS" |
---|
| 361 | |
---|
| 362 | AC_SUBST([MS_CFLAGS]) |
---|
| 363 | AC_SUBST([MS_LIBS]) |
---|
| 364 | AC_SUBST([MS_FILE]) |
---|
| 365 | |
---|
| 366 | # =========================================================================== |
---|
[634] | 367 | # Detect if python is installed |
---|
| 368 | # =========================================================================== |
---|
[1] | 369 | |
---|
[634] | 370 | AC_ARG_WITH([python], |
---|
[652] | 371 | [AS_HELP_STRING([--with-python=PATH], [To enable python support or Specifies an alternative directory for python installation, disabled by default])], |
---|
[634] | 372 | [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""]) |
---|
| 373 | |
---|
| 374 | AC_ARG_WITH([pyvers], |
---|
| 375 | [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])], |
---|
| 376 | [PYTHON_VERS="$withval"], [PYTHON_VERS=""]) |
---|
| 377 | |
---|
| 378 | |
---|
| 379 | if test -z "$PYTHON_ENABLED" |
---|
[1] | 380 | then |
---|
[634] | 381 | PYTHON_FILE="" |
---|
| 382 | else |
---|
| 383 | PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config" |
---|
| 384 | PYTHON_FILE="service_internal_python.o" |
---|
| 385 | if test "$PYTHON_PATH" = "yes" |
---|
[1] | 386 | then |
---|
[634] | 387 | # PHP was not specified, so search within the current path |
---|
| 388 | PYTHONCFG_PATH=`which python${PYTHON_VERS}-config` |
---|
| 389 | if test -z "${PYTHONCFG_PATH}" ; then |
---|
| 390 | AC_PATH_PROG([PYTHONCONFIG], [python-config-${PYTHON_VERS}]) |
---|
| 391 | else |
---|
| 392 | AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config]) |
---|
| 393 | fi |
---|
| 394 | else |
---|
| 395 | PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config" |
---|
[1] | 396 | fi |
---|
[634] | 397 | |
---|
| 398 | # Extract the linker and include flags |
---|
| 399 | PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags` |
---|
| 400 | PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes` |
---|
| 401 | |
---|
| 402 | # Check headers file |
---|
| 403 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 404 | CPPFLAGS="$PYTHON_CPPFLAGS" |
---|
| 405 | AC_CHECK_HEADERS([Python.h], |
---|
| 406 | [], [AC_MSG_ERROR([could not find headers include related to libpython])]) |
---|
| 407 | |
---|
| 408 | # Ensure we can link against libphp |
---|
| 409 | LIBS_SAVE="$LIBS" |
---|
| 410 | LIBS="$PYTHON_LDFLAGS" |
---|
| 411 | PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'` |
---|
| 412 | AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) |
---|
| 413 | AC_SUBST([PYTHON_CPPFLAGS]) |
---|
| 414 | AC_SUBST([PYTHON_LDFLAGS]) |
---|
[640] | 415 | LIBS="$LIBS_SAVE" |
---|
[634] | 416 | fi |
---|
| 417 | |
---|
| 418 | AC_SUBST([PYTHON_ENABLED]) |
---|
| 419 | AC_SUBST([PYTHON_FILE]) |
---|
| 420 | |
---|
| 421 | # =========================================================================== |
---|
| 422 | # Detect if spidermonkey is installed |
---|
| 423 | # =========================================================================== |
---|
| 424 | |
---|
| 425 | AC_ARG_WITH([js], |
---|
[652] | 426 | [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] | 427 | [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""]) |
---|
| 428 | |
---|
| 429 | if test -z "$JS_ENABLED" |
---|
| 430 | then |
---|
| 431 | JS_FILE="" |
---|
| 432 | else |
---|
| 433 | JS_FILE="service_internal_js.o" |
---|
| 434 | if test "$JSHOME" = "yes" |
---|
| 435 | then |
---|
| 436 | |
---|
| 437 | #on teste si on est sous debian like |
---|
| 438 | if test -f "/usr/bin/dpkg" |
---|
| 439 | then |
---|
| 440 | if test -n "`dpkg -l | grep libmozjs185-dev`" |
---|
| 441 | then |
---|
| 442 | JS_CPPFLAGS="-I/usr/include/js/" |
---|
| 443 | JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm" |
---|
| 444 | JS_LIB="mozjs185" |
---|
| 445 | else |
---|
| 446 | XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`" |
---|
| 447 | if test -n "$XUL_VERSION" |
---|
| 448 | then |
---|
| 449 | JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION" |
---|
| 450 | JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm" |
---|
| 451 | JS_LIB="mozjs" |
---|
| 452 | else |
---|
| 453 | AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ]) |
---|
| 454 | fi |
---|
| 455 | fi |
---|
| 456 | else |
---|
| 457 | AC_MSG_ERROR([You must specify your custom install of libmozjs185]) |
---|
| 458 | fi |
---|
| 459 | else |
---|
| 460 | JS_CPPFLAGS="-I$JSHOME/include/js/" |
---|
| 461 | JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm" |
---|
| 462 | JS_LIB="mozjs185" |
---|
| 463 | |
---|
| 464 | fi |
---|
| 465 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 466 | CPPFLAGS="$JS_CPPFLAGS" |
---|
[640] | 467 | AC_LANG_PUSH([C++]) |
---|
| 468 | AC_CHECK_HEADERS([jsapi.h], |
---|
| 469 | [], [AC_MSG_ERROR([could not find headers include related to libjs])]) |
---|
[634] | 470 | |
---|
[640] | 471 | AC_LANG_POP([C++]) |
---|
[634] | 472 | LIBS_SAVE="$LIBS" |
---|
| 473 | LIBS="$JS_LDFLAGS" |
---|
| 474 | |
---|
| 475 | AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], []) |
---|
[640] | 476 | LIBS="$LIBS_SAVE" |
---|
| 477 | |
---|
[634] | 478 | AC_SUBST([JS_CPPFLAGS]) |
---|
| 479 | AC_SUBST([JS_LDFLAGS]) |
---|
| 480 | fi |
---|
| 481 | |
---|
| 482 | AC_SUBST([JS_ENABLED]) |
---|
| 483 | AC_SUBST([JS_FILE]) |
---|
| 484 | |
---|
| 485 | # =========================================================================== |
---|
| 486 | # Detect if php is installed |
---|
| 487 | # =========================================================================== |
---|
| 488 | |
---|
| 489 | AC_ARG_WITH([php], |
---|
| 490 | [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation, disabled by default])], |
---|
| 491 | [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""]) |
---|
| 492 | |
---|
| 493 | |
---|
| 494 | if test -z "$PHP_ENABLED" |
---|
| 495 | then |
---|
| 496 | PHP_FILE="" |
---|
[1] | 497 | else |
---|
[634] | 498 | PHPCONFIG="$PHP_PATH/bin/php-config" |
---|
| 499 | PHP_FILE="service_internal_php.o" |
---|
| 500 | if test "$PHP_PATH" = "yes" |
---|
| 501 | then |
---|
| 502 | # PHP was not specified, so search within the current path |
---|
| 503 | AC_PATH_PROG([PHPCONFIG], [php-config]) |
---|
[1] | 504 | else |
---|
[634] | 505 | PHPCONFIG="$PHP_PATH/bin/php-config" |
---|
[1] | 506 | fi |
---|
[634] | 507 | |
---|
| 508 | # Extract the linker and include flags |
---|
| 509 | PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5" |
---|
| 510 | PHP_CPPFLAGS=`$PHPCONFIG --includes` |
---|
| 511 | |
---|
| 512 | # Check headers file |
---|
| 513 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 514 | CPPFLAGS="$PHP_CPPFLAGS" |
---|
| 515 | AC_CHECK_HEADERS([sapi/embed/php_embed.h], |
---|
| 516 | [], [AC_MSG_ERROR([could not find headers include related to libphp])]) |
---|
| 517 | |
---|
| 518 | # Ensure we can link against libphp |
---|
| 519 | LIBS_SAVE="$LIBS" |
---|
| 520 | LIBS="$PHP_LDFLAGS" |
---|
| 521 | # Shouldn't we get php here rather than php5 :) ?? |
---|
| 522 | AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], []) |
---|
[640] | 523 | LIBS="$LIBS_SAVE" |
---|
[634] | 524 | AC_SUBST([PHP_CPPFLAGS]) |
---|
| 525 | AC_SUBST([PHP_LDFLAGS]) |
---|
[1] | 526 | fi |
---|
| 527 | |
---|
[634] | 528 | AC_SUBST([PHP_ENABLED]) |
---|
| 529 | AC_SUBST([PHP_FILE]) |
---|
[1] | 530 | |
---|
[634] | 531 | # =========================================================================== |
---|
| 532 | # Detect if java is installed |
---|
| 533 | # =========================================================================== |
---|
[1] | 534 | |
---|
[634] | 535 | AC_ARG_WITH([java], |
---|
| 536 | [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME, disabled by default])], |
---|
| 537 | [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""]) |
---|
| 538 | |
---|
| 539 | if test -z "$JAVA_ENABLED" |
---|
| 540 | then |
---|
| 541 | JAVA_FILE="" |
---|
| 542 | else |
---|
| 543 | JAVA_FILE="service_internal_java.o" |
---|
| 544 | if test "x$JDKHOME" = "x"; |
---|
| 545 | then |
---|
| 546 | 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.]) |
---|
| 547 | fi # JAVA was specified; display a message to the user |
---|
| 548 | if test "x$JDKHOME" = "xyes"; |
---|
| 549 | then |
---|
| 550 | AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java]) |
---|
| 551 | fi |
---|
| 552 | |
---|
| 553 | # Extract the linker and include flags |
---|
| 554 | if test "x$JDKHOME" = "xmacos"; |
---|
| 555 | then |
---|
| 556 | JAVA_LDFLAGS="-framework JavaVM" |
---|
| 557 | JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/" |
---|
| 558 | else |
---|
| 559 | if test -d "$JDKHOME/jre/lib/i386"; |
---|
| 560 | then |
---|
| 561 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/server/ -ljvm -lpthread" |
---|
| 562 | JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux" |
---|
| 563 | else |
---|
| 564 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread" |
---|
| 565 | JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux" |
---|
| 566 | fi |
---|
| 567 | fi |
---|
| 568 | |
---|
| 569 | # Check headers file (second time we check that in fact) |
---|
| 570 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 571 | CPPFLAGS="$JAVA_CPPFLAGS" |
---|
| 572 | AC_CHECK_HEADERS([jni.h], |
---|
| 573 | [], [AC_MSG_ERROR([could not find jni.h file])]) |
---|
| 574 | |
---|
| 575 | # Ensure we can link against libjava |
---|
| 576 | LIBS_SAVE="$LIBS" |
---|
| 577 | LIBS="$JAVA_LDFLAGS" |
---|
| 578 | if test "x$JDKHOME" != "xmacos"; |
---|
| 579 | then |
---|
| 580 | AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjvm])], []) |
---|
| 581 | fi |
---|
[640] | 582 | LIBS="$LIBS_SAVE" |
---|
[634] | 583 | |
---|
| 584 | AC_SUBST([JAVA_CPPFLAGS]) |
---|
| 585 | AC_SUBST([JAVA_LDFLAGS]) |
---|
| 586 | fi |
---|
| 587 | |
---|
| 588 | AC_SUBST([JAVA_ENABLED]) |
---|
| 589 | AC_SUBST([JAVA_FILE]) |
---|
| 590 | |
---|
[1] | 591 | # =========================================================================== |
---|
[634] | 592 | # Detect if ruby is installed |
---|
| 593 | # =========================================================================== |
---|
| 594 | AC_ARG_WITH([ruby], |
---|
| 595 | [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation, disabled by default])], |
---|
| 596 | [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""]) |
---|
| 597 | |
---|
| 598 | AC_ARG_WITH([rvers], |
---|
| 599 | [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])], |
---|
| 600 | [RUBY_VERS="$withval"], [RUBY_VERS=""]) |
---|
| 601 | |
---|
| 602 | |
---|
| 603 | if test -z "$RUBY_ENABLED" |
---|
| 604 | then |
---|
| 605 | RUBY_FILE="" |
---|
| 606 | else |
---|
| 607 | RUBY_FILE="service_internal_ruby.o" |
---|
| 608 | |
---|
| 609 | # Extract the linker and include flags |
---|
| 610 | RUBY_LDFLAGS="-lruby" |
---|
| 611 | RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS" |
---|
| 612 | |
---|
| 613 | # Check headers file |
---|
| 614 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 615 | CPPFLAGS="$RUBY_CPPFLAGS" |
---|
| 616 | AC_CHECK_HEADERS([ruby.h], |
---|
| 617 | [], [AC_MSG_ERROR([could not find headers include related to libruby])]) |
---|
| 618 | |
---|
| 619 | # Ensure we can link against libphp |
---|
| 620 | LIBS_SAVE="$LIBS" |
---|
| 621 | LIBS="$RUBY_LDFLAGS" |
---|
| 622 | # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) |
---|
[640] | 623 | LIBS="$LIBS_SAVE" |
---|
[634] | 624 | AC_SUBST([RUBY_CPPFLAGS]) |
---|
| 625 | AC_SUBST([RUBY_LDFLAGS]) |
---|
| 626 | fi |
---|
| 627 | |
---|
| 628 | AC_SUBST([RUBY_ENABLED]) |
---|
| 629 | AC_SUBST([RUBY_FILE]) |
---|
| 630 | |
---|
| 631 | # =========================================================================== |
---|
| 632 | # Detect if perl is installed |
---|
| 633 | # =========================================================================== |
---|
| 634 | |
---|
| 635 | AC_ARG_WITH([perl], |
---|
| 636 | [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation, disabled by default])], |
---|
| 637 | [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""]) |
---|
| 638 | |
---|
| 639 | |
---|
| 640 | if test -z "$PERL_ENABLED" |
---|
| 641 | then |
---|
| 642 | PERL_FILE="" |
---|
| 643 | else |
---|
| 644 | PERL_FILE="service_internal_perl.o" |
---|
| 645 | if test "$PERL_PATH" = "yes" |
---|
| 646 | then |
---|
| 647 | # Perl was not specified, so search within the current path |
---|
| 648 | AC_PATH_PROG([PERLCONFIG], [perl]) |
---|
| 649 | else |
---|
| 650 | PERLCONFIG="$PERL_PATH/bin/perl" |
---|
| 651 | fi |
---|
| 652 | |
---|
| 653 | # Extract the linker and include flags |
---|
| 654 | PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts` |
---|
| 655 | PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts` |
---|
| 656 | |
---|
| 657 | # Check headers file |
---|
| 658 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 659 | CPPFLAGS="$PERL_CPPFLAGS" |
---|
| 660 | AC_CHECK_HEADERS([EXTERN.h], |
---|
| 661 | [], [AC_MSG_ERROR([could not find headers include related to libperl])]) |
---|
| 662 | |
---|
| 663 | AC_SUBST([PERL_CPPFLAGS]) |
---|
| 664 | AC_SUBST([PERL_LDFLAGS]) |
---|
| 665 | fi |
---|
| 666 | |
---|
| 667 | AC_SUBST([PERL_ENABLED]) |
---|
| 668 | AC_SUBST([PERL_FILE]) |
---|
| 669 | |
---|
| 670 | # =========================================================================== |
---|
[550] | 671 | # Detect if otb is available |
---|
| 672 | # =========================================================================== |
---|
| 673 | |
---|
[555] | 674 | AC_ARG_WITH([itk], |
---|
[652] | 675 | [AS_HELP_STRING([--with-itk=PATH], [Specifies an alternative location for the itk library])], |
---|
[555] | 676 | [ITKPATH="$withval"], [ITKPATH=""]) |
---|
| 677 | |
---|
| 678 | AC_ARG_WITH([itk-version], |
---|
[652] | 679 | [AS_HELP_STRING([--with-itk-version=VERSION], [Specifies an alternative version for the itk library])], |
---|
[555] | 680 | [ITKVERS="$withval"], [ITKVERS=""]) |
---|
| 681 | |
---|
[550] | 682 | AC_ARG_WITH([otb], |
---|
[652] | 683 | [AS_HELP_STRING([--with-otb=PATH], [Specifies an alternative location for the otb library])], |
---|
[550] | 684 | [OTBPATH="$withval"], [OTBPATH=""]) |
---|
| 685 | |
---|
| 686 | if test -z "$OTBPATH" |
---|
| 687 | then |
---|
| 688 | OTB_LDFLAGS="" |
---|
| 689 | OTB_CPPFLAGS="" |
---|
| 690 | OTB_FILE="" |
---|
| 691 | OTB_ENABLED="" |
---|
| 692 | else |
---|
[637] | 693 | if test -z "$ITKVERS" |
---|
| 694 | then |
---|
| 695 | ITKVERS="4.5" |
---|
| 696 | fi |
---|
[550] | 697 | OTB_ENABLED="-DUSE_OTB" |
---|
[555] | 698 | 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" |
---|
| 699 | 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] | 700 | OTB_FILE="otbZooWatcher.o service_internal_otb.o" |
---|
[550] | 701 | |
---|
| 702 | AC_LANG_PUSH([C++]) |
---|
| 703 | # Check headers file |
---|
| 704 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 705 | CPPFLAGS="$OTB_CPPFLAGS" |
---|
| 706 | LDFLAGS_SAVE="$LDFLAGS" |
---|
[640] | 707 | LIBS="$LIBS_SAVE $OTB_LDFLAGS" |
---|
[555] | 708 | AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h], |
---|
[550] | 709 | [], [AC_MSG_ERROR([could not find header file $i related to OTB])]) |
---|
| 710 | AC_LANG_POP([C++]) |
---|
[640] | 711 | AC_LANG(C++) |
---|
| 712 | LDFLAGS_SAVE="$LDFLAGS" |
---|
| 713 | LDFLAGS="$OTB_LDFLAGS" |
---|
| 714 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"],[std::vector<std::string> list = otb::Wrapwper::ApplicationRegistry::GetAvailableApplication();]])], |
---|
| 715 | [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])]) |
---|
| 716 | LDFLAGS="$LDFLAGS_SAVE" |
---|
| 717 | |
---|
[550] | 718 | fi |
---|
| 719 | AC_SUBST([OTB_CPPFLAGS]) |
---|
| 720 | AC_SUBST([OTB_LDFLAGS]) |
---|
| 721 | AC_SUBST([OTB_FILE]) |
---|
| 722 | AC_SUBST([OTB_ENABLED]) |
---|
| 723 | |
---|
| 724 | # =========================================================================== |
---|
[634] | 725 | # Detect if saga-gis is available |
---|
| 726 | # =========================================================================== |
---|
| 727 | |
---|
| 728 | AC_ARG_WITH([wx-config], |
---|
[652] | 729 | [AS_HELP_STRING([--with-wx-config=PATH], [Specifies an alternative path for the wx-config tool])], |
---|
[634] | 730 | [WXCFG="$withval"], [WXCFG=""]) |
---|
| 731 | |
---|
| 732 | AC_ARG_WITH([saga], |
---|
[652] | 733 | [AS_HELP_STRING([--with-saga=PATH], [Specifies an alternative location for the SAGA-GIS library])], |
---|
[634] | 734 | [SAGAPATH="$withval"], [SAGAPATH=""]) |
---|
| 735 | |
---|
| 736 | if test -z "$SAGAPATH" |
---|
| 737 | then |
---|
| 738 | SAGA_LDFLAGS="" |
---|
| 739 | SAGA_CPPFLAGS="" |
---|
| 740 | SAGA_FILE="" |
---|
| 741 | SAGA_ENABLED="" |
---|
| 742 | else |
---|
| 743 | if test -z "$WXCFG" ; then |
---|
| 744 | WXCFG="$(which wx-config)" |
---|
| 745 | fi |
---|
| 746 | if test "`$WXCFG --list | grep unicode`" == "" ; then |
---|
| 747 | AC_MSG_ERROR(SAGA requires a unicode build of wxGTK) |
---|
| 748 | fi |
---|
| 749 | WX_ISSUE="-D_WX_WXCRTVARARG_H_" |
---|
| 750 | SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\"" |
---|
| 751 | SAGA_CPPFLAGS=" -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE" |
---|
| 752 | SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api" |
---|
| 753 | SAGA_ENABLED="-DUSE_SAGA" |
---|
| 754 | SAGA_FILE="service_internal_saga.o" |
---|
| 755 | |
---|
| 756 | AC_LANG_PUSH([C++]) |
---|
| 757 | # Check headers file |
---|
| 758 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 759 | CPPFLAGS="$SAGA_CPPFLAGS" |
---|
| 760 | LIBS_SAVE="$LIBS" |
---|
| 761 | LIBS="$SAGA_LDFLAGS" |
---|
| 762 | AC_CHECK_HEADERS([module_library.h], |
---|
| 763 | [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])]) |
---|
[640] | 764 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])], |
---|
| 765 | [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])]) |
---|
| 766 | LIBS="$LIBS_SAVE" |
---|
[634] | 767 | AC_LANG_POP([C++]) |
---|
| 768 | fi |
---|
| 769 | AC_SUBST([SAGA_CPPFLAGS]) |
---|
| 770 | AC_SUBST([SAGA_LDFLAGS]) |
---|
| 771 | AC_SUBST([SAGA_FILE]) |
---|
| 772 | AC_SUBST([SAGA_ENABLED]) |
---|
| 773 | |
---|
[1] | 774 | AC_CONFIG_FILES([Makefile]) |
---|
[284] | 775 | AC_CONFIG_FILES([ZOOMakefile.opts]) |
---|
[1] | 776 | AC_OUTPUT |
---|