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