From 54c2f04ba05ce07e701345bc66d038b7d47a9bed Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Sun, 2 Apr 2000 15:34:17 +0000 Subject: [PATCH] JVMPI changes... Sun Apr 2 08:27:18 2000 Anthony Green * configure: Rebuilt. * configure.in: Add --disable-jvmpi. * include/config.h.in: Rebuilt. * acconfig.h: Add ENABLE_JVMPI. * include/jvm.h: Declare _Jv_DisableGC and _Jv_EnableGC. (_Jv_JVMPI_Notify_OBJECT_ALLOC): New define. (_Jv_JVMPI_Notify_THREAD_END): New define. (_Jv_JVMPI_Notify_THREAD_END): New define. * prims.cc (_Jv_JVMPI_Notify_OBJECT_ALLOC): Declare. (_Jv_JVMPI_Notify_THREAD_END): Declare. (_Jv_JVMPI_Notify_THREAD_END): Declare. * prims.cc (_Jv_AllocObject): Generate JVMPI object allocation events. * java/lang/natThread.cc: Include JVMPI headers if necessary. (finish_): Generate JVMPI thread end events. (run_): Generate JVMPI thread start events. * gnu/gcj/runtime/natFirstThread.cc (run): Call JNI_OnLoad for any preloaded JNI library. Include JVMPI headers if necessary. (run): Generate JVMPI thread start events. * boehm.cc: Define GC_disable and GC_enable. (_Jv_DisableGC): New function. (_Jv_EnableGC): New function. (disable_gc_mutex): Declare. * nogc.cc (_Jv_DisableGC): New function. (_Jv_EnableGC): New function. * jni.cc (_Jv_JNI_GetEnv): Handle JVMPI interface requests. (_Jv_JVMPI_Interface): Define. (jvmpiEnableEvent): New function. (_Jv_JNI_Init): Initialize _Jv_JVMPI_Interface. * include/jvmpi.h: New file. From-SVN: r32866 --- libjava/ChangeLog | 40 ++ libjava/acconfig.h | 3 + libjava/boehm.cc | 25 ++ libjava/configure | 476 ++++++++++++---------- libjava/configure.in | 8 + libjava/gnu/gcj/runtime/natFirstThread.cc | 97 ++++- libjava/include/config.h.in | 6 + libjava/include/jvm.h | 11 + libjava/java/lang/natThread.cc | 73 ++++ libjava/jni.cc | 66 +++ libjava/nogc.cc | 12 +- libjava/prims.cc | 31 ++ 12 files changed, 636 insertions(+), 212 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 3b4e8e7acc40..411965280a5e 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,43 @@ +Sun Apr 2 08:27:18 2000 Anthony Green + + * configure: Rebuilt. + * configure.in: Add --disable-jvmpi. + * include/config.h.in: Rebuilt. + * acconfig.h: Add ENABLE_JVMPI. + + * include/jvm.h: Declare _Jv_DisableGC and _Jv_EnableGC. + (_Jv_JVMPI_Notify_OBJECT_ALLOC): New define. + (_Jv_JVMPI_Notify_THREAD_END): New define. + (_Jv_JVMPI_Notify_THREAD_END): New define. + * prims.cc (_Jv_JVMPI_Notify_OBJECT_ALLOC): Declare. + (_Jv_JVMPI_Notify_THREAD_END): Declare. + (_Jv_JVMPI_Notify_THREAD_END): Declare. + + * prims.cc (_Jv_AllocObject): Generate JVMPI object allocation + events. + + * java/lang/natThread.cc: Include JVMPI headers if necessary. + (finish_): Generate JVMPI thread end events. + (run_): Generate JVMPI thread start events. + * gnu/gcj/runtime/natFirstThread.cc (run): Call JNI_OnLoad for any + preloaded JNI library. + Include JVMPI headers if necessary. + (run): Generate JVMPI thread start events. + + * boehm.cc: Define GC_disable and GC_enable. + (_Jv_DisableGC): New function. + (_Jv_EnableGC): New function. + (disable_gc_mutex): Declare. + * nogc.cc (_Jv_DisableGC): New function. + (_Jv_EnableGC): New function. + + * jni.cc (_Jv_JNI_GetEnv): Handle JVMPI interface requests. + (_Jv_JVMPI_Interface): Define. + (jvmpiEnableEvent): New function. + (_Jv_JNI_Init): Initialize _Jv_JVMPI_Interface. + + * include/jvmpi.h: New file. + 2000-03-27 Bryce McKinlay * Makefile.in: New #defines and friends for Thread.h. diff --git a/libjava/acconfig.h b/libjava/acconfig.h index a3a2ea22a2a5..0a4d96544a9a 100644 --- a/libjava/acconfig.h +++ b/libjava/acconfig.h @@ -137,3 +137,6 @@ /* Define if you have working iconv() function. */ #undef HAVE_ICONV + +/* Define if you are using JVMPI. */ +#undef ENABLE_JVMPI diff --git a/libjava/boehm.cc b/libjava/boehm.cc index 36b544863b1e..ba60ba0b6aaa 100644 --- a/libjava/boehm.cc +++ b/libjava/boehm.cc @@ -69,6 +69,9 @@ static ptr_t *obj_free_list; // Freelist used for Java arrays. static ptr_t *array_free_list; +// Lock used to protect access to Boehm's GC_enable/GC_disable functions. +static _Jv_Mutex_t disable_gc_mutex; + // This is called by the GC during the mark phase. It marks a Java @@ -391,6 +394,26 @@ _Jv_GCSetMaximumHeapSize (size_t size) GC_set_max_heap_size ((GC_word) size); } +// From boehm's misc.c +extern "C" void GC_enable(); +extern "C" void GC_disable(); + +void +_Jv_DisableGC (void) +{ + _Jv_MutexLock (&disable_gc_mutex); + GC_disable(); + _Jv_MutexUnlock (&disable_gc_mutex); +} + +void +_Jv_EnableGC (void) +{ + _Jv_MutexLock (&disable_gc_mutex); + GC_enable(); + _Jv_MutexUnlock (&disable_gc_mutex); +} + void _Jv_InitGC (void) { @@ -443,6 +466,8 @@ _Jv_InitGC (void) GC_obj_kinds[array_kind_x].ok_relocate_descr = FALSE; GC_obj_kinds[array_kind_x].ok_init = TRUE; + _Jv_MutexInit (&disable_gc_mutex); + UNLOCK (); ENABLE_SIGNALS (); } diff --git a/libjava/configure b/libjava/configure index 05fc056a5f4e..a45dc3c889dc 100755 --- a/libjava/configure +++ b/libjava/configure @@ -44,6 +44,8 @@ ac_help="$ac_help --enable-sjlj-exceptions use setjmp/longjmp exceptions" ac_help="$ac_help --disable-java-net disable java.net" +ac_help="$ac_help + --disable-jvmpi disable JVMPI support" ac_help="$ac_help --with-ecos enable runtime eCos target support" ac_help="$ac_help @@ -622,7 +624,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:626: checking host system type" >&5 +echo "configure:628: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -643,7 +645,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:647: checking target system type" >&5 +echo "configure:649: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -661,7 +663,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:665: checking build system type" >&5 +echo "configure:667: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -709,7 +711,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:713: checking for a BSD compatible install" >&5 +echo "configure:715: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -762,7 +764,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:766: checking whether build environment is sane" >&5 +echo "configure:768: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -819,7 +821,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:823: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:825: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -852,12 +854,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:856: checking for Cygwin environment" >&5 +echo "configure:858: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -885,19 +887,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:889: checking for mingw32 environment" >&5 +echo "configure:891: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -945,7 +947,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:949: checking host system type" >&5 +echo "configure:951: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -987,7 +989,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:991: checking for working aclocal" >&5 +echo "configure:993: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1000,7 +1002,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1004: checking for working autoconf" >&5 +echo "configure:1006: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1013,7 +1015,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1017: checking for working automake" >&5 +echo "configure:1019: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1026,7 +1028,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1030: checking for working autoheader" >&5 +echo "configure:1032: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1039,7 +1041,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1043: checking for working makeinfo" >&5 +echo "configure:1045: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1065,7 +1067,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1069: checking for $ac_word" >&5 +echo "configure:1071: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1095,7 +1097,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1099: checking for $ac_word" >&5 +echo "configure:1101: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1144,7 +1146,7 @@ fi fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1148: checking whether we are using GNU C" >&5 +echo "configure:1150: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1153,7 +1155,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1168,7 +1170,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1172: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1174: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1205,7 +1207,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1209: checking for $ac_word" >&5 +echo "configure:1211: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1238,7 +1240,7 @@ test -n "$CXX" || CXX="gcc" test -z "$CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1242: checking whether we are using GNU C++" >&5 +echo "configure:1244: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1247,7 +1249,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1262,7 +1264,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1266: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1268: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1295,7 +1297,7 @@ fi # LIBGCJ_CONFIGURE, which doesn't work because that means that it will # be run before AC_CANONICAL_HOST. echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1299: checking build system type" >&5 +echo "configure:1301: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1316,7 +1318,7 @@ echo "$ac_t""$build" 1>&6 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1320: checking for $ac_word" >&5 +echo "configure:1322: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1348,7 +1350,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1352: checking for $ac_word" >&5 +echo "configure:1354: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1380,7 +1382,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1384: checking for $ac_word" >&5 +echo "configure:1386: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1412,7 +1414,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1416: checking for $ac_word" >&5 +echo "configure:1418: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1457,7 +1459,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1461: checking for a BSD compatible install" >&5 +echo "configure:1463: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1511,7 +1513,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:1515: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:1517: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -1545,7 +1547,7 @@ if false; then echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1549: checking for executable suffix" >&5 +echo "configure:1551: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1555,7 +1557,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -1699,7 +1701,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1703: checking for $ac_word" >&5 +echo "configure:1705: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1738,7 +1740,7 @@ ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1742: checking for ld used by GCC" >&5 +echo "configure:1744: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -1762,10 +1764,10 @@ echo "configure:1742: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1766: checking for GNU ld" >&5 +echo "configure:1768: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1769: checking for non-GNU ld" >&5 +echo "configure:1771: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1800,7 +1802,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1804: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1806: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1816,7 +1818,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1820: checking for BSD-compatible nm" >&5 +echo "configure:1822: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1852,7 +1854,7 @@ NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1856: checking whether ln -s works" >&5 +echo "configure:1858: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1901,8 +1903,8 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1905 "configure"' > conftest.$ac_ext - if { (eval echo configure:1906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1907 "configure"' > conftest.$ac_ext + if { (eval echo configure:1908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -1923,19 +1925,19 @@ case "$lt_target" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1927: checking whether the C compiler needs -belf" >&5 +echo "configure:1929: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2142,18 +2144,18 @@ if test "$ac_cv_prog_gnu_ld" = yes; then fi echo $ac_n "checking for data_start""... $ac_c" 1>&6 -echo "configure:2146: checking for data_start" >&5 +echo "configure:2148: checking for data_start" >&5 LIBDATASTARTSPEC= NEEDS_DATA_START= cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""found it" 1>&6 else @@ -2184,6 +2186,20 @@ EOF fi +# Check whether --enable-jvmpi or --disable-jvmpi was given. +if test "${enable_jvmpi+set}" = set; then + enableval="$enable_jvmpi" + : +fi + + +if test "$enable_jvmpi" != no; then + cat >> confdefs.h <<\EOF +#define ENABLE_JVMPI 1 +EOF + +fi + TARGET_ECOS="no" # Check whether --with-ecos or --without-ecos was given. if test "${with_ecos+set}" = set; then @@ -2209,7 +2225,7 @@ EOF esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2213: checking how to run the C preprocessor" >&5 +echo "configure:2229: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2224,13 +2240,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2241,13 +2257,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2267: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2258,13 +2274,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2289,7 +2305,7 @@ fi echo "$ac_t""$CPP" 1>&6 cat > conftest.$ac_ext < EOF @@ -2304,7 +2320,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -2319,7 +2335,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -2334,7 +2350,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -2351,7 +2367,7 @@ rm -f conftest* cat > conftest.$ac_ext < EOF @@ -2366,7 +2382,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -2409,7 +2425,7 @@ ZLIBTESTSPEC= libsubdir=.libs echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6 -echo "configure:2413: checking for garbage collector to use" >&5 +echo "configure:2429: checking for garbage collector to use" >&5 # Check whether --enable-java-gc or --disable-java-gc was given. if test "${enable_java_gc+set}" = set; then enableval="$enable_java_gc" @@ -2462,7 +2478,7 @@ esac echo $ac_n "checking for threads package to use""... $ac_c" 1>&6 -echo "configure:2466: checking for threads package to use" >&5 +echo "configure:2482: checking for threads package to use" >&5 # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" @@ -2643,12 +2659,12 @@ else for ac_func in strerror ioctl select fstat open fsync sleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2647: checking for $ac_func" >&5 +echo "configure:2663: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2698,12 +2714,12 @@ done for ac_func in gmtime_r localtime_r readdir_r getpwuid_r getcwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2702: checking for $ac_func" >&5 +echo "configure:2718: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2753,12 +2769,12 @@ done for ac_func in access stat mkdir rename rmdir unlink realpath iconv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2757: checking for $ac_func" >&5 +echo "configure:2773: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2808,12 +2824,12 @@ done for ac_func in inet_aton inet_addr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2812: checking for $ac_func" >&5 +echo "configure:2828: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2863,12 +2879,12 @@ done for ac_func in inet_pton uname inet_ntoa do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2867: checking for $ac_func" >&5 +echo "configure:2883: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2918,12 +2934,12 @@ done for ac_func in backtrace fork execvp pipe do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2922: checking for $ac_func" >&5 +echo "configure:2938: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2974,17 +2990,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2978: checking for $ac_hdr" >&5 +echo "configure:2994: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3011,7 +3027,7 @@ fi done echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6 -echo "configure:3015: checking for dladdr in -ldl" >&5 +echo "configure:3031: checking for dladdr in -ldl" >&5 ac_lib_var=`echo dl'_'dladdr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3019,7 +3035,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3059,7 +3075,7 @@ do ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_file""... $ac_c" 1>&6 -echo "configure:3063: checking for $ac_file" >&5 +echo "configure:3079: checking for $ac_file" >&5 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3094,12 +3110,12 @@ done for ac_func in gethostbyname_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3098: checking for $ac_func" >&5 +echo "configure:3114: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3149,7 +3165,7 @@ EOF # We look for the one that returns `int'. # Hopefully this check is robust enough. cat > conftest.$ac_ext < EOF @@ -3169,7 +3185,7 @@ rm -f conftest* *" -D_REENTRANT "*) ;; *) echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6 -echo "configure:3173: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5 +echo "configure:3189: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5 if eval "test \"`echo '$''{'libjava_cv_gethostbyname_r_needs_reentrant'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3182,14 +3198,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { gethostbyname_r("", 0, 0); ; return 0; } EOF -if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_gethostbyname_r_needs_reentrant=no else @@ -3199,14 +3215,14 @@ else CPPFLAGS_SAVE="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_REENTRANT" cat > conftest.$ac_ext < int main() { gethostbyname_r("", 0, 0); ; return 0; } EOF -if { (eval echo configure:3210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_gethostbyname_r_needs_reentrant=yes else @@ -3241,12 +3257,12 @@ EOF esac echo $ac_n "checking for struct hostent_data""... $ac_c" 1>&6 -echo "configure:3245: checking for struct hostent_data" >&5 +echo "configure:3261: checking for struct hostent_data" >&5 if eval "test \"`echo '$''{'libjava_cv_struct_hostent_data'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_struct_hostent_data=yes else @@ -3286,12 +3302,12 @@ done for ac_func in gethostbyaddr_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3290: checking for $ac_func" >&5 +echo "configure:3306: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3341,7 +3357,7 @@ EOF # We look for the one that returns `int'. # Hopefully this check is robust enough. cat > conftest.$ac_ext < EOF @@ -3365,12 +3381,12 @@ done for ac_func in gethostname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3369: checking for $ac_func" >&5 +echo "configure:3385: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3417,7 +3433,7 @@ EOF EOF cat > conftest.$ac_ext < EOF @@ -3448,12 +3464,12 @@ done for ac_func in pthread_mutexattr_settype pthread_mutexattr_setkind_np do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3452: checking for $ac_func" >&5 +echo "configure:3468: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3506,12 +3522,12 @@ done for ac_func in sched_yield do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3510: checking for $ac_func" >&5 +echo "configure:3526: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3556,7 +3572,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6 -echo "configure:3560: checking for sched_yield in -lrt" >&5 +echo "configure:3576: checking for sched_yield in -lrt" >&5 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3564,7 +3580,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3601,7 +3617,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6 -echo "configure:3605: checking for sched_yield in -lposix4" >&5 +echo "configure:3621: checking for sched_yield in -lposix4" >&5 ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3609,7 +3625,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3656,7 +3672,7 @@ done # We can save a little space at runtime if the mutex has m_count # or __m_count. This is a nice hack for Linux. cat > conftest.$ac_ext < int main() { @@ -3665,7 +3681,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define PTHREAD_MUTEX_HAVE_M_COUNT 1 @@ -3677,7 +3693,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { @@ -3686,7 +3702,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define PTHREAD_MUTEX_HAVE___M_COUNT 1 @@ -3706,12 +3722,12 @@ rm -f conftest* for ac_func in gettimeofday time ftime do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3710: checking for $ac_func" >&5 +echo "configure:3726: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3765,12 +3781,12 @@ done for ac_func in memmove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3769: checking for $ac_func" >&5 +echo "configure:3785: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3823,12 +3839,12 @@ done for ac_func in memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3827: checking for $ac_func" >&5 +echo "configure:3843: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3899,7 +3915,7 @@ done #-------------------------------------------------------------------- echo $ac_n "checking for socket libraries""... $ac_c" 1>&6 -echo "configure:3903: checking for socket libraries" >&5 +echo "configure:3919: checking for socket libraries" >&5 if eval "test \"`echo '$''{'gcj_cv_lib_sockets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3907,12 +3923,12 @@ else gcj_checkBoth=0 unset ac_cv_func_connect echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:3911: checking for connect" >&5 +echo "configure:3927: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -3958,7 +3974,7 @@ fi if test "$gcj_checkSocket" = 1; then unset ac_cv_func_connect echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:3962: checking for main in -lsocket" >&5 +echo "configure:3978: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3966,14 +3982,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4000,12 +4016,12 @@ fi LIBS="$LIBS -lsocket -lnsl" unset ac_cv_func_accept echo $ac_n "checking for accept""... $ac_c" 1>&6 -echo "configure:4004: checking for accept" >&5 +echo "configure:4020: checking for accept" >&5 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_accept=yes" else @@ -4055,12 +4071,12 @@ fi gcj_oldLibs=$LIBS LIBS="$LIBS $gcj_cv_lib_sockets" echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:4059: checking for gethostbyname" >&5 +echo "configure:4075: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -4101,7 +4117,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:4105: checking for main in -lnsl" >&5 +echo "configure:4121: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4109,14 +4125,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4148,7 +4164,7 @@ echo "$ac_t""$gcj_cv_lib_sockets" 1>&6 if test "$with_system_zlib" = yes; then echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:4152: checking for deflate in -lz" >&5 +echo "configure:4168: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4156,7 +4172,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4197,7 +4213,7 @@ fi # requires -ldl. if test "$GC" = boehm; then echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6 -echo "configure:4201: checking for main in -ldl" >&5 +echo "configure:4217: checking for main in -ldl" >&5 ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4205,14 +4221,14 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4243,6 +4259,46 @@ fi fi fi +echo $ac_n "checking size of void *""... $ac_c" 1>&6 +echo "configure:4264: checking size of void *" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(void *)); + exit(0); +} +EOF +if { (eval echo configure:4283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_void_p=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_void_p=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6 +cat >> confdefs.h <&6 -echo "configure:4336: checking whether gcj supports -fuse-divide-subroutine" >&5 +echo "configure:4392: checking whether gcj supports -fuse-divide-subroutine" >&5 cat > conftest.java << 'END' public class conftest { } END @@ -4349,18 +4405,18 @@ echo "$ac_t""$use_fuse" 1>&6 echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6 -echo "configure:4353: checking for g++ -ffloat-store bug" >&5 +echo "configure:4409: checking for g++ -ffloat-store bug" >&5 save_CFLAGS="$CFLAGS" CFLAGS="-x c++ -O2 -ffloat-store" cat > conftest.$ac_ext < int main() { ; return 0; } EOF -if { (eval echo configure:4364: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""no" 1>&6 else @@ -4380,17 +4436,17 @@ for ac_hdr in unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4384: checking for $ac_hdr" >&5 +echo "configure:4440: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4420,17 +4476,17 @@ for ac_hdr in dirent.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4424: checking for $ac_hdr" >&5 +echo "configure:4480: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4458,12 +4514,12 @@ done echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4462: checking for ANSI C header files" >&5 +echo "configure:4518: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4471,7 +4527,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4475: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4488,7 +4544,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4506,7 +4562,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4527,7 +4583,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4538,7 +4594,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4562,12 +4618,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:4566: checking for ssize_t" >&5 +echo "configure:4622: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4596,9 +4652,9 @@ fi echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6 -echo "configure:4600: checking for in_addr_t" >&5 +echo "configure:4656: checking for in_addr_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4612,7 +4668,7 @@ int main() { in_addr_t foo; ; return 0; } EOF -if { (eval echo configure:4616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_IN_ADDR_T 1 @@ -4628,16 +4684,16 @@ fi rm -f conftest* echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6 -echo "configure:4632: checking whether struct ip_mreq is in netinet/in.h" >&5 +echo "configure:4688: checking whether struct ip_mreq is in netinet/in.h" >&5 cat > conftest.$ac_ext < int main() { struct ip_mreq mreq; ; return 0; } EOF -if { (eval echo configure:4641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_STRUCT_IP_MREQ 1 @@ -4653,16 +4709,16 @@ fi rm -f conftest* echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6 -echo "configure:4657: checking whether struct sockaddr_in6 is in netinet/in.h" >&5 +echo "configure:4713: checking whether struct sockaddr_in6 is in netinet/in.h" >&5 cat > conftest.$ac_ext < int main() { struct sockaddr_in6 addr6; ; return 0; } EOF -if { (eval echo configure:4666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_INET6 1 @@ -4678,16 +4734,16 @@ fi rm -f conftest* echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6 -echo "configure:4682: checking for socklen_t in sys/socket.h" >&5 +echo "configure:4738: checking for socklen_t in sys/socket.h" >&5 cat > conftest.$ac_ext < int main() { socklen_t x = 5; ; return 0; } EOF -if { (eval echo configure:4691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_SOCKLEN_T 1 @@ -4703,16 +4759,16 @@ fi rm -f conftest* echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6 -echo "configure:4707: checking for tm_gmtoff in struct tm" >&5 +echo "configure:4763: checking for tm_gmtoff in struct tm" >&5 cat > conftest.$ac_ext < int main() { struct tm tim; tim.tm_gmtoff = 0; ; return 0; } EOF -if { (eval echo configure:4716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define STRUCT_TM_HAS_GMTOFF 1 @@ -4725,16 +4781,16 @@ else rm -rf conftest* echo "$ac_t""no" 1>&6 echo $ac_n "checking for global timezone variable""... $ac_c" 1>&6 -echo "configure:4729: checking for global timezone variable" >&5 +echo "configure:4785: checking for global timezone variable" >&5 cat > conftest.$ac_ext < int main() { long z2 = timezone; ; return 0; } EOF -if { (eval echo configure:4738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_TIMEZONE 1 @@ -4754,19 +4810,19 @@ rm -f conftest* # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:4758: checking for working alloca.h" >&5 +echo "configure:4814: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -4787,12 +4843,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4791: checking for alloca" >&5 +echo "configure:4847: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4852,12 +4908,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4856: checking whether alloca needs Cray hooks" >&5 +echo "configure:4912: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4886: checking for $ac_func" >&5 +echo "configure:4942: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4937,7 +4993,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4941: checking stack direction for C alloca" >&5 +echo "configure:4997: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4945,7 +5001,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4991,7 +5047,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4995: checking for $ac_word" >&5 +echo "configure:5051: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else diff --git a/libjava/configure.in b/libjava/configure.in index 07a6fafb09f9..161275abb125 100644 --- a/libjava/configure.in +++ b/libjava/configure.in @@ -127,6 +127,14 @@ if test "$enable_java_net" = no; then AC_DEFINE(DISABLE_JAVA_NET) fi +dnl See if the user wants to disable JVMPI support. +AC_ARG_ENABLE(jvmpi, +[ --disable-jvmpi disable JVMPI support]) + +if test "$enable_jvmpi" != no; then + AC_DEFINE(ENABLE_JVMPI) +fi + dnl If the target is an eCos system, use the appropriate eCos dnl I/O routines. dnl FIXME: this should not be a local option but a global target diff --git a/libjava/gnu/gcj/runtime/natFirstThread.cc b/libjava/gnu/gcj/runtime/natFirstThread.cc index 458103c895a2..c498ff84d785 100644 --- a/libjava/gnu/gcj/runtime/natFirstThread.cc +++ b/libjava/gnu/gcj/runtime/natFirstThread.cc @@ -1,6 +1,6 @@ // natFirstThread.cc - Implementation of FirstThread native methods. -/* Copyright (C) 1998, 1999 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000 Free Software Foundation This file is part of libgcj. @@ -14,6 +14,7 @@ details. */ #include #include +#include #include #include @@ -22,16 +23,56 @@ details. */ #include #include +#ifdef ENABLE_JVMPI +#include +#include +#include +#endif + #define DIE(Message) die (JvNewStringLatin1 (Message)) typedef void main_func (jobject); +#ifdef WITH_JVMPI +extern void (*_Jv_JVMPI_Notify_THREAD_START) (JVMPI_Event *event); +#endif + +/* This will be non-NULL if the user has preloaded a JNI library, or + linked one into the executable. */ +extern "C" +{ +#pragma weak JNI_OnLoad + extern jint JNI_OnLoad (JavaVM *, void *) __attribute__((weak)); +} + void gnu::gcj::runtime::FirstThread::run (void) { + Utf8Const* main_signature = _Jv_makeUtf8Const ("([Ljava.lang.String;)V", 22); Utf8Const* main_name = _Jv_makeUtf8Const ("main", 4); + /* Some systems let you preload shared libraries before running a + program. Under Linux, this is done by setting the LD_PRELOAD + environment variable. We take advatage of this here to allow for + dynamically loading a JNI library into a fully linked executable. */ + + if (JNI_OnLoad != NULL) + { + JavaVM *vm = _Jv_GetJavaVM (); + if (vm == NULL) + { + // FIXME: what? + return; + } + jint vers = JNI_OnLoad (vm, NULL); + if (vers != JNI_VERSION_1_1 && vers != JNI_VERSION_1_2) + { + // FIXME: unload the library. + _Jv_Throw (new java::lang::UnsatisfiedLinkError (JvNewStringLatin1 ("unrecognized version from preloaded JNI_OnLoad"))); + } + } + if (klass == NULL) { klass = java::lang::Class::forName (klass_name); @@ -48,6 +89,60 @@ gnu::gcj::runtime::FirstThread::run (void) if (! java::lang::reflect::Modifier::isPublic(meth->accflags)) DIE ("`main' must be public"); +#ifdef WITH_JVMPI + if (_Jv_JVMPI_Notify_THREAD_START) + { + JVMPI_Event event; + + jstring thread_name = getName (); + jstring group_name = NULL, parent_name = NULL; + java::lang::ThreadGroup *group = getThreadGroup (); + + if (group) + { + group_name = group->getName (); + group = group->getParent (); + + if (group) + parent_name = group->getName (); + } + + int thread_len = thread_name ? JvGetStringUTFLength (thread_name) : 0; + int group_len = group_name ? JvGetStringUTFLength (group_name) : 0; + int parent_len = parent_name ? JvGetStringUTFLength (parent_name) : 0; + + char thread_chars[thread_len + 1]; + char group_chars[group_len + 1]; + char parent_chars[parent_len + 1]; + + if (thread_name) + JvGetStringUTFRegion (thread_name, 0, + thread_name->length(), thread_chars); + if (group_name) + JvGetStringUTFRegion (group_name, 0, + group_name->length(), group_chars); + if (parent_name) + JvGetStringUTFRegion (parent_name, 0, + parent_name->length(), parent_chars); + + thread_chars[thread_len] = '\0'; + group_chars[group_len] = '\0'; + parent_chars[parent_len] = '\0'; + + event.event_type = JVMPI_EVENT_THREAD_START; + event.env_id = NULL; + event.u.thread_start.thread_name = thread_chars; + event.u.thread_start.group_name = group_chars; + event.u.thread_start.parent_name = parent_chars; + event.u.thread_start.thread_id = (jobjectID) this; + event.u.thread_start.thread_env_id = _Jv_GetCurrentJNIEnv (); + + _Jv_DisableGC (); + (*_Jv_JVMPI_Notify_THREAD_START) (&event); + _Jv_EnableGC (); + } +#endif + main_func *real_main = (main_func *) meth->ncode; (*real_main) (args); } diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in index 42740c4a17e6..10b74af151d2 100644 --- a/libjava/include/config.h.in +++ b/libjava/include/config.h.in @@ -152,6 +152,12 @@ /* Define if g++ has a bug preventing us from inlining math routines. */ #undef __NO_MATH_INLINES +/* Define if you are using JVMPI. */ +#undef ENABLE_JVMPI + +/* The number of bytes in a void *. */ +#undef SIZEOF_VOID_P + /* Define if you have the access function. */ #undef HAVE_ACCESS diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index 32336db90772..19b03fbc9c65 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -82,6 +82,9 @@ void _Jv_RunFinalizers (void); void _Jv_RunAllFinalizers (void); /* Perform a GC. */ void _Jv_RunGC (void); +/* Disable and enable GC. */ +void _Jv_DisableGC (void); +void _Jv_EnableGC (void); /* Return approximation of total size of heap. */ long _Jv_GCTotalMemory (void); @@ -216,4 +219,12 @@ void _Jv_SetCurrentJNIEnv (_Jv_JNIEnv *); struct _Jv_JavaVM; _Jv_JavaVM *_Jv_GetJavaVM (); +#ifdef ENABLE_JVMPI +#include "jvmpi.h" + +extern void (*_Jv_JVMPI_Notify_OBJECT_ALLOC) (JVMPI_Event *event); +extern void (*_Jv_JVMPI_Notify_THREAD_START) (JVMPI_Event *event); +extern void (*_Jv_JVMPI_Notify_THREAD_END) (JVMPI_Event *event); +#endif + #endif /* __JAVA_JVM_H__ */ diff --git a/libjava/java/lang/natThread.cc b/libjava/java/lang/natThread.cc index 9fc30b9e5b02..7a5e9004c64d 100644 --- a/libjava/java/lang/natThread.cc +++ b/libjava/java/lang/natThread.cc @@ -27,6 +27,10 @@ details. */ #include +#ifdef ENABLE_JVMPI +#include +#endif + // This structure is used to represent all the data the native side @@ -173,6 +177,21 @@ java::lang::Thread::finish_ () natThread *nt = (natThread *) data; group->remove (this); + +#ifdef ENABLE_JVMPI + if (_Jv_JVMPI_Notify_THREAD_END) + { + JVMPI_Event event; + + event.event_type = JVMPI_EVENT_THREAD_END; + event.env_id = _Jv_GetCurrentJNIEnv (); + + _Jv_DisableGC (); + (*_Jv_JVMPI_Notify_THREAD_END) (&event); + _Jv_EnableGC (); + } +#endif + group = NULL; // Signal any threads that are waiting to join() us. @@ -188,6 +207,60 @@ java::lang::Thread::run_ (jobject obj) java::lang::Thread *thread = (java::lang::Thread *) obj; try { +#ifdef ENABLE_JVMPI + if (_Jv_JVMPI_Notify_THREAD_START) + { + JVMPI_Event event; + + jstring thread_name = thread->getName (); + jstring group_name = NULL, parent_name = NULL; + java::lang::ThreadGroup *group = thread->getThreadGroup (); + + if (group) + { + group_name = group->getName (); + group = group->getParent (); + + if (group) + parent_name = group->getName (); + } + + int thread_len = thread_name ? JvGetStringUTFLength (thread_name) : 0; + int group_len = group_name ? JvGetStringUTFLength (group_name) : 0; + int parent_len = parent_name ? JvGetStringUTFLength (parent_name) : 0; + + char thread_chars[thread_len + 1]; + char group_chars[group_len + 1]; + char parent_chars[parent_len + 1]; + + if (thread_name) + JvGetStringUTFRegion (thread_name, 0, + thread_name->length(), thread_chars); + if (group_name) + JvGetStringUTFRegion (group_name, 0, + group_name->length(), group_chars); + if (parent_name) + JvGetStringUTFRegion (parent_name, 0, + parent_name->length(), parent_chars); + + thread_chars[thread_len] = '\0'; + group_chars[group_len] = '\0'; + parent_chars[parent_len] = '\0'; + + event.event_type = JVMPI_EVENT_THREAD_START; + event.env_id = NULL; + event.u.thread_start.thread_name = thread_chars; + event.u.thread_start.group_name = group_chars; + event.u.thread_start.parent_name = parent_chars; + event.u.thread_start.thread_id = (jobjectID) thread; + event.u.thread_start.thread_env_id = _Jv_GetCurrentJNIEnv (); + + _Jv_DisableGC (); + (*_Jv_JVMPI_Notify_THREAD_START) (&event); + _Jv_EnableGC (); + } +#endif + thread->run (); } catch (java::lang::Throwable *t) diff --git a/libjava/jni.cc b/libjava/jni.cc index da9a84860ee2..ea2f03974f36 100644 --- a/libjava/jni.cc +++ b/libjava/jni.cc @@ -20,6 +20,9 @@ details. */ #include #include #include +#ifdef ENABLE_JVMPI +#include +#endif #include #include @@ -105,12 +108,66 @@ static java::util::Hashtable *ref_table; // The only VM. static JavaVM *the_vm; +#ifdef ENABLE_JVMPI +// The only JVMPI interface description. +static JVMPI_Interface _Jv_JVMPI_Interface; + +static jint +jvmpiEnableEvent (jint event_type, void *) +{ + switch (event_type) + { + case JVMPI_EVENT_OBJECT_ALLOC: + _Jv_JVMPI_Notify_OBJECT_ALLOC = _Jv_JVMPI_Interface.NotifyEvent; + break; + + case JVMPI_EVENT_THREAD_START: + _Jv_JVMPI_Notify_THREAD_START = _Jv_JVMPI_Interface.NotifyEvent; + break; + + case JVMPI_EVENT_THREAD_END: + _Jv_JVMPI_Notify_THREAD_END = _Jv_JVMPI_Interface.NotifyEvent; + break; + + default: + return JVMPI_NOT_AVAILABLE; + } + + return JVMPI_SUCCESS; +} + +static jint +jvmpiDisableEvent (jint event_type, void *) +{ + switch (event_type) + { + case JVMPI_EVENT_OBJECT_ALLOC: + _Jv_JVMPI_Notify_OBJECT_ALLOC = NULL; + break; + + default: + return JVMPI_NOT_AVAILABLE; + } + + return JVMPI_SUCCESS; +} +#endif + void _Jv_JNI_Init (void) { ref_table = new java::util::Hashtable; + +#ifdef ENABLE_JVMPI + _Jv_JVMPI_Interface.version = 1; + _Jv_JVMPI_Interface.EnableEvent = &jvmpiEnableEvent; + _Jv_JVMPI_Interface.DisableEvent = &jvmpiDisableEvent; + _Jv_JVMPI_Interface.EnableGC = &_Jv_EnableGC; + _Jv_JVMPI_Interface.DisableGC = &_Jv_DisableGC; + _Jv_JVMPI_Interface.RunGC = &_Jv_RunGC; +#endif } // Tell the GC that a certain pointer is live. @@ -1868,6 +1925,15 @@ _Jv_JNI_GetEnv (JavaVM *, void **penv, jint version) return JNI_EDETACHED; } +#ifdef ENABLE_JVMPI + // Handle JVMPI requests. + if (version == JVMPI_VERSION_1) + { + *penv = (void *) &_Jv_JVMPI_Interface; + return 0; + } +#endif + // FIXME: do we really want to support 1.1? if (version != JNI_VERSION_1_2 && version != JNI_VERSION_1_1) { diff --git a/libjava/nogc.cc b/libjava/nogc.cc index 1524139079a7..10d4f80ed00d 100644 --- a/libjava/nogc.cc +++ b/libjava/nogc.cc @@ -1,6 +1,6 @@ // nogc.cc - Code to implement no GC. -/* Copyright (C) 1998, 1999 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000 Free Software Foundation This file is part of libgcj. @@ -85,6 +85,16 @@ _Jv_GCSetMaximumHeapSize (size_t size) { } +void +_Jv_DisableGC (void) +{ +} + +void +_Jv_EnableGC (void) +{ +} + void _Jv_InitGC (void) { diff --git a/libjava/prims.cc b/libjava/prims.cc index 81668a86c887..5b1e62d4ba31 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -34,6 +34,10 @@ details. */ #include #include +#ifdef ENABLE_JVMPI +#include +#endif + #ifndef DISABLE_GETENV_PROPERTIES #include #include @@ -83,6 +87,12 @@ property_pair *_Jv_Environment_Properties; // The name of this executable. static char * _Jv_execName; +#ifdef ENABLE_JVMPI +// Pointer to JVMPI notification functions. +void (*_Jv_JVMPI_Notify_OBJECT_ALLOC) (JVMPI_Event *event); +void (*_Jv_JVMPI_Notify_THREAD_START) (JVMPI_Event *event); +void (*_Jv_JVMPI_Notify_THREAD_END) (JVMPI_Event *event); +#endif #ifdef HANDLE_SEGV @@ -326,6 +336,27 @@ _Jv_AllocObject (jclass c, jint size) if (c->vtable->method[1] != ObjectClass.vtable->method[1]) _Jv_RegisterFinalizer (obj, _Jv_FinalizeObject); +#ifdef ENABLE_JVMPI + // Service JVMPI request. + + if (_Jv_JVMPI_Notify_OBJECT_ALLOC) + { + JVMPI_Event event; + + event.event_type = JVMPI_EVENT_OBJECT_ALLOC; + event.env_id = NULL; + event.u.obj_alloc.arena_id = 0; + event.u.obj_alloc.class_id = (jobjectID) c; + event.u.obj_alloc.is_array = 0; + event.u.obj_alloc.size = size; + event.u.obj_alloc.obj_id = (jobjectID) obj; + + _Jv_DisableGC (); + (*_Jv_JVMPI_Notify_OBJECT_ALLOC) (&event); + _Jv_EnableGC (); + } +#endif + return obj; } -- 2.43.5