Patch: build AWT

Tom Tromey tromey@cygnus.com
Wed Apr 5 17:28:00 GMT 2000


I'm checking in this patch.  It adds a --enable-java-awt option to
configure (on by default on native platforms).  If given this switch
will cause a "libgcjawt.la" to be built and installed.

2000-04-05  Tom Tromey  <tromey@cygnus.com>

	* configure: Rebuilt.
	* configure.in: Recognize --enable-java-awt.
	(AWT): New conditional.
	* Makefile.in: Rebuilt.
	* Makefile.am (toolexeclib_LTLIBRARIES): Build libgcjawt.la if
	requested.
	(libgcjawt_la_SOURCES): New macro.
	(EXTRA_libgcjawt_la_SOURCES): Likewise.
	(libgcjawt_la_DEPENDENCIES): Likewise.
	(libgcjawt_la_LIBADD): Likewise.
	(libgcjawt_la_LDFLAGS): Likewise.
	(libgcj.zip): Depend on cond_java_awt_source_files
	(cond_awt_java_source_files): New macro.
	(MOSTLYCLEANFILES): Added awto_files.
	(awto_files): New macro.  Use where javao_files used.
	(nat_headers): Use cond_awt_java_source_files.

Tom

Index: configure.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/configure.in,v
retrieving revision 1.55
diff -u -r1.55 configure.in
--- configure.in	2000/04/02 15:34:17	1.55
+++ configure.in	2000/04/05 23:49:19
@@ -49,6 +49,18 @@
 # Nothing
 , AC_DEFINE(COMPACT_CHARACTER))
 
+AC_ARG_ENABLE(java-awt,
+[  --enable-java-awt       enable AWT implementation],
+  awt=$enable_java_awt
+, [# Default to enabled on native systems.
+if test -z "${with_cross_host}"; then
+   awt=yes
+else
+   awt=no
+fi])
+
+AM_CONDITIONAL(AWT, test "$awt" = yes)
+
 dnl Should the runtime set system properties by examining the 
 dnl environment variable GCJ_PROPERTIES?
 AC_ARG_ENABLE(getenv-properties,
Index: Makefile.am
===================================================================
RCS file: /cvs/java/libgcj/libjava/Makefile.am,v
retrieving revision 1.55
diff -u -r1.55 Makefile.am
--- Makefile.am	2000/04/04 19:56:20	1.55
+++ Makefile.am	2000/04/05 23:49:22
@@ -23,7 +23,11 @@
 toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
 endif
 
-toolexeclib_LTLIBRARIES = libgcj.la
+## Some versions of automake can't handle a conditional _LTLIBRARIES.
+if AWT
+hack1 = libgcjawt.la
+endif
+toolexeclib_LTLIBRARIES = libgcj.la $(hack1)
 toolexeclib_DATA = libgcj.spec
 data_DATA = libgcj.zip
 
@@ -108,6 +112,8 @@
 javao_files = $(java_source_files:.java=.lo) \
 	$(built_java_source_files:.java=.lo)
 
+awto_files = $(awt_java_source_files:.java=.lo)
+
 ## Extract the libffi object file names.
 libffi_files = `$(AR) t ../libffi/.libs/libffi.a 2>/dev/null | sed 's/\.o/\.lo/g' | sed 's/^/..\/libffi\//g'`
 
@@ -123,6 +129,14 @@
 ## The mysterious backslash is consumed by make.
 	-version-info `grep -v '^\#' $(srcdir)/libtool-version`
 
+libgcjawt_la_SOURCES = ## Nothing
+EXTRA_libgcjawt_la_SOURCES = $(awt_java_source_files)
+libgcjawt_la_DEPENDENCIES = libgcj.zip $(awto_files)
+libgcjawt_la_LIBADD = $(awto_files)
+libgcjawt_la_LDFLAGS = -rpath $(toolexeclibdir) \
+## The mysterious backslash is consumed by make.
+	-version-info `grep -v '^\#' $(srcdir)/libtool-version`
+
 ## Make the .class files depend on the .zip file.  This seems
 ## backwards, but is right.  This doesn't catch all the .class files,
 ## but that is ok, because the ones it fails to pick up are defined in
@@ -130,6 +144,7 @@
 ## only want to create headers for those files which do not have
 ## hand-maintained headers.
 $(java_source_files:.java=.class): libgcj.zip
+$(awt_java_source_files:.java=.class): libgcj.zip
 
 ## FIXME: this isn't really correct.
 $(built_java_source_files:.java=.class): $(built_java_source_files)
@@ -145,7 +160,7 @@
 ## up-to-date, and foo.class is removed, and bar.java is touched, then
 ## `make libgcj.zip' will not rebuilt foo.class.  That's because
 ## libgcj.zip is not out-of-date with respect to foo.java.
-libgcj.zip: $(java_source_files)
+libgcj.zip: $(java_source_files) $(cond_awt_java_source_files)
 ## FIXME: this ought to depend on built_java_source_files, but right
 ## now it can't.  Ugly.
 	$(MAKE) $(built_java_source_files:.java=.class)
@@ -158,7 +173,8 @@
 ## Note that we explicitly want to include directory information.
 	$(ZIP) -r libgcj java gnu -n .class -i '*.class' -i '*/'
 
-MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files)
+MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files) \
+	$(awto_files)
 CLEANFILES = libgcj.zip
 
 clean-local:
@@ -190,10 +206,10 @@
 $(c_files): java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h
 
 ## FIXME: GNU make.
-$(javao_files): %.lo: %.java
+$(awto_files) $(javao_files): %.lo: %.java
 	$(GCJCOMPILE) -o $@ $<
 
-$(javao_files): libgcj.zip
+$(awto_files) $(javao_files): libgcj.zip
 
 ## ################################################################
 
@@ -207,7 +223,8 @@
 
 ## Header files used when compiling some of the nat* files.
 nat_headers = $(ordinary_java_source_files:.java=.h) \
-	$(built_java_source_files:.java=.h)
+	$(built_java_source_files:.java=.h) \
+	$(cond_awt_java_source_files:.java=.h)
 
 $(nat_headers): libgcj.zip
 
@@ -519,7 +536,11 @@
 java/awt/peer/FramePeer.java \
 java/awt/peer/WindowPeer.java
 
-# $(awt_java_source_files)
+if AWT
+cond_awt_java_source_files = $(awt_java_source_files)
+else
+cond_awt_java_source_files =
+endif
 
 ## Java files which are created by configure and thus are in the build
 ## directory.


More information about the Java-patches mailing list