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