]> err.no Git - sope/commitdiff
added basic GCJ compilation support
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Fri, 31 Mar 2006 00:10:41 +0000 (00:10 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Fri, 31 Mar 2006 00:10:41 +0000 (00:10 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1237 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

gnustep-make/ChangeLog
gnustep-make/GNUmakefile.in
gnustep-make/Instance/gcj-tool.make [new file with mode: 0644]
gnustep-make/Instance/rules.make
gnustep-make/Master/gcj-tool.make [new file with mode: 0644]
gnustep-make/Master/java-tool.make
gnustep-make/common.make
gnustep-make/gcj-tool.make [new file with mode: 0644]
gnustep-make/rules.make

index c7f596ca4ce03032d5bbaf9c84ed26ccfaa4128d..a1fa37a4c646c3fd500dd8f3f8c0f5ee4fb30970 100644 (file)
@@ -1,3 +1,11 @@
+2006-03-31  Helge Hess  <helge.hess@opengroupware.org>
+
+       * gcj-tool.make, Instance/gcj-tool.make, Master/gcj-tool.make,
+         GNUmakefile.in: added special AOT tool makefile
+
+       * Instance/rules.make, common.make, rules.make: added support for
+         ahead-of-time Java compilation (AOT_JAVA_FILES), aka GCJ compilation
+
 2005-08-29  Helge Hess  <helge.hess@opengroupware.org>
 
        * Instance/subproject.make: moved include of Shared/pch.make up (to
index d75305a1519a3eb07612e8904b4d62db881cbde9..322af784a82b2da05b6189569dca907c047279ae 100644 (file)
@@ -75,7 +75,7 @@ MAKE_FILES = aggregate.make application.make bundle.make service.make \
        tool.make ctool.make test-library.make \
        objc.make test-application.make test-tool.make subproject.make \
        palette.make gswapp.make gswbundle.make clibrary.make \
-       documentation.make \
+       documentation.make gcj-tool.make \
        java-executable.template java-tool.make framework.make \
        native-library.make spec-rules.template spec-debug-rules.template \
         spec-debug-alone-rules.template \
@@ -87,7 +87,7 @@ MASTER_MAKE_FILES = \
         documentation.make framework.make gswapp.make gswbundle.make \
         library.make objc.make java.make java-tool.make palette.make \
         resource-set.make service.make subproject.make test-application.make \
-        test-library.make test-tool.make tool.make
+        test-library.make test-tool.make tool.make gcj-tool.make
 
 INSTANCE_MAKE_FILES = \
         rules.make \
@@ -95,7 +95,7 @@ INSTANCE_MAKE_FILES = \
         documentation.make framework.make gswapp.make gswbundle.make \
         library.make objc.make java.make java-tool.make palette.make \
         resource-set.make service.make subproject.make test-application.make \
-        test-library.make test-tool.make tool.make
+        test-library.make test-tool.make tool.make gcj-tool.make
 
 INSTANCE_SHARED_MAKE_FILES = bundle.make headers.make java.make \
                              stamp-string.make strings.make pch.make
diff --git a/gnustep-make/Instance/gcj-tool.make b/gnustep-make/Instance/gcj-tool.make
new file mode 100644 (file)
index 0000000..17ecff7
--- /dev/null
@@ -0,0 +1,91 @@
+#
+#   Instance/gcj-java-tool.make
+#
+#   Instance Makefile rules to build GNUstep-based command line ctools.
+#
+#   Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+#
+#   Author:  Scott Christley <scottc@net-community.com>
+#   Author:  Nicola Pero <nicola@brainstorm.co.uk>
+#   Author:  Helge Hess <helge.hess@opengroupware.org>
+#
+#   This file is part of the GNUstep Makefile Package.
+#
+#   This library is free software; you can redistribute it and/or
+#   modify it under the terms of the GNU General Public License
+#   as published by the Free Software Foundation; either version 2
+#   of the License, or (at your option) any later version.
+#   
+#   You should have received a copy of the GNU General Public
+#   License along with this library; see the file COPYING.LIB.
+#   If not, write to the Free Software Foundation,
+#   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+#
+# The name of the GCJ compiled tools is in the AOT_JAVA_TOOL_NAME variable.
+# The name of the app class is xxx_MAIN_CLASS (defaults to tool name).
+#
+# xxx We need to prefix the target name when cross-compiling
+#
+
+ifeq ($(RULES_MAKE_LOADED),)
+include $(GNUSTEP_MAKEFILES)/rules.make
+endif
+
+MAIN_CLASS = $(strip $($(GNUSTEP_INSTANCE)_MAIN_CLASS))
+
+ifeq ($(MAIN_CLASS),)
+  MAIN_CLASS = $(AOT_JAVA_TOOL_NAME)
+endif
+
+CC:=gcj # TODO: make configurable
+LD:=gcj # TODO: make configurable
+ALL_LDFLAGS += --main=$(MAIN_CLASS)
+
+# This is the directory where the aotjavatools get installed. If you don't
+# specify a directory they will get installed in the GNUstep Local
+# root.
+ifneq ($($(GNUSTEP_INSTANCE)_INSTALL_DIR),)
+  AOT_JAVA_TOOL_INSTALL_DIR = $($(GNUSTEP_INSTANCE)_INSTALL_DIR)
+endif
+
+ifeq ($(AOT_JAVA_TOOL_INSTALL_DIR),)
+  AOT_JAVA_TOOL_INSTALL_DIR = $(GNUSTEP_TOOLS)
+endif
+
+.PHONY: internal-aotjavatool-all_ \
+        internal-aotjavatool-install_ \
+        internal-aotjavatool-uninstall_
+
+ALL_TOOL_LIBS =                                                        \
+    $(shell $(WHICH_LIB_SCRIPT)                                        \
+     $(ALL_LIB_DIRS)                                           \
+     $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS)            \
+     $(TARGET_SYSTEM_LIBS)                                     \
+       debug=$(debug) profile=$(profile) shared=$(shared)      \
+       libext=$(LIBEXT) shared_libext=$(SHARED_LIBEXT))
+
+#
+# Compilation targets
+#
+internal-aotjavatool-all_:: $(GNUSTEP_OBJ_DIR) \
+                     $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
+
+$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT): $(OBJ_FILES_TO_LINK)
+       $(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) -o $(LDOUT)$@ \
+             $(OBJ_FILES_TO_LINK) \
+             $(ALL_TOOL_LIBS)$(END_ECHO)
+
+internal-aotjavatool-install_:: $(AOT_JAVA_TOOL_INSTALL_DIR)/$(GNUSTEP_TARGET_DIR)
+       $(ECHO_INSTALLING)$(INSTALL_PROGRAM) -m 0755 \
+                          $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT) \
+                          $(AOT_JAVA_TOOL_INSTALL_DIR)/$(GNUSTEP_TARGET_DIR)$(END_ECHO)
+
+$(AOT_JAVA_TOOL_INSTALL_DIR)/$(GNUSTEP_TARGET_DIR):
+       $(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
+
+internal-aotjavatool-uninstall_::
+       $(ECHO_UNINSTALLING)rm -f $(AOT_JAVA_TOOL_INSTALL_DIR)/$(GNUSTEP_TARGET_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)$(END_ECHO)
+
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/strings.make
+
index 4eb860c3e409ffc6ee763ec1014eb8cce8dc1b52..e9497e61236a7c83559da327e6fea987f2f7f0b1 100644 (file)
@@ -168,6 +168,9 @@ endif
 # The list of JAVA source files from which to generate jni headers
 # are in the JAVA_JNI_FILES variable.
 #
+# The list of ahead-of-time JAVA source files to be compiled
+# are in the AOT_JAVA_FILES variable.
+#
 # This list of WINDRES source files to be compiled
 # are in the WINDRES_FILES variable.
 # 
@@ -196,6 +199,9 @@ endif
 OBJC_OBJS = $(patsubst %.m,%$(OEXT),$($(GNUSTEP_INSTANCE)_OBJC_FILES))
 OBJC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(OBJC_OBJS))
 
