[817] | 1 | AC_INIT([ZOO Kernel], [1.7.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 | #============================================================================ |
---|
[753] | 42 | # Detect if openssl is available |
---|
| 43 | #============================================================================ |
---|
| 44 | |
---|
| 45 | AC_ARG_WITH([openssl], |
---|
| 46 | [AS_HELP_STRING([--with-openssl=PATH], [Specifies an alternative location for the openssl library])], |
---|
| 47 | [OPENSSL_DIR="$withval"], [OPENSSL_DIR="/usr/"]) |
---|
| 48 | OPENSSL_CFLAGS="-I$OPENSSL_DIR/include" |
---|
| 49 | OPENSSL_LDFLAGS="-lcrypto -L$OPENSSL_DIR/lib -lssl" |
---|
| 50 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 51 | CPPFLAGS="$OPENSSL_CFLAGS" |
---|
| 52 | LIBS_SAVE="$LIBS" |
---|
| 53 | LIBS="$OPENSSL_LDFLAGS" |
---|
| 54 | AC_CHECK_HEADERS([openssl/md5.h openssl/hmac.h openssl/evp.h openssl/bio.h openssl/buffer.h], |
---|
| 55 | [], [AC_MSG_ERROR([could not find header file $i related to openssl])]) |
---|
| 56 | AC_CHECK_LIB(crypto, BIO_f_base64, |
---|
| 57 | [], [AC_MSG_ERROR([could not find $i function in openssl library])]) |
---|
| 58 | AC_SUBST([OPENSSL_CFLAGS]) |
---|
| 59 | AC_SUBST([OPENSSL_LDFLAGS]) |
---|
| 60 | |
---|
| 61 | #============================================================================ |
---|
[466] | 62 | # Detect if run on debian / ubuntu |
---|
| 63 | #============================================================================ |
---|
| 64 | if test -f "/usr/bin/dpkg" |
---|
| 65 | then |
---|
| 66 | DEB_DEF=-DDEB |
---|
| 67 | fi |
---|
| 68 | AC_SUBST([DEB_DEF]) |
---|
| 69 | |
---|
[784] | 70 | AC_ARG_WITH([etc-dir], |
---|
| 71 | [AS_HELP_STRING([--with-etc-dir=PATH], [Specifies an alternative path to store the main.cfg file ( default: ZOO-Kernel location) ])], |
---|
| 72 | [ETC_DEF="#define ETC_DIR \\\"${sysconfdir}\\\""], [ETC_DEF=""]) |
---|
| 73 | AC_SUBST([ETC_DEF]) |
---|
| 74 | |
---|
[518] | 75 | AC_ARG_WITH([cgi-dir], |
---|
[652] | 76 | [AS_HELP_STRING([--with-cgi-dir=PATH], [Specifies an alternative cgi directory path ( default: /usr/lib/cgi-bin) ])], |
---|
[518] | 77 | [CGI_DIR="$withval"], [CGI_DIR="/usr/lib/cgi-bin"]) |
---|
| 78 | AC_SUBST([CGI_DIR]) |
---|
| 79 | |
---|
[652] | 80 | AC_ARG_WITH([db-backend], |
---|
| 81 | [AS_HELP_STRING([--with-db-backend], [Relies on a database for storing status messages and response files ])], |
---|
| 82 | [RELY_ON_DB="-DRELY_ON_DB"], [RELY_ON_DB=""]) |
---|
| 83 | AC_SUBST([RELY_ON_DB]) |
---|
[640] | 84 | |
---|
[652] | 85 | |
---|
[634] | 86 | # =========================================================================== |
---|
[640] | 87 | # Detect if libyaml is available |
---|
| 88 | # =========================================================================== |
---|
| 89 | |
---|
| 90 | AC_ARG_WITH([yaml], |
---|
[652] | 91 | [AS_HELP_STRING([--with-yaml=PATH], [Specifies an alternative location for the yaml library])], |
---|
[640] | 92 | [YAMLPATH="$withval"], [YAMLPATH=""]) |
---|
| 93 | |
---|
| 94 | if test -z "$YAMLPATH" |
---|
| 95 | then |
---|
| 96 | YAML_LDFLAGS="" |
---|
| 97 | YAML_CPPFLAGS="" |
---|
| 98 | YAML_FILE="" |
---|
| 99 | YAML_FILE1="" |
---|
| 100 | else |
---|
| 101 | |
---|
| 102 | # Extract the linker and include flags |
---|
| 103 | YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml" |
---|
| 104 | YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML" |
---|
| 105 | YAML_FILE="service_yaml.o" |
---|
| 106 | YAML_FILE1="zcfg2yaml" |
---|
| 107 | |
---|
| 108 | # Check headers file |
---|
| 109 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 110 | CPPFLAGS="$YAML_CPPFLAGS" |
---|
| 111 | LIBS_SAVE="$LIBS" |
---|
| 112 | LIBS="$YAML_LDFLAGS" |
---|
| 113 | AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan]) |
---|
| 114 | AC_CHECK_HEADERS([yaml.h], |
---|
| 115 | [], [AC_MSG_ERROR([could not find headers include related to YAML])]) |
---|
| 116 | LIBS="$LIBS_SAVE" |
---|
| 117 | fi |
---|
| 118 | AC_SUBST([YAML_CPPFLAGS]) |
---|
| 119 | AC_SUBST([YAML_LDFLAGS]) |
---|
| 120 | AC_SUBST([YAML_FILE]) |
---|
| 121 | AC_SUBST([YAML_FILE1]) |
---|
| 122 | |
---|
| 123 | # =========================================================================== |
---|
| 124 | # Detect if fastcgi is available |
---|
| 125 | # =========================================================================== |
---|
| 126 | |
---|
| 127 | AC_ARG_WITH([fastcgi], |
---|
[652] | 128 | [AS_HELP_STRING([--with-fastcgi=PATH], [Specifies an alternative location for the fastcgi library])], |
---|
[640] | 129 | [FCGIPATH="$withval"], [FCGIPATH="/usr"]) |
---|
| 130 | |
---|
| 131 | # Extract the linker and include flags |
---|
[740] | 132 | FCGI_LDFLAGS="-L$FCGIPATH/lib -lfcgi" |
---|
[640] | 133 | FCGI_CPPFLAGS="-I$FCGIPATH/include" |
---|
| 134 | |
---|
| 135 | # Check headers file |
---|
| 136 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 137 | CPPFLAGS="$FCGI_CPPFLAGS" |
---|
| 138 | LIBS_SAVE="$LIBS" |
---|
| 139 | LIBS="$FCGI_LDFLAGS" |
---|
| 140 | AC_CHECK_LIB([fcgi], [main]) |
---|
| 141 | AC_CHECK_HEADERS([fcgi_stdio.h], |
---|
| 142 | [], [AC_MSG_ERROR([could not find headers include related to fastcgi])]) |
---|
| 143 | LIBS="$LIBS_SAVE" |
---|
| 144 | AC_SUBST([FCGI_CPPFLAGS]) |
---|
| 145 | AC_SUBST([FCGI_LDFLAGS]) |
---|
| 146 | |
---|
| 147 | # =========================================================================== |
---|
| 148 | # Detect if libxml2 is installed |
---|
| 149 | # =========================================================================== |
---|
| 150 | |
---|
| 151 | AC_ARG_WITH([xml2config], |
---|
[652] | 152 | [AS_HELP_STRING([--with-xml2config=FILE], [Specifies an alternative xml2-config file])], |
---|
[640] | 153 | [XML2CONFIG="$withval"], [XML2CONFIG=""]) |
---|
| 154 | |
---|
| 155 | if test "x$XML2CONFIG" = "x"; then |
---|
| 156 | # XML2CONFIG was not specified, so search within the current path |
---|
| 157 | AC_PATH_PROG([XML2CONFIG], [xml2-config]) |
---|
| 158 | |
---|
| 159 | # If we couldn't find xml2-config, display a warning |
---|
| 160 | if test "x$XML2CONFIG" = "x"; then |
---|
| 161 | 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.]) |
---|
| 162 | fi |
---|
| 163 | else |
---|
| 164 | # XML2CONFIG was specified; display a message to the user |
---|
| 165 | if test "x$XML2CONFIG" = "xyes"; then |
---|
[652] | 166 | AC_MSG_ERROR([you must Specifies a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config]) |
---|
[640] | 167 | else |
---|
| 168 | if test -f $XML2CONFIG; then |
---|
| 169 | AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG]) |
---|
| 170 | else |
---|
| 171 | AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist]) |
---|
| 172 | fi |
---|
| 173 | fi |
---|
| 174 | fi |
---|
| 175 | |
---|
| 176 | # Extract the linker and include flags |
---|
| 177 | XML2_LDFLAGS=`$XML2CONFIG --libs` |
---|
| 178 | XML2_CPPFLAGS=`$XML2CONFIG --cflags` |
---|
| 179 | |
---|
| 180 | # Check headers file |
---|
| 181 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 182 | CPPFLAGS="$XML2_CPPFLAGS" |
---|
| 183 | AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h], |
---|
| 184 | [], [AC_MSG_ERROR([could not find headers include related to libxml2])]) |
---|
| 185 | |
---|
| 186 | # Ensure we can link against libxml2 |
---|
| 187 | LIBS_SAVE="$LIBS" |
---|
| 188 | LIBS="$XML2_LDFLAGS" |
---|
| 189 | AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], []) |
---|
| 190 | |
---|
| 191 | AC_SUBST([XML2_CPPFLAGS]) |
---|
| 192 | AC_SUBST([XML2_LDFLAGS]) |
---|
| 193 | LIBS="$LIBS_SAVE" |
---|
| 194 | |
---|
| 195 | |
---|
| 196 | # =========================================================================== |
---|
| 197 | # Detect if libxslt is installed |
---|
| 198 | # =========================================================================== |
---|
| 199 | |
---|
| 200 | AC_ARG_WITH([xsltconfig], |
---|
[652] | 201 | [AS_HELP_STRING([--with-xsltconfig=FILE], [Specifies an alternative xslt-config file])], |
---|
[640] | 202 | [XSLTCONFIG="$withval"], [XSLTCONFIG=""]) |
---|
| 203 | |
---|
| 204 | if test "x$XSLTCONFIG" = "x"; then |
---|
| 205 | # XSLTCONFIG was not specified, so search within the current path |
---|
| 206 | AC_PATH_PROG([XSLTCONFIG], [xslt-config]) |
---|
| 207 | |
---|
| 208 | # If we couldn't find xslt-config, display a warning |
---|
| 209 | if test "x$XSLTCONFIG" = "x"; then |
---|
| 210 | 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.]) |
---|
| 211 | fi |
---|
| 212 | else |
---|
| 213 | # XSLTCONFIG was specified; display a message to the user |
---|
| 214 | if test "x$XSLTCONFIG" = "xyes"; then |
---|
[652] | 215 | AC_MSG_ERROR([you must Specifies a parameter to --with-xsltconfig, e.g. --with-xsltconfig=/path/to/xslt-config]) |
---|
[640] | 216 | else |
---|
| 217 | if test -f $XSLTCONFIG; then |
---|
| 218 | AC_MSG_RESULT([Using user-specified xslt-config file: $XSLTCONFIG]) |
---|
| 219 | else |
---|
| 220 | AC_MSG_ERROR([the user-specified xslt-config file $XSLTCONFIG does not exist]) |
---|
| 221 | fi |
---|
| 222 | fi |
---|
| 223 | fi |
---|
| 224 | |
---|
| 225 | # Extract the linker and include flags |
---|
| 226 | XSLT_LDFLAGS=`$XSLTCONFIG --libs` |
---|
| 227 | XSLT_CPPFLAGS=`$XSLTCONFIG --cflags` |
---|
| 228 | |
---|
| 229 | # Check headers file |
---|
| 230 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 231 | CPPFLAGS="$XSLT_CPPFLAGS" |
---|
| 232 | AC_CHECK_HEADERS([libxslt/xslt.h libxslt/xsltInternals.h libxslt/transform.h libxslt/xsltutils.h], |
---|
| 233 | [], [AC_MSG_ERROR([could not find headers include related to libxlst])]) |
---|
| 234 | |
---|
| 235 | AC_SUBST([XSLT_CPPFLAGS]) |
---|
| 236 | AC_SUBST([XSLT_LDFLAGS]) |
---|
| 237 | |
---|
| 238 | #============================================================================ |
---|
| 239 | # Detect if gdal is installed |
---|
| 240 | #============================================================================ |
---|
| 241 | |
---|
| 242 | AC_ARG_WITH([gdal-config], |
---|
[652] | 243 | [AS_HELP_STRING([--with-gdal-config=FILE], [Specifies an alternative gdal-config file])], |
---|
[640] | 244 | [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""]) |
---|
| 245 | if test -z $GDAL_CONFIG; |
---|
| 246 | then |
---|
| 247 | AC_PATH_PROG([GDAL_CONFIG], [gdal-config]) |
---|
| 248 | if test -z $GDAL_CONFIG; |
---|
| 249 | then |
---|
| 250 | 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.]) |
---|
| 251 | fi |
---|
| 252 | |
---|
| 253 | else |
---|
| 254 | if test -f $GDAL_CONFIG; then |
---|
| 255 | AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG]) |
---|
| 256 | else |
---|
| 257 | AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist]) |
---|
| 258 | fi |
---|
| 259 | fi |
---|
| 260 | |
---|
| 261 | GDAL_CFLAGS="`$GDAL_CONFIG --cflags`" |
---|
| 262 | GDAL_LIBS="`$GDAL_CONFIG --libs`" |
---|
| 263 | |
---|
| 264 | AC_SUBST([GDAL_CFLAGS]) |
---|
| 265 | AC_SUBST([GDAL_LIBS]) |
---|
| 266 | |
---|
| 267 | # =========================================================================== |
---|
| 268 | # Detect if proj is installed |
---|
| 269 | # =========================================================================== |
---|
| 270 | |
---|
| 271 | AC_ARG_WITH([proj], |
---|
[652] | 272 | [AS_HELP_STRING([--with-proj=PATH], [Specifies an alternative location for PROJ4 setup])], |
---|
[640] | 273 | [PROJPATH="$withval"], [PROJPATH=""]) |
---|
| 274 | |
---|
| 275 | # Extract the linker and include flags |
---|
| 276 | PROJ_LDFLAGS="-L$PROJPATH/lib" |
---|
| 277 | PROJ_CPPFLAGS="-I$PROJPATH/include" |
---|
| 278 | |
---|
| 279 | # Check headers file |
---|
| 280 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 281 | CPPFLAGS="$PROJ_CPPFLAGS" |
---|
| 282 | AC_CHECK_HEADERS([proj_api.h], |
---|
| 283 | [], [AC_MSG_ERROR([could not find headers include related to PROJ4])]) |
---|
| 284 | |
---|
| 285 | AC_SUBST([PROJ_CPPFLAGS]) |
---|
| 286 | AC_SUBST([PROJ_LDFLAGS]) |
---|
| 287 | |
---|
| 288 | # =========================================================================== |
---|
| 289 | # Detect if libgeos is installed |
---|
| 290 | # =========================================================================== |
---|
| 291 | |
---|
| 292 | AC_ARG_WITH([geosconfig], |
---|
[652] | 293 | [AS_HELP_STRING([--with-geosconfig=FILE], [Specifies an alternative geos-config file])], |
---|
[640] | 294 | [GEOSCONFIG="$withval"], [GEOSCONFIG=""]) |
---|
| 295 | |
---|
| 296 | if test "x$GEOSCONFIG" = "x"; then |
---|
| 297 | # GEOSCONFIG was not specified, so search within the current path |
---|
| 298 | AC_PATH_PROG([GEOSCONFIG], [geos-config]) |
---|
| 299 | |
---|
| 300 | # If we couldn't find geos-config, display a warning |
---|
| 301 | if test "x$GEOSCONFIG" = "x"; then |
---|
| 302 | 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.]) |
---|
| 303 | fi |
---|
| 304 | else |
---|
| 305 | # GEOSCONFIG was specified; display a message to the user |
---|
| 306 | if test "x$GEOSCONFIG" = "xyes"; then |
---|
[652] | 307 | AC_MSG_WARN([you must Specifies a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config]) |
---|
[640] | 308 | else |
---|
| 309 | if test -f $GEOSCONFIG; then |
---|
| 310 | AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG]) |
---|
| 311 | else |
---|
| 312 | AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist]) |
---|
| 313 | fi |
---|
| 314 | fi |
---|
| 315 | fi |
---|
| 316 | |
---|
| 317 | GEOS_LDFLAGS=`$GEOSCONFIG --libs` |
---|
| 318 | GEOS_CPPFLAGS=`$GEOSCONFIG --cflags` |
---|
| 319 | |
---|
| 320 | # Check headers file |
---|
| 321 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 322 | CPPFLAGS="$GEOS_CPPFLAGS" |
---|
| 323 | AC_CHECK_HEADERS([geos_c.h], |
---|
| 324 | [], [AC_MSG_WARN([could not find headers include related to libgeos])]) |
---|
| 325 | |
---|
| 326 | AC_SUBST([GEOS_CPPFLAGS]) |
---|
| 327 | AC_SUBST([GEOS_LDFLAGS]) |
---|
| 328 | |
---|
| 329 | |
---|
| 330 | # =========================================================================== |
---|
| 331 | # Detect if cgal is installed |
---|
| 332 | # =========================================================================== |
---|
| 333 | |
---|
| 334 | AC_ARG_WITH([cgal], |
---|
[652] | 335 | [AS_HELP_STRING([--with-cgal=PATH], [Specifies an alternative location for CGAL setup])], |
---|
[640] | 336 | [CGALPATH="$withval"], [CGALPATH="/usr"]) |
---|
| 337 | |
---|
| 338 | |
---|
| 339 | # Check headers file |
---|
| 340 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
[775] | 341 | CGAL_CPPFLAGS="-I$CGALPATH/include" |
---|
[640] | 342 | CPPFLAGS="$CGAL_CPPFLAGS" |
---|
| 343 | AC_CHECK_HEADERS([CGAL/Delaunay_triangulation_2.h], |
---|
| 344 | [], [AC_MSG_WARN([could not find headers include related to libCGAL])]) |
---|
| 345 | |
---|
| 346 | # Extract the linker and include flags |
---|
| 347 | CGAL_LDFLAGS="-L$CGALPATH/lib" |
---|
| 348 | CGAL_CPPFLAGS="-I$CGALPATH/include" |
---|
| 349 | |
---|
| 350 | |
---|
| 351 | AC_SUBST([CGAL_CPPFLAGS]) |
---|
| 352 | AC_SUBST([CGAL_LDFLAGS]) |
---|
| 353 | #============================================================================ |
---|
| 354 | # Detect if mapserver is installed |
---|
| 355 | #============================================================================ |
---|
| 356 | |
---|
| 357 | AC_ARG_WITH([mapserver], |
---|
[652] | 358 | [AS_HELP_STRING([--with-mapserver=PATH], [Specifies the path for MapServer compiled source tree])], |
---|
[640] | 359 | [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""]) |
---|
| 360 | |
---|
[753] | 361 | AC_ARG_WITH([ms-version], |
---|
| 362 | [AS_HELP_STRING([--with-ms-version=VERSION], [Specifies the MapServer version to build against])], |
---|
| 363 | [MS_VERSION="$withval"], [MS_VERSION=""]) |
---|
| 364 | |
---|
[640] | 365 | if test -z $MS_SRC_PATH; |
---|
| 366 | then |
---|
| 367 | MS_CPPFLAGS="" |
---|
| 368 | MS_LDFLAGS="" |
---|
| 369 | else |
---|
| 370 | if test "x$MS_SRC_PATH" = "xmacos"; |
---|
| 371 | then |
---|
| 372 | MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl" |
---|
| 373 | MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver " |
---|
| 374 | AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree]) |
---|
| 375 | AC_MSG_RESULT([Using MacOS X Framework for MapServer]) |
---|
| 376 | else |
---|
[753] | 377 | if test "x$MS_VERSION" = "x7"; |
---|
| 378 | then |
---|
| 379 | MS_LDFLAGS="-L$MS_SRC_PATH/lib -lmapserver" |
---|
| 380 | MS_CPPFLAGS="-DUSE_MS -I$MS_SRC_PATH/include/mapserver " |
---|
| 381 | AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH]) |
---|
| 382 | else |
---|
[640] | 383 | if test -d $MS_SRC_PATH; then |
---|
| 384 | MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`" |
---|
| 385 | MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH " |
---|
| 386 | |
---|
| 387 | AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH]) |
---|
| 388 | else |
---|
| 389 | AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist]) |
---|
| 390 | fi |
---|
[753] | 391 | fi |
---|
[640] | 392 | fi |
---|
| 393 | MS_FILE="service_internal_ms.o" |
---|
| 394 | fi |
---|
| 395 | |
---|
| 396 | MS_CFLAGS="$MS_CPPFLAGS" |
---|
| 397 | MS_LIBS="$MS_LDFLAGS" |
---|
| 398 | |
---|
| 399 | AC_SUBST([MS_CFLAGS]) |
---|
| 400 | AC_SUBST([MS_LIBS]) |
---|
| 401 | AC_SUBST([MS_FILE]) |
---|
| 402 | |
---|
| 403 | # =========================================================================== |
---|
[634] | 404 | # Detect if python is installed |
---|
| 405 | # =========================================================================== |
---|
[1] | 406 | |
---|
[634] | 407 | AC_ARG_WITH([python], |
---|
[652] | 408 | [AS_HELP_STRING([--with-python=PATH], [To enable python support or Specifies an alternative directory for python installation, disabled by default])], |
---|
[634] | 409 | [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""]) |
---|
| 410 | |
---|
| 411 | AC_ARG_WITH([pyvers], |
---|
| 412 | [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])], |
---|
| 413 | [PYTHON_VERS="$withval"], [PYTHON_VERS=""]) |
---|
| 414 | |
---|
| 415 | |
---|
| 416 | if test -z "$PYTHON_ENABLED" |
---|
[1] | 417 | then |
---|
[634] | 418 | PYTHON_FILE="" |
---|
| 419 | else |
---|
| 420 | PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config" |
---|
| 421 | PYTHON_FILE="service_internal_python.o" |
---|
| 422 | if test "$PYTHON_PATH" = "yes" |
---|
[1] | 423 | then |
---|
[797] | 424 | # PYTHON was not specified, so search within the current path |
---|
[634] | 425 | PYTHONCFG_PATH=`which python${PYTHON_VERS}-config` |
---|
| 426 | if test -z "${PYTHONCFG_PATH}" ; then |
---|
| 427 | AC_PATH_PROG([PYTHONCONFIG], [python-config-${PYTHON_VERS}]) |
---|
| 428 | else |
---|
| 429 | AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config]) |
---|
| 430 | fi |
---|
| 431 | else |
---|
| 432 | PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config" |
---|
[1] | 433 | fi |
---|
[634] | 434 | |
---|
| 435 | # Extract the linker and include flags |
---|
| 436 | PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags` |
---|
| 437 | PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes` |
---|
| 438 | |
---|
| 439 | # Check headers file |
---|
| 440 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 441 | CPPFLAGS="$PYTHON_CPPFLAGS" |
---|
| 442 | AC_CHECK_HEADERS([Python.h], |
---|
| 443 | [], [AC_MSG_ERROR([could not find headers include related to libpython])]) |
---|
| 444 | |
---|
| 445 | # Ensure we can link against libphp |
---|
| 446 | LIBS_SAVE="$LIBS" |
---|
| 447 | LIBS="$PYTHON_LDFLAGS" |
---|
[740] | 448 | PY_LIB=`$PYTHONCONFIG --libs | sed \ |
---|
| 449 | -e 's/.*\(python[[0-9]]\.[[0-9]]\).*/\1/'` |
---|
[634] | 450 | AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) |
---|
[640] | 451 | LIBS="$LIBS_SAVE" |
---|
[634] | 452 | fi |
---|
| 453 | |
---|
[740] | 454 | AC_SUBST([PYTHON_CPPFLAGS]) |
---|
| 455 | AC_SUBST([PYTHON_LDFLAGS]) |
---|
[634] | 456 | AC_SUBST([PYTHON_ENABLED]) |
---|
| 457 | AC_SUBST([PYTHON_FILE]) |
---|
| 458 | |
---|
| 459 | # =========================================================================== |
---|
| 460 | # Detect if spidermonkey is installed |
---|
| 461 | # =========================================================================== |
---|
| 462 | |
---|
| 463 | AC_ARG_WITH([js], |
---|
[652] | 464 | [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] | 465 | [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""]) |
---|
| 466 | |
---|
| 467 | if test -z "$JS_ENABLED" |
---|
| 468 | then |
---|
| 469 | JS_FILE="" |
---|
| 470 | else |
---|
| 471 | JS_FILE="service_internal_js.o" |
---|
| 472 | if test "$JSHOME" = "yes" |
---|
| 473 | then |
---|
| 474 | |
---|
| 475 | #on teste si on est sous debian like |
---|
| 476 | if test -f "/usr/bin/dpkg" |
---|
| 477 | then |
---|
| 478 | if test -n "`dpkg -l | grep libmozjs185-dev`" |
---|
| 479 | then |
---|
| 480 | JS_CPPFLAGS="-I/usr/include/js/" |
---|
| 481 | JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm" |
---|
| 482 | JS_LIB="mozjs185" |
---|
| 483 | else |
---|
| 484 | XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`" |
---|
| 485 | if test -n "$XUL_VERSION" |
---|
| 486 | then |
---|
| 487 | JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION" |
---|
| 488 | JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm" |
---|
| 489 | JS_LIB="mozjs" |
---|
| 490 | else |
---|
| 491 | AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ]) |
---|
| 492 | fi |
---|
| 493 | fi |
---|
| 494 | else |
---|
| 495 | AC_MSG_ERROR([You must specify your custom install of libmozjs185]) |
---|
| 496 | fi |
---|
| 497 | else |
---|
| 498 | JS_CPPFLAGS="-I$JSHOME/include/js/" |
---|
| 499 | JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm" |
---|
| 500 | JS_LIB="mozjs185" |
---|
| 501 | |
---|
| 502 | fi |
---|
| 503 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 504 | CPPFLAGS="$JS_CPPFLAGS" |
---|
[640] | 505 | AC_LANG_PUSH([C++]) |
---|
| 506 | AC_CHECK_HEADERS([jsapi.h], |
---|
| 507 | [], [AC_MSG_ERROR([could not find headers include related to libjs])]) |
---|
[634] | 508 | |
---|
[640] | 509 | AC_LANG_POP([C++]) |
---|
[634] | 510 | LIBS_SAVE="$LIBS" |
---|
| 511 | LIBS="$JS_LDFLAGS" |
---|
| 512 | |
---|
| 513 | AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], []) |
---|
[640] | 514 | LIBS="$LIBS_SAVE" |
---|
| 515 | |
---|
[634] | 516 | AC_SUBST([JS_CPPFLAGS]) |
---|
| 517 | AC_SUBST([JS_LDFLAGS]) |
---|
| 518 | fi |
---|
| 519 | |
---|
| 520 | AC_SUBST([JS_ENABLED]) |
---|
| 521 | AC_SUBST([JS_FILE]) |
---|
| 522 | |
---|
| 523 | # =========================================================================== |
---|
| 524 | # Detect if php is installed |
---|
| 525 | # =========================================================================== |
---|
| 526 | |
---|
| 527 | AC_ARG_WITH([php], |
---|
| 528 | [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation, disabled by default])], |
---|
| 529 | [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""]) |
---|
| 530 | |
---|
[797] | 531 | AC_ARG_WITH([php-version], |
---|
| 532 | [AS_HELP_STRING([--with-phpvers=NUM], [To use a specific php version])], |
---|
| 533 | [PHP_VERS="$withval"], [PHP_VERS=""]) |
---|
[634] | 534 | |
---|
[797] | 535 | |
---|
[634] | 536 | if test -z "$PHP_ENABLED" |
---|
| 537 | then |
---|
| 538 | PHP_FILE="" |
---|
[1] | 539 | else |
---|
[634] | 540 | PHPCONFIG="$PHP_PATH/bin/php-config" |
---|
[797] | 541 | if test "x$PHP_VERS" = "x7" |
---|
| 542 | then |
---|
| 543 | PHP_FILE="service_internal_php7.o" |
---|
| 544 | else |
---|
| 545 | PHP_FILE="service_internal_php.o" |
---|
| 546 | fi |
---|
[634] | 547 | if test "$PHP_PATH" = "yes" |
---|
| 548 | then |
---|
| 549 | # PHP was not specified, so search within the current path |
---|
| 550 | AC_PATH_PROG([PHPCONFIG], [php-config]) |
---|
[1] | 551 | else |
---|
[634] | 552 | PHPCONFIG="$PHP_PATH/bin/php-config" |
---|
[1] | 553 | fi |
---|
[634] | 554 | |
---|
| 555 | # Extract the linker and include flags |
---|
[797] | 556 | if test "x$PHP_VERS" = "x7" |
---|
| 557 | then |
---|
| 558 | PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib64 -lphp7" |
---|
| 559 | else |
---|
| 560 | PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5" |
---|
| 561 | fi |
---|
[634] | 562 | PHP_CPPFLAGS=`$PHPCONFIG --includes` |
---|
| 563 | |
---|
| 564 | # Check headers file |
---|
| 565 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 566 | CPPFLAGS="$PHP_CPPFLAGS" |
---|
| 567 | AC_CHECK_HEADERS([sapi/embed/php_embed.h], |
---|
| 568 | [], [AC_MSG_ERROR([could not find headers include related to libphp])]) |
---|
| 569 | |
---|
| 570 | # Ensure we can link against libphp |
---|
| 571 | LIBS_SAVE="$LIBS" |
---|
| 572 | LIBS="$PHP_LDFLAGS" |
---|
| 573 | # Shouldn't we get php here rather than php5 :) ?? |
---|
[797] | 574 | if test "x$PHP_VERS" = "x7" |
---|
| 575 | then |
---|
| 576 | echo $LIBS |
---|
| 577 | #AC_CHECK_LIB([php7], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], []) |
---|
| 578 | else |
---|
| 579 | AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], []) |
---|
| 580 | fi |
---|
[640] | 581 | LIBS="$LIBS_SAVE" |
---|
[634] | 582 | AC_SUBST([PHP_CPPFLAGS]) |
---|
| 583 | AC_SUBST([PHP_LDFLAGS]) |
---|
[1] | 584 | fi |
---|
| 585 | |
---|
[634] | 586 | AC_SUBST([PHP_ENABLED]) |
---|
| 587 | AC_SUBST([PHP_FILE]) |
---|
[1] | 588 | |
---|
[634] | 589 | # =========================================================================== |
---|
| 590 | # Detect if java is installed |
---|
| 591 | # =========================================================================== |
---|
[1] | 592 | |
---|
[634] | 593 | AC_ARG_WITH([java], |
---|
| 594 | [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME, disabled by default])], |
---|
| 595 | [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""]) |
---|
| 596 | |
---|
[809] | 597 | AC_ARG_WITH([java-rpath], |
---|
| 598 | [AS_HELP_STRING([--with-java-rpath=yes], [To set rpath for java support, disabled by default])], |
---|
| 599 | [JAVA_RPATH="$withval"], [JAVA_RPATH=""]) |
---|
| 600 | |
---|
[634] | 601 | if test -z "$JAVA_ENABLED" |
---|
| 602 | then |
---|
| 603 | JAVA_FILE="" |
---|
| 604 | else |
---|
| 605 | JAVA_FILE="service_internal_java.o" |
---|
| 606 | if test "x$JDKHOME" = "x"; |
---|
| 607 | then |
---|
| 608 | 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.]) |
---|
| 609 | fi # JAVA was specified; display a message to the user |
---|
| 610 | if test "x$JDKHOME" = "xyes"; |
---|
| 611 | then |
---|
| 612 | AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java]) |
---|
| 613 | fi |
---|
| 614 | |
---|
| 615 | # Extract the linker and include flags |
---|
| 616 | if test "x$JDKHOME" = "xmacos"; |
---|
| 617 | then |
---|
| 618 | JAVA_LDFLAGS="-framework JavaVM" |
---|
[767] | 619 | for i in `ls /Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/`; do |
---|
| 620 | JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/$i/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/" |
---|
| 621 | done |
---|
[634] | 622 | else |
---|
| 623 | if test -d "$JDKHOME/jre/lib/i386"; |
---|
| 624 | then |
---|
| 625 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/server/ -ljvm -lpthread" |
---|
| 626 | JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux" |
---|
[809] | 627 | if test x$JAVA_RPATH = "xyes"; then |
---|
| 628 | JAVA_LDFLAGS="$JAVA_LDFLAGS -Wl,-rpath,$JDKHOME/jre/lib/i386/server/" |
---|
| 629 | fi |
---|
[634] | 630 | else |
---|
[767] | 631 | if test -d "$JDKHOME/jre/lib/amd64"; then |
---|
| 632 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread" |
---|
| 633 | JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux" |
---|
[809] | 634 | if test x$JAVA_RPATH = "xyes"; then |
---|
| 635 | JAVA_LDFLAGS="$JAVA_LDFLAGS -Wl,-rpath,$JDKHOME/jre/lib/amd64/server/" |
---|
| 636 | fi |
---|
[767] | 637 | else |
---|
| 638 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/server/ -ljvm -lpthread" |
---|
| 639 | JAVA_CPPFLAGS="-I$JDKHOME/include/ -I$JDKHOME/include/darwin" |
---|
[809] | 640 | if test x$JAVA_RPATH = "xyes"; then |
---|
| 641 | JAVA_LDFLAGS="$JAVA_LDFLAGS -Wl,-rpath,$JDKHOME/jre/lib/server/" |
---|
| 642 | fi |
---|
[767] | 643 | fi |
---|
[634] | 644 | fi |
---|
| 645 | fi |
---|
| 646 | |
---|
[767] | 647 | AC_LANG([C++]) |
---|
| 648 | echo $JAVA_CPPFLAGS |
---|
[634] | 649 | # Check headers file (second time we check that in fact) |
---|
| 650 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 651 | CPPFLAGS="$JAVA_CPPFLAGS" |
---|
| 652 | AC_CHECK_HEADERS([jni.h], |
---|
| 653 | [], [AC_MSG_ERROR([could not find jni.h file])]) |
---|
[767] | 654 | CPPFLAGS="$CPPFLAGS_SAVE" |
---|
[634] | 655 | # Ensure we can link against libjava |
---|
| 656 | LIBS_SAVE="$LIBS" |
---|
| 657 | LIBS="$JAVA_LDFLAGS" |
---|
| 658 | if test "x$JDKHOME" != "xmacos"; |
---|
| 659 | then |
---|
| 660 | AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjvm])], []) |
---|
| 661 | fi |
---|
[640] | 662 | LIBS="$LIBS_SAVE" |
---|
[634] | 663 | |
---|
| 664 | AC_SUBST([JAVA_CPPFLAGS]) |
---|
| 665 | AC_SUBST([JAVA_LDFLAGS]) |
---|
| 666 | fi |
---|
| 667 | |
---|
| 668 | AC_SUBST([JAVA_ENABLED]) |
---|
| 669 | AC_SUBST([JAVA_FILE]) |
---|
| 670 | |
---|
[1] | 671 | # =========================================================================== |
---|
[794] | 672 | # Detect if mono is installed |
---|
| 673 | # =========================================================================== |
---|
| 674 | |
---|
| 675 | AC_ARG_WITH([mono], |
---|
| 676 | [AS_HELP_STRING([--with-mono=PATH], [To enable mono support, specify the path to find pkg-config, disabled by default])], |
---|
| 677 | [MONOHOME="$withval"; MONO_ENABLED="-DUSE_MONO"], [MONO_ENABLED=""]) |
---|
| 678 | |
---|
| 679 | if test -z "$MONO_ENABLED" |
---|
| 680 | then |
---|
| 681 | MONO_FILE="" |
---|
| 682 | else |
---|
| 683 | MONO_FILE="service_internal_mono.o" |
---|
| 684 | if test "x$MONOHOME" = "x"; |
---|
| 685 | then |
---|
| 686 | MONOHOME="/usr" |
---|
| 687 | fi |
---|
| 688 | if test "x$MONOHOME" = "xyes"; |
---|
| 689 | then |
---|
| 690 | MONOHOME="/usr" |
---|
| 691 | fi |
---|
| 692 | |
---|
| 693 | # Extract the linker and include flags |
---|
| 694 | MONO_CFLAGS=`$MONOHOME/bin/pkg-config --cflags mono-2` |
---|
| 695 | MONO_LDFLAGS=`$MONOHOME/bin/pkg-config --libs mono-2` |
---|
| 696 | |
---|
| 697 | AC_LANG([C++]) |
---|
| 698 | echo $JAVA_CPPFLAGS |
---|
| 699 | # Check headers file (second time we check that in fact) |
---|
| 700 | CPPFLAGS_SAVE="$CFLAGS" |
---|
| 701 | CPPFLAGS="$MONO_CFLAGS" |
---|
| 702 | AC_CHECK_HEADERS([mono/jit/jit.h], |
---|
| 703 | [], [AC_MSG_ERROR([could not find jit.h file])]) |
---|
| 704 | CPPFLAGS="$CPPFLAGS_SAVE" |
---|
| 705 | # Ensure we can link against libmono-2.0 |
---|
| 706 | LIBS_SAVE="$LIBS" |
---|
| 707 | LIBS="$MONO_LDFLAGS" |
---|
| 708 | AC_CHECK_LIB([mono-2.0], [mono_runtime_invoke], [], [AC_MSG_ERROR([could not find libmono])], []) |
---|
| 709 | LIBS="$LIBS_SAVE" |
---|
| 710 | |
---|
| 711 | AC_SUBST([MONO_CFLAGS]) |
---|
| 712 | AC_SUBST([MONO_LDFLAGS]) |
---|
| 713 | fi |
---|
| 714 | |
---|
| 715 | AC_SUBST([MONO_ENABLED]) |
---|
| 716 | AC_SUBST([MONO_FILE]) |
---|
| 717 | |
---|
| 718 | # =========================================================================== |
---|
[634] | 719 | # Detect if ruby is installed |
---|
| 720 | # =========================================================================== |
---|
| 721 | AC_ARG_WITH([ruby], |
---|
| 722 | [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation, disabled by default])], |
---|
| 723 | [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""]) |
---|
| 724 | |
---|
| 725 | AC_ARG_WITH([rvers], |
---|
| 726 | [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])], |
---|
| 727 | [RUBY_VERS="$withval"], [RUBY_VERS=""]) |
---|
| 728 | |
---|
| 729 | |
---|
| 730 | if test -z "$RUBY_ENABLED" |
---|
| 731 | then |
---|
| 732 | RUBY_FILE="" |
---|
| 733 | else |
---|
| 734 | RUBY_FILE="service_internal_ruby.o" |
---|
| 735 | |
---|
| 736 | # Extract the linker and include flags |
---|
| 737 | RUBY_LDFLAGS="-lruby" |
---|
| 738 | RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS" |
---|
| 739 | |
---|
| 740 | # Check headers file |
---|
| 741 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 742 | CPPFLAGS="$RUBY_CPPFLAGS" |
---|
| 743 | AC_CHECK_HEADERS([ruby.h], |
---|
| 744 | [], [AC_MSG_ERROR([could not find headers include related to libruby])]) |
---|
| 745 | |
---|
| 746 | # Ensure we can link against libphp |
---|
| 747 | LIBS_SAVE="$LIBS" |
---|
| 748 | LIBS="$RUBY_LDFLAGS" |
---|
| 749 | # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) |
---|
[640] | 750 | LIBS="$LIBS_SAVE" |
---|
[634] | 751 | AC_SUBST([RUBY_CPPFLAGS]) |
---|
| 752 | AC_SUBST([RUBY_LDFLAGS]) |
---|
| 753 | fi |
---|
| 754 | |
---|
| 755 | AC_SUBST([RUBY_ENABLED]) |
---|
| 756 | AC_SUBST([RUBY_FILE]) |
---|
| 757 | |
---|
| 758 | # =========================================================================== |
---|
| 759 | # Detect if perl is installed |
---|
| 760 | # =========================================================================== |
---|
| 761 | |
---|
| 762 | AC_ARG_WITH([perl], |
---|
| 763 | [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation, disabled by default])], |
---|
| 764 | [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""]) |
---|
| 765 | |
---|
| 766 | |
---|
| 767 | if test -z "$PERL_ENABLED" |
---|
| 768 | then |
---|
| 769 | PERL_FILE="" |
---|
| 770 | else |
---|
| 771 | PERL_FILE="service_internal_perl.o" |
---|
| 772 | if test "$PERL_PATH" = "yes" |
---|
| 773 | then |
---|
| 774 | # Perl was not specified, so search within the current path |
---|
| 775 | AC_PATH_PROG([PERLCONFIG], [perl]) |
---|
| 776 | else |
---|
| 777 | PERLCONFIG="$PERL_PATH/bin/perl" |
---|
| 778 | fi |
---|
| 779 | |
---|
| 780 | # Extract the linker and include flags |
---|
| 781 | PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts` |
---|
| 782 | PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts` |
---|
| 783 | |
---|
| 784 | # Check headers file |
---|
| 785 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 786 | CPPFLAGS="$PERL_CPPFLAGS" |
---|
| 787 | AC_CHECK_HEADERS([EXTERN.h], |
---|
| 788 | [], [AC_MSG_ERROR([could not find headers include related to libperl])]) |
---|
| 789 | |
---|
| 790 | AC_SUBST([PERL_CPPFLAGS]) |
---|
| 791 | AC_SUBST([PERL_LDFLAGS]) |
---|
| 792 | fi |
---|
| 793 | |
---|
| 794 | AC_SUBST([PERL_ENABLED]) |
---|
| 795 | AC_SUBST([PERL_FILE]) |
---|
| 796 | |
---|
| 797 | # =========================================================================== |
---|
[550] | 798 | # Detect if otb is available |
---|
| 799 | # =========================================================================== |
---|
| 800 | |
---|
[555] | 801 | AC_ARG_WITH([itk], |
---|
[652] | 802 | [AS_HELP_STRING([--with-itk=PATH], [Specifies an alternative location for the itk library])], |
---|
[555] | 803 | [ITKPATH="$withval"], [ITKPATH=""]) |
---|
| 804 | |
---|
| 805 | AC_ARG_WITH([itk-version], |
---|
[652] | 806 | [AS_HELP_STRING([--with-itk-version=VERSION], [Specifies an alternative version for the itk library])], |
---|
[555] | 807 | [ITKVERS="$withval"], [ITKVERS=""]) |
---|
| 808 | |
---|
[550] | 809 | AC_ARG_WITH([otb], |
---|
[652] | 810 | [AS_HELP_STRING([--with-otb=PATH], [Specifies an alternative location for the otb library])], |
---|
[550] | 811 | [OTBPATH="$withval"], [OTBPATH=""]) |
---|
| 812 | |
---|
[775] | 813 | AC_ARG_WITH([otb-version], |
---|
| 814 | [AS_HELP_STRING([--with-otb-version=PATH], [Specifies an alternative location for the otb library])], |
---|
| 815 | [OTBVERS="$withval"], [OTBVERS=""]) |
---|
| 816 | |
---|
[550] | 817 | if test -z "$OTBPATH" |
---|
| 818 | then |
---|
| 819 | OTB_LDFLAGS="" |
---|
| 820 | OTB_CPPFLAGS="" |
---|
| 821 | OTB_FILE="" |
---|
| 822 | OTB_ENABLED="" |
---|
| 823 | else |
---|
[637] | 824 | if test -z "$ITKVERS" |
---|
| 825 | then |
---|
| 826 | ITKVERS="4.5" |
---|
| 827 | fi |
---|
[550] | 828 | OTB_ENABLED="-DUSE_OTB" |
---|
[804] | 829 | IVERS="$(echo -e '4.10\n$ITKVERS' | sort -r | head -n1)" |
---|
| 830 | if test "$IVERS" == "$ITKVERS"; then |
---|
| 831 | ITK_LDFLAGS="-lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS" |
---|
| 832 | else |
---|
| 833 | ITK_LDFLAGS="-lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS" |
---|
| 834 | fi |
---|
| 835 | |
---|
[775] | 836 | if test -a "${OTBPATH}/include/OTB-${OTBVERS}" ; then |
---|
| 837 | OTB_RPATH="$OTBPATH/include/OTB-${OTBVERS}/" |
---|
| 838 | OTB_CPPFLAGS="-I${OTB_RPATH}ApplicationEngine -I$OTB_RPATH/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTB_RPATH/Utilities/ITK -I$OTB_RPATH/ -I$OTB_RPATH/IO -I$OTB_RPATH/UtilitiesAdapters/OssimAdapters -I$OTB_RPATH/UtilitiesAdapters/CurlAdapters -I$OTB_RPATH/Utilities/BGL -I$OTB_RPATH/UtilitiesAdapters/ITKPendingPatches -I$OTB_RPATH/Utilities/otbconfigfile $GDAL_CFLAGS" |
---|
[805] | 839 | OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib $ITK_LDFLAGS" |
---|
[775] | 840 | else |
---|
| 841 | 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" |
---|
[805] | 842 | OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib $ITK_LDFLAGS" |
---|
[775] | 843 | |
---|
| 844 | fi |
---|
[559] | 845 | OTB_FILE="otbZooWatcher.o service_internal_otb.o" |
---|
[550] | 846 | |
---|
| 847 | AC_LANG_PUSH([C++]) |
---|
| 848 | # Check headers file |
---|
| 849 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 850 | CPPFLAGS="$OTB_CPPFLAGS" |
---|
| 851 | LDFLAGS_SAVE="$LDFLAGS" |
---|
[640] | 852 | LIBS="$LIBS_SAVE $OTB_LDFLAGS" |
---|
[803] | 853 | #echo $OTB_CPPFLAGS |
---|
| 854 | AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h], |
---|
| 855 | [], [AC_MSG_ERROR([could not find header file $i related to OTB])]) |
---|
[640] | 856 | LDFLAGS_SAVE="$LDFLAGS" |
---|
| 857 | LDFLAGS="$OTB_LDFLAGS" |
---|
[803] | 858 | #echo $OTB_LDFLAGS |
---|
[804] | 859 | #UVERS="$(echo -e '5.8\n$OTBVERS' | sort -r | head -n1)" |
---|
| 860 | #if test "$OTBVERS" == "$UVERS" ; then |
---|
| 861 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplicationRegistry.h"]],[[std::vector<std::string> list = otb::Wrapper::ApplicationRegistry::GetAvailableApplications();]])], |
---|
| 862 | [AC_MSG_RESULT([checking for GetAvailableApplications... yes])],[AC_MSG_ERROR([checking for GetAvailableApplications... failed])]) |
---|
| 863 | #else |
---|
| 864 | # AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"]],[[std::vector<std::string> list = otb::Wrapper::ApplicationRegistry::GetAvailableApplication();]])], |
---|
| 865 | # [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])]) |
---|
| 866 | #fi |
---|
[803] | 867 | |
---|
[640] | 868 | LDFLAGS="$LDFLAGS_SAVE" |
---|
[775] | 869 | AC_LANG_POP([C++]) |
---|
| 870 | AC_LANG(C++) |
---|
[640] | 871 | |
---|
[550] | 872 | fi |
---|
| 873 | AC_SUBST([OTB_CPPFLAGS]) |
---|
| 874 | AC_SUBST([OTB_LDFLAGS]) |
---|
| 875 | AC_SUBST([OTB_FILE]) |
---|
| 876 | AC_SUBST([OTB_ENABLED]) |
---|
| 877 | |
---|
| 878 | # =========================================================================== |
---|
[634] | 879 | # Detect if saga-gis is available |
---|
| 880 | # =========================================================================== |
---|
| 881 | |
---|
| 882 | AC_ARG_WITH([wx-config], |
---|
[652] | 883 | [AS_HELP_STRING([--with-wx-config=PATH], [Specifies an alternative path for the wx-config tool])], |
---|
[634] | 884 | [WXCFG="$withval"], [WXCFG=""]) |
---|
| 885 | |
---|
| 886 | AC_ARG_WITH([saga], |
---|
[652] | 887 | [AS_HELP_STRING([--with-saga=PATH], [Specifies an alternative location for the SAGA-GIS library])], |
---|
[634] | 888 | [SAGAPATH="$withval"], [SAGAPATH=""]) |
---|
| 889 | |
---|
| 890 | if test -z "$SAGAPATH" |
---|
| 891 | then |
---|
| 892 | SAGA_LDFLAGS="" |
---|
| 893 | SAGA_CPPFLAGS="" |
---|
| 894 | SAGA_FILE="" |
---|
| 895 | SAGA_ENABLED="" |
---|
| 896 | else |
---|
| 897 | if test -z "$WXCFG" ; then |
---|
| 898 | WXCFG="$(which wx-config)" |
---|
| 899 | fi |
---|
| 900 | if test "`$WXCFG --list | grep unicode`" == "" ; then |
---|
| 901 | AC_MSG_ERROR(SAGA requires a unicode build of wxGTK) |
---|
| 902 | fi |
---|
| 903 | WX_ISSUE="-D_WX_WXCRTVARARG_H_" |
---|
| 904 | SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\"" |
---|
| 905 | SAGA_CPPFLAGS=" -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE" |
---|
| 906 | SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api" |
---|
| 907 | SAGA_ENABLED="-DUSE_SAGA" |
---|
| 908 | SAGA_FILE="service_internal_saga.o" |
---|
| 909 | |
---|
| 910 | AC_LANG_PUSH([C++]) |
---|
| 911 | # Check headers file |
---|
| 912 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 913 | CPPFLAGS="$SAGA_CPPFLAGS" |
---|
| 914 | LIBS_SAVE="$LIBS" |
---|
| 915 | LIBS="$SAGA_LDFLAGS" |
---|
| 916 | AC_CHECK_HEADERS([module_library.h], |
---|
| 917 | [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])]) |
---|
[640] | 918 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])], |
---|
| 919 | [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])]) |
---|
| 920 | LIBS="$LIBS_SAVE" |
---|
[634] | 921 | AC_LANG_POP([C++]) |
---|
| 922 | fi |
---|
| 923 | AC_SUBST([SAGA_CPPFLAGS]) |
---|
| 924 | AC_SUBST([SAGA_LDFLAGS]) |
---|
| 925 | AC_SUBST([SAGA_FILE]) |
---|
| 926 | AC_SUBST([SAGA_ENABLED]) |
---|
| 927 | |
---|
[1] | 928 | AC_CONFIG_FILES([Makefile]) |
---|
[284] | 929 | AC_CONFIG_FILES([ZOOMakefile.opts]) |
---|
[813] | 930 | AC_CONFIG_FILES([main.cfg]) |
---|
[1] | 931 | AC_OUTPUT |
---|