summaryrefslogtreecommitdiff
path: root/java/java3d/files/patch-freebsd
blob: e11a2df2c13c564c18d7dfb7797594e5a7353a89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
diff -ruN ../java3d-1.5.2/j3d-core/build.xml ./j3d-core/build.xml
--- ../java3d-1.5.2/j3d-core/build.xml	2008-05-24 08:31:19.000000000 +1200
+++ ./j3d-core/build.xml	2009-07-12 13:20:26.000000000 +1200
@@ -142,6 +142,16 @@
     <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}"/>
+    <property name="ports.localbase" value="/usr/local"/>
+  </target>
+
   <target name="setupSolaris" if="isSolarisOnSparc">
     <property name="isUnix" value="true"/>
     <property name="shell" value="/usr/bin/ksh"/>
@@ -232,7 +242,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 ../java3d-1.5.2/j3d-core/src/classes/build.xml ./j3d-core/src/classes/build.xml
--- ../java3d-1.5.2/j3d-core/src/classes/build.xml	2008-02-29 09:17:18.000000000 +1300
+++ ./j3d-core/src/classes/build.xml	2009-07-12 13:19:17.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 ../java3d-1.5.2/j3d-core/src/native/build.xml ./j3d-core/src/native/build.xml
--- ../java3d-1.5.2/j3d-core/src/native/build.xml	2008-02-29 09:17:58.000000000 +1300
+++ ./j3d-core/src/native/build.xml	2009-07-12 13:19:17.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"/>
@@ -347,6 +360,7 @@
     <javah destdir="${javahCoreTarget}" force="yes">
 	<classpath>
 	    <pathelement path="${build}/${platform}/${bldType}/classes"/>
+	    <pathelement path="${vecmath_home}/build/opt/lib/ext/vecmath.jar"/>
 	</classpath>
 	
 	<class name="javax.media.j3d.Background"/>
diff -ruN ../java3d-1.5.2/j3d-core/src/native/ogl/build-freebsd.xml ./j3d-core/src/native/ogl/build-freebsd.xml
--- ../java3d-1.5.2/j3d-core/src/native/ogl/build-freebsd.xml	1970-01-01 12:00:00.000000000 +1200
+++ ./j3d-core/src/native/ogl/build-freebsd.xml	2009-07-12 13:21:41.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 -I${oglsrc} -I${ports.localbase}/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${ports.localbase}/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="-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>