Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Sep 2008 10:27:36 +1200
From:      Jonathan Chen <jonc@chen.org.nz>
To:        Max Khon <fjoe@samodelkin.net>
Cc:        freebsd-java@FreeBSD.org
Subject:   Re: Current problem reports assigned to freebsd-java@FreeBSD.org
Message-ID:  <20080902222736.GA61025@osiris.chen.org.nz>
In-Reply-To: <48BCC718.5020103@samodelkin.net>
References:  <200809011106.m81B6vTH068481@freefall.freebsd.org> <20080901190357.GA78771@osiris.chen.org.nz> <48BCC718.5020103@samodelkin.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Sep 02, 2008 at 11:54:48AM +0700, Max Khon wrote:
> Jonathan Chen wrote:
> >On Mon, Sep 01, 2008 at 11:06:57AM +0000, FreeBSD bugmaster wrote:
> >[...]
> >>o ports/125828 java       upgrade java/java3d to 1.5.2
> >
> >Would any committers on the list mind reviewing and committing this port?
> 
> It does not build for me:
[...]
> compile-opt:
>     [mkdir] Created dir: 
> /usr/ports/java/java3d/work/java3d-1.5.2/j3d-core/build/freebsd/opt/classes
>     [mkdir] Created dir: 
> /usr/ports/java/java3d/work/java3d-1.5.2/j3d-core/build/freebsd/opt/gen/tools
>     [mkdir] Created dir: 
> /usr/ports/java/java3d/work/java3d-1.5.2/j3d-core/build/freebsd/opt/gen/classes/javax/media/j3d
>      [copy] Copying 1 file to 
> /usr/ports/java/java3d/work/java3d-1.5.2/j3d-core/build/freebsd/opt/gen/classes/javax/media/j3d
>     [javac] Compiling 760 source files to 
> /usr/ports/java/java3d/work/java3d-1.5.2/j3d-core/build/freebsd/opt/classes
>     [javac]
>     [javac]
>     [javac] The system is out of resources.
>     [javac] Consult the following stack trace for details.
>     [javac] java.lang.OutOfMemoryError: Java heap space

Could you please try the attached updated "files/patch-freebsd", and if it
works I'll update the PR.

Thansk.
-- 
Jonathan Chen <jonc@chen.org.nz>
----------------------------------------------------------------------
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}

--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-freebsd

diff -ruN ./j3d-core/build.xml ../java3d-1.5.2/j3d-core/build.xml
--- ./j3d-core/build.xml	2008-05-24 08:31:19.000000000 +1200
+++ ../java3d-1.5.2/j3d-core/build.xml	2008-07-21 23:00:14.000000000 +1200
@@ -142,6 +142,15 @@
     <echo message="version_file    = ${version_file}"/>
   </target>
 
+  <target name="setupFreeBSD" if="isFreeBSD">
+    <property name="isUnix" value="true"/>
+    <property name="shell" value="/bin/sh"/>
+    <property name="wstype" value="x11"/>
+    <property name="platformname" value="freebsd-${os.arch}"/>
+    <property name="platform" value="freebsd"/>
+    <property name="install.bin" value="lib/${os.arch}"/>
+  </target>
+
   <target name="setupSolaris" if="isSolarisOnSparc">
     <property name="isUnix" value="true"/>
     <property name="shell" value="/usr/bin/ksh"/>
@@ -232,7 +241,7 @@
   </target>
 
   <target name="setupPlatform"
-       depends="init, setupBuildType, setupSolaris, setupSolarisX86, setupLinux, setupLinuxAmd64, setupLinuxIA64, setupLinuxPPC, setupWindows, setupWindowsAmd64, setupMacOSX, setupJogl">
+       depends="init, setupBuildType, setupFreeBSD, setupSolaris, setupSolarisX86, setupLinux, setupLinuxAmd64, setupLinuxIA64, setupLinuxPPC, setupWindows, setupWindowsAmd64, setupMacOSX, setupJogl">
     <property name="build-debug-gen" location="${build}/${platform}/debug/gen"/>
     <property name="build-opt-gen" location="${build}/${platform}/opt/gen"/>
     <property name="docname" value="${build.relprefix}-${version_file}-doc"/>
diff -ruN ./j3d-core/src/classes/build.xml ../java3d-1.5.2/j3d-core/src/classes/build.xml
--- ./j3d-core/src/classes/build.xml	2008-02-29 09:17:18.000000000 +1300
+++ ../java3d-1.5.2/j3d-core/src/classes/build.xml	2008-07-21 23:02:37.000000000 +1200
@@ -95,6 +95,7 @@
    <javac srcdir="${src}/classes/share:${src}/classes/${wstype}:${jogl.pipeline.srcdir}:${core_utils_src}/classes/share:${build-opt-gen}/classes"            destdir="${build}/${platform}/opt/classes"
            source="1.5"
            target="1.5"
