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