+AOT_JAVA_OBJS = $(patsubst %.java,%$(OEXT),$($(GNUSTEP_INSTANCE)_AOT_JAVA_FILES))
+AOT_JAVA_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(AOT_JAVA_OBJS))
+
 JAVA_OBJS = $(patsubst %.java,%.class,$($(GNUSTEP_INSTANCE)_JAVA_FILES))
 JAVA_OBJ_FILES = $(JAVA_OBJS)
 
@@ -234,7 +240,7 @@ OBJ_FILES = $($(GNUSTEP_INSTANCE)_OBJ_FILES)
 # OBJ_FILES_TO_LINK to '' we know if there is a link stage to be
 # performed at all (useful for example in bundles which can contain an
 # object file, or not).
-OBJ_FILES_TO_LINK = $(strip $(C_OBJ_FILES) $(OBJC_OBJ_FILES) $(CC_OBJ_FILES) $(WINDRES_OBJ_FILES) $(SUBPROJECT_OBJ_FILES) $(OBJ_FILES))
+OBJ_FILES_TO_LINK = $(strip $(C_OBJ_FILES) $(OBJC_OBJ_FILES) $(CC_OBJ_FILES) $(AOT_JAVA_OBJ_FILES) $(WINDRES_OBJ_FILES) $(SUBPROJECT_OBJ_FILES) $(OBJ_FILES))
 
 ifeq ($(AUTO_DEPENDENCIES),yes)
   ifneq ($(strip $(OBJ_FILES_TO_LINK)),)
