This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Disable xlib peers by default, add --enable-java-awt configure option


Jeff Sturm wrote:

> > > Since others have reported problems building the xlib peers,
> > > and they really aren't in a release form yet, should they be disabled by
> > > default on the branch?

Heres a patch to do that. The idea is that you can specify a comma separated
list of peers to build in the --enable-java-awt argument

eg

--enable-java-awt=gtk
--enable-java-awt=xlib,gtk

The patch disables the xlib peers by default unless xlib is specified on the
configure cmd.

It works nicely but I'd also like to have it complain appropriatly if someone
specifies "--enable-java-awt=xlib" but doesn't have X headers installed or
whatever. It seems that the test for
"if [test "$no_x" = yes]" doesn't actually work, even though it definatly did
seem work inside an AM_CONDITIONAL previously ("--without-x" stopped libgcjx
being build).

Any ideas on that one Tom?

regards

  [ bryce ]


2001-02-21  Bryce McKinlay  <bryce@albatross.co.nz>

	* configure.in: Add support for --enable-java-awt option. Use
	--enable-java-awt=xlib to build the xlib peers (libgcjx).
	* Makefile.am: Make libgcjx conditional on XLIB_AWT, instead of NO_X.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libjava/configure.in,v
retrieving revision 1.73
diff -u -r1.73 configure.in
--- configure.in	2001/02/05 05:46:15	1.73
+++ configure.in	2001/02/21 11:21:42
@@ -102,6 +102,35 @@
    AC_DEFINE(SJLJ_EXCEPTIONS)
 fi
 
+dnl Determine which AWT peer libraries to build
+AC_ARG_ENABLE(java-awt,
+[  --enable-java-awt       which AWT peer implementation(s) to build])
+
+peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
+use_xlib_awt=""
+use_gtk_awt=""
+
+for peer in $peerlibs ; do
+  case $peer in
+    xlib)
+      if [test "$no_x" = yes]; then
+        echo "*** xlib peers requested but no X library available" 1>&2
+        exit 1
+      else
+        use_xlib_awt="yes"
+      fi
+      ;;
+    gtk)
+      # Nothing, yet...
+      ;;
+    *)
+      echo "*** unrecognised value \"${peer}\" for --enable-java-awt ignored." 1>&2
+  esac
+done
+
+AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes)
+AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes)
+
 AC_MSG_CHECKING([for data_start])
 LIBDATASTARTSPEC=
 NEEDS_DATA_START=
@@ -744,8 +773,6 @@
 fi
 
 AC_PATH_XTRA
-
-AM_CONDITIONAL(NO_X, test "$no_x" = yes)
 
 here=`pwd`
 AC_SUBST(here)
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libjava/Makefile.am,v
retrieving revision 1.129.2.1
diff -u -r1.129.2.1 Makefile.am
--- Makefile.am	2001/02/17 01:06:44	1.129.2.1
+++ Makefile.am	2001/02/21 11:21:42
@@ -23,10 +23,10 @@
 toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
 endif
 
-if NO_X
-cond_x_ltlibrary =
-else
+if XLIB_AWT
 cond_x_ltlibrary = libgcjx.la
+else
+cond_x_ltlibrary =
 endif
 
 toolexeclib_LTLIBRARIES = libgcj.la $(cond_x_ltlibrary)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]