native builds are now oneshot compiled
authoradam <adam@megacz.com>
Wed, 10 Mar 2004 08:31:25 +0000 (08:31 +0000)
committeradam <adam@megacz.com>
Wed, 10 Mar 2004 08:31:25 +0000 (08:31 +0000)
darcs-hash:20040310083125-5007d-2b94eb5b8c12c75e44d4d919bed5ea48b53878b4.gz

Makefile
src/org/ibex/plat/GCJ.cc
src/org/ibex/plat/Linux.cc
src/org/ibex/plat/POSIX.cc
src/org/ibex/plat/X11.cc
upstream/jpeg-6b/patches/jpeg-6b.patch [deleted file]

index 685b011..a5e0f7a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -201,20 +201,15 @@ build/h/%.h: build/class/%.class .compile
 build/$(platform)/org/ibex/plat/Linux.cc.o: .install_WindowMaker-0.80.2_$(target) 
 build/$(platform)/org/ibex/plat/Solaris.cc.o: .install_WindowMaker-0.80.2_$(target) 
 
-build/$(platform)/org/ibex/plat/$(platform).cc.o: src/org/ibex/plat/$(platform).cc src/org/ibex/plat/*.cc .configure_jpeg-6b_$(target)
-       @make $(java_headers)
-       @echo -e "\n\033[1mcompiling            .cc -> .o:     $<\033[0m"
-       mkdir -p `dirname $@`
-       $(g++) -c $< -o $@
-
 libjava_dir := $(shell pwd)/upstream/gcc-3.3/build-$(target)/$(target)/libjava
 nat_libjava_files_ := boehm.o exception.o posix-threads.o posix.o prims.o resolve.o java/net/natInetAddress.o
-nat_libjava_files_ += java/net/natPlainSocketImpl.o java/io/natFile*.o java/util/zip/nat*.o gnu/gcj/runtime/natFirstThread.o
+nat_libjava_files_ += java/net/natPlainSocketImpl.o java/util/zip/nat*.o gnu/gcj/runtime/natFirstThread.o
 nat_libjava_files_ += gnu/gcj/runtime/natNameFinder.o gnu/gcj/runtime/natStackTrace.o gnu/gcj/runtime/natSharedLibLoader.o
 nat_libjava_files_ += gnu/gcj/runtime/natStringBuffer.o gnu/gcj/runtime/natVMClassLoader.o gnu/gcj/runtime/natFinalizerThread.o
 nat_libjava_files_ += $(shell cd $(libjava_dir) 2>/dev/null; find java/lang -name \*.o -not -name '*[A-Z]*' 2>/dev/null)
 nat_libjava_files_ += $(shell cd $(libjava_dir) 2>/dev/null; find java/lang -name nat\*.o 2>/dev/null)
 nat_libjava_files := $(nat_libjava_files_:%=$(libjava_dir)/%)
+nat_libjava_files += $(libjava_dir)/java/io/natFile.o $(libjava_dir)/java/io/natFileDescriptor.o
 
 build/$(platform)/natibex.a: $(nat_libjava_files)
        @echo -e "\n\033[1mdetecting CNI calls...\033[0m"
@@ -235,29 +230,55 @@ build/$(platform)/ibex.pruned.jar: .compile .install_jpeg-6b_$(target) build/$(p
        mkdir tmp; cd tmp; fastjar xvf ../build/$(platform)/ibex.jar.pruned; cp ../build/class/org/ibex/plat/GCJ* org/ibex/plat/; cp -r ../build/class/org/xwt/mips/* org/xwt/mips/; mkdir -p $(shell pwd)/build/$(platform)/java/lang; mv java/lang/Class.class $(shell pwd)/build/$(platform)/java/lang; fastjar cvf ../build/$(platform)/ibex.jar.pruned .; cd ..; rm -rf tmp
        mv build/$(platform)/ibex.jar.pruned $@
 
+ifeq ($(platform),Win32)
+filedes := $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFileWin32.cc
+filedes += $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFileDescriptorWin32.cc
+else
+filedes := $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFilePosix.cc
+filedes += $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFileDescriptorPosix.cc
+endif
+
 ifneq ($(target_bin_extension),jar)
-build/$(platform)/$(target_bin): build/$(platform)/ibex.pruned.jar build/$(platform)/natibex.a build/$(platform)/org/ibex/plat/$(platform).cc.o build/$(platform)/builtin.o
+build/$(platform)/$(target_bin): build/$(platform)/ibex.pruned.jar src/org/ibex/plat/*.cc build/$(platform)/builtin.o $(java_headers)
 
        @echo -e "\n\033[1mlinking              .jar -> $(target_bin).phat\033[0m"
-#      PATH=upstream/install/bin:$$PATH $(gcj)
-#              -Os -w                                                               
+# -Os
        cd build/$(platform); $(shell pwd)/upstream/install/bin/$(target)-gcj        \
                -fCLASSPATH=$(shell pwd)/upstream/install/share/java/libgcj-3.3.jar  \
+               -finhibit-reflection                                                 \
                -c java/lang/Class.class
-       PATH=upstream/install/bin:$$PATH upstream/install/bin/$(target)-gcj          \
-               -Wl,-O2,--relax,--gc-sections,--noinhibit-exec,--no-whole-archive    \
-               --main=org.ibex.plat.$(platform)                                     \
-               -Dfile.encoding=UTF8                                                 \
-               -Lupstream/install/$(target)/lib -Lupstream/install/lib              \
-               -w                                                                   \
-               build/$(platform)/org/ibex/plat/$(platform).cc.o                     \
-               build/$(platform)/ibex.pruned.jar                                    \
-               build/$(platform)/natibex.a                                          \
-               build/$(platform)/builtin.o                                          \
-               upstream/jpeg-6b/build-$(target)/libjpeg.a                           \
-               $(link_flags)                                                        \
-               $(libjava_dir)/../boehm-gc/.libs/libgcjgc.a                          \
-               build/$(platform)/Class.o                                            \
+       cd upstream/gcc-3.3/src/libjava/java/lang;\
+               ln -sf ../../../../build-$(target)/$(target)/libjava/java/lang/natConcreteProcess.cc
+       PATH=upstream/install/bin:$$PATH upstream/install/bin/$(target)-gcj              \
+               -Wl,-O2,--relax,--gc-sections,--noinhibit-exec,--no-whole-archive        \
+               --main=org.ibex.plat.$(platform)                                         \
+               -Dfile.encoding=UTF8                                                     \
+               -DPREFIX=\"\" \
+               -Lupstream/install/$(target)/lib -Lupstream/install/lib                  \
+               -finhibit-reflection                                                     \
+               -w -g                                                                    \
+               -Iupstream/jpeg-6b/build-$(target)/                                      \
+               -Iupstream/jpeg-6b/src                                                   \
+               -Ibuild/h                                                                \
+               -Iupstream/gcc-3.3/src/gcc \
+               -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/boehm-gc/    \
+               -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/boehm-gc/include    \
+               -Iupstream/gcc-3.3/src/boehm-gc                                           \
+               -Iupstream/gcc-3.3/src/boehm-gc/include                                       \
+               -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/libjava/    \
+               -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/libjava/include    \
+               -Iupstream/gcc-3.3/src/libjava                                           \
+               -Iupstream/gcc-3.3/src/libjava/include                                       \
+               -Ufile \
+               src/org/ibex/plat/$(platform).cc                                         \
+               $(nat_libjava_files_:%.o=$(shell pwd)/upstream/gcc-3.3/src/libjava/%.c*) \
+               $(filedes) \
+               build/$(platform)/ibex.pruned.jar                                        \
+               build/$(platform)/builtin.o                                              \
+               upstream/jpeg-6b/build-$(target)/libjpeg.a                               \
+               $(link_flags)                                                            \
+               $(libjava_dir)/../boehm-gc/.libs/libgcjgc.a                              \
+               build/$(platform)/Class.o                                                \
                -lz -o $@.phat
        @echo; ls -l $@.phat
 
index ca5aa9b..53e7f19 100644 (file)
@@ -4,6 +4,14 @@
 
 #include <gcj/cni.h>
 #include <gcj/array.h>
+#include <org/ibex/Platform.h>
+#include <org/ibex/Picture.h>
+#include <org/ibex/plat/GCJ.h>
+#include <java/io/InputStream.h>
+#include <java/io/ByteArrayInputStream.h>
+#include <java/lang/RuntimeException.h>
+#include <org/ibex/plat/GCJ.h>
+#include <org/ibex/util/Log.h>
 extern "C" {
 
 // hack for broken Solaris headers
@@ -14,14 +22,6 @@ extern "C" {
 #include <setjmp.h>
 #include "jpeglib.h"
 }
-#include <org/ibex/Platform.h>
-#include <org/ibex/Picture.h>
-#include <org/ibex/plat/GCJ.h>
-#include <java/io/InputStream.h>
-#include <java/io/ByteArrayInputStream.h>
-#include <java/lang/RuntimeException.h>
-#include <org/ibex/plat/GCJ.h>
-#include <org/ibex/util/Log.h>
 
 #ifdef TRUE
 #undef TRUE
index e96c23c..37118c3 100644 (file)
@@ -1,7 +1,12 @@
+// IMPORTANT: inclusion order: always include gcjh'ed headers first, then superclass cc's, then system headers
+#undef file
 #include <stdint.h>
-#include "X11.cc"
-
+#include <java/lang/Class.h>
+#include <org/ibex/js/JS.h>
+#include <org/ibex/util/Log.h>
 #include <org/ibex/plat/Linux.h>
+#include "X11.cc"
+#include <stdint.h>
 
 // we love libgcj!
 extern const char **_Jv_argv;
index 869e275..0fe7dc1 100644 (file)
@@ -1,18 +1,6 @@
 // Copyright 2002 Adam Megacz, see the COPYING file for licensing [LGPL]
 // see below for copyright information on the second portion of this file
 
-#include "GCJ.cc"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <java/lang/String.h>
-
-// FIXME: we don't need all these
 #include <java/lang/String.h>
 #include <org/ibex/Surface.h>
 #include <org/ibex/Picture.h>
 #include <java/lang/System.h>
 #include <java/io/PrintStream.h>
 
+#include "GCJ.cc"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <sys/types.h>
+#include <signal.h>
+
 jstring org::ibex::plat::POSIX::_getEnv(jstring key) {
     int len = JvGetStringUTFLength(key);
     char buf[len + 1];
index 680fb1e..0e91ece 100644 (file)
@@ -1,8 +1,6 @@
 // Copyright 2002 Adam Megacz, see the COPYING file for licensing [LGPL]
 // see below for copyright information on the second portion of this file
 
-#include "POSIX.cc"
-
 #include <X11/Xlib.h>
 #include <X11/extensions/XShm.h>
 #include <X11/keysymdef.h>
@@ -29,6 +27,8 @@
 #include <java/lang/System.h>
 #include <java/io/PrintStream.h>
 
+#include "POSIX.cc"
+
 // static (per-xserver) data
 static Visual* visual;
 static Colormap s_colormap;
diff --git a/upstream/jpeg-6b/patches/jpeg-6b.patch b/upstream/jpeg-6b/patches/jpeg-6b.patch
deleted file mode 100644 (file)
index ba5ce1d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
---- jmorecfg.h Thu Jun 12 03:18:52 2003
-+++ jmorecfg.h Thu Jun 12 03:21:25 2003
-@@ -290,8 +290,11 @@
- #define IDCT_SCALING_SUPPORTED      /* Output rescaling via IDCT? */
- #undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */
- #define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */
-+/* Can't use these with RGB_PIXELSIZE != 3 */
-+#if 0
- #define QUANT_1PASS_SUPPORTED      /* 1-pass color quantization? */
- #define QUANT_2PASS_SUPPORTED      /* 2-pass color quantization? */
-+#endif
- /* more capability options later, no doubt */
-@@ -311,10 +314,30 @@
-  *    can't use color quantization if you change that value.
-  */
--#define RGB_RED       0        /* Offset of Red in an RGB scanline element */
-+#include <sys/types.h>
-+#if defined(__BYTE_ORDER) && !defined(BYTE_ORDER)
-+#define BYTE_ORDER __BYTE_ORDER
-+#endif
-+#if defined(__LITTLE_ENDIAN) && !defined(LITTLE_ENDIAN)
-+#define LITTLE_ENDIAN __LITTLE_ENDIAN
-+#endif
-+#if defined(__BIG_ENDIAN) && !defined(BIG_ENDIAN)
-+#define BIG_ENDIAN __BIG_ENDIAN
-+#endif
-+
-+#if BYTE_ORDER == BIG_ENDIAN
-+#define RGB_RED        1       /* Offset of Red in an RGB scanline element */
-+#define RGB_GREEN      2       /* Offset of Green */
-+#define RGB_BLUE       3       /* Offset of Blue */
-+#elif BYTE_ORDER == LITTLE_ENDIAN
-+#define RGB_RED        2       /* Offset of Red in an RGB scanline element */
- #define RGB_GREEN      1       /* Offset of Green */
--#define RGB_BLUE       2       /* Offset of Blue */
--#define RGB_PIXELSIZE  3       /* JSAMPLEs per RGB scanline element */
-+#define RGB_BLUE       0       /* Offset of Blue */
-+#else
-+#error Cannot figure out endianness
-+#endif
-+
-+#define RGB_PIXELSIZE  4       /* JSAMPLEs per RGB scanline element */
- /* Definitions for speed-related optimizations. */