+		   fork="yes" memoryMaximumSize="128m"
            debug="true"
            debuglevel="lines,source"
            deprecation="off"
@@ -318,7 +319,7 @@
              excludepackagenames="com.sun.j3d.utils.scenegraph.io.retained,
 			   com.sun.j3d.exp.swing.impl,
 			   com.sun.j3d.utils.scenegraph.io.state.*"
-             maxmemory="128m"
+             maxmemory="256m"
              destdir="${build}/${platform}/javadocs/docs-public"
 	     bottom="${javadoc.bottom}"
              windowtitle="${build.javadoc.name} ${version}">
diff -ruN ./j3d-core/src/native/build.xml ../java3d-1.5.2/j3d-core/src/native/build.xml
--- ./j3d-core/src/native/build.xml	2008-02-29 09:17:58.000000000 +1300
+++ ../java3d-1.5.2/j3d-core/src/native/build.xml	2008-07-21 23:00:14.000000000 +1200
@@ -3,6 +3,19 @@
 <!-- Ant file for building native files -->
 <project name="j3d-core native" default="compile-opt">
 
+  <target name="nativeSetup-debug-freebsd" if="isFreeBSD">
+	<property name="bldFlag" value="-g -DDEBUG"/>
+	<property name="coreLibDependency" value="lib/${os.arch}/libj3dcore-ogl.so"/>
+        <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+        <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
+  </target>
+  <target name="nativeSetup-opt-freebsd" if="isFreeBSD">
+	<property name="bldFlag" value="-O2"/>
+	<property name="coreLibDependency" value="lib/${os.arch}/libj3dcore-ogl.so"/>
+        <property name="osNativeConfigTemplate3D" value="X11NativeConfigTemplate3D"/>
+        <property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
+  </target>
+
   <target name="nativeSetup-debug-solaris" if="isSolarisOnSparc">
 	<property name="bldFlag" value="-g -DDEBUG"/>
 	<property name="coreLibDependency" value="lib/sparc/libj3dcore-ogl.so"/>
@@ -62,7 +75,7 @@
         <property name="osNativeScreenInfo" value="Win32NativeScreenInfo"/>
   </target>
 
-  <target name="nativeSetup-debug" depends="nativeSetup-debug-solaris, nativeSetup-debug-solaris-x86, nativeSetup-debug-linux, nativeSetup-debug-linux-amd64, nativeSetup-debug-linux-ia64, nativeSetup-debug-linux-ppc, nativeSetup-debug-win32, nativeSetup-debug-winamd64">
+  <target name="nativeSetup-debug" depends="nativeSetup-debug-freebsd, nativeSetup-debug-solaris, nativeSetup-debug-solaris-x86, nativeSetup-debug-linux, nativeSetup-debug-linux-amd64, nativeSetup-debug-linux-ia64, nativeSetup-debug-linux-ppc, nativeSetup-debug-win32, nativeSetup-debug-winamd64">
 	<property name="bldType" value="debug"/>
 	<property name="javahCoreSrc"     
 	 location="${src}/classes/share/javax/media/j3d"/>
@@ -128,7 +141,7 @@
         <property name="osNativeScreenInfo" value="Win32NativeScreenInfo"/>
   </target>
 
-  <target name="nativeSetup-opt" depends="nativeSetup-opt-solaris, nativeSetup-opt-solaris-x86, nativeSetup-opt-linux, nativeSetup-opt-linux-amd64, nativeSetup-opt-linux-ia64, nativeSetup-opt-linux-ppc, nativeSetup-opt-win32, nativeSetup-opt-winamd64">
+  <target name="nativeSetup-opt" depends="nativeSetup-opt-freebsd, nativeSetup-opt-solaris, nativeSetup-opt-solaris-x86, nativeSetup-opt-linux, nativeSetup-opt-linux-amd64, nativeSetup-opt-linux-ia64, nativeSetup-opt-linux-ppc, nativeSetup-opt-win32, nativeSetup-opt-winamd64">
 	<property name="bldType" value="opt"/>
 	<property name="javahCoreSrc"     
 	 location="${src}/classes/share/javax/media/j3d"/>
