[435] | 1 | AC_INIT([ZOO Kernel], [1.4.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 | #============================================================================ |
---|
| 40 | # Detect if gdal is installed |
---|
| 41 | #============================================================================ |
---|
| 42 | |
---|
| 43 | AC_ARG_WITH([gdal-config], |
---|
| 44 | [AS_HELP_STRING([--with-gdal-config=FILE], [specify an alternative gdal-config file])], |
---|
| 45 | [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""]) |
---|
| 46 | if test -z $GDAL_CONFIG; |
---|
| 47 | then |
---|
| 48 | AC_PATH_PROG([GDAL_CONFIG], [gdal-config]) |
---|
| 49 | if test -z $GDAL_CONFIG; |
---|
| 50 | then |
---|
| 51 | 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.]) |
---|
| 52 | fi |
---|
| 53 | |
---|
| 54 | else |
---|
| 55 | if test -f $GDAL_CONFIG; then |
---|
| 56 | AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG]) |
---|
| 57 | else |
---|
| 58 | AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist]) |
---|
| 59 | fi |
---|
| 60 | fi |
---|
| 61 | |
---|
| 62 | GDAL_CFLAGS="`$GDAL_CONFIG --cflags`" |
---|
| 63 | GDAL_LIBS="`$GDAL_CONFIG --libs`" |
---|
| 64 | |
---|
| 65 | AC_SUBST([GDAL_CFLAGS]) |
---|
| 66 | AC_SUBST([GDAL_LIBS]) |
---|
| 67 | |
---|
| 68 | # =========================================================================== |
---|
[465] | 69 | # Detect if libyaml is available |
---|
| 70 | # =========================================================================== |
---|
| 71 | |
---|
| 72 | AC_ARG_WITH([yaml], |
---|
| 73 | [AS_HELP_STRING([--with-yaml=PATH], [specify an alternative location for the fastcgi library])], |
---|
| 74 | [YAMLPATH="$withval"], [YAMLPATH=""]) |
---|
| 75 | |
---|
| 76 | if test -z "$YAMLPATH" |
---|
| 77 | then |
---|
| 78 | YAML_LDFLAGS="" |
---|
| 79 | YAML_CPPFLAGS="" |
---|
| 80 | YAML_FILE="" |
---|
| 81 | YAML_FILE1="" |
---|
| 82 | else |
---|
| 83 | |
---|
| 84 | # Extract the linker and include flags |
---|
| 85 | YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml" |
---|
| 86 | YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML" |
---|
| 87 | YAML_FILE="service_yaml.o" |
---|
| 88 | YAML_FILE1="zcfg2yaml" |
---|
| 89 | |
---|
| 90 | # Check headers file |
---|
| 91 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 92 | CPPFLAGS="$YAML_CPPFLAGS" |
---|
| 93 | LDFLAGS_SAVE="$LDFLAGS" |
---|
| 94 | LDFLAGS="YAML_LDFLAGS" |
---|
| 95 | AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan]) |
---|
| 96 | AC_CHECK_HEADERS([yaml.h], |
---|
| 97 | [], [AC_MSG_ERROR([could not find headers include related to YAML])]) |
---|
| 98 | |
---|
| 99 | fi |
---|
| 100 | AC_SUBST([YAML_CPPFLAGS]) |
---|
| 101 | AC_SUBST([YAML_LDFLAGS]) |
---|
| 102 | AC_SUBST([YAML_FILE]) |
---|
| 103 | AC_SUBST([YAML_FILE1]) |
---|
| 104 | |
---|
| 105 | # =========================================================================== |
---|
[459] | 106 | # Detect if fastcgi is available |
---|
| 107 | # =========================================================================== |
---|
| 108 | |
---|
| 109 | AC_ARG_WITH([fastcgi], |
---|
| 110 | [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])], |
---|
[465] | 111 | [FCGIPATH="$withval"], [FCGIPATH="/usr"]) |
---|
[459] | 112 | |
---|
| 113 | # Extract the linker and include flags |
---|
| 114 | FCGI_LDFLAGS="-L$FCGIPATH/lib" |
---|
| 115 | FCGI_CPPFLAGS="-I$FCGIPATH/include" |
---|
| 116 | |
---|
| 117 | # Check headers file |
---|
| 118 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 119 | CPPFLAGS="$FCGI_CPPFLAGS" |
---|
[465] | 120 | LDFLAGS_SAVE="LDFLAGS" |
---|
| 121 | LDFLAGS="$FCGI_LDFLAGS" |
---|
| 122 | AC_CHECK_LIB([fcgi], [main]) |
---|
[459] | 123 | AC_CHECK_HEADERS([fcgi_stdio.h], |
---|
| 124 | [], [AC_MSG_ERROR([could not find headers include related to fastcgi])]) |
---|
| 125 | |
---|
| 126 | AC_SUBST([FCGI_CPPFLAGS]) |
---|
| 127 | AC_SUBST([FCGI_LDFLAGS]) |
---|
| 128 | |
---|
| 129 | # =========================================================================== |
---|
| 130 | # Detect if proj is installed |
---|
| 131 | # =========================================================================== |
---|
| 132 | |
---|
| 133 | AC_ARG_WITH([proj], |
---|
| 134 | [AS_HELP_STRING([--with-proj=PATH], [specify an alternative location for PROJ4 setup])], |
---|
| 135 | [PROJPATH="$withval"], [PROJPATH=""]) |
---|
| 136 | |
---|
| 137 | # Extract the linker and include flags |
---|
| 138 | PROJ_LDFLAGS="-L$PROJPATH/lib" |
---|
| 139 | PROJ_CPPFLAGS="-I$PROJPATH/include" |
---|
| 140 | |
---|
| 141 | # Check headers file |
---|
| 142 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 143 | CPPFLAGS="$PROJ_CPPFLAGS" |
---|
| 144 | AC_CHECK_HEADERS([proj_api.h], |
---|
| 145 | [], [AC_MSG_ERROR([could not find headers include related to PROJ4])]) |
---|
| 146 | |
---|
| 147 | AC_SUBST([PROJ_CPPFLAGS]) |
---|
| 148 | AC_SUBST([PROJ_LDFLAGS]) |
---|
| 149 | |
---|
| 150 | # =========================================================================== |
---|
[1] | 151 | # Detect if libxml2 is installed |
---|
| 152 | # =========================================================================== |
---|
| 153 | |
---|
| 154 | AC_ARG_WITH([xml2config], |
---|
| 155 | [AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])], |
---|
| 156 | [XML2CONFIG="$withval"], [XML2CONFIG=""]) |
---|
| 157 | |
---|
| 158 | if test "x$XML2CONFIG" = "x"; then |
---|
| 159 | # XML2CONFIG was not specified, so search within the current path |
---|
| 160 | AC_PATH_PROG([XML2CONFIG], [xml2-config]) |
---|
| 161 | |
---|
| 162 | # If we couldn't find xml2-config, display a warning |
---|
| 163 | if test "x$XML2CONFIG" = "x"; then |
---|
| 164 | 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.]) |
---|
| 165 | fi |
---|
| 166 | else |
---|
| 167 | # XML2CONFIG was specified; display a message to the user |
---|
| 168 | if test "x$XML2CONFIG" = "xyes"; then |
---|
| 169 | AC_MSG_ERROR([you must specify a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config]) |
---|
| 170 | else |
---|
| 171 | if test -f $XML2CONFIG; then |
---|
| 172 | AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG]) |
---|
| 173 | else |
---|
| 174 | AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist]) |
---|
| 175 | fi |
---|
| 176 | fi |
---|
| 177 | fi |
---|
| 178 | |
---|
| 179 | # Extract the linker and include flags |
---|
| 180 | XML2_LDFLAGS=`$XML2CONFIG --libs` |
---|
| 181 | XML2_CPPFLAGS=`$XML2CONFIG --cflags` |
---|
| 182 | |
---|
| 183 | # Check headers file |
---|
| 184 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 185 | CPPFLAGS="$XML2_CPPFLAGS" |
---|
| 186 | AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h], |
---|
| 187 | [], [AC_MSG_ERROR([could not find headers include related to libxml2])]) |
---|
| 188 | |
---|
| 189 | # Ensure we can link against libxml2 |
---|
| 190 | LIBS_SAVE="$LIBS" |
---|
| 191 | LIBS="$XML2_LDFLAGS" |
---|
| 192 | AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], []) |
---|
| 193 | |
---|
| 194 | AC_SUBST([XML2_CPPFLAGS]) |
---|
| 195 | AC_SUBST([XML2_LDFLAGS]) |
---|
| 196 | |
---|
[297] | 197 | #============================================================================ |
---|
| 198 | # Detect if mapserver is installed |
---|
| 199 | #============================================================================ |
---|
| 200 | |
---|
| 201 | AC_ARG_WITH([mapserver], |
---|
| 202 | [AS_HELP_STRING([--with-mapserver=PATH], [specify the path for MapServer compiled source tree])], |
---|
| 203 | [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""]) |
---|
[305] | 204 | |
---|
[297] | 205 | if test -z $MS_SRC_PATH; |
---|
| 206 | then |
---|
[305] | 207 | MS_CPPFLAGS="" |
---|
| 208 | MS_LDFLAGS="" |
---|
[297] | 209 | else |
---|
| 210 | if test "x$MS_SRC_PATH" = "xmacos"; |
---|
| 211 | then |
---|
| 212 | MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl" |
---|
| 213 | MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver " |
---|
| 214 | AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree]) |
---|
| 215 | AC_MSG_RESULT([Using MacOS X Framework for MapServer]) |
---|
| 216 | else |
---|
| 217 | if test -d $MS_SRC_PATH; then |
---|
| 218 | MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`" |
---|
| 219 | MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH " |
---|
| 220 | |
---|
| 221 | AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH]) |
---|
| 222 | else |
---|
| 223 | AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist]) |
---|
| 224 | fi |
---|
| 225 | fi |
---|
| 226 | MS_FILE="service_internal_ms.o" |
---|
| 227 | fi |
---|
| 228 | |
---|
| 229 | MS_CFLAGS="$MS_CPPFLAGS" |
---|
| 230 | MS_LIBS="$MS_LDFLAGS" |
---|
| 231 | |
---|
| 232 | AC_SUBST([MS_CFLAGS]) |
---|
| 233 | AC_SUBST([MS_LIBS]) |
---|
| 234 | AC_SUBST([MS_FILE]) |
---|
| 235 | |
---|
[1] | 236 | # =========================================================================== |
---|
[459] | 237 | # Detect if ruby is installed |
---|
| 238 | # =========================================================================== |
---|
| 239 | AC_ARG_WITH([ruby], |
---|
| 240 | [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation, disabled by default])], |
---|
| 241 | [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""]) |
---|
| 242 | |
---|
| 243 | AC_ARG_WITH([rvers], |
---|
| 244 | [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])], |
---|
| 245 | [RUBY_VERS="$withval"], [RUBY_VERS=""]) |
---|
| 246 | |
---|
| 247 | |
---|
| 248 | if test -z "$RUBY_ENABLED" |
---|
| 249 | then |
---|
| 250 | RUBY_FILE="" |
---|
| 251 | else |
---|
| 252 | RUBY_FILE="service_internal_ruby.o" |
---|
| 253 | |
---|
| 254 | # Extract the linker and include flags |
---|
| 255 | RUBY_LDFLAGS="-lruby" |
---|
| 256 | RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS" |
---|
| 257 | |
---|
| 258 | # Check headers file |
---|
| 259 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 260 | CPPFLAGS="$RUBY_CPPFLAGS" |
---|
| 261 | AC_CHECK_HEADERS([ruby.h], |
---|
| 262 | [], [AC_MSG_ERROR([could not find headers include related to libruby])]) |
---|
| 263 | |
---|
| 264 | # Ensure we can link against libphp |
---|
| 265 | LIBS_SAVE="$LIBS" |
---|
| 266 | LIBS="$RUBY_LDFLAGS" |
---|
| 267 | # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) |
---|
| 268 | AC_SUBST([RUBY_CPPFLAGS]) |
---|
| 269 | AC_SUBST([RUBY_LDFLAGS]) |
---|
| 270 | fi |
---|
| 271 | |
---|
| 272 | AC_SUBST([RUBY_ENABLED]) |
---|
| 273 | AC_SUBST([RUBY_FILE]) |
---|
| 274 | |
---|
| 275 | # =========================================================================== |
---|
[1] | 276 | # Detect if python is installed |
---|
| 277 | # =========================================================================== |
---|
| 278 | |
---|
| 279 | AC_ARG_WITH([python], |
---|
[208] | 280 | [AS_HELP_STRING([--with-python=PATH], [To enable python support or specify an alternative directory for python installation, disabled by default])], |
---|
[29] | 281 | [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""]) |
---|
[1] | 282 | |
---|
[285] | 283 | AC_ARG_WITH([pyvers], |
---|
| 284 | [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])], |
---|
[284] | 285 | [PYTHON_VERS="$withval"], [PYTHON_VERS=""]) |
---|
[1] | 286 | |
---|
[284] | 287 | |
---|
[29] | 288 | if test -z "$PYTHON_ENABLED" |
---|
| 289 | then |
---|
| 290 | PYTHON_FILE="" |
---|
[1] | 291 | else |
---|
[284] | 292 | PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config" |
---|
[29] | 293 | PYTHON_FILE="service_internal_python.o" |
---|
| 294 | if test "$PYTHON_PATH" = "yes" |
---|
| 295 | then |
---|
| 296 | # PHP was not specified, so search within the current path |
---|
[370] | 297 | PYTHONCFG_PATH=`which python${PYTHON_VERS}-config` |
---|
| 298 | if test -z "${PYTHONCFG_PATH}" ; then |
---|
| 299 | AC_PATH_PROG([PYTHONCONFIG], [python-config-${PYTHON_VERS}]) |
---|
| 300 | else |
---|
[284] | 301 | AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config]) |
---|
[370] | 302 | fi |
---|
[1] | 303 | else |
---|
[284] | 304 | PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config" |
---|
[1] | 305 | fi |
---|
| 306 | |
---|
[29] | 307 | # Extract the linker and include flags |
---|
| 308 | PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags` |
---|
[459] | 309 | PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes` |
---|
[1] | 310 | |
---|
[29] | 311 | # Check headers file |
---|
| 312 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 313 | CPPFLAGS="$PYTHON_CPPFLAGS" |
---|
| 314 | AC_CHECK_HEADERS([Python.h], |
---|
[1] | 315 | [], [AC_MSG_ERROR([could not find headers include related to libpython])]) |
---|
| 316 | |
---|
[29] | 317 | # Ensure we can link against libphp |
---|
| 318 | LIBS_SAVE="$LIBS" |
---|
| 319 | LIBS="$PYTHON_LDFLAGS" |
---|
| 320 | PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'` |
---|
| 321 | AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) |
---|
| 322 | AC_SUBST([PYTHON_CPPFLAGS]) |
---|
| 323 | AC_SUBST([PYTHON_LDFLAGS]) |
---|
| 324 | fi |
---|
[1] | 325 | |
---|
[29] | 326 | AC_SUBST([PYTHON_ENABLED]) |
---|
| 327 | AC_SUBST([PYTHON_FILE]) |
---|
[1] | 328 | |
---|
| 329 | # =========================================================================== |
---|
| 330 | # Detect if php is installed |
---|
| 331 | # =========================================================================== |
---|
| 332 | |
---|
| 333 | AC_ARG_WITH([php], |
---|
[208] | 334 | [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation, disabled by default])], |
---|
[28] | 335 | [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""]) |
---|
| 336 | |
---|
| 337 | |
---|
| 338 | if test -z "$PHP_ENABLED" |
---|
| 339 | then |
---|
| 340 | PHP_FILE="" |
---|
| 341 | else |
---|
[1] | 342 | PHPCONFIG="$PHP_PATH/bin/php-config" |
---|
| 343 | PHP_FILE="service_internal_php.o" |
---|
[28] | 344 | if test "$PHP_PATH" = "yes" |
---|
[1] | 345 | then |
---|
[28] | 346 | # PHP was not specified, so search within the current path |
---|
| 347 | AC_PATH_PROG([PHPCONFIG], [php-config]) |
---|
[1] | 348 | else |
---|
[28] | 349 | PHPCONFIG="$PHP_PATH/bin/php-config" |
---|
[1] | 350 | fi |
---|
[28] | 351 | |
---|
[1] | 352 | # Extract the linker and include flags |
---|
| 353 | PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5" |
---|
| 354 | PHP_CPPFLAGS=`$PHPCONFIG --includes` |
---|
| 355 | |
---|
| 356 | # Check headers file |
---|
| 357 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 358 | CPPFLAGS="$PHP_CPPFLAGS" |
---|
| 359 | AC_CHECK_HEADERS([sapi/embed/php_embed.h], |
---|
| 360 | [], [AC_MSG_ERROR([could not find headers include related to libphp])]) |
---|
| 361 | |
---|
| 362 | # Ensure we can link against libphp |
---|
| 363 | LIBS_SAVE="$LIBS" |
---|
| 364 | LIBS="$PHP_LDFLAGS" |
---|
| 365 | # Shouldn't we get php here rather than php5 :) ?? |
---|
| 366 | AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], []) |
---|
| 367 | AC_SUBST([PHP_CPPFLAGS]) |
---|
| 368 | AC_SUBST([PHP_LDFLAGS]) |
---|
| 369 | fi |
---|
| 370 | |
---|
| 371 | AC_SUBST([PHP_ENABLED]) |
---|
| 372 | AC_SUBST([PHP_FILE]) |
---|
| 373 | |
---|
| 374 | # =========================================================================== |
---|
[15] | 375 | # Detect if perl is installed |
---|
| 376 | # =========================================================================== |
---|
| 377 | |
---|
[28] | 378 | AC_ARG_WITH([perl], |
---|
[208] | 379 | [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation, disabled by default])], |
---|
[28] | 380 | [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""]) |
---|
[15] | 381 | |
---|
| 382 | |
---|
[28] | 383 | if test -z "$PERL_ENABLED" |
---|
| 384 | then |
---|
| 385 | PERL_FILE="" |
---|
| 386 | else |
---|
[112] | 387 | PERL_FILE="service_internal_perl.o" |
---|
[28] | 388 | if test "$PERL_PATH" = "yes" |
---|
[15] | 389 | then |
---|
[112] | 390 | # Perl was not specified, so search within the current path |
---|
[15] | 391 | AC_PATH_PROG([PERLCONFIG], [perl]) |
---|
| 392 | else |
---|
| 393 | PERLCONFIG="$PERL_PATH/bin/perl" |
---|
| 394 | fi |
---|
| 395 | |
---|
| 396 | # Extract the linker and include flags |
---|
| 397 | PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts` |
---|
| 398 | PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts` |
---|
| 399 | |
---|
| 400 | # Check headers file |
---|
| 401 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 402 | CPPFLAGS="$PERL_CPPFLAGS" |
---|
| 403 | AC_CHECK_HEADERS([EXTERN.h], |
---|
| 404 | [], [AC_MSG_ERROR([could not find headers include related to libperl])]) |
---|
| 405 | |
---|
| 406 | AC_SUBST([PERL_CPPFLAGS]) |
---|
| 407 | AC_SUBST([PERL_LDFLAGS]) |
---|
| 408 | fi |
---|
| 409 | |
---|
| 410 | AC_SUBST([PERL_ENABLED]) |
---|
| 411 | AC_SUBST([PERL_FILE]) |
---|
| 412 | |
---|
| 413 | # =========================================================================== |
---|
[1] | 414 | # Detect if java is installed |
---|
| 415 | # =========================================================================== |
---|
| 416 | |
---|
| 417 | AC_ARG_WITH([java], |
---|
[208] | 418 | [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME, disabled by default])], |
---|
[46] | 419 | [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""]) |
---|
[1] | 420 | |
---|
[46] | 421 | if test -z "$JAVA_ENABLED" |
---|
[1] | 422 | then |
---|
[46] | 423 | JAVA_FILE="" |
---|
| 424 | else |
---|
[1] | 425 | JAVA_FILE="service_internal_java.o" |
---|
| 426 | if test "x$JDKHOME" = "x"; |
---|
| 427 | then |
---|
[46] | 428 | 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.]) |
---|
| 429 | fi # JAVA was specified; display a message to the user |
---|
| 430 | if test "x$JDKHOME" = "xyes"; |
---|
| 431 | then |
---|
| 432 | AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java]) |
---|
[1] | 433 | fi |
---|
[77] | 434 | |
---|
[1] | 435 | # Extract the linker and include flags |
---|
[77] | 436 | if test "x$JDKHOME" = "xmacos"; |
---|
[1] | 437 | then |
---|
[77] | 438 | JAVA_LDFLAGS="-framework JavaVM" |
---|
[393] | 439 | JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/" |
---|
[1] | 440 | else |
---|
[77] | 441 | if test -d "$JDKHOME/jre/lib/i386"; |
---|
| 442 | then |
---|
| 443 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/client/ -ljvm -lpthread" |
---|
| 444 | JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux" |
---|
| 445 | else |
---|
| 446 | JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/client/ -ljvm -lpthread" |
---|
| 447 | JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux" |
---|
| 448 | fi |
---|
[1] | 449 | fi |
---|
| 450 | |
---|
| 451 | # Check headers file (second time we check that in fact) |
---|
| 452 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
| 453 | CPPFLAGS="$JAVA_CPPFLAGS" |
---|
| 454 | AC_CHECK_HEADERS([jni.h], |
---|
| 455 | [], [AC_MSG_ERROR([could not find headers include related to libjava])]) |
---|
| 456 | |
---|
| 457 | # Ensure we can link against libjava |
---|
| 458 | LIBS_SAVE="$LIBS" |
---|
| 459 | LIBS="$JAVA_LDFLAGS" |
---|
[77] | 460 | if test "x$JDKHOME" != "xmacos"; |
---|
| 461 | then |
---|
| 462 | AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjava])], []) |
---|
| 463 | fi |
---|
[1] | 464 | |
---|
| 465 | AC_SUBST([JAVA_CPPFLAGS]) |
---|
| 466 | AC_SUBST([JAVA_LDFLAGS]) |
---|
| 467 | fi |
---|
| 468 | |
---|
| 469 | AC_SUBST([JAVA_ENABLED]) |
---|
| 470 | AC_SUBST([JAVA_FILE]) |
---|
| 471 | |
---|
| 472 | # =========================================================================== |
---|
| 473 | # Detect if spidermonkey is installed |
---|
| 474 | # =========================================================================== |
---|
| 475 | |
---|
| 476 | AC_ARG_WITH([js], |
---|
[208] | 477 | [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] | 478 | [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""]) |
---|
[3] | 479 | |
---|
[46] | 480 | if test -z "$JS_ENABLED" |
---|
[1] | 481 | then |
---|
[46] | 482 | JS_FILE="" |
---|
| 483 | else |
---|
[274] | 484 | JS_FILE="service_internal_js.o" |
---|
[46] | 485 | if test "$JSHOME" = "yes" |
---|
| 486 | then |
---|
[1] | 487 | |
---|
[46] | 488 | #on teste si on est sous debian like |
---|
| 489 | if test -f "/usr/bin/dpkg" |
---|
[3] | 490 | then |
---|
[274] | 491 | if test -n "`dpkg -l | grep libmozjs185-dev`" |
---|
[46] | 492 | then |
---|
[274] | 493 | JS_CPPFLAGS="-I/usr/include/js/" |
---|
| 494 | JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm" |
---|
| 495 | JS_LIB="mozjs185" |
---|
[89] | 496 | else |
---|
[288] | 497 | XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`" |
---|
[89] | 498 | if test -n "$XUL_VERSION" |
---|
| 499 | then |
---|
| 500 | JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION" |
---|
| 501 | JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm" |
---|
| 502 | JS_LIB="mozjs" |
---|
| 503 | else |
---|
[274] | 504 | AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ]) |
---|
[89] | 505 | fi |
---|
[46] | 506 | fi |
---|
[3] | 507 | else |
---|
[274] | 508 | AC_MSG_ERROR([You must specify your custom install of libmozjs185]) |
---|
[3] | 509 | fi |
---|
| 510 | else |
---|
[274] | 511 | JS_CPPFLAGS="-I$JSHOME/include/js/" |
---|
| 512 | JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm" |
---|
| 513 | JS_LIB="mozjs185" |
---|
[46] | 514 | |
---|
| 515 | fi |
---|
[1] | 516 | CPPFLAGS_SAVE="$CPPFLAGS" |
---|
[3] | 517 | CPPFLAGS="$JS_CPPFLAGS" |
---|
[46] | 518 | |
---|
| 519 | #AC_CHECK_HEADERS([jsapi.h], |
---|
[3] | 520 | # [], [AC_MSG_ERROR([could not find headers include related to libjs])]) |
---|
[1] | 521 | |
---|
[46] | 522 | |
---|
| 523 | LIBS_SAVE="$LIBS" |
---|
[3] | 524 | LIBS="$JS_LDFLAGS" |
---|
[1] | 525 | |
---|
[288] | 526 | AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], []) |
---|
[46] | 527 | |
---|
[3] | 528 | AC_SUBST([JS_CPPFLAGS]) |
---|
| 529 | AC_SUBST([JS_LDFLAGS]) |
---|
[46] | 530 | fi |
---|
[3] | 531 | |
---|
[1] | 532 | AC_SUBST([JS_ENABLED]) |
---|
| 533 | AC_SUBST([JS_FILE]) |
---|
| 534 | |
---|
| 535 | AC_CONFIG_FILES([Makefile]) |
---|
[284] | 536 | AC_CONFIG_FILES([ZOOMakefile.opts]) |
---|
[1] | 537 | AC_OUTPUT |
---|