2006-03-31 Helge Hess <helge.hess@opengroupware.org>
+ * Instance/library.make: added a hack to redefine CC to gcj in case
+ the shared library build includes AOT_JAVA_FILES.
+
* gcj-tool.make, Instance/gcj-tool.make, Master/gcj-tool.make,
GNUmakefile.in: added special AOT tool makefile
#
# Instance/gcj-java-tool.make
#
-# Instance Makefile rules to build GNUstep-based command line ctools.
+# Instance Makefile rules to build GNUstep-based command line gcj tools.
#
# Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
#
debug=$(debug) profile=$(profile) shared=$(shared) \
libext=$(LIBEXT) shared_libext=$(SHARED_LIBEXT))
+
+#
+# This is a hack to properly compile GCJ libraries. Part of the problem is
+# that target.make often uses $(CC) instead of $(LD) to define the
+# SHARED_LIB_LINK_CMD command.
+#
+# Well, and Java libraries apparently need to be compiled with 'gcj', otherwise
+# the result doesn't work (gives runtime class linking errors).
+#
+# Note that GCJ seems to link regular libraries just fine, so this doesn't
+# seem to conflict with C_FILES, OBJC_FILES etc.
+#
+ifneq ($($(GNUSTEP_INSTANCE)_AOT_JAVA_FILES),)
+CC:=gcj # force gstep-make to use GCJ to link the shared library
+endif
+
+
ifeq ($(shared), yes)
ifneq ($(BUILD_DLL),yes)