diff -ruN ./j3d-core/src/native/ogl/build-freebsd.xml ../java3d-1.5.2/j3d-core/src/native/ogl/build-freebsd.xml
--- ./j3d-core/src/native/ogl/build-freebsd.xml	1970-01-01 12:00:00.000000000 +1200
+++ ../java3d-1.5.2/j3d-core/src/native/ogl/build-freebsd.xml	2008-07-21 23:00:14.000000000 +1200
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+
+<!-- Ant file for building native ogl renderer files for FreeBSD -->
+<project name="j3d-core native" default="compile">
+
+  <target name="init" depends="init-cg,init-nocg">
+    <!-- Create the build directories for freebsd -->
+    <mkdir dir="${build}/${platform}/${bldType}/native/ogl/objs"/>
+    <mkdir dir="${build}/${platform}/${bldType}/lib/${os.arch}"/>
+    
+    <property name="oglsrc"     location="${src}/native/ogl"/>
+  </target>
+
+  <target name="init-cg" if="build.cg">
+    <property name="cflags.cg"  value="-DCOMPILE_CG_SHADERS=1"/>
+  </target>
+
+  <target name="init-nocg" unless="build.cg">
+    <property name="cflags.cg"  value=""/>
+  </target>
+
+  <target name="compile-ogl">
+    <echo message="Executing native renderer build [${bldType}]"/>
+
+    <!-- Compile the c source files-->
+    <exec dir="${build}/${platform}/${bldType}/native/ogl/objs" executable="gcc">
+	<arg line="-fPIC -march=k8 -I${oglsrc} -I/usr/local/include -I${java.home}/../include -I${java.home}/../include/freebsd -I${javahCoreTarget} ${bldFlag} -DLINUX ${cflags.cg} -c ${oglsrc}/DrawingSurfaceObjectAWT.c ${oglsrc}/Canvas3D.c ${oglsrc}/GraphicsContext3D.c  ${oglsrc}/NativeScreenInfo.c  ${oglsrc}/NativeConfigTemplate3D.c  ${oglsrc}/MasterControl.c  ${oglsrc}/GeometryArrayRetained.c  ${oglsrc}/Attributes.c  ${oglsrc}/CgShaderProgram.c  ${oglsrc}/GLSLShaderProgram.c  ${oglsrc}/Lights.c"/>
+    </exec>
+
+    <!-- Create the library file-->
+    <exec dir="${build}/${platform}/${bldType}/native/ogl/objs" executable="ld">
+	<arg line="DrawingSurfaceObjectAWT.o  Canvas3D.o  GraphicsContext3D.o  NativeScreenInfo.o  NativeConfigTemplate3D.o  MasterControl.o  GeometryArrayRetained.o  Attributes.o  CgShaderProgram.o  GLSLShaderProgram.o  Lights.o -G -z defs -L/usr/local/lib -lGL -lX11 -lXext -lm -lc -L${java.home}/lib/${os.arch} -ljawt -L${java.home}/lib/${os.arch}/server -ljvm  -o libj3dcore-ogl.so"/>
+    </exec>
+
+  </target>
+
+  <target name="compile-ogl-cg" if="build.cg">
+    <!-- Compile the wrapper -->
+    <exec dir="${build}/${platform}/${bldType}/native/ogl/objs" executable="gcc">
+	<arg line="-march=k8 -I${oglsrc} -I${java.home}/../include -I${java.home}/../include/freebsd -I${javahCoreTarget} ${bldFlag} -DLINUX ${cflags.cg} -c ${oglsrc}/CgWrapper.c"/>
+    </exec>
+
+    <!-- Create the wrapper library -->
+    <exec dir="${build}/${platform}/${bldType}/native/ogl/objs" executable="ld">
+	<arg line="CgWrapper.o -G -z defs -L/usr/X11R6/lib64 -ldl -lCg -lCgGL -lpthread -lGL -lX11 -lXext -lm -lnsl -lc -o libj3dcore-ogl-cg.so"/>
+    </exec>
+
+  </target>
+
+  <target name="compile" depends="init,compile-ogl,compile-ogl-cg">
+
+    <!-- Copy the  library file -->
+    <copy todir="${build}/${platform}/${bldType}/lib/${os.arch}">
+          <fileset dir="${build}/${platform}/${bldType}/native/ogl/objs"
+                      includes="libj3dcore-ogl*.so"
+          />
+    </copy>
+
+  </target>
+
+  <target name="dist">
+    <!-- Create the distribution directory -->
+    <mkdir dir="${dist}/${platform}/lib/${os.arch}"/>
+
+    <!-- Copy the library files -->
+    <copy todir="${dist}/${platform}/lib/${os.arch}">
+          <fileset dir="${build}/${platform}/opt/lib/${os.arch}"
+                      includes="libj3dcore-ogl*.so"
+          />
+    </copy>
+
+  </target>
+
+</project>

--XsQoSWH+UP9D9v3l--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080902222736.GA61025>