pike.git / src / modules / Java / configure.in

version» Context lines:

pike.git/src/modules/Java/configure.in:5:      OLD_LIBS=$LIBS   OLD_LDFLAGS=$LDFLAGS   OLD_CPPFLAGS=$CPPFLAGS   OLD_LIBPATH=$LIBPATH   JAVA_LIBS=""   JAVA_LIBPATH=""   JAVA_AVAILABLE=0   LINKER_OPTIONS=""    - AC_ARG_WITH(java, [ --without-java no support for Java],[],[with_java=yes]) + AC_ARG_WITH(java, [ --without-java no support for Java],[], +  [with_java=${with_Java:-yes}])   AC_ARG_WITH(java-include-dir,    [ --with-java-include-dir=dir look for header-files in dir],    [pike_java_user_include_directory=$withval])   AC_ARG_WITH(java-lib-dir,    [ --with-java-lib-dir=dir look for JRE libs in dir],    [pike_java_user_lib_directory=$withval])      PIKE_FEATURE_WITHOUT(Java)      if test "x$with_java" = xyes; then
pike.git/src/modules/Java/configure.in:98:    ])    AC_MSG_RESULT($pike_cv_java_arch)       java_arch_dirs=$pike_cv_java_arch    case "x$java_arch_dirs" in    xx86_64)    # Some dists (e.g. Ubuntu and Solaris) have decided to use "amd64"    # as arch specifier in dirs etc even though uname -m returns "x86_64".    java_arch_dirs="x86_64 amd64"    ;; -  xsparcv9) -  # FIXME: Is this needed? -  java_arch_dirs="sparcv9 sparc" -  ;; +     esac       AC_MSG_CHECKING(what kind of threads to use)    AC_CACHE_VAL(pike_cv_java_threads_type, [    if test "x$THREADS_FLAG" = x; then    pike_cv_java_threads_type=native_threads    else    pike_cv_java_threads_type="${THREADS_FLAG}_threads"    fi    ])
pike.git/src/modules/Java/configure.in:153:    if test no = "$pike_cv_ls"; then    AC_MSG_WARN([no working ls found! Java configure will almost certainly fail.])    LS="false"    else    LS="$pike_cv_ls"    fi       AC_MSG_CHECKING(for JAVA_HOME)       AC_CACHE_VAL(pike_cv_java_java_home, [ +  # For reference; some locations of libjvm on various OSes: +  # +  # /usr/java/jdk1.5.0/jre/lib/amd64/server Fedora Core 4 x86_64 +  # /usr/java/jdk1.5.0_05/jre/lib/amd64/server Fedora Core 4 x86_64 +  # /usr/java/j2sdk1.4.2_08/jre/lib/i386/server Fedora Core 4 i386 +  # /usr/java/j2sdk1.4.2_08/jre/lib/i386/client Fedora Core 4 i386 +  # /usr/lib/jvm/icedtea-bin-8/jre/lib/amd64/server Gentoo Linux x86_64 +  # /usr/lib/jvm/icedtea-bin-8-x86/jre/lib/i386/ +  # server Gentoo Linux i386 +  # /Developer/Applications/Utilities/ +  # Application Loader.app/Contents/MacOS/itms/ +  # java/lib/client MacOS X 10.6 x86_64 +  # /Developer/Applications/Utilities/ +  # Application Loader.app/Contents/MacOS/itms/ +  # java/lib/server MacOS X 10.6 x86_64 +  # /Applications/Xcode.app/Contents/Applications/ +  # Application Loader.app/Contents/MacOS/itms/ +  # java/lib/server/ MacOS X 10.9 x86_64 +  # /usr/lib64/gcj-4.1.1 RHEL 5 x86_64 +  # /usr/lib/gcj-4.1.1 RHEL 5 i386 +  # /usr/lib64/gcj-4.4.4 RHEL 6 x86_64 +  # /usr/java/default/jre/lib/amd64/server RHEL 6 x86_64 +  # /usr/lib/jvm/jre/lib/amd64/server RHEL 7 x86_64 +  # /usr/java/jre/lib/sparc Solaris 8 sparc +  # /usr/j2se/jre/lib/sparc/client Solaris 8 sparc +  # /usr/j2se/jre/lib/sparc/server Solaris 8 sparc +  # /usr/jdk/latest/jre/lib/i386/client Solaris 10 i386 +  # /usr/jdk/latest/jre/lib/i386/server Solaris 10 i386 +  # /usr/jdk/latest/jre/lib/amd64/server Solaris 10 x86_64 +  # /usr/jdk/latest/jre/lib/i386/client Solaris 11 i386 +  # /usr/jdk/latest/jre/lib/i386/server Solaris 11 i386 +  # /usr/jdk/latest/jre/lib/amd64/server Solaris 11 x86_64 +  # /usr/lib/jvm/default-java/jre/lib/amd64/server Ubuntu 16.04 x86_64 +  # /usr/lib/jvm/default-java/lib/server Ubuntu 18.04 x86_64 +     if test "x$JAVA_HOME" = x; then    pike_cv_java_java_home=no    java_home_guess=`"$srcdir/find_java_home.sh"` -  for tmp_java_home in /usr/java /usr/local/java /usr/local/jdk* /usr/java*/jre /usr/java/jdk*/jre /usr/java/j2sdk*/jre /usr/local/java*/jre /usr/local/jdk*/jre /usr/local/jre* /usr/local/j2sdk*/jre /usr/local/j2re* /usr/lib/j2se/*/jre /usr/lib/jvm/*/jre "$java_home_guess" "$pike_java_user_lib_directory"/..; do +  for tmp_java_home in /usr/java /usr/local/java /usr/local/jdk* /usr/java*/jre /usr/java/jdk*/jre /usr/java/j2sdk*/jre /usr/local/java*/jre /usr/local/jdk*/jre /usr/local/jre* /usr/local/j2sdk*/jre /usr/local/j2re* /usr/lib/j2se/*/jre /usr/lib/jvm/* /usr/lib/jvm/*/jre "$java_home_guess" "$pike_java_user_lib_directory"/..; do    if test -d $tmp_java_home/.; then    tmp_arch_dir=nowhere    for ad in $java_arch_dirs; do    if test -d "$tmp_java_home/lib/$ad/."; then    tmp_arch_dir="$tmp_java_home/lib/$ad"    tmp_arch="$ad"    break    fi    done    if "$LS" "$tmp_arch_dir/$pike_cv_java_threads_type"/libjvm* >/dev/null 2>&1 || \    "$LS" "$tmp_arch_dir"/libjvm* >/dev/null 2>&1 || \    "$LS" "$tmp_arch_dir"/classic/libjvm* >/dev/null 2>&1 || \    "$LS" "$tmp_java_home/bin"/classic/libjvm* >/dev/null 2>&1 || \    "$LS" "$tmp_arch_dir"/client/libjvm* >/dev/null 2>&1 || \    "$LS" "$tmp_java_home/bin"/client/libjvm* >/dev/null 2>&1 || \    "$LS" "$tmp_arch_dir"/server/libjvm* >/dev/null 2>&1 || \    "$LS" "$tmp_java_home/bin"/server/libjvm* >/dev/null 2>&1 || \ -  +  "$LS" "$tmp_java_home/lib"/server/libjvm* >/dev/null 2>&1 || \    "$LS" "$tmp_java_home/Libraries"/libjvm* >/dev/null 2>&1; then    pike_cv_java_java_home="$tmp_java_home"    java_arch_dir=$tmp_arch    else    :    fi    else    :    fi    done
pike.git/src/modules/Java/configure.in:241:    echo Adding $pike_cv_java_lib_dir to the library search path.    for i in $pike_cv_java_lib_dir; do    LDFLAGS="-L$i -R$i ${LDFLAGS}"    LINKER_OPTIONS="-L$i -R$i ${LINKER_OPTIONS}"    JAVA_LIBPATH="${JAVA_LIBPATH}${JAVA_LIBPATH:+:}$i"    LIBPATH="${LIBPATH}${LIBPATH:+:}$i"    done    export LIBPATH    fi    +  if test x"$pike_cv_java_java_home" = "xno" ; then +  AC_SYS_COMPILER_FLAG(-framework JavaVM, framework_JavaVM, JAVA_FRAMEWORKS) +  +  AC_MSG_CHECKING([for JavaVM (MacOS X)]) +  AC_CACHE_VAL(pike_cv_java_javavm, [ +  pike_cv_java_javavm=no; +  for tmp_java_javavm in ../.. .. . ../../../../Frameworks/JavaVM.framework/; do +  if test -f "$pike_cv_java_java_home"/"$tmp_java_javavm"/JavaVM; then +  pike_cv_java_javavm="$pike_cv_java_java_home"/"$tmp_java_javavm"/JavaVM +  else +  : +  fi +  done +  ]) +  AC_MSG_RESULT($pike_cv_java_javavm) +  +  if test x"$pike_cv_option_framework_JavaVM" = xyes ; then +  AC_CHECK_HEADERS(JavaVM/jni.h) +  fi +  +  else +     # FIXME: If several jvm's are installed then we can find the include    # files for a different one from the JAVA_HOME search above. This is    # not only a matter of having paths in the same order; e.g.    # /usr/lib/jvm/* can match more than one viable jvm's.       AC_MSG_CHECKING(for the Java include directory)    AC_CACHE_VAL(pike_cv_java_include_dir, [    pike_cv_java_include_dir=no -  for tmp_java_incdir in /usr/java* /usr/local/java* /usr/local/jdk* /usr/local/jre* /usr/java/j2sdk* /usr/local/j2sdk* /usr/lib/jvm/* "$pike_cv_java_java_home"/../.. "$pike_cv_java_java_home"/.. "$pike_cv_java_java_home" "$pike_java_user_include_directory"; do +  # NB: Reverse priority order (highest priority last). +  for tmp_java_incdir in /usr/java* \ +  /usr/local/java* \ +  /usr/local/jdk* \ +  /usr/local/jre* \ +  /usr/java/j2sdk* \ +  /usr/local/j2sdk* \ +  /usr/lib/jvm/* \ +  /usr/jdk/instances/* \ +  /usr/jdk/latest \ +  "$pike_cv_java_java_home"/../.. \ +  "$pike_cv_java_java_home"/.. \ +  "$pike_cv_java_java_home" \ +  "$pike_java_user_include_directory"; do    if test -d $tmp_java_incdir/. && "$LS" "$tmp_java_incdir/include/jni.h" >/dev/null 2>&1 ; then    pike_cv_java_include_dir="$tmp_java_incdir/include"    else    if test -d $tmp_java_incdir/. -a -d $tmp_java_incdir/Headers/. &&\    "$LS" "$tmp_java_incdir/Headers/jni.h" >/dev/null 2>&1 ; then    pike_cv_java_include_dir="$tmp_java_incdir/Headers"    else    :    fi    fi
pike.git/src/modules/Java/configure.in:280:    else    :    fi    for d in "$pike_cv_java_include_dir/$java_arch_dir/."; do    if test -d "$d"; then    echo "Adding $d to the include search path."    CPPFLAGS="-I$d ${CPPFLAGS}"    fi    done    fi -  -  AC_MSG_CHECKING([for JavaVM (MacOS X)]) -  AC_CACHE_VAL(pike_cv_java_javavm, [ -  pike_cv_java_javavm=no; -  for tmp_java_javavm in ../.. .. . ../../../../Frameworks/JavaVM.framework/; do -  if test -f "$pike_cv_java_java_home"/"$tmp_java_javavm"/JavaVM; then -  pike_cv_java_javavm="$pike_cv_java_java_home"/"$tmp_java_javavm"/JavaVM -  else -  : +     fi -  done -  ]) -  AC_MSG_RESULT($pike_cv_java_javavm) +        if test osf1 = "$pike_cv_java_sysos"; then    CPPFLAGS="-D_REENTRANT $CPPFLAGS"    else    :    fi       else # if test x"$CC" = xrntcl    pike_cv_java_javavm=no    fi       PIKE_PKG_CONFIG(libffi)       # FFI on OS X (10.5 or newer) expects MACOSX defined    DO_IF_OS(Darwin,    [    AC_SYS_COMPILER_FLAG(-DMACOSX, define_macosx, CPPFLAGS)    ])    -  AC_CHECK_HEADERS(jni.h winbase.h setjmp.h ffi.h ffi/ffi.h libffi/ffi.h) +  AC_CHECK_HEADERS(jni.h winbase.h ffi.h ffi/ffi.h libffi/ffi.h setjmp.h) +     AC_CHECK_TYPES([ffi_arg, ffi_sarg],,,[#ifdef HAVE_FFI_H   #include <ffi.h>   #else   #ifdef HAVE_FFI_FFI_H   #include <ffi/ffi.h>   #else   #ifdef HAVE_LIBFFI_FFI_H   #include <libffi/ffi.h>   #endif   #endif   #endif])       pike_cv_java=no    -  if test "$ac_cv_header_jni_h" = yes; then +  if test "$ac_cv_header_jni_h" = yes -o "$ac_cv_header_JavaVM_jni_h" = yes; then       AC_CHECK_LIB(hpi, sysOpen, [    LIBS="$LIBS -lhpi"    JAVA_LIBS="${JAVA_LIBS} -lhpi"    ], [])       if test x"$pike_cv_java_javavm" = xno; then    :    else    AC_MSG_CHECKING([for JNI_CreateJavaVM in "$pike_cv_java_javavm"])
pike.git/src/modules/Java/configure.in:357:    if test x"$ac_cv_lib_javavm_JNI_CreateJavaVM" = xyes; then    LIBS="$pike_cv_java_javavm $LIBS"    JAVA_LIBS="$pike_cv_java_javavm ${JAVA_LIBS}"    pike_cv_java=yes;    AC_MSG_RESULT(yes)    else    AC_MSG_RESULT(no)    fi    fi    +  if test x"$pike_cv_option_framework_JavaVM" = xyes ; then +  AC_MSG_CHECKING([for JNI_CreateJavaVM in -framework JavaVM]) +  AC_CACHE_VAL(ac_cv_framework_JavaVM_JNI_CreateJavaVM, [ +  ac_save_LIBS="$LIBS" +  LIBS="-framework JavaVM $LIBS" +  AC_TRY_LINK([#include <JavaVM/jni.h>], dnl +  [JNI_CreateJavaVM((JavaVM**)0,(void**)0,(void*)0);], dnl +  [ac_cv_framework_JavaVM_JNI_CreateJavaVM=yes], dnl +  [ac_cv_framework_JavaVM_JNI_CreateJavaVM=no]) +  LIBS="$ac_save_LIBS" +  ]) +  if test x"$ac_cv_framework_JavaVM_JNI_CreateJavaVM" = xyes; then +  LIBS="-framework JavaVM ${LIBS}" +  JAVA_LIBS="-framework JavaVM ${JAVA_LIBS}" +  pike_cv_java=yes +  AC_MSG_RESULT(yes) +  else +  AC_MSG_RESULT(no) +  fi +  fi +     if test x"$pike_cv_java" = xyes; then    :    else       AC_MSG_CHECKING([for JNI_CreateJavaVM in -ljvm])    AC_CACHE_VAL(ac_cv_lib_jvm_JNI_CreateJavaVM, [    ac_save_LIBS="$LIBS"    LIBS="-ljvm $LIBS"    AC_TRY_LINK([#include <jni.h>], dnl    [JNI_CreateJavaVM((JavaVM**)0,(void**)0,(void*)0);], dnl
pike.git/src/modules/Java/configure.in:393:    [JNI_CreateJavaVM((JavaVM**)0,(void**)0,(void*)0);], dnl    [ac_cv_lib_gcj_JNI_CreateJavaVM=yes], dnl    [ac_cv_lib_gcj_JNI_CreateJavaVM=no])    LIBS="$ac_save_LIBS"    ])    if test x"$ac_cv_lib_gcj_JNI_CreateJavaVM" = xyes; then    LIBS="-lgcj $LIBS"    JAVA_LIBS="-lgcj ${JAVA_LIBS}"    pike_cv_java=yes;    AC_MSG_RESULT(yes) +  +  # Boem-gc used in some versions of gcj (eg 3.3.2) complains +  # if it fails to read the page table into a 4096 byte buffer. +  # This happens on Solaris/sun4u: +  # GC Warning: Insufficient space for /proc read +  AC_MSG_CHECKING([for GC_proc_buf_size in -lgcj]) +  AC_TRY_LINK([#include <stddef.h>],[extern size_t GC_proc_buf_size; +  GC_proc_buf_size = 16384; +  ],[ +  AC_DEFINE(HAVE_GC_PROC_BUF_SIZE, [1], +  [gcj uses boem-gc, and has GC_proc_buf_size]) +  AC_MSG_RESULT(yes) +  ],[ +  AC_MSG_RESULT(no) +  ])    else    AC_MSG_RESULT(no)    fi    fi       fi       if test "$pike_cv_java" = yes; then       AC_CHECK_LIB(java, Java_java_lang_Class_isInstance, [
pike.git/src/modules/Java/configure.in:419:    JAVA_LIBS="-lzip ${JAVA_LIBS}"    ], [])       AC_CHECK_LIB(thread, thr_create, [    LIBS="$LIBS -lthread"    JAVA_LIBS="${JAVA_LIBS} -lthread"    LINKER_OPTIONS="${LINKER_OPTIONS} -lthread"    ], [])       pike_java_ffi=no -  AC_CHECK_LIB(ffi, ffi_prep_closure, [ +     if test "$ac_cv_header_ffi_h" = yes \    -o "$ac_cv_header_ffi_ffi_h" = yes \    -o "$ac_cv_header_libffi_ffi_h" = yes; then -  +  AC_CHECK_LIB(ffi, ffi_prep_closure_loc, +  [AC_DEFINE(HAVE_FFI_PREP_CLOSURE_LOC, 1, +  [Define to 1 if you have ffi_prep_closure_loc.]) +  ]) +  AC_CHECK_LIB(ffi, ffi_prep_closure) +  if test "$ac_cv_lib_ffi_ffi_prep_closure_loc" = yes \ +  -o "$ac_cv_lib_ffi_ffi_prep_closure" = yes; then    LIBS="-lffi $LIBS"    JAVA_LIBS="-lffi ${JAVA_LIBS}"    AC_DEFINE(HAVE_FFI)    pike_java_ffi=yes    else    :    fi -  ], []) +  else +  : +  fi       # Java/AIX has this. For debug...    AC_CHECK_LIB(java, ibmFindDLL, [    AC_DEFINE(HAVE_IBMFINDDLL)    ])    else    :    fi    else    :
pike.git/src/modules/Java/configure.in:453:    PIKE_FEATURE(Java,[no (no known JVM found)])       if test "$pike_cv_java" = yes; then    AC_MSG_CHECKING(if the JVM really works)    AC_CACHE_VAL(pike_cv_java_working, [    OLD_CPPFLAGS="$CPPFLAGS"    CPPFLAGS="-I$srcdir $OLD_CPPFLAGS"    AC_TRY_RUN([#ifdef HAVE_JNI_H   #include <jni.h>   #endif + #ifdef HAVE_JAVAVM_JNI_H + #include <JavaVM/jni.h> + #endif   #ifdef HAVE_SETJMP_H   #include <setjmp.h>   #endif   #include <stdio.h>   #ifdef __NT__   #include <windows.h>   #include "ntdl.c"   #endif    int main(int argc, char *argv[])    {