From 29e531ff29f5677799bf45a62e85a442d9c492f6 Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Mon, 30 Jun 2003 23:53:29 +0000 Subject: [PATCH] glib-2.0.m4: New file. * glib-2.0.m4: New file. * gtk-2.0.m4: New file. * glib.m4: Remove. * gtk.m4: Remove. * configure.in: Update AM_PATH_GTK macro call to AM_PATH_GTK_2_0. Likewise for AM_PATH_GLIB. * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h: New versions from classpath. * aclocal.m4: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. * gcj/Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. From-SVN: r68746 --- libjava/ChangeLog | 29 + libjava/Makefile.in | 8 +- libjava/aclocal.m4 | 268 +++-- libjava/configure | 1024 ++++++++--------- libjava/configure.in | 4 +- libjava/gcj/Makefile.in | 6 +- libjava/{glib.m4 => glib-2.0.m4} | 138 ++- libjava/{gtk.m4 => gtk-2.0.m4} | 130 +-- libjava/include/Makefile.in | 6 +- .../gnu_java_awt_peer_gtk_GdkGraphics.c | 4 +- .../gnu_java_awt_peer_gtk_GtkButtonPeer.c | 50 +- .../gnu_java_awt_peer_gtk_GtkComponentPeer.c | 46 +- .../gnu_java_awt_peer_gtk_GtkEvents.c | 12 +- .../gnu_java_awt_peer_gtk_GtkListPeer.c | 30 +- .../gnu_java_awt_peer_gtk_GtkMainThread.c | 15 +- .../gnu_java_awt_peer_gtk_GtkScrollBarPeer.c | 18 +- .../gnu_java_awt_peer_gtk_GtkTextAreaPeer.c | 153 +-- ...u_java_awt_peer_gtk_GtkTextComponentPeer.c | 257 ++++- .../gnu_java_awt_peer_gtk_GtkTextFieldPeer.c | 80 +- .../gnu_java_awt_peer_gtk_GtkWindowPeer.c | 82 +- libjava/jni/gtk-peer/gthread-jni.c | 486 ++++++-- libjava/jni/gtk-peer/gthread-jni.h | 1 + libjava/testsuite/Makefile.in | 6 +- 23 files changed, 1653 insertions(+), 1200 deletions(-) rename libjava/{glib.m4 => glib-2.0.m4} (58%) rename libjava/{gtk.m4 => gtk-2.0.m4} (55%) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 6ab73abeb50..32af9058169 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,32 @@ +2003-06-30 Thomas Fitzsimmons + + * glib-2.0.m4: New file. + * gtk-2.0.m4: New file. + * glib.m4: Remove. + * gtk.m4: Remove. + * configure.in: Update AM_PATH_GTK macro call to + AM_PATH_GTK_2_0. Likewise for AM_PATH_GLIB. + * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c, + jni/gtk-peer/gthread-jni.c, + jni/gtk-peer/gthread-jni.h: + New versions from classpath. + * aclocal.m4: Regenerate. + * configure: Regenerate. + * Makefile.in: Regenerate. + * gcj/Makefile.in: Regenerate. + * include/Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. + 2003-06-30 Gary Benson For PR libgcj/11349: diff --git a/libjava/Makefile.in b/libjava/Makefile.in index 8700e237c3d..a138372c59f 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -86,10 +86,11 @@ GCOBJS = @GCOBJS@ GCSPEC = @GCSPEC@ GCTESTSPEC = @GCTESTSPEC@ GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GTK_CFLAGS = @GTK_CFLAGS@ -GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ HASH_SYNC_SPEC = @HASH_SYNC_SPEC@ IEEESPEC = @IEEESPEC@ @@ -115,6 +116,7 @@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ PLATFORMOBJS = @PLATFORMOBJS@ RANLIB = @RANLIB@ STRIP = @STRIP@ @@ -4284,7 +4286,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 \ - ./acinclude.m4 ./aclocal.m4 ./glib.m4 ./gtk.m4 \ + ./acinclude.m4 ./aclocal.m4 ./glib-2.0.m4 ./gtk-2.0.m4 \ ./libart.m4 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) diff --git a/libjava/aclocal.m4 b/libjava/aclocal.m4 index eea585e50f9..ef532589313 100644 --- a/libjava/aclocal.m4 +++ b/libjava/aclocal.m4 @@ -435,58 +435,70 @@ done<<>>dnl>>) changequote([,]))]) # Configure paths for GTK+ -# Owen Taylor 97-11-3 +# Owen Taylor 1997-2001 -dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS +dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, +dnl pass to pkg-config dnl -AC_DEFUN(AM_PATH_GTK, +AC_DEFUN(AM_PATH_GTK_2_0, [dnl -dnl Get the cflags and libraries from the gtk-config script +dnl Get the cflags and libraries from pkg-config dnl -AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], - gtk_config_prefix="$withval", gtk_config_prefix="") -AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], - gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") -AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], +AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], , enable_gtktest=yes) + pkg_config_args=gtk+-2.0 for module in . $4 do case "$module" in gthread) - gtk_config_args="$gtk_config_args gthread" + pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done - if test x$gtk_config_exec_prefix != x ; then - gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" - if test x${GTK_CONFIG+set} != xset ; then - GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config - fi - fi - if test x$gtk_config_prefix != x ; then - gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" - if test x${GTK_CONFIG+set} != xset ; then - GTK_CONFIG=$gtk_config_prefix/bin/gtk-config - fi + no_gtk="" + + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + + if test x$PKG_CONFIG != xno ; then + if pkg-config --atleast-pkgconfig-version 0.7 ; then + : + else + echo *** pkg-config too old; version 0.7 or better required. + no_gtk=yes + PKG_CONFIG=no + fi + else + no_gtk=yes fi - AC_PATH_PROG(GTK_CONFIG, gtk-config, no) - min_gtk_version=ifelse([$1], ,0.99.7,$1) - AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) - no_gtk="" - if test "$GTK_CONFIG" = "no" ; then - no_gtk=yes - else - GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` - GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` - gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + min_gtk_version=ifelse([$1], ,2.0.0,$1) + AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" + enable_gtktest=no + fi + + if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then + : + else + no_gtk=yes + fi + fi + + if test x"$no_gtk" = x ; then + GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` + GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` + gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -494,8 +506,8 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" dnl -dnl Now check if the installed GTK is sufficiently new. (Also sanity -dnl checks the results of gtk-config to some extent +dnl Now check if the installed GTK+ is sufficiently new. (Also sanity +dnl checks the results of pkg-config to some extent) dnl rm -f conf.gtktest AC_TRY_RUN([ @@ -522,19 +534,17 @@ main () (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { - printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); - printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); - printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); - printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); } -#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) @@ -544,7 +554,6 @@ main () printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } -#endif /* defined (GTK_MAJOR_VERSION) ... */ else { if ((gtk_major_version > major) || @@ -562,10 +571,10 @@ main () printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); - printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } @@ -578,20 +587,20 @@ main () fi fi if test "x$no_gtk" = x ; then - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) - if test "$GTK_CONFIG" = "no" ; then - echo "*** The gtk-config script installed by GTK could not be found" - echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GTK_CONFIG environment variable to the" - echo "*** full path to gtk-config." + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else - echo "*** Could not run GTK test program, checking why..." + echo "*** Could not run GTK+ test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ @@ -599,23 +608,16 @@ main () #include ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GTK or finding the wrong" - echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** that the run-time linker is not finding GTK+ or finding the wrong" + echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" ], + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GTK was incorrectly installed" - echo "*** or that you have moved GTK since it was installed. In the latter case, you" - echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) + echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi @@ -630,62 +632,80 @@ main () ]) # Configure paths for GLIB -# Owen Taylor 97-11-3 +# Owen Taylor 1997-2001 -dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or -dnl gthread is specified in MODULES, pass to glib-config +dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or +dnl gthread is specified in MODULES, pass to pkg-config dnl -AC_DEFUN(AM_PATH_GLIB, +AC_DEFUN(AM_PATH_GLIB_2_0, [dnl -dnl Get the cflags and libraries from the glib-config script +dnl Get the cflags and libraries from pkg-config dnl -AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], - glib_config_prefix="$withval", glib_config_prefix="") -AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], - glib_config_exec_prefix="$withval", glib_config_exec_prefix="") -AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], +AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], , enable_glibtest=yes) - if test x$glib_config_exec_prefix != x ; then - glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config - fi - fi - if test x$glib_config_prefix != x ; then - glib_config_args="$glib_config_args --prefix=$glib_config_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_prefix/bin/glib-config - fi - fi - + pkg_config_args=glib-2.0 for module in . $4 do case "$module" in gmodule) - glib_config_args="$glib_config_args gmodule" + pkg_config_args="$pkg_config_args gmodule-2.0" + ;; + gobject) + pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) - glib_config_args="$glib_config_args gthread" + pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done - AC_PATH_PROG(GLIB_CONFIG, glib-config, no) - min_glib_version=ifelse([$1], ,0.99.7,$1) - AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + no_glib="" - if test "$GLIB_CONFIG" = "no" ; then - no_glib=yes + + if test x$PKG_CONFIG != xno ; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then + : + else + echo *** pkg-config too old; version 0.7 or better required. + no_glib=yes + PKG_CONFIG=no + fi else - GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` - GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` - glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ + no_glib=yes + fi + + min_glib_version=ifelse([$1], ,2.0.0,$1) + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" + enable_glibtest=no + fi + + if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then + : + else + no_glib=yes + fi + fi + + if test x"$no_glib" = x ; then + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + + GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` + GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` + glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ + glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ + glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -694,7 +714,7 @@ AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and ru LIBS="$GLIB_LIBS $LIBS" dnl dnl Now check if the installed GLIB is sufficiently new. (Also sanity -dnl checks the results of glib-config to some extent +dnl checks the results of pkg-config to some extent) dnl rm -f conf.glibtest AC_TRY_RUN([ @@ -721,17 +741,16 @@ main () (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { - printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If glib-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); - printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); - printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || @@ -759,10 +778,10 @@ main () printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the glib-config shell script is\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); - printf("*** correct copy of glib-config. (In this case, you will have to\n"); + printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } @@ -775,20 +794,20 @@ main () fi fi if test "x$no_glib" = x ; then - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) - if test "$GLIB_CONFIG" = "no" ; then - echo "*** The glib-config script installed by GLIB could not be found" - echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GLIB_CONFIG environment variable to the" - echo "*** full path to glib-config." + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" AC_TRY_LINK([ @@ -803,26 +822,25 @@ main () echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" ], + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB was incorrectly installed" - echo "*** or that you have moved GLIB since it was installed. In the latter case, you" - echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) + echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" + GLIB_GENMARSHAL="" + GOBJECT_QUERY="" + GLIB_MKENUMS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) + AC_SUBST(GLIB_GENMARSHAL) + AC_SUBST(GOBJECT_QUERY) + AC_SUBST(GLIB_MKENUMS) rm -f conf.glibtest ]) diff --git a/libjava/configure b/libjava/configure index 8eba4cb110f..fa37b78b96a 100755 --- a/libjava/configure +++ b/libjava/configure @@ -66,17 +66,9 @@ ac_help="$ac_help ac_help="$ac_help --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib" ac_help="$ac_help - --with-gtk-prefix=PFX Prefix where GTK is installed (optional)" + --disable-gtktest do not try to compile and run a test GTK+ program" ac_help="$ac_help - --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)" -ac_help="$ac_help - --disable-gtktest Do not try to compile and run a test GTK program" -ac_help="$ac_help - --with-glib-prefix=PFX Prefix where GLIB is installed (optional)" -ac_help="$ac_help - --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)" -ac_help="$ac_help - --disable-glibtest Do not try to compile and run a test GLIB program" + --disable-glibtest do not try to compile and run a test GLIB program" ac_help="$ac_help --with-libart-prefix=PFX Prefix where LIBART is installed (optional)" ac_help="$ac_help @@ -601,7 +593,7 @@ fi ORIGINAL_LD_FOR_MULTILIBS=$LD echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:605: checking whether ln -s works" >&5 +echo "configure:597: 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 @@ -654,7 +646,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:658: checking for a BSD compatible install" >&5 +echo "configure:650: 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 @@ -707,7 +699,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:711: checking whether build environment is sane" >&5 +echo "configure:703: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -764,7 +756,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:768: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:760: 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 @@ -797,12 +789,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:801: checking for Cygwin environment" >&5 +echo "configure:793: 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:809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -830,19 +822,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:834: checking for mingw32 environment" >&5 +echo "configure:826: 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:838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -969,7 +961,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:973: checking host system type" >&5 +echo "configure:965: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -990,7 +982,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:994: checking target system type" >&5 +echo "configure:986: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -1008,7 +1000,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:1012: checking build system type" >&5 +echo "configure:1004: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1037,7 +1029,7 @@ test "$host_alias" != "$target_alias" && # 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:1041: checking for $ac_word" >&5 +echo "configure:1033: 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 @@ -1067,7 +1059,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:1071: checking for $ac_word" >&5 +echo "configure:1063: 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 @@ -1118,7 +1110,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1122: checking for $ac_word" >&5 +echo "configure:1114: 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 @@ -1151,7 +1143,7 @@ fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1155: checking whether we are using GNU C" >&5 +echo "configure:1147: 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 @@ -1160,7 +1152,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1164: \"$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:1156: \"$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 @@ -1179,7 +1171,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1183: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1175: 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 @@ -1228,7 +1220,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:1232: checking for $ac_word" >&5 +echo "configure:1224: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_glibjava_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1263,7 +1255,7 @@ CXX=$glibjava_CXX test -z "$glibjava_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:1267: checking whether we are using GNU C++" >&5 +echo "configure:1259: 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 @@ -1272,7 +1264,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1276: \"$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:1268: \"$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 @@ -1287,7 +1279,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:1291: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1283: 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 @@ -1336,7 +1328,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1340: checking for working aclocal" >&5 +echo "configure:1332: 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. @@ -1349,7 +1341,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1353: checking for working autoconf" >&5 +echo "configure:1345: 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. @@ -1362,7 +1354,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1366: checking for working automake" >&5 +echo "configure:1358: 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. @@ -1375,7 +1367,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1379: checking for working autoheader" >&5 +echo "configure:1371: 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. @@ -1388,7 +1380,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1392: checking for working makeinfo" >&5 +echo "configure:1384: 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. @@ -1407,7 +1399,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:1411: checking build system type" >&5 +echo "configure:1403: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1428,7 +1420,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:1432: checking for $ac_word" >&5 +echo "configure:1424: 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 @@ -1460,7 +1452,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:1464: checking for $ac_word" >&5 +echo "configure:1456: 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 @@ -1492,7 +1484,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:1496: checking for $ac_word" >&5 +echo "configure:1488: 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 @@ -1524,7 +1516,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:1528: checking for $ac_word" >&5 +echo "configure:1520: 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 @@ -1569,7 +1561,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:1573: checking for a BSD compatible install" >&5 +echo "configure:1565: 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 @@ -1623,7 +1615,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:1627: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:1619: 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" @@ -1649,7 +1641,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1653: checking for executable suffix" >&5 +echo "configure:1645: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1659,7 +1651,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -1809,7 +1801,7 @@ ac_prog=ld if test "$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:1813: checking for ld used by GCC" >&5 +echo "configure:1805: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1839,10 +1831,10 @@ echo "configure:1813: 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:1843: checking for GNU ld" >&5 +echo "configure:1835: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1846: checking for non-GNU ld" >&5 +echo "configure:1838: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1877,7 +1869,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:1881: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1873: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1894,7 +1886,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1898: checking for $LD option to reload object files" >&5 +echo "configure:1890: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1906,7 +1898,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1910: checking for BSD-compatible nm" >&5 +echo "configure:1902: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1944,7 +1936,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1948: checking how to recognise dependant libraries" >&5 +echo "configure:1940: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2117,13 +2109,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:2121: checking for object suffix" >&5 +echo "configure:2113: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:2127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -2147,7 +2139,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:2151: checking for ${ac_tool_prefix}file" >&5 +echo "configure:2143: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2209,7 +2201,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:2213: checking for file" >&5 +echo "configure:2205: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2280,7 +2272,7 @@ esac # 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:2284: checking for $ac_word" >&5 +echo "configure:2276: 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 @@ -2312,7 +2304,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:2316: checking for $ac_word" >&5 +echo "configure:2308: 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 @@ -2347,7 +2339,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2351: checking for $ac_word" >&5 +echo "configure:2343: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2379,7 +2371,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2383: checking for $ac_word" >&5 +echo "configure:2375: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2446,8 +2438,8 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2450 "configure"' > conftest.$ac_ext - if { (eval echo configure:2451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2442 "configure"' > conftest.$ac_ext + if { (eval echo configure:2443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) @@ -2480,7 +2472,7 @@ case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:2484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:2476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *ELF-32*) HPUX_IA64_MODE="32" @@ -2496,7 +2488,7 @@ ia64-*-hpux*) x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:2500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:2492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in @@ -2540,7 +2532,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2544: checking whether the C compiler needs -belf" >&5 +echo "configure:2536: 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 @@ -2553,14 +2545,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2556: \"$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 @@ -2590,7 +2582,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 esac echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:2594: checking how to run the C++ preprocessor" >&5 +echo "configure:2586: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2603,12 +2595,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2604: \"$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 : @@ -2844,7 +2836,7 @@ INTERPRETER="$libgcj_interpreter" echo $ac_n "checking for exception model to use""... $ac_c" 1>&6 -echo "configure:2848: checking for exception model to use" >&5 +echo "configure:2840: checking for exception model to use" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2859,7 +2851,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then : else cat > conftest.$ac_ext << EOF -#line 2863 "configure" +#line 2855 "configure" struct S { ~S(); }; void bar(); void foo() @@ -2870,7 +2862,7 @@ void foo() EOF old_CXXFLAGS="$CXXFLAGS" CXXFLAGS=-S -if { (eval echo configure:2874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then enable_sjlj_exceptions=yes elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then @@ -2981,7 +2973,7 @@ case "$TARGET_ECOS" in PLATFORMH=win32.h echo $ac_n "checking whether 'ld' is at least 2.13""... $ac_c" 1>&6 -echo "configure:2985: checking whether 'ld' is at least 2.13" >&5 +echo "configure:2977: checking whether 'ld' is at least 2.13" >&5 LD_PROG=`$CC --print-prog-name=ld` LD_VERSION=`$LD_PROG --version` LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4` @@ -3027,7 +3019,7 @@ esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3031: checking how to run the C preprocessor" >&5 +echo "configure:3023: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3042,13 +3034,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:3052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3044: \"$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 : @@ -3059,13 +3051,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:3069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3061: \"$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 : @@ -3076,13 +3068,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:3086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3078: \"$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 : @@ -3107,7 +3099,7 @@ fi echo "$ac_t""$CPP" 1>&6 cat > conftest.$ac_ext < EOF @@ -3122,7 +3114,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -3137,7 +3129,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -3152,7 +3144,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -3169,7 +3161,7 @@ rm -f conftest* cat > conftest.$ac_ext < EOF @@ -3184,7 +3176,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -3244,7 +3236,7 @@ ZLIBTESTSPEC= # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:3248: checking for X" >&5 +echo "configure:3240: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -3306,12 +3298,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3307: \"$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* @@ -3380,14 +3372,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -3493,17 +3485,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:3497: checking whether -R must be followed by a space" >&5 +echo "configure:3489: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -3519,14 +3511,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -3558,7 +3550,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:3562: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:3554: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3566,7 +3558,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3573: \"$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 @@ -3599,7 +3591,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:3603: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:3595: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3607,7 +3599,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3614: \"$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 @@ -3647,12 +3639,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:3651: checking for gethostbyname" >&5 +echo "configure:3643: 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:3671: \"$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 @@ -3696,7 +3688,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:3700: checking for gethostbyname in -lnsl" >&5 +echo "configure:3692: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3704,7 +3696,7 @@ 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:3711: \"$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 @@ -3745,12 +3737,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:3749: checking for connect" >&5 +echo "configure:3741: 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:3769: \"$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 @@ -3794,7 +3786,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:3798: checking for connect in -lsocket" >&5 +echo "configure:3790: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3802,7 +3794,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3809: \"$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 @@ -3837,12 +3829,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:3841: checking for remove" >&5 +echo "configure:3833: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+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:3861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -3886,7 +3878,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:3890: checking for remove in -lposix" >&5 +echo "configure:3882: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3894,7 +3886,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3901: \"$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 @@ -3929,12 +3921,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:3933: checking for shmat" >&5 +echo "configure:3925: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+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:3953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -3978,7 +3970,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:3982: checking for shmat in -lipc" >&5 +echo "configure:3974: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3986,7 +3978,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $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 @@ -4030,7 +4022,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:4034: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:4026: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4038,7 +4030,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4045: \"$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 @@ -4147,7 +4139,7 @@ fi libsubdir=.libs echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6 -echo "configure:4151: checking for garbage collector to use" >&5 +echo "configure:4143: 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" @@ -4200,7 +4192,7 @@ esac echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6 -echo "configure:4204: checking for thread model used by GCC" >&5 +echo "configure:4196: checking for thread model used by GCC" >&5 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` echo "$ac_t""$THREADS" 1>&6 @@ -4409,12 +4401,12 @@ else for ac_func in strerror ioctl select fstat open fsync sleep opendir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4413: checking for $ac_func" >&5 +echo "configure:4405: 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:4433: \"$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 @@ -4464,12 +4456,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:4468: checking for $ac_func" >&5 +echo "configure:4460: 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:4488: \"$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 @@ -4519,12 +4511,12 @@ done for ac_func in access stat mkdir rename rmdir unlink realpath utime chmod do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4523: checking for $ac_func" >&5 +echo "configure:4515: 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:4543: \"$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 @@ -4574,12 +4566,12 @@ done for ac_func in nl_langinfo setlocale do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4578: checking for $ac_func" >&5 +echo "configure:4570: 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:4598: \"$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 @@ -4629,12 +4621,12 @@ done for ac_func in inet_aton inet_addr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4633: checking for $ac_func" >&5 +echo "configure:4625: 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:4653: \"$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 @@ -4684,12 +4676,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:4688: checking for $ac_func" >&5 +echo "configure:4680: 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:4708: \"$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 @@ -4739,12 +4731,12 @@ done for ac_func in fork execvp pipe sigaction ftruncate do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4743: checking for $ac_func" >&5 +echo "configure:4735: 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:4763: \"$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 @@ -4795,17 +4787,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4799: checking for $ac_hdr" >&5 +echo "configure:4791: 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:4809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4801: \"$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* @@ -4832,12 +4824,12 @@ fi done echo $ac_n "checking for backtrace""... $ac_c" 1>&6 -echo "configure:4836: checking for backtrace" >&5 +echo "configure:4828: checking for backtrace" >&5 if eval "test \"`echo '$''{'ac_cv_func_backtrace'+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:4856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_backtrace=yes" else @@ -4904,7 +4896,7 @@ fi echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6 -echo "configure:4908: checking for dladdr in -ldl" >&5 +echo "configure:4900: 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 @@ -4912,7 +4904,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:4919: \"$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 @@ -4953,7 +4945,7 @@ do ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_file""... $ac_c" 1>&6 -echo "configure:4957: checking for $ac_file" >&5 +echo "configure:4949: 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 @@ -5011,7 +5003,7 @@ fi echo $ac_n "checking for iconv""... $ac_c" 1>&6 -echo "configure:5015: checking for iconv" >&5 +echo "configure:5007: checking for iconv" >&5 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5019,7 +5011,7 @@ else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat > conftest.$ac_ext < #include @@ -5029,7 +5021,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_func_iconv=yes else @@ -5041,7 +5033,7 @@ rm -f conftest* am_save_LIBS="$LIBS" LIBS="$LIBS $am_cv_libiconv_ldpath -liconv" cat > conftest.$ac_ext < #include @@ -5051,7 +5043,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:5055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_lib_iconv=yes am_cv_func_iconv=yes @@ -5072,13 +5064,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6 EOF echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 -echo "configure:5076: checking for iconv declaration" >&5 +echo "configure:5068: checking for iconv declaration" >&5 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5097,7 +5089,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_proto_iconv_arg1="" else @@ -5126,19 +5118,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:5130: checking for LC_MESSAGES" >&5 +echo "configure:5122: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:5142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -5159,12 +5151,12 @@ EOF fi fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:5163: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:5155: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5172,7 +5164,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:5176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -5193,12 +5185,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:5197: checking for tm_zone in struct tm" >&5 +echo "configure:5189: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -5206,7 +5198,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:5210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -5226,12 +5218,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:5230: checking for tzname" >&5 +echo "configure:5222: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -5241,7 +5233,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:5245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -5266,12 +5258,12 @@ fi for ac_func in gethostbyname_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5270: checking for $ac_func" >&5 +echo "configure:5262: 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:5290: \"$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 @@ -5321,7 +5313,7 @@ EOF # We look for the one that returns `int'. # Hopefully this check is robust enough. cat > conftest.$ac_ext < EOF @@ -5341,7 +5333,7 @@ rm -f conftest* *" -D_REENTRANT "*) ;; *) echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6 -echo "configure:5345: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5 +echo "configure:5337: 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 @@ -5354,14 +5346,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:5365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_gethostbyname_r_needs_reentrant=no else @@ -5371,14 +5363,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:5382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_gethostbyname_r_needs_reentrant=yes else @@ -5413,12 +5405,12 @@ EOF esac echo $ac_n "checking for struct hostent_data""... $ac_c" 1>&6 -echo "configure:5417: checking for struct hostent_data" >&5 +echo "configure:5409: 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:5425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_struct_hostent_data=yes else @@ -5461,7 +5453,7 @@ done # to exist where expected. (The root issue: AC_CHECK_FUNCS assumes C # linkage check is enough, yet C++ code requires proper prototypes.) cat > conftest.$ac_ext < EOF @@ -5472,12 +5464,12 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | for ac_func in gethostbyaddr_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5476: checking for $ac_func" >&5 +echo "configure:5468: 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:5496: \"$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 @@ -5527,7 +5519,7 @@ EOF # We look for the one that returns `int'. # Hopefully this check is robust enough. cat > conftest.$ac_ext < EOF @@ -5554,12 +5546,12 @@ rm -f conftest* for ac_func in gethostname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5558: checking for $ac_func" >&5 +echo "configure:5550: 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:5578: \"$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 @@ -5606,7 +5598,7 @@ EOF EOF cat > conftest.$ac_ext < EOF @@ -5637,12 +5629,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:5641: checking for $ac_func" >&5 +echo "configure:5633: 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:5661: \"$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 @@ -5695,12 +5687,12 @@ done for ac_func in sched_yield do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5699: checking for $ac_func" >&5 +echo "configure:5691: 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:5719: \"$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 @@ -5745,7 +5737,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6 -echo "configure:5749: checking for sched_yield in -lrt" >&5 +echo "configure:5741: 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 @@ -5753,7 +5745,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:5760: \"$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 @@ -5790,7 +5782,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6 -echo "configure:5794: checking for sched_yield in -lposix4" >&5 +echo "configure:5786: 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 @@ -5798,7 +5790,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:5805: \"$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 @@ -5845,7 +5837,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() { @@ -5854,7 +5846,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define PTHREAD_MUTEX_HAVE_M_COUNT 1 @@ -5866,7 +5858,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { @@ -5875,7 +5867,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define PTHREAD_MUTEX_HAVE___M_COUNT 1 @@ -5895,12 +5887,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:5899: checking for $ac_func" >&5 +echo "configure:5891: 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:5919: \"$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 @@ -5954,12 +5946,12 @@ done for ac_func in memmove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5958: checking for $ac_func" >&5 +echo "configure:5950: 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:5978: \"$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 @@ -6012,12 +6004,12 @@ done for ac_func in memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6016: checking for $ac_func" >&5 +echo "configure:6008: 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:6036: \"$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 @@ -6069,7 +6061,7 @@ done fi echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:6073: checking for dlopen in -ldl" >&5 +echo "configure:6065: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6077,7 +6069,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:6084: \"$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 @@ -6133,7 +6125,7 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for socket libraries""... $ac_c" 1>&6 -echo "configure:6137: checking for socket libraries" >&5 +echo "configure:6129: 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 @@ -6141,12 +6133,12 @@ else gcj_checkBoth=0 unset ac_cv_func_connect echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:6145: checking for connect" >&5 +echo "configure:6137: 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:6165: \"$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 @@ -6192,7 +6184,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:6196: checking for main in -lsocket" >&5 +echo "configure:6188: 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 @@ -6200,14 +6192,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:6203: \"$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 @@ -6234,12 +6226,12 @@ fi LIBS="$LIBS -lsocket -lnsl" unset ac_cv_func_accept echo $ac_n "checking for accept""... $ac_c" 1>&6 -echo "configure:6238: checking for accept" >&5 +echo "configure:6230: 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:6258: \"$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 @@ -6289,12 +6281,12 @@ fi gcj_oldLibs=$LIBS LIBS="$LIBS $gcj_cv_lib_sockets" echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:6293: checking for gethostbyname" >&5 +echo "configure:6285: 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:6313: \"$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 @@ -6335,7 +6327,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:6339: checking for main in -lnsl" >&5 +echo "configure:6331: 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 @@ -6343,14 +6335,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:6346: \"$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 @@ -6382,7 +6374,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:6386: checking for deflate in -lz" >&5 +echo "configure:6378: 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 @@ -6390,7 +6382,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:6397: \"$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 @@ -6426,23 +6418,7 @@ fi # Test for Gtk stuff, if asked for. if test "$use_gtk_awt" = yes; then - # Check whether --with-gtk-prefix or --without-gtk-prefix was given. -if test "${with_gtk_prefix+set}" = set; then - withval="$with_gtk_prefix" - gtk_config_prefix="$withval" -else - gtk_config_prefix="" -fi - -# Check whether --with-gtk-exec-prefix or --without-gtk-exec-prefix was given. -if test "${with_gtk_exec_prefix+set}" = set; then - withval="$with_gtk_exec_prefix" - gtk_config_exec_prefix="$withval" -else - gtk_config_exec_prefix="" -fi - -# Check whether --enable-gtktest or --disable-gtktest was given. + # Check whether --enable-gtktest or --disable-gtktest was given. if test "${enable_gtktest+set}" = set; then enableval="$enable_gtktest" : @@ -6451,41 +6427,31 @@ else fi + pkg_config_args=gtk+-2.0 for module in . do case "$module" in gthread) - gtk_config_args="$gtk_config_args gthread" + pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done - if test x$gtk_config_exec_prefix != x ; then - gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" - if test x${GTK_CONFIG+set} != xset ; then - GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config - fi - fi - if test x$gtk_config_prefix != x ; then - gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" - if test x${GTK_CONFIG+set} != xset ; then - GTK_CONFIG=$gtk_config_prefix/bin/gtk-config - fi - fi + no_gtk="" - # Extract the first word of "gtk-config", so it can be a program name with args. -set dummy gtk-config; ac_word=$2 + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6480: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then +echo "configure:6446: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$GTK_CONFIG" in + case "$PKG_CONFIG" in /*) - ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path. + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; ?:/*) - ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a dos path. + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" @@ -6493,36 +6459,61 @@ else for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_path_GTK_CONFIG="$ac_dir/$ac_word" + ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no" + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi -GTK_CONFIG="$ac_cv_path_GTK_CONFIG" -if test -n "$GTK_CONFIG"; then - echo "$ac_t""$GTK_CONFIG" 1>&6 +PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +if test -n "$PKG_CONFIG"; then + echo "$ac_t""$PKG_CONFIG" 1>&6 else echo "$ac_t""no" 1>&6 fi - min_gtk_version=1.2.4 - echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:6515: checking for GTK - version >= $min_gtk_version" >&5 - no_gtk="" - if test "$GTK_CONFIG" = "no" ; then - no_gtk=yes + + if test x$PKG_CONFIG != xno ; then + if pkg-config --atleast-pkgconfig-version 0.7 ; then + : + else + echo *** pkg-config too old; version 0.7 or better required. + no_gtk=yes + PKG_CONFIG=no + fi else - GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` - GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` - gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + no_gtk=yes + fi + + min_gtk_version=2.0.0 + echo $ac_n "checking for GTK+ - version >= $min_gtk_version""... $ac_c" 1>&6 +echo "configure:6494: checking for GTK+ - version >= $min_gtk_version" >&5 + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" + enable_gtktest=no + fi + + if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then + : + else + no_gtk=yes + fi + fi + + if test x"$no_gtk" = x ; then + GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` + GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` + gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -6534,7 +6525,7 @@ echo "configure:6515: checking for GTK - version >= $min_gtk_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -6560,19 +6551,17 @@ main () (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { - printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); - printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); - printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); - printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); } -#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) @@ -6582,7 +6571,6 @@ main () printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } -#endif /* defined (GTK_MAJOR_VERSION) ... */ else { if ((gtk_major_version > major) || @@ -6600,10 +6588,10 @@ main () printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); - printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } @@ -6612,7 +6600,7 @@ main () } EOF -if { (eval echo configure:6616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -6629,24 +6617,24 @@ fi fi fi if test "x$no_gtk" = x ; then - echo "$ac_t""yes" 1>&6 + echo "$ac_t""yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" 1>&6 : else echo "$ac_t""no" 1>&6 - if test "$GTK_CONFIG" = "no" ; then - echo "*** The gtk-config script installed by GTK could not be found" - echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GTK_CONFIG environment variable to the" - echo "*** full path to gtk-config." + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else - echo "*** Could not run GTK test program, checking why..." + echo "*** Could not run GTK+ test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat > conftest.$ac_ext < @@ -6656,30 +6644,23 @@ int main() { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } EOF -if { (eval echo configure:6660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GTK or finding the wrong" - echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** that the run-time linker is not finding GTK+ or finding the wrong" + echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GTK was incorrectly installed" - echo "*** or that you have moved GTK since it was installed. In the latter case, you" - echo "*** may want to edit the gtk-config script: $GTK_CONFIG" + echo "*** exact error that occured. This usually means GTK+ is incorrectly installed." fi rm -f conftest* CFLAGS="$ac_save_CFLAGS" @@ -6694,23 +6675,7 @@ rm -f conftest* rm -f conf.gtktest - # Check whether --with-glib-prefix or --without-glib-prefix was given. -if test "${with_glib_prefix+set}" = set; then - withval="$with_glib_prefix" - glib_config_prefix="$withval" -else - glib_config_prefix="" -fi - -# Check whether --with-glib-exec-prefix or --without-glib-exec-prefix was given. -if test "${with_glib_exec_prefix+set}" = set; then - withval="$with_glib_exec_prefix" - glib_config_exec_prefix="$withval" -else - glib_config_exec_prefix="" -fi - -# Check whether --enable-glibtest or --disable-glibtest was given. + # Check whether --enable-glibtest or --disable-glibtest was given. if test "${enable_glibtest+set}" = set; then enableval="$enable_glibtest" : @@ -6719,44 +6684,35 @@ else fi - if test x$glib_config_exec_prefix != x ; then - glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config - fi - fi - if test x$glib_config_prefix != x ; then - glib_config_args="$glib_config_args --prefix=$glib_config_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_prefix/bin/glib-config - fi - fi - + pkg_config_args=glib-2.0 for module in . gthread do case "$module" in gmodule) - glib_config_args="$glib_config_args gmodule" + pkg_config_args="$pkg_config_args gmodule-2.0" + ;; + gobject) + pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) - glib_config_args="$glib_config_args gthread" + pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done - # Extract the first word of "glib-config", so it can be a program name with args. -set dummy glib-config; ac_word=$2 + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6751: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then +echo "configure:6707: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$GLIB_CONFIG" in + case "$PKG_CONFIG" in /*) - ac_cv_path_GLIB_CONFIG="$GLIB_CONFIG" # Let the user override the test with a path. + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; ?:/*) - ac_cv_path_GLIB_CONFIG="$GLIB_CONFIG" # Let the user override the test with a dos path. + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" @@ -6764,36 +6720,67 @@ else for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_path_GLIB_CONFIG="$ac_dir/$ac_word" + ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_GLIB_CONFIG" && ac_cv_path_GLIB_CONFIG="no" + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi -GLIB_CONFIG="$ac_cv_path_GLIB_CONFIG" -if test -n "$GLIB_CONFIG"; then - echo "$ac_t""$GLIB_CONFIG" 1>&6 +PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +if test -n "$PKG_CONFIG"; then + echo "$ac_t""$PKG_CONFIG" 1>&6 else echo "$ac_t""no" 1>&6 fi - min_glib_version=1.2.4 - echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6 -echo "configure:6786: checking for GLIB - version >= $min_glib_version" >&5 + no_glib="" - if test "$GLIB_CONFIG" = "no" ; then - no_glib=yes + + if test x$PKG_CONFIG != xno ; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then + : + else + echo *** pkg-config too old; version 0.7 or better required. + no_glib=yes + PKG_CONFIG=no + fi else - GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` - GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` - glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ + no_glib=yes + fi + + min_glib_version=2.0.0 + echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6 +echo "configure:6757: checking for GLIB - version >= $min_glib_version" >&5 + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" + enable_glibtest=no + fi + + if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then + : + else + no_glib=yes + fi + fi + + if test x"$no_glib" = x ; then + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + + GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` + GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` + glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ + glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ + glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -6805,7 +6792,7 @@ echo "configure:6786: checking for GLIB - version >= $min_glib_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -6831,17 +6818,16 @@ main () (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { - printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If glib-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); - printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); - printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || @@ -6869,10 +6855,10 @@ main () printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the glib-config shell script is\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); - printf("*** correct copy of glib-config. (In this case, you will have to\n"); + printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } @@ -6881,7 +6867,7 @@ main () } EOF -if { (eval echo configure:6885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -6898,24 +6884,24 @@ fi fi fi if test "x$no_glib" = x ; then - echo "$ac_t""yes" 1>&6 + echo "$ac_t""yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" 1>&6 : else echo "$ac_t""no" 1>&6 - if test "$GLIB_CONFIG" = "no" ; then - echo "*** The glib-config script installed by GLIB could not be found" - echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GLIB_CONFIG environment variable to the" - echo "*** full path to glib-config." + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" cat > conftest.$ac_ext < @@ -6925,7 +6911,7 @@ int main() { return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } EOF -if { (eval echo configure:6929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" @@ -6935,20 +6921,13 @@ if { (eval echo configure:6929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && t echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB was incorrectly installed" - echo "*** or that you have moved GLIB since it was installed. In the latter case, you" - echo "*** may want to edit the glib-config script: $GLIB_CONFIG" + echo "*** exact error that occured. This usually means GLIB is incorrectly installed." fi rm -f conftest* CFLAGS="$ac_save_CFLAGS" @@ -6957,10 +6936,16 @@ rm -f conftest* fi GLIB_CFLAGS="" GLIB_LIBS="" + GLIB_GENMARSHAL="" + GOBJECT_QUERY="" + GLIB_MKENUMS="" exit 1 fi + + + rm -f conf.glibtest enable_libarttest=no @@ -7005,7 +6990,7 @@ fi # Extract the first word of "libart-config", so it can be a program name with args. set dummy libart-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7009: checking for $ac_word" >&5 +echo "configure:6994: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LIBART_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7040,7 +7025,7 @@ fi min_libart_version=2.1.0 echo $ac_n "checking for LIBART - version >= $min_libart_version""... $ac_c" 1>&6 -echo "configure:7044: checking for LIBART - version >= $min_libart_version" >&5 +echo "configure:7029: checking for LIBART - version >= $min_libart_version" >&5 no_libart="" if test "$LIBART_CONFIG" = "no" ; then no_libart=yes @@ -7064,7 +7049,7 @@ echo "configure:7044: checking for LIBART - version >= $min_libart_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -7122,7 +7107,7 @@ int main () EOF -if { (eval echo configure:7126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -7156,7 +7141,7 @@ fi CFLAGS="$CFLAGS $LIBART_CFLAGS" LIBS="$LIBS $LIBART_LIBS" cat > conftest.$ac_ext < @@ -7166,7 +7151,7 @@ int main() { return 0; ; return 0; } EOF -if { (eval echo configure:7170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding LIBART or finding the wrong" @@ -7205,7 +7190,7 @@ rm -f conftest* # requires -ldl. if test "$GC" = boehm; then echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6 -echo "configure:7209: checking for main in -ldl" >&5 +echo "configure:7194: 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 @@ -7213,14 +7198,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:7209: \"$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 @@ -7287,7 +7272,7 @@ fi # Extract the first word of "${ac_tool_prefix}gcj", so it can be a program name with args. set dummy ${ac_tool_prefix}gcj; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7291: checking for $ac_word" >&5 +echo "configure:7276: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7319,7 +7304,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "gcj", so it can be a program name with args. set dummy gcj; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7323: checking for $ac_word" >&5 +echo "configure:7308: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7381,13 +7366,13 @@ exec 5>>./config.log CPPFLAGS=$GCJ_SAVE_CPPFLAGS echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:7385: checking size of void *" >&5 +echo "configure:7370: 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 for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -7397,7 +7382,7 @@ int main() { switch (0) case 0: case (sizeof (void *) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:7401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_void_p=$ac_size else @@ -7507,18 +7492,18 @@ EOF echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6 -echo "configure:7511: checking for g++ -ffloat-store bug" >&5 +echo "configure:7496: 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:7522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""no" 1>&6 else @@ -7538,17 +7523,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:7542: checking for $ac_hdr" >&5 +echo "configure:7527: 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:7552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7537: \"$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* @@ -7578,17 +7563,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:7582: checking for $ac_hdr" >&5 +echo "configure:7567: 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:7592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7577: \"$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* @@ -7618,17 +7603,17 @@ for ac_hdr in inttypes.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7622: checking for $ac_hdr" >&5 +echo "configure:7607: 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:7632: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7617: \"$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* @@ -7664,12 +7649,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:7668: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:7653: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7685,7 +7670,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:7689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -7707,12 +7692,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:7711: checking for ANSI C header files" >&5 +echo "configure:7696: 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 @@ -7720,7 +7705,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7709: \"$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* @@ -7737,7 +7722,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 @@ -7755,7 +7740,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 @@ -7776,7 +7761,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -7787,7 +7772,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:7791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -7811,12 +7796,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:7815: checking for ssize_t" >&5 +echo "configure:7800: 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 @@ -7845,9 +7830,9 @@ fi echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6 -echo "configure:7849: checking for in_addr_t" >&5 +echo "configure:7834: checking for in_addr_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -7861,7 +7846,7 @@ int main() { in_addr_t foo; ; return 0; } EOF -if { (eval echo configure:7865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_IN_ADDR_T 1 @@ -7877,16 +7862,16 @@ fi rm -f conftest* echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6 -echo "configure:7881: checking whether struct ip_mreq is in netinet/in.h" >&5 +echo "configure:7866: 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:7890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_STRUCT_IP_MREQ 1 @@ -7902,16 +7887,16 @@ fi rm -f conftest* echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6 -echo "configure:7906: checking whether struct ipv6_mreq is in netinet/in.h" >&5 +echo "configure:7891: checking whether struct ipv6_mreq is in netinet/in.h" >&5 cat > conftest.$ac_ext < int main() { struct ipv6_mreq mreq6; ; return 0; } EOF -if { (eval echo configure:7915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_STRUCT_IPV6_MREQ 1 @@ -7927,16 +7912,16 @@ fi rm -f conftest* echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6 -echo "configure:7931: checking whether struct sockaddr_in6 is in netinet/in.h" >&5 +echo "configure:7916: 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:7940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_INET6 1 @@ -7952,9 +7937,9 @@ fi rm -f conftest* echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6 -echo "configure:7956: checking for socklen_t in sys/socket.h" >&5 +echo "configure:7941: checking for socklen_t in sys/socket.h" >&5 cat > conftest.$ac_ext < @@ -7963,7 +7948,7 @@ int main() { socklen_t x = 5; ; return 0; } EOF -if { (eval echo configure:7967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_SOCKLEN_T 1 @@ -7979,16 +7964,16 @@ fi rm -f conftest* echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6 -echo "configure:7983: checking for tm_gmtoff in struct tm" >&5 +echo "configure:7968: 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:7992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define STRUCT_TM_HAS_GMTOFF 1 @@ -8001,16 +7986,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:8005: checking for global timezone variable" >&5 +echo "configure:7990: checking for global timezone variable" >&5 cat > conftest.$ac_ext < int main() { void i(){long z2 = 2*timezone;} ; return 0; } EOF -if { (eval echo configure:8014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_TIMEZONE 1 @@ -8023,16 +8008,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:8027: checking for global _timezone variable" >&5 +echo "configure:8012: checking for global _timezone variable" >&5 cat > conftest.$ac_ext < int main() { long z2 = _timezone; ; return 0; } EOF -if { (eval echo configure:8036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_UNDERSCORE_TIMEZONE 1 @@ -8054,19 +8039,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:8058: checking for working alloca.h" >&5 +echo "configure:8043: 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:8070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8055: \"$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 @@ -8087,12 +8072,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:8091: checking for alloca" >&5 +echo "configure:8076: 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:8109: \"$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 @@ -8152,12 +8137,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:8156: checking whether alloca needs Cray hooks" >&5 +echo "configure:8141: 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:8186: checking for $ac_func" >&5 +echo "configure:8171: 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:8199: \"$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 @@ -8237,7 +8222,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8241: checking stack direction for C alloca" >&5 +echo "configure:8226: 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 @@ -8245,7 +8230,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:8253: \"$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 @@ -8285,21 +8270,21 @@ EOF fi -for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h +for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8293: checking for $ac_hdr" >&5 +echo "configure:8278: 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:8303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8288: \"$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* @@ -8328,12 +8313,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8332: checking for $ac_func" >&5 +echo "configure:8317: 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:8345: \"$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 @@ -8381,7 +8366,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:8385: checking for working mmap" >&5 +echo "configure:8370: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8389,7 +8374,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include -#if HAVE_SYS_TYPES_H -# include -#endif - -#if HAVE_STDLIB_H -# include -#endif - -#if HAVE_SYS_STAT_H -# include -#endif - -#if HAVE_UNISTD_H -# include -#endif - /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include +# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -8542,7 +8514,7 @@ main() } EOF -if { (eval echo configure:8546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -8570,7 +8542,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:8574: checking for $ac_word" >&5 +echo "configure:8546: 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 @@ -8899,12 +8871,14 @@ s%@USING_GCC_FALSE@%$USING_GCC_FALSE%g s%@tool_include_dir@%$tool_include_dir%g s%@gcc_version@%$gcc_version%g s%@LIBICONV@%$LIBICONV%g -s%@GTK_CONFIG@%$GTK_CONFIG%g +s%@PKG_CONFIG@%$PKG_CONFIG%g s%@GTK_CFLAGS@%$GTK_CFLAGS%g s%@GTK_LIBS@%$GTK_LIBS%g -s%@GLIB_CONFIG@%$GLIB_CONFIG%g s%@GLIB_CFLAGS@%$GLIB_CFLAGS%g s%@GLIB_LIBS@%$GLIB_LIBS%g +s%@GLIB_GENMARSHAL@%$GLIB_GENMARSHAL%g +s%@GOBJECT_QUERY@%$GOBJECT_QUERY%g +s%@GLIB_MKENUMS@%$GLIB_MKENUMS%g s%@LIBART_CONFIG@%$LIBART_CONFIG%g s%@LIBART_CFLAGS@%$LIBART_CFLAGS%g s%@LIBART_LIBS@%$LIBART_LIBS%g diff --git a/libjava/configure.in b/libjava/configure.in index dcdf4c16872..f2ba05b5481 100644 --- a/libjava/configure.in +++ b/libjava/configure.in @@ -785,8 +785,8 @@ else # Test for Gtk stuff, if asked for. if test "$use_gtk_awt" = yes; then - AM_PATH_GTK(1.2.4,,exit 1) - AM_PATH_GLIB(1.2.4,,exit 1,gthread) + AM_PATH_GTK_2_0(2.0.0,,exit 1) + AM_PATH_GLIB_2_0(2.0.0,,exit 1,gthread) dnl XXX Fix me when libart.m4 has the compile test fixed! enable_libarttest=no AM_PATH_LIBART(2.1.0,,exit 1) diff --git a/libjava/gcj/Makefile.in b/libjava/gcj/Makefile.in index 3c8dd1b7fa8..fa140875acd 100644 --- a/libjava/gcj/Makefile.in +++ b/libjava/gcj/Makefile.in @@ -87,10 +87,11 @@ GCOBJS = @GCOBJS@ GCSPEC = @GCSPEC@ GCTESTSPEC = @GCTESTSPEC@ GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GTK_CFLAGS = @GTK_CFLAGS@ -GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ HASH_SYNC_SPEC = @HASH_SYNC_SPEC@ IEEESPEC = @IEEESPEC@ @@ -117,6 +118,7 @@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ PLATFORMOBJS = @PLATFORMOBJS@ RANLIB = @RANLIB@ STRIP = @STRIP@ diff --git a/libjava/glib.m4 b/libjava/glib-2.0.m4 similarity index 58% rename from libjava/glib.m4 rename to libjava/glib-2.0.m4 index b8094bbfe05..28ccef4a5f6 100644 --- a/libjava/glib.m4 +++ b/libjava/glib-2.0.m4 @@ -1,60 +1,78 @@ # Configure paths for GLIB -# Owen Taylor 97-11-3 +# Owen Taylor 1997-2001 -dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or -dnl gthread is specified in MODULES, pass to glib-config +dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or +dnl gthread is specified in MODULES, pass to pkg-config dnl -AC_DEFUN(AM_PATH_GLIB, +AC_DEFUN(AM_PATH_GLIB_2_0, [dnl -dnl Get the cflags and libraries from the glib-config script +dnl Get the cflags and libraries from pkg-config dnl -AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], - glib_config_prefix="$withval", glib_config_prefix="") -AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], - glib_config_exec_prefix="$withval", glib_config_exec_prefix="") -AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], +AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], , enable_glibtest=yes) - if test x$glib_config_exec_prefix != x ; then - glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config - fi - fi - if test x$glib_config_prefix != x ; then - glib_config_args="$glib_config_args --prefix=$glib_config_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_prefix/bin/glib-config - fi - fi - + pkg_config_args=glib-2.0 for module in . $4 do case "$module" in gmodule) - glib_config_args="$glib_config_args gmodule" + pkg_config_args="$pkg_config_args gmodule-2.0" + ;; + gobject) + pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) - glib_config_args="$glib_config_args gthread" + pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done - AC_PATH_PROG(GLIB_CONFIG, glib-config, no) - min_glib_version=ifelse([$1], ,0.99.7,$1) - AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + no_glib="" - if test "$GLIB_CONFIG" = "no" ; then - no_glib=yes + + if test x$PKG_CONFIG != xno ; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then + : + else + echo *** pkg-config too old; version 0.7 or better required. + no_glib=yes + PKG_CONFIG=no + fi else - GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` - GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` - glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ + no_glib=yes + fi + + min_glib_version=ifelse([$1], ,2.0.0,$1) + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" + enable_glibtest=no + fi + + if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then + : + else + no_glib=yes + fi + fi + + if test x"$no_glib" = x ; then + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + + GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` + GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` + glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ + glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ + glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -63,7 +81,7 @@ AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and ru LIBS="$GLIB_LIBS $LIBS" dnl dnl Now check if the installed GLIB is sufficiently new. (Also sanity -dnl checks the results of glib-config to some extent +dnl checks the results of pkg-config to some extent) dnl rm -f conf.glibtest AC_TRY_RUN([ @@ -90,17 +108,16 @@ main () (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { - printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If glib-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); - printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); - printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || @@ -128,10 +145,10 @@ main () printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the glib-config shell script is\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); - printf("*** correct copy of glib-config. (In this case, you will have to\n"); + printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } @@ -144,20 +161,20 @@ main () fi fi if test "x$no_glib" = x ; then - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) - if test "$GLIB_CONFIG" = "no" ; then - echo "*** The glib-config script installed by GLIB could not be found" - echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GLIB_CONFIG environment variable to the" - echo "*** full path to glib-config." + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" AC_TRY_LINK([ @@ -172,25 +189,24 @@ main () echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" ], + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB was incorrectly installed" - echo "*** or that you have moved GLIB since it was installed. In the latter case, you" - echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) + echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" + GLIB_GENMARSHAL="" + GOBJECT_QUERY="" + GLIB_MKENUMS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) + AC_SUBST(GLIB_GENMARSHAL) + AC_SUBST(GOBJECT_QUERY) + AC_SUBST(GLIB_MKENUMS) rm -f conf.glibtest ]) diff --git a/libjava/gtk.m4 b/libjava/gtk-2.0.m4 similarity index 55% rename from libjava/gtk.m4 rename to libjava/gtk-2.0.m4 index b8cf4024af6..a0c53ac11ff 100644 --- a/libjava/gtk.m4 +++ b/libjava/gtk-2.0.m4 @@ -1,56 +1,68 @@ # Configure paths for GTK+ -# Owen Taylor 97-11-3 +# Owen Taylor 1997-2001 -dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS +dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, +dnl pass to pkg-config dnl -AC_DEFUN(AM_PATH_GTK, +AC_DEFUN(AM_PATH_GTK_2_0, [dnl -dnl Get the cflags and libraries from the gtk-config script +dnl Get the cflags and libraries from pkg-config dnl -AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], - gtk_config_prefix="$withval", gtk_config_prefix="") -AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], - gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") -AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], +AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], , enable_gtktest=yes) + pkg_config_args=gtk+-2.0 for module in . $4 do case "$module" in gthread) - gtk_config_args="$gtk_config_args gthread" + pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done - if test x$gtk_config_exec_prefix != x ; then - gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" - if test x${GTK_CONFIG+set} != xset ; then - GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config - fi - fi - if test x$gtk_config_prefix != x ; then - gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" - if test x${GTK_CONFIG+set} != xset ; then - GTK_CONFIG=$gtk_config_prefix/bin/gtk-config - fi + no_gtk="" + + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + + if test x$PKG_CONFIG != xno ; then + if pkg-config --atleast-pkgconfig-version 0.7 ; then + : + else + echo *** pkg-config too old; version 0.7 or better required. + no_gtk=yes + PKG_CONFIG=no + fi + else + no_gtk=yes fi - AC_PATH_PROG(GTK_CONFIG, gtk-config, no) - min_gtk_version=ifelse([$1], ,0.99.7,$1) - AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) - no_gtk="" - if test "$GTK_CONFIG" = "no" ; then - no_gtk=yes - else - GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` - GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` - gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + min_gtk_version=ifelse([$1], ,2.0.0,$1) + AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" + enable_gtktest=no + fi + + if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then + : + else + no_gtk=yes + fi + fi + + if test x"$no_gtk" = x ; then + GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` + GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` + gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -58,8 +70,8 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" dnl -dnl Now check if the installed GTK is sufficiently new. (Also sanity -dnl checks the results of gtk-config to some extent +dnl Now check if the installed GTK+ is sufficiently new. (Also sanity +dnl checks the results of pkg-config to some extent) dnl rm -f conf.gtktest AC_TRY_RUN([ @@ -86,19 +98,17 @@ main () (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { - printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); - printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); - printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); - printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); } -#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) @@ -108,7 +118,6 @@ main () printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } -#endif /* defined (GTK_MAJOR_VERSION) ... */ else { if ((gtk_major_version > major) || @@ -126,10 +135,10 @@ main () printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); - printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } @@ -142,20 +151,20 @@ main () fi fi if test "x$no_gtk" = x ; then - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) - if test "$GTK_CONFIG" = "no" ; then - echo "*** The gtk-config script installed by GTK could not be found" - echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GTK_CONFIG environment variable to the" - echo "*** full path to gtk-config." + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else - echo "*** Could not run GTK test program, checking why..." + echo "*** Could not run GTK+ test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ @@ -163,23 +172,16 @@ main () #include ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GTK or finding the wrong" - echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** that the run-time linker is not finding GTK+ or finding the wrong" + echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" ], + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GTK was incorrectly installed" - echo "*** or that you have moved GTK since it was installed. In the latter case, you" - echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) + echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi diff --git a/libjava/include/Makefile.in b/libjava/include/Makefile.in index b5cb5dba9dc..1a38831cb19 100644 --- a/libjava/include/Makefile.in +++ b/libjava/include/Makefile.in @@ -87,10 +87,11 @@ GCOBJS = @GCOBJS@ GCSPEC = @GCSPEC@ GCTESTSPEC = @GCTESTSPEC@ GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GTK_CFLAGS = @GTK_CFLAGS@ -GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ HASH_SYNC_SPEC = @HASH_SYNC_SPEC@ IEEESPEC = @IEEESPEC@ @@ -117,6 +118,7 @@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ PLATFORMOBJS = @PLATFORMOBJS@ RANLIB = @RANLIB@ STRIP = @STRIP@ diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c index 41e9db6b8fa..2c574942b21 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c @@ -1,5 +1,5 @@ /* gdkgraphics.c - Copyright (C) 1999, 2003 Free Software Foundation, Inc. + Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -40,7 +40,7 @@ exception statement from your version. */ #include #include -#define GDK_STABLE_IS_PIXMAP(d) (((GdkWindowPrivate *)d)->window_type == GDK_WINDOW_PIXMAP) +#define GDK_STABLE_IS_PIXMAP(d) (GDK_IS_PIXMAP(d)) GdkPoint * translate_points (JNIEnv *env, jintArray xpoints, jintArray ypoints, diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c index e33aff046fc..e87a9c4d7f0 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c @@ -42,47 +42,43 @@ exception statement from your version. */ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create (JNIEnv *env, jobject obj) { - gpointer widget; + GtkButton *button; gdk_threads_enter (); - widget = gtk_type_new (gtk_button_get_type ()); + button = gtk_button_new(); + gtk_widget_show (GTK_WIDGET(button)); gdk_threads_leave (); - - NSA_SET_PTR (env, obj, widget); + NSA_SET_PTR (env, obj, button); } JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetFont (JNIEnv *env, jobject obj, jstring jname, jint size) { - const char *xlfd; -# define FBUFSZ 200 - char buf[FBUFSZ]; + const char *font_name; void *ptr; - GdkFont * new_font; - GtkStyle * style; - GtkWidget * button; - GtkWidget * label; + GtkWidget *button; + GtkWidget *label; + PangoFontDescription *font_desc; ptr = NSA_GET_PTR (env, obj); + button = GTK_WIDGET (ptr); - label = GTK_BIN(button)->child; + label = gtk_bin_get_child (GTK_BIN(button)); - if (label == NULL) return; - xlfd = (*env)->GetStringUTFChars (env, jname, NULL); - snprintf(buf, FBUFSZ, xlfd, size); - (*env)->ReleaseStringUTFChars (env, jname, xlfd); - gdk_threads_enter(); - new_font = gdk_font_load (buf); /* FIXME: deprecated. Replacement? */ - if (new_font == NULL) - { - /* Fail quietly for now. */ - gdk_threads_leave(); + if (!label) return; - } - style = gtk_style_copy (gtk_widget_get_style (label)); - style -> font = new_font; - gtk_widget_set_style (label, style); - /* FIXME: Documentation varies as to whether we should unref style. */ + + font_name = (*env)->GetStringUTFChars (env, jname, NULL); + + gdk_threads_enter(); + + font_desc = pango_font_description_from_string (font_name); + pango_font_description_set_size (font_desc, size); + gtk_widget_modify_font (GTK_WIDGET(label), font_desc); + pango_font_description_free (font_desc); + gdk_threads_leave(); + + (*env)->ReleaseStringUTFChars (env, jname, font_name); } diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c index 5522354e35d..6d3e06b0c4b 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c @@ -40,22 +40,6 @@ exception statement from your version. */ #include "gnu_java_awt_peer_gtk_GtkComponentPeer.h" #include -#define GTK_OBJECT_SETV(ptr, arg) \ - gdk_threads_enter (); \ - { \ - GtkArgInfo *info = NULL; \ - char *error; \ - \ - error = gtk_object_arg_get_info (GTK_OBJECT_TYPE (ptr), arg.name, &info); \ - if (error) \ - { \ - /* assume the argument is destined for the container's only child */ \ - ptr = gtk_container_children (GTK_CONTAINER (ptr))->data; \ - } \ - gtk_object_setv (GTK_OBJECT (ptr), 1, &arg); \ - } \ - gdk_threads_leave (); \ - JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose (JNIEnv *env, jobject obj) { @@ -519,8 +503,9 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_S arg.type = GTK_TYPE_STRING; arg.name = (char *) name; GTK_VALUE_STRING (arg) = (char *) value; - - GTK_OBJECT_SETV (ptr, arg); + gdk_threads_enter(); + g_object_set(ptr, name, value, NULL); + gdk_threads_leave(); (*env)->ReleaseStringUTFChars (env, jname, name); (*env)->ReleaseStringUTFChars (env, jvalue, value); @@ -540,7 +525,9 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_la arg.name = (char *) name; GTK_VALUE_BOOL (arg) = value; - GTK_OBJECT_SETV (ptr, arg); + gdk_threads_enter(); + g_object_set(ptr, name, value, NULL); + gdk_threads_leave(); (*env)->ReleaseStringUTFChars (env, jname, name); } @@ -559,7 +546,9 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_la arg.name = (char *) name; GTK_VALUE_INT (arg) = value; - GTK_OBJECT_SETV (ptr, arg); + gdk_threads_enter(); + g_object_set(ptr, name, value, NULL); + gdk_threads_leave(); (*env)->ReleaseStringUTFChars (env, jname, name); } @@ -578,7 +567,9 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_la arg.name = (char *) name; GTK_VALUE_FLOAT (arg) = value; - GTK_OBJECT_SETV (ptr, arg); + gdk_threads_enter(); + g_object_set(ptr, name, value, NULL); + gdk_threads_leave(); (*env)->ReleaseStringUTFChars (env, jname, name); } @@ -611,7 +602,9 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_O arg.name = (char *) name; GTK_VALUE_OBJECT (arg) = GTK_OBJECT (ptr2); - GTK_OBJECT_SETV (ptr1, arg); + gdk_threads_enter(); + g_object_set(ptr1, name, ptr2, NULL); + gdk_threads_leave(); (*env)->ReleaseStringUTFChars (env, jname, name); } @@ -644,6 +637,15 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks gdk_threads_enter (); gtk_widget_realize (GTK_WIDGET (ptr)); + if(GTK_IS_BUTTON(ptr)) + { + g_print("-- connecting a button --\n"); + connect_awt_hook (env, obj, 1, GTK_BUTTON(ptr)->event_window); + } + else + { connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window); + g_print("Connection object %p with window %p (but ptr is %p)\n", obj, GTK_WIDGET(ptr)->window, ptr); + } gdk_threads_leave (); } diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c index 99ca0934c3d..2573a1823c3 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c @@ -526,6 +526,7 @@ attach_jobject (GdkWindow *window, jobject *obj) | GDK_KEY_PRESS_MASK | GDK_FOCUS_CHANGE_MASK); + // g_print("storing obj %p property on window %p\n", obj, window); gdk_property_change (window, addr_atom, type_atom, @@ -538,15 +539,22 @@ attach_jobject (GdkWindow *window, jobject *obj) void connect_awt_hook (JNIEnv *env, jobject peer_obj, int nwindows, ...) { - int i; va_list ap; jobject *obj; obj = (jobject *) malloc (sizeof (jobject)); *obj = (*env)->NewGlobalRef (env, peer_obj); + //g_print("Connection obj %p\n", peer_obj); va_start (ap, nwindows); + { + int i; for (i = 0; i < nwindows; i++) - attach_jobject (va_arg (ap, GdkWindow *), obj); + { + GdkWindow* attach = (va_arg (ap, GdkWindow *)); + //g_print("attach peer obj %p and %p\n", peer_obj, attach); + attach_jobject(attach, obj); + } + } va_end (ap); } diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c index 5787ce5083e..bdf064ff8f3 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c @@ -251,33 +251,9 @@ Java_gnu_java_awt_peer_gtk_GtkListPeer_getSize list = GTK_WIDGET (CLIST_FROM_SW (ptr)); sw = GTK_SCROLLED_WINDOW (ptr); - /* - gtk_widget_size_request(GTK_WIDGET (GTK_SCROLLED_WINDOW(sw)->hscrollbar), - &myreq); - dims[1]=myreq.height+GTK_SCROLLED_WINDOW_CLASS - (GTK_OBJECT (sw)->klass)->scrollbar_spacing; - */ - - gtk_signal_emit_by_name (GTK_OBJECT (GTK_SCROLLED_WINDOW(sw)->vscrollbar), - "size_request", &myreq); - /* - - gtk_widget_size_request(GTK_WIDGET (GTK_SCROLLED_WINDOW(sw)->vscrollbar), - &myreq); - */ - - dims[0]=myreq.width+GTK_SCROLLED_WINDOW_CLASS - (GTK_OBJECT (sw)->klass)->scrollbar_spacing; - - gtk_signal_emit_by_name (GTK_OBJECT (list), "size_request", &myreq); - - // gtk_widget_size_request(GTK_WIDGET (list), &myreq); - - dims[0] += myreq.width + gdk_char_width (list->style->font, 'W'); - - dims[1] += ((rows * (gdk_char_height (list->style->font, 'W')+7)) - + (2 * (list->style->klass->ythickness))); - + gtk_widget_size_request(list, &myreq); + dims[1]=myreq.height; + dims[0]=myreq.width; gdk_threads_leave (); diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c index af14f0be8a9..cd4d7e2fe7b 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c @@ -56,6 +56,10 @@ jmethodID postItemEventID; jmethodID postListItemEventID; JNIEnv *gdk_env; +#ifdef PORTABLE_NATIVE_SYNC +JavaVM *gdk_vm; +#endif + /* * Call gtk_init. It is very important that this happen before any other * gtk calls. @@ -81,7 +85,16 @@ Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz) /* until we have JDK 1.2 JNI, assume we have a VM with threads that match what GLIB was compiled for */ - g_thread_init (NULL); +#ifdef PORTABLE_NATIVE_SYNC + (*env)->GetJavaVM( env, &gdk_vm ); + g_thread_init ( &g_thread_jni_functions ); + printf("called gthread init\n"); +#else + g_thread_init ( NULL ); +#endif + + /* From GDK 2.0 onwards we have to explicitly call gdk_threads_init */ + gdk_threads_init(); gtk_init (&argc, &argv); diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c index 9237a01b5a8..a246b372904 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c @@ -46,11 +46,15 @@ struct range_scrollbar }; static void -post_adjustment_event (GtkAdjustment *adj, struct range_scrollbar *rs) +post_adjustment_event (GtkRange *range, GtkScrollType scroll, + struct range_scrollbar *rs) { jint type; + GtkAdjustment *adj; - switch (rs->range->scroll_type) + adj = gtk_range_get_adjustment (range); + + switch (scroll) { case GTK_SCROLL_STEP_FORWARD: type = AWT_ADJUSTMENT_UNIT_INCREMENT; @@ -113,15 +117,11 @@ Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectHooks rs->range = GTK_RANGE (ptr); rs->scrollbar = (jobject *) malloc (sizeof (jobject)); *(rs->scrollbar) = (*env)->NewGlobalRef (env, obj); - gtk_signal_connect (GTK_OBJECT (GTK_RANGE (ptr)->adjustment), - "value_changed", + gtk_signal_connect (GTK_OBJECT (GTK_RANGE (ptr)), + "move_slider", GTK_SIGNAL_FUNC (post_adjustment_event), rs); - connect_awt_hook (env, obj, 4, - GTK_RANGE (ptr)->trough, - GTK_RANGE (ptr)->slider, - GTK_RANGE (ptr)->step_forw, - GTK_RANGE (ptr)->step_back); + connect_awt_hook (env, obj, 1, GTK_SCROLLBAR (ptr)->range); gdk_threads_leave (); } diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c index 27f27461518..103ddd22a9a 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c @@ -39,7 +39,7 @@ exception statement from your version. */ #include "gtkpeer.h" #include "gnu_java_awt_peer_gtk_GtkTextAreaPeer.h" -#define TEXT_FROM_SW(obj) (GTK_TEXT(GTK_SCROLLED_WINDOW (obj)->container.child)) +#define TEXT_FROM_SW(obj) (GTK_TEXT_VIEW(GTK_SCROLLED_WINDOW (obj)->container.child)) JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create (JNIEnv *env, jobject obj, jint scroll) @@ -47,7 +47,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create GtkWidget *text, *sw; gdk_threads_enter (); - text = gtk_text_new (NULL, NULL); + text = gtk_text_view_new (); gtk_widget_show (text); sw = gtk_scrolled_window_new (NULL, NULL); @@ -64,54 +64,9 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH || scroll == AWT_TEXTAREA_SCROLLBARS_VERTICAL_ONLY) ? GTK_POLICY_ALWAYS : GTK_POLICY_NEVER); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, sw); -} - - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_old_create - (JNIEnv *env, jobject obj, jobject parent_obj, - jstring contents, jint scroll) -{ - GtkWidget *text, *sw; - const char *str; - int pos=0; - void *parent; - - parent = NSA_GET_PTR (env, parent_obj); - str = (*env)->GetStringUTFChars (env, contents, NULL); - - gdk_threads_enter (); - - text = gtk_text_new (NULL, NULL); - gtk_text_set_editable (GTK_TEXT (text), TRUE); - - gtk_editable_insert_text (GTK_EDITABLE (text), str, - strlen (str), &pos); - - sw = gtk_scrolled_window_new (NULL, NULL); - gtk_container_add (GTK_CONTAINER (sw), text); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), - - /* horizontal scrollbar */ - (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH - || scroll == AWT_TEXTAREA_SCROLLBARS_HORIZONTAL_ONLY) ? - GTK_POLICY_ALWAYS : GTK_POLICY_NEVER, - - /* vertical scrollbar */ - (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH - || scroll == AWT_TEXTAREA_SCROLLBARS_VERTICAL_ONLY) ? - GTK_POLICY_ALWAYS : GTK_POLICY_NEVER); - - set_visible (text, TRUE); - set_parent (sw, GTK_CONTAINER (parent)); gdk_threads_leave (); - (*env)->ReleaseStringUTFChars (env, contents, str); - NSA_SET_PTR (env, obj, sw); } @@ -122,8 +77,8 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkTextGetSize void *ptr; jint *dims; GtkWidget *text; - GtkScrolledWindow *sw; - GtkRequisition myreq; +/* GtkScrolledWindow *sw; */ + GtkRequisition requisition; ptr = NSA_GET_PTR (env, obj); @@ -133,35 +88,11 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkTextGetSize gdk_threads_enter (); text = GTK_WIDGET (TEXT_FROM_SW (ptr)); - sw = GTK_SCROLLED_WINDOW (ptr); + /* sw = GTK_SCROLLED_WINDOW (ptr); */ - gtk_signal_emit_by_name (GTK_OBJECT (GTK_SCROLLED_WINDOW(sw)->vscrollbar), - "size_request", &myreq); - //gtk_widget_size_request(GTK_WIDGET (GTK_SCROLLED_WINDOW(sw)->hscrollbar), - // &myreq); - dims[0]=myreq.width+GTK_SCROLLED_WINDOW_CLASS - (GTK_OBJECT (sw)->klass)->scrollbar_spacing; - - gtk_signal_emit_by_name (GTK_OBJECT (GTK_SCROLLED_WINDOW(sw)->hscrollbar), - "size_request", &myreq); - //gtk_widget_size_request(GTK_WIDGET (GTK_SCROLLED_WINDOW(sw)->vscrollbar), - // &myreq); - dims[1]=myreq.height+GTK_SCROLLED_WINDOW_CLASS - (GTK_OBJECT (sw)->klass)->scrollbar_spacing; - - /* The '1' in the following assignments is from - #define TEXT_BORDER_ROOM 1 - in gtktext.c */ - - /* Gtk text seems to wrap slightly prematurely. Compensate. */ - ++cols; - ++dims[0]; - - dims[0] += ((cols * gdk_char_width (text->style->font, 'W')) - + (2 * (text->style->klass->xthickness + 1))); - /* Guess at the height. Is there a better way? */ - dims[1] += ((rows * gdk_string_height (text->style->font, "Wg")) - + (2 * (text->style->klass->ythickness + 1))); + gtk_widget_size_request(GTK_WIDGET (text), &requisition); + dims[0] = requisition.width; + dims[1] = requisition.height; gdk_threads_leave (); @@ -173,6 +104,9 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_insert (JNIEnv *env, jobject obj, jstring contents, jint position) { + GtkTextBuffer *buf; + GtkTextIter iter; + GtkWidget *text; void *ptr; const char *str; int pos=position; @@ -181,8 +115,13 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_insert str = (*env)->GetStringUTFChars (env, contents, NULL); gdk_threads_enter (); - gtk_editable_insert_text (GTK_EDITABLE (TEXT_FROM_SW (ptr)), - str, strlen (str), &pos); + + text = GTK_WIDGET (TEXT_FROM_SW (ptr)); + + buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); + gtk_text_buffer_get_iter_at_offset (buf, &iter, pos); + gtk_text_buffer_insert (buf, &iter, str, strlen (str)); + gdk_threads_leave (); (*env)->ReleaseStringUTFChars (env, contents, str); @@ -192,21 +131,29 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_replaceRange (JNIEnv *env, jobject obj, jstring contents, jint start, jint end) { + GtkWidget *text; + GtkTextBuffer *buf; + GtkTextIter iter, startIter, endIter; void *ptr; - GtkEditable *text; const char *str; - int pos = start; + int mystart = start; + int myend = end; ptr = NSA_GET_PTR (env, obj); str = (*env)->GetStringUTFChars (env, contents, NULL); gdk_threads_enter (); - text = GTK_EDITABLE (TEXT_FROM_SW (ptr)); - gtk_text_freeze (GTK_TEXT (text)); - gtk_editable_delete_text (text, start, end); - gtk_editable_insert_text (text, str, strlen (str), &pos); - gtk_text_thaw (GTK_TEXT (text)); + text = GTK_WIDGET (TEXT_FROM_SW (ptr)); + + buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); + + gtk_text_buffer_get_iter_at_offset (buf, &startIter, mystart); + gtk_text_buffer_get_iter_at_offset (buf, &endIter, myend); + gtk_text_buffer_delete (buf, &startIter, &endIter); + + gtk_text_buffer_get_iter_at_offset (buf, &iter, mystart); + gtk_text_buffer_insert(buf, &iter, str, strlen (str)); gdk_threads_leave (); (*env)->ReleaseStringUTFChars (env, contents, str); @@ -216,31 +163,25 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkSetFont (JNIEnv *env, jobject obj, jstring jname, jint size) { - const char *xlfd; -# define FBUFSZ 200 - char buf[FBUFSZ]; + const char *font_name; void *ptr; - GdkFont * new_font; - GtkStyle * style; - GtkWidget * text; + GtkWidget *text; + PangoFontDescription *font_desc; ptr = NSA_GET_PTR (env, obj); text = GTK_WIDGET (TEXT_FROM_SW (ptr)); - xlfd = (*env)->GetStringUTFChars (env, jname, NULL); - snprintf(buf, FBUFSZ, xlfd, size); - (*env)->ReleaseStringUTFChars (env, jname, xlfd); + font_name = (*env)->GetStringUTFChars (env, jname, NULL); + gdk_threads_enter(); - new_font = gdk_font_load (buf); /* FIXME: deprecated. Replacement? */ - if (new_font == NULL) - { - /* Fail quietly for now. */ - gdk_threads_leave(); - return; - } - style = gtk_style_copy (gtk_widget_get_style (text)); - style -> font = new_font; - gtk_widget_set_style (text , style); - /* FIXME: Documentation varies as to whether we should unref style. */ + + font_desc = pango_font_description_from_string (font_name); + pango_font_description_set_size (font_desc, size); + gtk_widget_modify_font (GTK_WIDGET(text), font_desc); + pango_font_description_free (font_desc); + gdk_threads_leave(); + + (*env)->ReleaseStringUTFChars (env, jname, font_name); + } diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c index 0b6db8f1840..8cdff34f11b 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c @@ -39,20 +39,47 @@ exception statement from your version. */ #include "gtkpeer.h" #include "gnu_java_awt_peer_gtk_GtkTextComponentPeer.h" -#define GET_EDITABLE(obj) (GTK_IS_EDITABLE (obj) ? GTK_EDITABLE (obj) : \ - GTK_EDITABLE (GTK_SCROLLED_WINDOW (obj)->container.child)) - JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getCaretPosition (JNIEnv *env, jobject obj) { void *ptr; int pos; + GtkEditable *editable; // type of GtkEntry (TextField) + GtkWidget *text = NULL; // type of GtkTextView (TextArea) + GtkTextBuffer *buf; + GtkTextMark *mark; + GtkTextIter iter; ptr = NSA_GET_PTR (env, obj); gdk_threads_enter (); - pos = gtk_editable_get_position (GET_EDITABLE (ptr)); + + if (GTK_IS_EDITABLE (ptr)) + { + editable = GTK_EDITABLE (ptr); + pos = gtk_editable_get_position (editable); + } + else + { + if (GTK_IS_SCROLLED_WINDOW (ptr)) + { + text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child)); + } + else if (GTK_IS_TEXT_VIEW (ptr)) + { + text = GTK_WIDGET (ptr); + } + + if (text) + { + buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); + mark = gtk_text_buffer_get_insert (buf); + gtk_text_buffer_get_iter_at_mark (buf, &iter, mark); + pos = gtk_text_iter_get_offset (&iter); + } + } + gdk_threads_leave (); return pos; @@ -63,11 +90,40 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setCaretPosition (JNIEnv *env, jobject obj, jint pos) { void *ptr; + GtkEditable *editable; // type of GtkEntry (TextField) + GtkWidget *text = NULL; // type of GtkTextView (TextArea) + GtkTextBuffer *buf; + GtkTextMark *mark; + GtkTextIter iter; ptr = NSA_GET_PTR (env, obj); gdk_threads_enter (); - gtk_editable_set_position (GET_EDITABLE (ptr), pos); + if (GTK_IS_EDITABLE (ptr)) + { + editable = GTK_EDITABLE (ptr); + gtk_editable_set_position (editable, pos); + } + else + { + if (GTK_IS_SCROLLED_WINDOW (ptr)) + { + text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child)); + } + else if (GTK_IS_TEXT_VIEW (ptr)) + { + text = GTK_WIDGET (ptr); + } + + if (text) + { + buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); + mark = gtk_text_buffer_get_insert (buf); + gtk_text_buffer_get_iter_at_mark (buf, &iter, mark); + gtk_text_iter_set_offset (&iter, pos); + } + } + gdk_threads_leave (); } @@ -77,11 +133,42 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionStart { void *ptr; int pos; + GtkEditable *editable; // type of GtkEntry (TextField) + GtkWidget *text = NULL; // type of GtkTextView (TextArea) + GtkTextBuffer *buf; + GtkTextIter start; + GtkTextIter end; + int starti, endi; ptr = NSA_GET_PTR (env, obj); gdk_threads_enter (); - pos = GET_EDITABLE (ptr)->selection_start_pos; + + if (GTK_IS_EDITABLE (ptr)) + { + editable = GTK_EDITABLE (ptr); + if (gtk_editable_get_selection_bounds (editable, &starti, &endi)) + pos = starti; + } + else + { + if (GTK_IS_SCROLLED_WINDOW (ptr)) + { + text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child)); + } + else if (GTK_IS_TEXT_VIEW (ptr)) + { + text = GTK_WIDGET (ptr); + } + + if (text) + { + buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); + if (gtk_text_buffer_get_selection_bounds(buf, &start, &end)) + pos = gtk_text_iter_get_offset (&start); + } + } + gdk_threads_leave (); return pos; @@ -93,11 +180,42 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionEnd { void *ptr; int pos; + GtkEditable *editable; // type of GtkEntry (TextField) + GtkWidget *text = NULL; // type of GtkTextView (TextArea) + GtkTextBuffer *buf; + GtkTextIter start; + GtkTextIter end; + int starti, endi; ptr = NSA_GET_PTR (env, obj); gdk_threads_enter (); - pos = GET_EDITABLE (ptr)->selection_end_pos; + + if (GTK_IS_EDITABLE (ptr)) + { + editable = GTK_EDITABLE (ptr); + if (gtk_editable_get_selection_bounds (editable, &starti, &endi)) + pos = endi; + } + else + { + if (GTK_IS_SCROLLED_WINDOW (ptr)) + { + text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child)); + } + else if (GTK_IS_TEXT_VIEW (ptr)) + { + text = GTK_WIDGET (ptr); + } + + if (text) + { + buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); + if (gtk_text_buffer_get_selection_bounds(buf, &start, &end)) + pos = gtk_text_iter_get_offset (&end); + } + } + gdk_threads_leave (); return pos; @@ -108,11 +226,44 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_select (JNIEnv *env, jobject obj, jint start, jint end) { void *ptr; + GtkEditable *editable; // type of GtkEntry (TextField) + GtkWidget *text = NULL; // type of GtkTextView (TextArea) + GtkTextBuffer *buf; + GtkTextIter iter; ptr = NSA_GET_PTR (env, obj); gdk_threads_enter (); - gtk_editable_select_region (GET_EDITABLE (ptr), start, end); + + + if (GTK_IS_EDITABLE (ptr)) + { + editable = GTK_EDITABLE (ptr); + gtk_editable_select_region (editable, start, end); + } + else + { + if (GTK_IS_SCROLLED_WINDOW (ptr)) + { + text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child)); + } + else if (GTK_IS_TEXT_VIEW (ptr)) + { + text = GTK_WIDGET (ptr); + } + + if (text) + { + buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); + gtk_text_buffer_get_iter_at_offset (buf, &iter, start); + /* quickly move both 'insert' and 'selection_bound' to the + same position */ + gtk_text_buffer_place_cursor (buf, &iter); + gtk_text_buffer_get_iter_at_offset (buf, &iter, end); + gtk_text_buffer_move_mark_by_name (buf, "selection_bound", &iter); + } + } + gdk_threads_leave (); } @@ -121,11 +272,35 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setEditable (JNIEnv *env, jobject obj, jboolean state) { void *ptr; + GtkEditable *editable; // type of GtkEntry (TextField) + GtkWidget *text = NULL; // type of GtkTextView (TextArea) ptr = NSA_GET_PTR (env, obj); gdk_threads_enter (); - gtk_editable_set_editable (GET_EDITABLE (ptr), state); + + if (GTK_IS_EDITABLE (ptr)) + { + editable = GTK_EDITABLE (ptr); + gtk_editable_set_editable (editable, state); + } + else + { + if (GTK_IS_SCROLLED_WINDOW (ptr)) + { + text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child)); + } + else if (GTK_IS_TEXT_VIEW (ptr)) + { + text = GTK_WIDGET (ptr); + } + + if (text) + { + gtk_text_view_set_editable (GTK_TEXT_VIEW (text), state); + } + } + gdk_threads_leave (); } @@ -136,11 +311,40 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getText void *ptr; char *contents; jstring jcontents; + GtkEditable *editable; // type of GtkEntry (TextField) + GtkWidget *text = NULL; // type of GtkTextView (TextArea) + GtkTextBuffer *buf; + GtkTextIter start, end; ptr = NSA_GET_PTR (env, obj); gdk_threads_enter (); - contents = gtk_editable_get_chars (GET_EDITABLE (ptr), 0, -1); + + if (GTK_IS_EDITABLE (ptr)) + { + editable = GTK_EDITABLE (ptr); + contents = gtk_editable_get_chars (editable, 0, -1); + } + else + { + if (GTK_IS_SCROLLED_WINDOW (ptr)) + { + text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child)); + } + else if (GTK_IS_TEXT_VIEW (ptr)) + { + text = GTK_WIDGET (ptr); + } + + if (text) + { + buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); + gtk_text_buffer_get_start_iter (buf, &start); + gtk_text_buffer_get_end_iter (buf, &end); + contents = gtk_text_buffer_get_text (buf, &start, &end, FALSE); + } + } + gdk_threads_leave (); jcontents = (*env)->NewStringUTF (env, contents); @@ -154,25 +358,36 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setText (JNIEnv *env, jobject obj, jstring contents) { void *ptr; - GtkEditable *text; const char *str; - int pos = 0; + GtkWidget *text = NULL; // type of GtkTextView (TextArea) + GtkTextBuffer *buf; ptr = NSA_GET_PTR (env, obj); str = (*env)->GetStringUTFChars (env, contents, NULL); gdk_threads_enter (); - text = GET_EDITABLE (ptr); + if (GTK_IS_EDITABLE (ptr)) + { + gtk_entry_set_text (GTK_ENTRY (ptr), str); + } + else + { + if (GTK_IS_SCROLLED_WINDOW (ptr)) + { + text = GTK_WIDGET (GTK_TEXT_VIEW (GTK_SCROLLED_WINDOW (ptr)->container.child)); + } + else if (GTK_IS_TEXT_VIEW (ptr)) + { + text = GTK_WIDGET (ptr); + } - if (GTK_IS_TEXT (text)) - gtk_text_freeze (GTK_TEXT (text)); - - gtk_editable_delete_text (text, 0, -1); - gtk_editable_insert_text (text, str, strlen (str), &pos); - - if (GTK_IS_TEXT (text)) - gtk_text_thaw (GTK_TEXT (text)); + if (text) + { + buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); + gtk_text_buffer_set_text (buf, str, strlen (str)); + } + } gdk_threads_leave (); diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c index 658c8639bb7..69b3e521abc 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c @@ -43,10 +43,10 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create (JNIEnv *env, jobject obj) { - gpointer widget; + GtkWidget *widget; gdk_threads_enter (); - widget = gtk_type_new (gtk_entry_get_type ()); + widget = gtk_entry_new (); gdk_threads_leave (); NSA_SET_PTR (env, obj, widget); @@ -68,36 +68,6 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_connectHooks gdk_threads_leave (); } - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_old_create - (JNIEnv *env, jobject obj, jobject parent_obj, jstring text) -{ - GtkWidget *entry; - const char *str; - void *parent; - - parent = NSA_GET_PTR (env, parent_obj); - - str = (*env)->GetStringUTFChars (env, text, NULL); - gdk_threads_enter (); - - entry = gtk_entry_new (); - gtk_entry_set_text (GTK_ENTRY (entry), str); - - set_parent (entry, GTK_CONTAINER (parent)); - - gtk_widget_realize (entry); - connect_awt_hook (env, obj, 2, - entry->window, GTK_ENTRY (entry)->text_area); - - NSA_SET_PTR (env, obj, entry); - - gdk_threads_leave (); - (*env)->ReleaseStringUTFChars (env, text, str); -} - - JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkEntryGetSize (JNIEnv *env, jobject obj, jint cols, jintArray jdims) @@ -105,19 +75,16 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkEntryGetSize void *ptr; jint *dims; GtkRequisition myreq; - GtkEntry *entry; + GtkWidget *entry; ptr = NSA_GET_PTR (env, obj); dims = (*env)->GetIntArrayElements (env, jdims, 0); gdk_threads_enter (); - entry = GTK_ENTRY (ptr); - - gtk_signal_emit_by_name (GTK_OBJECT (entry), "size_request", &myreq); - dims[0]=myreq.width-150 + (cols * - gdk_char_width (GTK_WIDGET (entry)->style->font, - 'W')); + entry = GTK_WIDGET (ptr); + gtk_widget_size_request(entry, &myreq); + dims[0]=myreq.width; dims[1]=myreq.height; gdk_threads_leave (); @@ -153,31 +120,24 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkSetFont (JNIEnv *env, jobject obj, jstring jname, jint size) { - const char *xlfd; -# define FBUFSZ 200 - char buf[FBUFSZ]; + const char *font_name; void *ptr; - GdkFont * new_font; - GtkStyle * style; - GtkWidget * text; + GtkWidget *entry; + PangoFontDescription *font_desc; ptr = NSA_GET_PTR (env, obj); - text = GTK_WIDGET (ptr); - xlfd = (*env)->GetStringUTFChars (env, jname, NULL); - snprintf(buf, FBUFSZ, xlfd, size); - (*env)->ReleaseStringUTFChars (env, jname, xlfd); + entry = GTK_WIDGET (ptr); + font_name = (*env)->GetStringUTFChars (env, jname, NULL); + gdk_threads_enter(); - new_font = gdk_font_load(buf); /* FIXME: deprecated. Replacement? */ - if (new_font == NULL) - { - /* Fail quietly for now. */ - gdk_threads_leave(); - return; - } - style = gtk_style_copy (gtk_widget_get_style (text)); - style -> font = new_font; - gtk_widget_set_style (text , style); - /* FIXME: Documentation varies as to whether we should unref style. */ + + font_desc = pango_font_description_from_string (font_name); + pango_font_description_set_size (font_desc, size); + gtk_widget_modify_font (GTK_WIDGET(entry), font_desc); + pango_font_description_free (font_desc); + gdk_threads_leave(); + + (*env)->ReleaseStringUTFChars (env, jname, font_name); } diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c index 3b7c06bf057..9a8cc32efd8 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c @@ -93,17 +93,37 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectHooks (JNIEnv *env, jobject obj) { void *ptr; + GtkVBox* vbox; GtkWidget *layout; - + GList* children; + char* name; ptr = NSA_GET_PTR (env, obj); gdk_threads_enter (); - layout = GTK_WIDGET (gtk_container_children (GTK_CONTAINER (GTK_BIN (ptr)->child))->data); + + children = gtk_container_get_children(GTK_CONTAINER(ptr)); + vbox = children->data; + name = GTK_OBJECT_TYPE_NAME(vbox); + if(!GTK_IS_VBOX(vbox)) + { + printf("*** this is not a vbox\n"); + } + children = gtk_container_get_children(GTK_CONTAINER(vbox)); + layout = children->data; + name = GTK_OBJECT_TYPE_NAME(layout); + if(!GTK_IS_LAYOUT(layout)) + { + printf("*** widget is not a layout ***"); + } + gtk_widget_realize (layout); + connect_awt_hook (env, obj, 1, GTK_LAYOUT (layout)->bin_window); - gtk_widget_realize (GTK_WIDGET (ptr)); + gtk_widget_realize (ptr); + connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window); + gdk_threads_leave (); } @@ -112,8 +132,8 @@ setup_window (JNIEnv *env, jobject obj, GtkWidget *window, jint width, jint height, jboolean visible) { GtkWidget *layout, *vbox; - gint x, y; + gdk_threads_enter(); gtk_window_set_policy (GTK_WINDOW (window), 1, 1, 0); gtk_widget_set_usize (window, width, height); @@ -131,6 +151,7 @@ setup_window (JNIEnv *env, jobject obj, GtkWidget *window, jint width, connect_awt_hook (env, obj, 1, window->window); set_visible (window, visible); + gdk_threads_leave (); } /* @@ -212,9 +233,6 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_toFront (JNIEnv *env, static void setBounds (GtkWidget *widget, jint x, jint y, jint width, jint height) { - gint current_x, current_y; - gint origin_x, origin_y; - /* gdk_window_get_root_origin (widget->window, ¤t_x, ¤t_y); */ /* if (current_x != x || current_y != y) */ @@ -295,16 +313,12 @@ gdk_window_get_root_geometry (GdkWindow *window, gint *border, gint *depth) { - GdkWindowPrivate *private; - Window xwindow; - Window xparent; - Window root; - Window *children; + GdkWindow *private; unsigned int nchildren; g_return_if_fail (window != NULL); - private = (GdkWindowPrivate*) window; + private = (GdkWindow*) window; if (x) *x = 0; if (y) @@ -318,48 +332,14 @@ gdk_window_get_root_geometry (GdkWindow *window, if (depth) *depth = 0; - if (private->destroyed) + if (GDK_WINDOW_DESTROYED (private)) return; - while (private->parent && ((GdkWindowPrivate*) private->parent)->parent) - private = (GdkWindowPrivate*) private->parent; - if (private->destroyed) + private = gdk_window_get_toplevel (private); + if (GDK_WINDOW_DESTROYED(private)) return; - xparent = private->xwindow; - do - { - xwindow = xparent; - if (!XQueryTree (private->xdisplay, xwindow, - &root, &xparent, - &children, &nchildren)) - return; + gdk_window_get_geometry (private, x, y, width, height, depth); - if (children) - XFree (children); - } - while (xparent != root); - - if (xparent == root) - { - unsigned int ww, wh, wb, wd; - int wx, wy; - - if (XGetGeometry (private->xdisplay, xwindow, &root, &wx, &wy, &ww, &wh, &wb, &wd)) - { - if (x) - *x = wx; - if (y) - *y = wy; - if (width) - *width = ww; - if (height) - *height = wh; - if (border) - *border = wb; - if (depth) - *depth = wd; - } - } } diff --git a/libjava/jni/gtk-peer/gthread-jni.c b/libjava/jni/gtk-peer/gthread-jni.c index 9409720f9ac..b1077a79677 100644 --- a/libjava/jni/gtk-peer/gthread-jni.c +++ b/libjava/jni/gtk-peer/gthread-jni.c @@ -35,116 +35,430 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +/************************************************************************/ +/* Header */ +/************************************************************************/ + +/* + * Julian Dolby (dolby@us.ibm.com) + * February 7, 2003 + * + * This code implements the GThreadFunctions interface for GLIB using + * Java threading primitives. All of the locking and conditional variable + * functionality required by GThreadFunctions is implemented using the + * monitor and wait/notify functionality of Java objects. The thread- + * local fucntionality uses the java.lang.ThreadLocal class. + * + * This code is designed to be portable in that it makes no assumptions + * about the underlying VM beyond that it implements the JNI functionality + * that this code uses. + * + * The one piece that does not really work is trylock for mutexes. The + * Java locking model does not include such functionality, and I do not + * see how to implement it without knowing something about how the VM + * implements locking. + * + * NOTES: + * + * I have tested it only on JikesRVM---the CVS head as of early February + * 2003. + * + * Currently, use of this code is governed by the configuration option + * --enable-portable-native-sync + * + */ + + +/************************************************************************/ +/* Global data */ +/************************************************************************/ #include "gthread-jni.h" -/* - * This code has been written specifically to be used with GTK+ 1.2. - * `Real' GLIB threading is not supported. We fake things where necessary. - * Once we know we're running on a 1.2 VM, we can write a real implementation. - */ +/* The VM handle. This is set in GtkToolkitMain.gtkInit */ +JavaVM *gdk_vm; -static GMutex * -g_mutex_new_jni_impl (void) -{ + +/************************************************************************/ +/* Utilities to reflect exceptions back to the VM */ +/************************************************************************/ + +/* This function checks for a pending exception, and rethrows it with + * a wrapper RuntimeException to deal with possible type problems (in + * case some calling piece of code does not expect the exception being + * thrown) and to include the given extra message. + */ +static void maybe_rethrow(JNIEnv *gdk_env, char *message, char *file, int line) { + jthrowable cause; + + /* rethrow if an exception happened */ + if ((cause = (*gdk_env)->ExceptionOccurred(gdk_env)) != NULL) { + jstring jmessage; jclass obj_class; - jobject *mutex; + jobject obj; + jmethodID ctor; + + /* allocate local message in Java */ + int len = strlen(message) + strlen(file) + 25; + char buf[ len ]; + bzero(buf, len); + sprintf(buf, "%s (at %s:%d)", message, file, line); + jmessage = (*gdk_env)->NewStringUTF(gdk_env, buf); + + /* create RuntimeException wrapper object */ + obj_class = (*gdk_env)->FindClass (gdk_env, "java/lang/RuntimeException"); + ctor = (*gdk_env)->GetMethodID(gdk_env, obj_class, "", "(Ljava/langString;Ljava/lang/Throwable)V"); + obj = (*gdk_env)->NewObject (gdk_env, obj_class, ctor, jmessage, cause); + + /* throw it */ + (*gdk_env)->Throw(gdk_env, (jthrowable)obj); + } +} + +/* This macro is used to include a source location in the exception message */ +#define MAYBE_RETHROW(_class, _message) \ +maybe_rethrow(_class, _message, __FILE__, __LINE__) + + +/************************************************************************/ +/* Utilities to allocate and free java.lang.Objects */ +/************************************************************************/ + +/* Both the mutexes and the condition variables are java.lang.Object objects, + * which this method allocates and returns a global ref. Note that global + * refs must be explicitly freed (isn't C fun?). + */ +static jobject *allocatePlainObject() { + jclass obj_class; + jobject *obj; + JNIEnv *gdk_env; + jmethodID ctor; + + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); obj_class = (*gdk_env)->FindClass (gdk_env, "java/lang/Object"); - if (obj_class == NULL) - return NULL; + MAYBE_RETHROW(gdk_env, "cannot find Object"); - mutex = (jobject *) g_malloc (sizeof (jobject)); - *mutex = (*gdk_env)->AllocObject (gdk_env, obj_class); - if (*mutex == NULL) - { - g_free (mutex); - return NULL; - } - *mutex = (*gdk_env)->NewGlobalRef (gdk_env, *mutex); + ctor = (*gdk_env)->GetMethodID(gdk_env, obj_class, "", "()V"); + MAYBE_RETHROW(gdk_env, "cannot find constructor"); - return (GMutex *) mutex; + obj = (jobject *) g_malloc (sizeof (jobject)); + *obj = (*gdk_env)->NewObject (gdk_env, obj_class, ctor); + MAYBE_RETHROW(gdk_env, "cannot allocate object"); + + *obj = (*gdk_env)->NewGlobalRef (gdk_env, *obj); + MAYBE_RETHROW(gdk_env, "cannot make global ref"); + + return obj; } -static void -g_mutex_lock_jni_impl (GMutex *mutex) -{ - if (mutex && mutex == gdk_threads_mutex) - (*gdk_env)->MonitorEnter (gdk_env, *((jobject *)mutex)); +/* Frees a Java object given a global ref (isn't C fun?) */ +static void freePlainObject(jobject *obj) { + JNIEnv *gdk_env; + + if (obj) { + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); + + (*gdk_env)->DeleteGlobalRef (gdk_env, *obj); + MAYBE_RETHROW(gdk_env, "cannot delete global ref"); + + g_free (obj); + } } -static gboolean -g_mutex_trylock_jni_impl (GMutex *mutex) -{ - return FALSE; + +/************************************************************************/ +/* Locking code */ +/************************************************************************/ + +/* Lock a Java object */ +static void takeLock(JNIEnv *gdk_env, void *mutex) { + (*gdk_env)->MonitorEnter (gdk_env, *((jobject *)mutex)); + MAYBE_RETHROW(gdk_env, "cannot get lock"); } -static void -g_mutex_unlock_jni_impl (GMutex *mutex) -{ - if (mutex && mutex == gdk_threads_mutex) +/* Unlock a Java object */ +static void releaseLock(JNIEnv *gdk_env, void *mutex) { (*gdk_env)->MonitorExit (gdk_env, *((jobject *)mutex)); + MAYBE_RETHROW(gdk_env, "cannot release lock"); } -static void -g_mutex_free_jni_impl (GMutex *mutex) -{ - if (mutex && mutex == gdk_threads_mutex) - { - (*gdk_env)->DeleteGlobalRef (gdk_env, *((jobject *)mutex)); - g_free (mutex); - } +/* Create a mutex, which is a java.lang.Object for us */ +static GMutex *g_mutex_new_jni_impl (void) { + return (GMutex*) allocatePlainObject(); } -static GPrivate * -g_private_new_jni_impl (GDestroyNotify notify) -{ - return NULL; +/* Lock a mutex. */ +static void g_mutex_lock_jni_impl (GMutex *mutex) { + JNIEnv *gdk_env; + + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); + + takeLock(gdk_env, mutex); } -static gpointer -g_private_get_jni_impl (GPrivate *private) -{ - return NULL; -} - -static void -g_private_set_jni_impl (GPrivate *private, gpointer data) -{ -} - -static GCond * -g_cond_new_jni_impl () -{ - return NULL; -} - -static void -g_cond_signal_jni_impl (GCond *cond) -{ -} - -static void -g_cond_broadcast_jni_impl (GCond *cond) -{ -} - -static void -g_cond_wait_jni_impl (GCond *cond, GMutex *mutex) -{ -} - -static gboolean -g_cond_timed_wait_jni_impl (GCond *cond, GMutex *mutex) -{ +/* Try to lock a mutex. Actually, do not try because Java objects + * do not provide such an interface. To be at least minimally correct, + * pretend we tried and failed. + */ +static gboolean g_mutex_trylock_jni_impl (GMutex *mutex) { + // Shall we implement this in a JikesRVM-specific way under a flag? return FALSE; } -static void -g_cond_free_jni_impl (GCond *cond) -{ +/* Unlock a mutex. */ +static void g_mutex_unlock_jni_impl (GMutex *mutex) { + JNIEnv *gdk_env; + + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); + + releaseLock(gdk_env, mutex); } +/* Free a mutex (isn't C fun?) */ +static void g_mutex_free_jni_impl (GMutex *mutex) +{ + freePlainObject( (jobject*)mutex ); +} + + +/************************************************************************/ +/* Condition variable code */ +/************************************************************************/ + +/* Create a new condition variable. This is a java.lang.Object for us. */ +static GCond *g_cond_new_jni_impl () { + return (GCond*)allocatePlainObject(); +} + +/* Signal on a condition variable. This is simply calling Object.notify + * for us. + */ +static void g_cond_signal_jni_impl (GCond *cond) { + jclass lcl_class; + jmethodID signal_mth; + JNIEnv *gdk_env; + + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); + + lcl_class = (*gdk_env)->FindClass (gdk_env, "java.lang.Object"); + MAYBE_RETHROW(gdk_env, "cannot find Object"); + + signal_mth = (*gdk_env)->GetMethodID(gdk_env, lcl_class, "notify", "()V"); + MAYBE_RETHROW(gdk_env, "cannot find Object."); + + /* Must have locked an object to call notify */ + takeLock(gdk_env, cond); + + (*gdk_env)->CallVoidMethod(gdk_env, *(jobject*)cond, signal_mth); + MAYBE_RETHROW(gdk_env, "cannot signal mutex"); + + releaseLock(gdk_env, cond); +} + +/* Broadcast to all waiting on a condition variable. This is simply + * calling Object.notifyAll for us. + */ +static void g_cond_broadcast_jni_impl (GCond *cond) { + jclass lcl_class; + jmethodID bcast_mth; + JNIEnv *gdk_env; + + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); + + lcl_class = (*gdk_env)->FindClass (gdk_env, "java.lang.Object"); + MAYBE_RETHROW(gdk_env, "cannot find Object"); + + bcast_mth = (*gdk_env)->GetMethodID(gdk_env, lcl_class, "notifyAll", "()V"); + MAYBE_RETHROW(gdk_env, "cannot find Object."); + + /* Must have locked an object to call notifyAll */ + takeLock(gdk_env, cond); + + (*gdk_env)->CallVoidMethod(gdk_env, *(jobject*)cond, bcast_mth); + MAYBE_RETHROW(gdk_env, "cannot broadcast to mutex"); + + releaseLock(gdk_env, cond); +} + + +/* Wait on a condition variable. For us, this simply means call + * Object.wait. + */ +static void g_cond_wait_jni_impl (GCond *cond, GMutex *mutex) { + jclass lcl_class; + jmethodID wait_mth; + JNIEnv *gdk_env; + + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); + + lcl_class = (*gdk_env)->FindClass (gdk_env, "java.lang.Object"); + MAYBE_RETHROW(gdk_env, "cannot find Object"); + + wait_mth = (*gdk_env)->GetMethodID(gdk_env, lcl_class, "wait", "()V"); + MAYBE_RETHROW(gdk_env, "cannot find Object."); + + /* Must have locked an object to call wait */ + takeLock(gdk_env, cond); + + (*gdk_env)->CallVoidMethod(gdk_env, *(jobject*)cond, wait_mth); + MAYBE_RETHROW(gdk_env, "cannot wait on mutex"); + + releaseLock(gdk_env, cond); +} + +/* Wait on a condition vairable until a timeout. This is a little tricky + * for us. We first call Object.wait(J) giving it the appropriate timeout + * value. On return, we check whether an InterruptedException happened. If + * so, that is Java-speak for wait timing out. + */ +static gboolean +g_cond_timed_wait_jni_impl (GCond *cond, GMutex *mutex, GTimeVal *end_time) { + jclass lcl_class; + jmethodID wait_mth; + JNIEnv *gdk_env; + jlong time; + jthrowable cause; + + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); + + lcl_class = (*gdk_env)->FindClass (gdk_env, "java.lang.Object"); + MAYBE_RETHROW(gdk_env, "cannot find Object"); + + wait_mth = (*gdk_env)->GetMethodID(gdk_env, lcl_class, "wait", "(J)V"); + MAYBE_RETHROW(gdk_env, "cannot find Object."); + + time = end_time->tv_sec*1000; + time += end_time->tv_usec/1000; + + /* Must have locked an object to call wait */ + takeLock(gdk_env, cond); + + (*gdk_env)->CallVoidMethod(gdk_env, *(jobject*)cond, wait_mth, time); + + if ((cause = (*gdk_env)->ExceptionOccurred(gdk_env)) != NULL) { + jclass intr = (*gdk_env)->FindClass (gdk_env, "java.lang.InterruptedException"); + if ( (*gdk_env)->IsInstanceOf(gdk_env, cause, intr) ) { + releaseLock(gdk_env, cond); + return FALSE; + } else { + MAYBE_RETHROW(gdk_env, "error in timed wait"); + } + } + + releaseLock(gdk_env, cond); + + return TRUE; +} + +/* Free a condition variable. (isn't C fun?) */ +static void g_cond_free_jni_impl (GCond *cond) { + freePlainObject( (jobject*)cond ); +} + + +/************************************************************************/ +/* Thread-local data code */ +/************************************************************************/ + +/* Create a new thread-local key. We use java.lang.ThreadLocal objects + * for this. + */ +static GPrivate *g_private_new_jni_impl (GDestroyNotify notify) { + jclass lcl_class; + jobject *local; + JNIEnv *gdk_env; + jmethodID ctor; + + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); + + lcl_class = (*gdk_env)->FindClass (gdk_env, "java.lang.ThreadLocal"); + MAYBE_RETHROW(gdk_env, "cannot find ThreadLocal"); + + ctor = (*gdk_env)->GetMethodID(gdk_env, lcl_class, "", "()V"); + MAYBE_RETHROW(gdk_env, "cannot find ThreadLocal."); + + local = (jobject *) g_malloc (sizeof (jobject)); + *local = (*gdk_env)->NewObject(gdk_env, lcl_class, ctor); + MAYBE_RETHROW(gdk_env, "cannot allocate a ThreadLocal"); + + *local = ((*gdk_env)->NewGlobalRef (gdk_env, *local)); + MAYBE_RETHROW(gdk_env, "cannot create a GlobalRef"); + + return (GPrivate*) local; +} + +/* Get this thread's value for a thread-local key. This is simply + * ThreadLocal.get for us. + */ +static gpointer g_private_get_jni_impl (GPrivate *private) { + jclass lcl_class; + jobject lcl_obj; + JNIEnv *gdk_env; + jmethodID get_mth; + jclass int_class; + jmethodID val_mth; + jint int_val; + + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); + + lcl_class = (*gdk_env)->FindClass (gdk_env, "java.lang.ThreadLocal"); + MAYBE_RETHROW(gdk_env, "cannot find ThreadLocal"); + + get_mth = (*gdk_env)->GetMethodID(gdk_env, lcl_class, "get", "()Ljava/lang/Object;"); + MAYBE_RETHROW(gdk_env, "cannot find ThreadLocal."); + + lcl_obj = (*gdk_env)->CallObjectMethod(gdk_env, *(jobject*)private, get_mth); + MAYBE_RETHROW(gdk_env, "cannot find thread-local object"); + + int_class = (*gdk_env)->FindClass (gdk_env, "java.lang.Integer"); + MAYBE_RETHROW(gdk_env, "cannot find Integer"); + + val_mth = (*gdk_env)->GetMethodID(gdk_env, int_class, "intValue", "()I"); + MAYBE_RETHROW(gdk_env, "cannot find Integer."); + + int_val = (*gdk_env)->CallIntMethod(gdk_env, lcl_obj, val_mth); + MAYBE_RETHROW(gdk_env, "cannot get thread local value"); + + return (gpointer) int_val; +} + +/* Set this thread's value for a thread-local key. This is simply + * ThreadLocal.set for us. + */ +static void g_private_set_jni_impl (GPrivate *private, gpointer data) { + jclass lcl_class, int_class; + jobject lcl_obj; + JNIEnv *gdk_env; + jmethodID new_int, set_mth; + + (*gdk_vm)->GetEnv(gdk_vm, (void **)&gdk_env, JNI_VERSION_1_1); + + int_class = (*gdk_env)->FindClass (gdk_env, "java.lang.Integer"); + MAYBE_RETHROW(gdk_env, "cannot find Integer"); + + new_int = (*gdk_env)->GetMethodID(gdk_env, int_class, "", "(I)V"); + MAYBE_RETHROW(gdk_env, "cannot find Integer."); + + lcl_obj = (*gdk_env)->NewObject(gdk_env, int_class, new_int, (jint)data); + MAYBE_RETHROW(gdk_env, "cannot create an Integer"); + + lcl_class = (*gdk_env)->FindClass (gdk_env, "java.lang.ThreadLocal"); + MAYBE_RETHROW(gdk_env, "cannot find ThreadLocal"); + + set_mth = (*gdk_env)->GetMethodID(gdk_env, lcl_class, "set", "(Ljava/lang/Object;)V"); + MAYBE_RETHROW(gdk_env, "cannot find ThreadLocal."); + + (*gdk_env)->CallVoidMethod(gdk_env, *(jobject*)private, set_mth, lcl_obj); + MAYBE_RETHROW(gdk_env, "cannot set thread local value"); +} + + +/************************************************************************/ +/* GLIB interface */ +/************************************************************************/ + +/* set of function pointers to give to glib. */ GThreadFunctions g_thread_jni_functions = { g_mutex_new_jni_impl, /* mutex_new */ @@ -163,7 +477,7 @@ GThreadFunctions g_thread_jni_functions = g_private_set_jni_impl /* private_set */ }; -void -gdk_threads_wake () -{ +/* ??? */ +void gdk_threads_wake () { + } diff --git a/libjava/jni/gtk-peer/gthread-jni.h b/libjava/jni/gtk-peer/gthread-jni.h index 0bb5a56f1d8..a0d093dccc8 100644 --- a/libjava/jni/gtk-peer/gthread-jni.h +++ b/libjava/jni/gtk-peer/gthread-jni.h @@ -43,5 +43,6 @@ exception statement from your version. */ #include "gtkpeer.h" extern GThreadFunctions g_thread_jni_functions; +extern JavaVM *gdk_vm; #endif /* __GTHREADJNI_H__ */ diff --git a/libjava/testsuite/Makefile.in b/libjava/testsuite/Makefile.in index 86079be8e0b..091051224b9 100644 --- a/libjava/testsuite/Makefile.in +++ b/libjava/testsuite/Makefile.in @@ -87,10 +87,11 @@ GCOBJS = @GCOBJS@ GCSPEC = @GCSPEC@ GCTESTSPEC = @GCTESTSPEC@ GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GTK_CFLAGS = @GTK_CFLAGS@ -GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ HASH_SYNC_SPEC = @HASH_SYNC_SPEC@ IEEESPEC = @IEEESPEC@ @@ -117,6 +118,7 @@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ PLATFORMOBJS = @PLATFORMOBJS@ RANLIB = @RANLIB@ STRIP = @STRIP@