@@ -256,6 +262,8 @@ ADDITIONAL_TOOL_LIBS += $($(GNUSTEP_INSTANCE)_TOOL_LIBS)
 
 ADDITIONAL_OBJC_LIBS += $($(GNUSTEP_INSTANCE)_OBJC_LIBS)
 
+ADDITIONAL_AOT_JAVA_LIBS += $($(GNUSTEP_INSTANCE)_AOT_JAVA_LIBS)
+
 ADDITIONAL_LIBRARY_LIBS += $($(GNUSTEP_INSTANCE)_LIBS) \
                            $($(GNUSTEP_INSTANCE)_LIBRARY_LIBS)
 
@@ -269,6 +277,8 @@ ADDITIONAL_CFLAGS += $($(GNUSTEP_INSTANCE)_CFLAGS)
 
 ADDITIONAL_OBJCFLAGS += $($(GNUSTEP_INSTANCE)_OBJCFLAGS)
 
+ADDITIONAL_AOT_JAVAFLAGS += $($(GNUSTEP_INSTANCE)_AOT_JAVAFLAGS)
+
 ADDITIONAL_CCFLAGS += $($(GNUSTEP_INSTANCE)_CCFLAGS)
 
 ADDITIONAL_LDFLAGS += $($(GNUSTEP_INSTANCE)_LDFLAGS)
diff --git a/gnustep-make/Master/gcj-tool.make b/gnustep-make/Master/gcj-tool.make
new file mode 100644 (file)
index 0000000..0223f7c
--- /dev/null
@@ -0,0 +1,55 @@
+#
+#   Master/gcj-java-tool.make
+#
+#   Master Makefile rules to build GNUstep-based command line ctools.
+#
+#   Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+#
+#   Author:  Scott Christley <scottc@net-community.com>
+#   Author:  Nicola Pero <nicola@brainstorm.co.uk>
+#   Author:  Helge Hess <helge.hess@opengroupware.org>
+#
+#   This file is part of the GNUstep Makefile Package.
+#
+#   This library is free software; you can redistribute it and/or
+#   modify it under the terms of the GNU General Public License
+#   as published by the Free Software Foundation; either version 2
+#   of the License, or (at your option) any later version.
+#   
+#   You should have received a copy of the GNU General Public
+#   License along with this library; see the file COPYING.LIB.
+#   If not, write to the Free Software Foundation,
+#   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ifeq ($(RULES_MAKE_LOADED),)
+include $(GNUSTEP_MAKEFILES)/rules.make
+endif
+
+AOT_JAVA_TOOL_NAME := $(strip $(AOT_JAVA_TOOL_NAME))
+
+internal-all:: $(AOT_JAVA_TOOL_NAME:=.all.aotjavatool.variables)
+
+internal-install:: $(AOT_JAVA_TOOL_NAME:=.install.aotjavatool.variables)
+
+internal-uninstall:: $(AOT_JAVA_TOOL_NAME:=.uninstall.aotjavatool.variables)
+
+internal-clean::
+       rm -rf $(GNUSTEP_OBJ_DIR)
+
+internal-distclean::
+       (cd $(GNUSTEP_BUILD_DIR); \
+       rm -rf shared_obj static_obj shared_debug_obj shared_profile_obj \
+         static_debug_obj static_profile_obj shared_profile_debug_obj \
+         static_profile_debug_obj)
+
+AOT_JAVA_TOOLS_WITH_SUBPROJECTS = $(strip $(foreach aotjavatool,$(AOT_JAVA_TOOL_NAME),$(patsubst %,$(aotjavatool),$($(aotjavatool)_SUBPROJECTS))))
+ifneq ($(AOT_JAVA_TOOLS_WITH_SUBPROJECTS),)
+internal-clean:: $(AOT_JAVA_TOOLS_WITH_SUBPROJECTS:=.clean.aotjavatool.subprojects)
+internal-distclean:: $(AOT_JAVA_TOOLS_WITH_SUBPROJECTS:=.distclean.aotjavatool.subprojects)
+endif
+
+internal-strings:: $(AOT_JAVA_TOOL_NAME:=.strings.aotjavatool.variables)
+
+$(AOT_JAVA_TOOL_NAME):
+       @$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory \
+                $@.all.aotjavatool.variables
index 6ea0ad4d0ed4b1d0c462f3e8094878c4f4518fe1..bde5a58bc5c24eb0deff620cee8fe9111b3f4033 100644 (file)
@@ -25,7 +25,7 @@
 #
 # The name of the tools is in the JAVA_TOOL_NAME variable.
 # The main class (the one implementing main) is in the
