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
|
--- a/j3d-core/build.xml
+++ b/j3d-core/build.xml
@@ -196,6 +196,15 @@
<property name="install.bin" value="lib/ppc"/>
</target>
+ <target name="setupLinuxGeneric" if="isLinuxGeneric">
+ <property name="isUnix" value="true"/>
+ <property name="shell" value="/bin/sh"/>
+ <property name="wstype" value="x11"/>
+ <property name="platformname" value="linux-generic"/>
+ <property name="platform" value="linux-generic"/>
+ <property name="install.bin" value="lib/${os.arch}"/>
+ </target>
+
<!-- win32 should be rename as windows -->
<target name="setupWindows" if="isWindowsOnX86">
<property name="isWindows" value="true"/>
@@ -232,7 +241,7 @@
</target>
<target name="setupPlatform"
- depends="init, setupBuildType, setupSolaris, setupSolarisX86, setupLinux, setupLinuxAmd64, setupLinuxIA64, setupLinuxPPC, setupWindows, setupWindowsAmd64, setupMacOSX, setupJogl">
+ depends="init, setupBuildType, setupSolaris, setupSolarisX86, setupLinux, setupLinuxAmd64, setupLinuxIA64, setupLinuxPPC, setupLinuxGeneric, 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"/>
@@ -382,6 +391,13 @@
<os name="linux" arch="ppc"/>
</condition>
+ <condition property="isLinuxGeneric">
+ <or>
+ <os name="linux"/>
+ <os name="GNU/kFreeBSD"/>
+ </or>
+ </condition>
+
<condition property="isSolarisOnSparc">
<os name="SunOS" arch="sparc"/>
</condition>
--- a/j3d-core/src/native/build.xml
+++ b/j3d-core/src/native/build.xml
@@ -45,6 +45,13 @@
<property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
+ <target name="nativeSetup-debug-linux-generic" if="isLinuxGeneric">
+ <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-debug-win32" if="isWindowsOnX86">
<property name="bldFlag"
value="-DDEBUG -DWIN32 -D_WINDOWS"/>
@@ -62,7 +69,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-solaris, nativeSetup-debug-solaris-x86, nativeSetup-debug-linux, nativeSetup-debug-linux-amd64, nativeSetup-debug-linux-ia64, nativeSetup-debug-linux-ppc, nativeSetup-debug-linux-generic, nativeSetup-debug-win32, nativeSetup-debug-winamd64">
<property name="bldType" value="debug"/>
<property name="javahCoreSrc"
location="${src}/classes/share/javax/media/j3d"/>
@@ -112,6 +119,13 @@
<property name="osNativeScreenInfo" value="X11NativeScreenInfo"/>
</target>
+ <target name="nativeSetup-opt-linux-generic" if="isLinuxGeneric">
+ <property name="bldFlag" value="-O"/>
+ <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-win32" if="isWindowsOnX86">
<property name="bldFlag"
value="-DWIN32 -D_WINDOWS"/>
@@ -128,7 +142,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-solaris, nativeSetup-opt-solaris-x86, nativeSetup-opt-linux, nativeSetup-opt-linux-amd64, nativeSetup-opt-linux-ia64, nativeSetup-opt-linux-ppc, nativeSetup-opt-linux-generic, nativeSetup-opt-win32, nativeSetup-opt-winamd64">
<property name="bldType" value="opt"/>
<property name="javahCoreSrc"
location="${src}/classes/share/javax/media/j3d"/>
--- /dev/null
+++ b/j3d-core/src/native/ogl/build-linux-generic.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+
+<!-- Ant file for building native ogl renderer files for Linux/x86 -->
+<project name="j3d-core native" default="compile">
+
+ <target name="init" depends="init-cg,init-nocg">
+ <!-- Create the build directories for linux -->
+ <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${java.home}/include -I${java.home}/include/linux -I${java.home}/../include -I${java.home}/../include/linux -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="gcc">
+ <arg line="-shared DrawingSurfaceObjectAWT.o Canvas3D.o GraphicsContext3D.o NativeScreenInfo.o NativeConfigTemplate3D.o MasterControl.o GeometryArrayRetained.o Attributes.o CgShaderProgram.o GLSLShaderProgram.o Lights.o -Wl,-z,defs -L/usr/X11R6/lib -ldl -lGL -lX11 -lXext -lm -lnsl -L${java.home}/lib/${os.arch} -L${java.home}/lib -ljawt -L${java.home}/lib/${os.arch}/server -L${java.home}/lib/${os.arch}/client -L${java.home}/lib/server -L${java.home}/lib/client -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="-fPIC -I${oglsrc} -I${java.home}/include -I${java.home}/include/linux -I${java.home}/../include -I${java.home}/../include/linux -I${javahCoreTarget} ${bldFlag} -DLINUX ${cflags.cg} -c ${oglsrc}/CgWrapper.c"/>
+ </exec>
+
+ <!-- Create the wrapper library -->
+ <exec dir="${build}/${platform}/${bldType}/native/ogl/objs" executable="gcc">
+ <arg line="CgWrapper.o -Wl,-z,defs -L/usr/X11R6/lib -ldl -lCg -lCgGL -lpthread -lGL -lX11 -lXext -lm -lnsl -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>
|