From 3f8dfdd4dff477332819e8050733ddc3c66740c0 Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Wed, 23 Feb 2005 01:05:46 +0000 Subject: [PATCH] re PR awt/20029 (Robot needs XTest) 2005-02-22 Thomas Fitzsimmons PR libgcj/20029: * Makefile.am (lib_gnu_java_awt_peer_gtk_la_CFLAGS): Add X_CFLAGS. (lib_gnu_java_awt_peer_gtk_la_LDFLAGS): Add X_LIBS and -lXtst. * Makefile.in: Regenerate. * configure.ac: Check for libXtst. * configure: Regenerate. From-SVN: r95428 --- libjava/ChangeLog | 9 +++++ libjava/Makefile.am | 4 +-- libjava/Makefile.in | 4 +-- libjava/configure | 79 ++++++++++++++++++++++++++++++++++++++++++++ libjava/configure.ac | 5 +++ 5 files changed, 97 insertions(+), 4 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index b67b545ba8f..f12fe286373 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,12 @@ +2005-02-22 Thomas Fitzsimmons + + PR libgcj/20029: + * Makefile.am (lib_gnu_java_awt_peer_gtk_la_CFLAGS): Add X_CFLAGS. + (lib_gnu_java_awt_peer_gtk_la_LDFLAGS): Add X_LIBS and -lXtst. + * Makefile.in: Regenerate. + * configure.ac: Check for libXtst. + * configure: Regenerate. + 2005-02-22 Mark Wielaard * java/security/AlgorithmParameterGenerator.java (getInstance): diff --git a/libjava/Makefile.am b/libjava/Makefile.am index ed24da3ae0a..14edb061c24 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -456,13 +456,13 @@ jni/classpath/primlib.h lib_gnu_java_awt_peer_gtk_la_CFLAGS = \ -Ijniinclude -I$(srcdir)/jni/classpath \ -I$(srcdir)/jni/gtk-peer $(PEDANTIC_CFLAGS) $(GTK_CFLAGS) $(LIBART_CFLAGS) \ - $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS) + $(X_CFLAGS) $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS) lib_gnu_java_awt_peer_gtk_la_GCJFLAGS = $(AM_GCJFLAGS) -fjni lib_gnu_java_awt_peer_gtk_la_LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS) lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = $(gtk_jni_headers) libgcj-@gcc_version@.jar libgcj.la libgcj.spec ## The mysterious backslash in the grep pattern is consumed by make. lib_gnu_java_awt_peer_gtk_la_LDFLAGS = \ - -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) + -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst lib_gnu_java_awt_peer_gtk_la_LINK = $(LIBLINK) libjawt_la_SOURCES = jawt.c diff --git a/libjava/Makefile.in b/libjava/Makefile.in index 1d8d2616ca8..a8d26c44c05 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -5303,13 +5303,13 @@ jni/classpath/primlib.h lib_gnu_java_awt_peer_gtk_la_CFLAGS = \ -Ijniinclude -I$(srcdir)/jni/classpath \ -I$(srcdir)/jni/gtk-peer $(PEDANTIC_CFLAGS) $(GTK_CFLAGS) $(LIBART_CFLAGS) \ - $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS) + $(X_CFLAGS) $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS) lib_gnu_java_awt_peer_gtk_la_GCJFLAGS = $(AM_GCJFLAGS) -fjni lib_gnu_java_awt_peer_gtk_la_LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS) lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = $(gtk_jni_headers) libgcj-@gcc_version@.jar libgcj.la libgcj.spec lib_gnu_java_awt_peer_gtk_la_LDFLAGS = \ - -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) + -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst lib_gnu_java_awt_peer_gtk_la_LINK = $(LIBLINK) libjawt_la_SOURCES = jawt.c diff --git a/libjava/configure b/libjava/configure index a243d6c9521..7dee1e010dc 100755 --- a/libjava/configure +++ b/libjava/configure @@ -13104,6 +13104,85 @@ echo "$as_me: error: Library requirements (libart-2.0 >= 2.1) not met; consider + + # We require the XTest Extension to support java.awt.Robot. + echo "$as_me:$LINENO: checking for XTestQueryExtension in -lXtst" >&5 +echo $ECHO_N "checking for XTestQueryExtension in -lXtst... $ECHO_C" >&6 +if test "${ac_cv_lib_Xtst_XTestQueryExtension+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXtst ${X_LIBS} $LIBS" +if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XTestQueryExtension (); +int +main () +{ +XTestQueryExtension (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Xtst_XTestQueryExtension=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xtst_XTestQueryExtension=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_Xtst_XTestQueryExtension" >&5 +echo "${ECHO_T}$ac_cv_lib_Xtst_XTestQueryExtension" >&6 +if test $ac_cv_lib_Xtst_XTestQueryExtension = yes; then + true +else + { { echo "$as_me:$LINENO: error: libXtst not found, required by java.awt.Robot" >&5 +echo "$as_me: error: libXtst not found, required by java.awt.Robot" >&2;} + { (exit 1); exit 1; }; } +fi + fi # On Solaris, and maybe other architectures, the Boehm collector diff --git a/libjava/configure.ac b/libjava/configure.ac index d2f1c1058fa..c7da4f591f2 100644 --- a/libjava/configure.ac +++ b/libjava/configure.ac @@ -1014,6 +1014,11 @@ else PKG_CHECK_MODULES(LIBART, libart-2.0 >= 2.1) AC_SUBST(LIBART_CFLAGS) AC_SUBST(LIBART_LIBS) + + # We require the XTest Extension to support java.awt.Robot. + AC_CHECK_LIB([Xtst], [XTestQueryExtension], [true], + [AC_MSG_ERROR([libXtst not found, required by java.awt.Robot])], + [${X_LIBS}]) fi # On Solaris, and maybe other architectures, the Boehm collector