-# xxx_PRINCIPAL_CLASS variable.
+# xxx_MAIN_CLASS variable.
 #
 
 JAVA_TOOL_NAME := $(strip $(JAVA_TOOL_NAME))
index 4ba8a31478ddde605ad06e306ff36c7775f138aa..1b968c86315ca35d4456cf5b6e70f7166cc99f4b 100644 (file)
@@ -556,6 +556,18 @@ ifeq ($(JAVAH),)
   JAVAH = $(JAVA_HOME)/bin/javah
 endif
 
+#
+# Some GCJ Java Options
+#
+
+INTERNAL_AOT_JAVAFLAGS += -fjni -findirect-dispatch
+
+ifeq ($(shared), yes)
+  INTERNAL_AOT_JAVAFLAGS += $(SHARED_CFLAGS)
+endif
+
+INTERNAL_AOT_JAVAFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG)
+
 #
 # Common variables - default values
 #
diff --git a/gnustep-make/gcj-tool.make b/gnustep-make/gcj-tool.make
new file mode 100644 (file)
index 0000000..c9ef63d
--- /dev/null
@@ -0,0 +1,31 @@
+#
+#   gcj-tool.make
+#
+#   Makefile rules to build GNUstep-based command line ctools.
+#
+#   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+#
+#   Author:  Nicola Pero <nicola@brainstorm.co.uk>
+#   Author:  Helge Hess  <helge.hess@opengroupware.org>
+#
+#   This file is part of the GNUstep Makefile Package.
+#
+#   This library is free software; you can redistribute it and/or
+#   modify it under the terms of the GNU General Public License
+#   as published by the Free Software Foundation; either version 2
+#   of the License, or (at your option) any later version.
+#   
+#   You should have received a copy of the GNU General Public
+#   License along with this library; see the file COPYING.LIB.
+#   If not, write to the Free Software Foundation,
+#   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ifeq ($(GNUSTEP_INSTANCE),)
+include $(GNUSTEP_MAKEFILES)/Master/gcj-tool.make
+else
+
+ifeq ($(GNUSTEP_TYPE),aotjavatool)
+include $(GNUSTEP_MAKEFILES)/Instance/gcj-tool.make
+endif
+
+endif
index 5676b4aa22de7068bbce034212497567d83a8b8c..050a11e89a4b222109da9ee76938bbc29b5555af 100644 (file)
@@ -246,6 +246,14 @@ ALL_CFLAGS = $(INTERNAL_CFLAGS) $(ADDITIONAL_CFLAGS) \
    $(GNUSTEP_HEADERS_FLAGS) \
    $(GNUSTEP_FRAMEWORKS_FLAGS)
 
+ALL_AOT_JAVAFLAGS = $(INTERNAL_AOT_JAVAFLAGS) $(ADDITIONAL_AOT_JAVAFLAGS) \
+   $(AUXILIARY_AOT_JAVAFLAGS) $(ADDITIONAL_INCLUDE_DIRS) \
+   $(AUXILIARY_INCLUDE_DIRS) \
+   $(DERIVED_SOURCES_HEADERS_FLAG) \
+   -I. $(SYSTEM_INCLUDES) \
+   $(GNUSTEP_HEADERS_FLAGS) \
+   $(GNUSTEP_FRAMEWORKS_FLAGS)
+
 # if you need, you can define ADDITIONAL_CCFLAGS to add C++ specific flags
 ALL_CCFLAGS = $(ADDITIONAL_CCFLAGS) $(AUXILIARY_CCFLAGS)
 
@@ -395,6 +403,12 @@ $(GNUSTEP_OBJ_DIR)/%${OEXT} : %.m
              $(PCH_INCLUDE_FLAG) \
              $($<_FILE_FLAGS) -o $@$(END_ECHO)
 
+$(GNUSTEP_OBJ_DIR)/%${OEXT} : %.java
+       $(ECHO_COMPILING)$(CC) $< -c \
+             $(filter-out -D%,$(ALL_CPPFLAGS) $(ALL_AOT_JAVAFLAGS)) \
+             $(PCH_INCLUDE_FLAG) \
+             $($<_FILE_FLAGS) -o $@$(END_ECHO)
+
 $(GNUSTEP_OBJ_DIR)/%${OEXT} : %.C
        $(ECHO_COMPILING)$(CC) $< -c \
              $(filter-out $($<_FILE_FILTER_OUT_FLAGS),$(ALL_CPPFLAGS) \