diff options
author | Sven Gothel <[email protected]> | 2009-03-16 15:17:52 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-03-16 15:17:52 +0000 |
commit | 673c39d908a03db6c7825c7760bcc12014b64cda (patch) | |
tree | 7d84fe811ca1734dd02c572959efe94babf94dba /make/build-nwi.xml | |
parent | 3b83ea25d64ab2c92822265f2eb74b35eddab722 (diff) |
repair
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1873 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make/build-nwi.xml')
-rw-r--r-- | make/build-nwi.xml | 1354 |
1 files changed, 1354 insertions, 0 deletions
diff --git a/make/build-nwi.xml b/make/build-nwi.xml new file mode 100644 index 000000000..3a8807815 --- /dev/null +++ b/make/build-nwi.xml @@ -0,0 +1,1354 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + - Ant build for NWI. This build has been tested with ANT 1.7.0. The + - optional.jar that contains the optional ANT tasks must be in the ANT + - classpath (typically the ant/lib directory). + - + - A clean download of NWI is required for this build. + - + - This build has no dependence on environment variables; the needed + - ones (e.g. java.home, ANT_HOME) are all set by the Ant wrapper shell + - script, by the virtual machine, or elsewhere. However, on all platforms, + - the C compiler and linker should be in the path. All other paths that + - need to be set are in host.properties. + - + - NOTE: because the GlueGen config files have their own relative paths + - which cannot be overridden by GlueGen, GlueGen MUST be run from + - the "make" directory. This also means that this build.xml MUST + - be run from the "make" directory. + - + - Public targets: + - all: (default; autodetects OS and chooses C compiler from nwi.properties) + - clean: clean all built + - javadoc: create the standard developer Javadoc (recommended) + - (Note: should build all first - may be dependence in the future) + - javadoc.spec: create the standard developer Javadoc but exclude com.sun.* classes + - javadoc.dev: create the internal developer Javadoc. This includes the + - Java and C file generators. Note that it is only supported + - to create the Javadoc for the platform on which you are + - currently running. + - + - Note: on Windows the "win32.c.compiler" property in nwi.properties + - is required to select the appropriate C compiler. See the example + - nwi.properties in this directory for valid values. On Mac OS X + - universal binaries may also be built by setting the "macosxfat" + - property in nwi.properties; again see the example file in this + - directory. + - + - Thanks to Rob Grzywinski and Artur Biesiadowski for the bulk of the + - ANT build, including the GlueGen and StaticGLInfo tasks, the building of + - the Java generated sources, the first and second phase Java compiles, and + - the building of the jar file. Thanks to Alex Radeski for the bulk of the + - port to the ant-contrib CPPTask framework. Thanks to Athomas Goldberg for + - the original OS detection code. + - + - Some environment defs affecting compilation + + setup.cdcfp - Using the CDC Java runtime library + - no DoubleBuffer + - no LongBuffer + + This will set + -> setup.noAWT + + - Internal settings, may not be necessary to set them manually, + since all JAR archives are orthogonal. + setup.noAWT + setup.noX11WindowsMacOsX, which implies: + setup.noX11 + setup.noWindows + setup.noMacOsX + --> +<project name="NWI" basedir="." default="all"> + + <!-- This is the version of JOGL you are building --> + <property name="base_version" value="0.0.0-rc0"/> + + <!-- Uncomment this property definition to cause a full release build to be done --> + <!-- without needing to specify the RI target on the command line --> + <property name="RImanifestfile" value="nwiRIversion" /> + + <!-- Pull in GlueGen cpptasks build file --> + <property name="gluegen.root" value="../../gluegen" /> + <import file="${gluegen.root}/make/gluegen-cpptasks.xml" /> + + <available file="${user.home}/nwi.compiler.xml" property="nwi.compiler.present"/> + <import file="${user.home}/nwi.compiler.xml" optional="true" /> + + <!-- ================================================================== --> + <!-- + - Base initialization and detection of operating system. + --> + <target name="base.init"> + + <condition property="setup.noAWT"> + <isset property="setup.cdcfp"/> + </condition> + <condition property="isCDCFP"> + <isset property="setup.cdcfp"/> + </condition> + <condition property="javac.bootclasspath.jar" + value="../../gluegen/make/lib/cdc_fp.jar"> + <isset property="setup.cdcfp"/> + </condition> + <echo message="setup.cdcfp: ${setup.cdcfp}" /> + <echo message="setup.noAWT: ${setup.noAWT}" /> + <echo message="javac.bootclasspath.jar: ${javac.bootclasspath.jar}" /> + + <condition property="setup.noX11WindowsMacOsX"> + <and> + <isset property="setup.noX11"/> + <isset property="setup.noWindows"/> + <isset property="setup.noMacOsX"/> + </and> + </condition> + + <condition property="setup.noX11"> + <isset property="setup.noX11WindowsMacOsX"/> + </condition> + + <condition property="setup.noWindows"> + <isset property="setup.noX11WindowsMacOsX" /> + </condition> + + <condition property="setup.noMacOsX"> + <isset property="setup.noX11WindowsMacOsX" /> + </condition> + + <echo message="setup.noX11WindowsMacOsX: ${setup.noX11WindowsMacOsX}" /> + <echo message="setup.noX11: ${setup.noX11}" /> + <echo message="setup.noWindows: ${setup.noWindows}" /> + <echo message="setup.noMacOsX: ${setup.noMacOsX}" /> + + <!-- partitioning --> + + <property name="java.part.core" + value="javax/media/nwi/*, javax/media/nwi/x11/*, com/sun/nwi/impl/*, com/sun/nwi/impl/x11/*"/> + + <!-- property name="java.part.win" + value="com/sun/nwi/impl/win/**"/ NOTHING TO DO HERE --> + + <!-- property name="java.part.macosx" + value="com/sun/nwi/impl/macosx/**"/ NOTHING TO DO HERE --> + + <property name="java.part.awt" + value="javax/media/nwi/awt/*, com/sun/nwi/impl/jawt/**, com/sun/nwi/impl/**/awt/**"/> + + <!-- condition excludes --> + + <condition property="java.excludes.awt" + value="${java.part.awt}"> + <isset property="setup.noAWT"/> + </condition> + + <condition property="java.excludes.win" + value="${java.part.win}"> + <isset property="setup.noWindows"/> + </condition> + + <condition property="java.excludes.macosx" + value="${java.part.macosx}"> + <isset property="setup.noMacOsX"/> + </condition> + + <condition property="java.excludes.cdcfp" + value=""> + <isset property="setup.cdcfp"/> + </condition> + + <property name="java.excludes.all" value="${java.excludes.awt}, ${java.excludes.win}, ${java.excludes.macosx}, ${java.excludes.cdcfp}" /> + <echo message="java.excludes.all: ${java.excludes.all}" /> + + + <!-- Set the project root directory to be up one directory. --> + <property name="project.root" value=".." /> + + <!-- Set the configuration and build files to this directory. --> + <property name="make" value="." /> + </target> + + <target name="base.init.sourcelevel.1"> + <property name="nwi.sourcelevel" value="1.4" /> + </target> + + <!--target name="base.init.sourcelevel.2" if="gluegen.nsig"> + <property name="nwi.sourcelevel" value="1.5" /> + </target--> + + <!-- ================================================================== --> + <!-- + - Load user properties which override build defaults. + --> + <target name="load.user.properties" depends="base.init,base.init.sourcelevel.1" unless="user.properties.file"> + <!-- Load the user specified properties file that defines various host + - specific paths. The user will be notified if this is does not + - exist. --> + <property name="user.properties.file" value="${user.home}/nwi.properties" /> + <property file="${user.properties.file}" /> + <echo message="Loaded ${user.properties.file}." /> + <property file="${user.home}/gluegen.properties" /> + <echo message="Loaded ${user.home}/gluegen.properties." /> + <fail message="antlr.jar was not specified in nwi.properties or gluegen.properties. Please see README.txt for instructions" unless="antlr.jar"/> + <echo message="antlr.jar=${antlr.jar}" /> + </target> + + <!-- ================================================================== --> + <!-- + - Declare all paths and user defined variables. + --> + <target name="declare.common" description="Declare properties" depends="load.user.properties"> + <!-- The location and name of the configuration ANT file that will + - validate to ensure that all user-define variables are set. --> + <property name="validate.user.properties" value="${make}/validate-properties.xml" /> + + <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally --> + <property name="javacdebug" value="true" /> + <property name="javacdebuglevel" value="source,lines" /> + + <!-- Names of directories relative to the project root. + Some of these are used in FileMappers later for dependence information + and need exact string matching, which is why they use file.separator + instead of "/". --> + <condition property="rootrel.build" value="build"> + <not> + <isset property="rootrel.build"/> + </not> + </condition> + <property name="rootrel.build.nwi" value="${rootrel.build}-nwi" /> + <property name="rootrel.src" value="src/nwi" /> + <property name="rootrel.src.java" value="${rootrel.src}/classes" /> + <property name="rootrel.src.c" value="${rootrel.src}/native" /> + + <property name="rootrel.src.generated" value="${rootrel.build.nwi}/gensrc" /> + <property name="rootrel.generated.c" value="${rootrel.src.generated}/native" /> + <property name="rootrel.obj" value="${rootrel.build.nwi}/obj" /> + + <!-- GlueGen properties. --> + <!-- NOTE that these require a checked-out GlueGen workspace as a --> + <!-- sibling of the NWI workspace. --> + <property name="gluegen.make.dir" value="../../gluegen/make" /> + <property name="gluegen.build.xml" value="${gluegen.make.dir}/build.xml" /> + <property name="gluegen.jar" value="../../gluegen/${rootrel.build}/gluegen.jar" /> + <property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" /> + + <!-- The source directories. --> + <property name="src.java" value="${project.root}/${rootrel.src.java}" /> + <property name="src.c" value="${project.root}/${rootrel.src.c}" /> + <property name="build" value="${project.root}/${rootrel.build.nwi}" /> + + <!-- The generated source directories. --> + <property name="src.generated" value="${build}/gensrc" /> + <property name="src.generated.java" value="${src.generated}/classes" /> + <property name="src.generated.c" value="${src.generated}/native" /> + + <!-- The compiler output directories. --> + <property name="classes" value="${build}/classes" /> + <property name="obj" value="${project.root}/${rootrel.obj}" /> + + <!-- The headers from which Java files are generated --> + <property name="config" value="${make}/config/nwi" /> + <property name="stub.includes" value="${make}/stub_includes" /> + <property name="stub.includes.dir" value="stub_includes" /> <!-- NOTE: this MUST be relative for FileSet --> + <property name="stub.includes.common" value="${stub.includes}/common" /> + <dirset id="stub.includes.fileset.all" dir="."> + <include name="${stub.includes.dir}/macosx/**" /> + <include name="${stub.includes.dir}/win32/**" /> + <include name="${stub.includes.dir}/x11/**" /> + <include name="${stub.includes.dir}/common/**" /> + <include name="${stub.includes.dir}/jni/**" /> + </dirset> + <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes.dir}"> + <include name="macosx/**" /> + <include name="win32/**" /> + <include name="x11/**" /> + <include name="common/**" /> + <include name="jni/**" /> + </fileset> + <fileset id="stub.includes.dependencies.fileset.2" file="${gluegen.jar}" /> + <fileset id="stub.includes.dependencies.fileset.3" dir="${config}"> + <include name="*.cfg" /> + <include name="*.java" /> + <include name="*.c" /> + </fileset> + + <!-- Create the classpath that includes GlueGen and + - ANTLR. This requires the user-defined "antlr.jar" + - property. --> + <path id="gluegen.classpath"> + <pathelement location="${gluegen.jar}" /> + <pathelement location="${antlr.jar}" /> + </path> + + <!-- The resulting nwi.jar. --> + <property name="nwi.core.jar" value="${build}/nwi.core.jar" /> + <property name="nwi.awt.jar" value="${build}/nwi.awt.jar" /> + <property name="nwi.all.jar" value="${build}/nwi.all.jar" /> + + <!-- The javadoc dirs. --> + <property name="javadoc" value="${project.root}/javadoc_nwi_public" /> + <property name="javadoc.spec" value="${project.root}/javadoc_nwi_spec" /> + <property name="javadoc.dev" value="${project.root}/javadoc_nwi_dev" /> + <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" /> + <property name="javadoc.windowtitle" value="Native Windowing Interface (NWI) API -- ${base_version} Specification" /> + <property name="javadoc.overview" value="spec-overview.html" /> + <property name="javadoc.spec.packagenames" value="javax.media.nwi.*" /> + + <property name="javadoc.packagenames" value="${javadoc.spec.packagenames}" /> + + <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.sun.nwi.impl.*,com.sun.gluegen,com.sun.gluegen.runtime" /> + <property name="javadoc.bottom" value="Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="http://jcp.org/en/jsr/detail?id=231">license terms</a>." /> + </target> + + <!-- ================================================================== --> + <!-- + - Initialize all parameters required for the build and create any + - required directories. + --> + <target name="init" depends="declare.common"> + <!-- Call the external config validator script to make sure the config is ok and consistent --> + <ant antfile="${validate.user.properties}" inheritall="true"/> + + <!-- Create the required output directories. --> + <mkdir dir="${src.generated.java}" /> + <mkdir dir="${src.generated.c}" /> + <mkdir dir="${src.generated.c}/MacOSX" /> + <mkdir dir="${src.generated.c}/Windows" /> + <mkdir dir="${src.generated.c}/X11" /> + <mkdir dir="${classes}" /> + <mkdir dir="${obj}" /> + </target> + + <!-- ================================================================== --> + <!-- GlueGen and BuildStaticGLInfo creation, task setup and Java file generation --> + <!-- + - Build GlueGen + --> + <target name="build.gluegen" depends="init"> + <!-- Run the GlueGen build to ensure that the GlueGen ANT task + - has been built. --> + <!-- FIXME: remove passing down of antlr.jar when gluegen.properties is on all + nightly build machines --> + <ant antfile="${gluegen.build.xml}" dir="${gluegen.make.dir}" target="all" inheritAll="false"> + <propertyset> + <propertyref name="antlr.jar" /> + <!--propertyref name="gluegen.nsig" /--> + <propertyref name="isCDCFP" /> + </propertyset> + </ant> + </target> + + <!-- + - Check to see whether we need to rebuild the generated sources. + --> + <target name="java.generate.check"> + <!-- Blow away all target files if any dependencies are violated + (the uptodate task doesn't allow arbitrary source and target filesets but should) --> + <!-- + <dependset> + <srcfileset refid="stub.includes.dependencies.fileset.1" /> + <srcfileset refid="stub.includes.dependencies.fileset.2" /> + <srcfileset refid="stub.includes.dependencies.fileset.3" /> + <targetfileset dir="${src.generated}"> + <include name="**/*.java" /> + <include name="**/*.c" /> + </targetfileset> + </dependset> + --> + + <!-- Now check for the presence of one well-known file --> + <uptodate property="java.generate.skip.x11windowlib" + targetfile="${src.generated.java}/com/sun/nwi/impl/x11/X11Lib.java"> + <srcfiles refid="stub.includes.dependencies.fileset.1" /> + <srcfiles refid="stub.includes.dependencies.fileset.2" /> + <srcfiles refid="stub.includes.dependencies.fileset.3" /> + </uptodate> + <uptodate property="java.generate.skip.jawt" + targetfile="${src.generated.java}/com/sun/nwi/impl/jawt/JAWT.java"> + <srcfiles refid="stub.includes.dependencies.fileset.1" /> + <srcfiles refid="stub.includes.dependencies.fileset.2" /> + <srcfiles refid="stub.includes.dependencies.fileset.3" /> + </uptodate> + + <condition property="java.generate.skip"> + <and> + <isset property="java.generate.skip.x11windowlib"/> + <isset property="java.generate.skip.jawt"/> + </and> + </condition> + + <!--property name="java.generate.skip" value="true"/--> + </target> + + <target name="java.generate.windowlib" if="windowlib.os.cfg"> + <echo message="Generating Windowing Lib implementation class" /> + <gluegen src="${stub.includes.dir}/${window.os.system}/window-lib.c" + outputRootDir="../${rootrel.build.nwi}" + config="${windowlib.os.cfg}" + includeRefid="stub.includes.fileset.platform" + emitter="com.sun.gluegen.JavaEmitter"> + <classpath refid="gluegen.classpath" /> + </gluegen> + </target> + + <target name="java.generate.jawt" unless="setup.noAWT"> + <!-- NOTE: the "literalInclude" in this GlueGen call is simply to + - get around the fact that neither FileSet nor DirSet can + - handle different drives in an effective manner. --> + <echo message="Generating JAWT interface class" /> + <echo message="java.home.dir=${java.home.dir}" /> + <gluegen src="${jawt.platform.header}" + outputRootDir="../${rootrel.build.nwi}" + config="${jawt.cfg}" + literalInclude="${stub.includes.dir}/jni" + includeRefid="stub.includes.fileset.platform" + emitter="com.sun.gluegen.JavaEmitter"> + <classpath refid="gluegen.classpath" /> + </gluegen> + </target> + + <target name="java.generate.platforms" > + <echo message="Generating platform-specifics: os: ${window.os.system}, cfgs: ${windowlib.os.cfg}, ${jawt.cfg}" /> + <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.os.system}/** ${stub.includes.dir}/common/**" /> + <antcall target="java.generate.windowlib" inheritRefs="true" /> + <antcall target="java.generate.jawt" inheritRefs="true" /> + </target> + + <!-- + - Setup the generating ANT tasks and use it to generate the Java files + - from the C GL headers. This involves setting the taskdef and creating + - the classpath reference id then running the task on each header. + --> + <target name="java.generate" depends="build.gluegen, java.generate.check" unless="java.generate.skip"> + + <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT --> + <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask" + classpathref="gluegen.classpath" /> + <taskdef name="staticglgen" classname="com.sun.gluegen.ant.StaticGLGenTask" + classpathref="gluegen.classpath" /> + + <!-- Use the GlueGen and BuildStaticGLInfo tasks to generate the + - Java files --> + + <echo message="Generating platform-specifics: X11" /> + <antcall target="java.generate.platforms" inheritRefs="true"> + <param name="window.os.system" value="x11"/> + <param name="windowlib.os.cfg" value="${config}/x11-lib.cfg" /> + <param name="jawt.cfg" value="${config}/jawt-x11.cfg" /> + <param name="jawt.platform.header" value="${stub.includes.dir}/jni/x11/jawt_md.h" /> + </antcall> + + <echo message="Generating platform-specifics: Win32" /> + <antcall target="java.generate.platforms" inheritRefs="true"> + <param name="window.os.system" value="win32"/> + <param name="jawt.cfg" value="${config}/jawt-win32.cfg" /> + <param name="jawt.platform.header" value="${stub.includes.dir}/jni/win32/jawt_md.h" /> + </antcall> + + <echo message="Generating platform-specifics: MaxOsX" /> + <antcall target="java.generate.platforms" inheritRefs="true"> + <param name="window.os.system" value="macosx"/> + <param name="jawt.cfg" value="${config}/jawt-macosx.cfg" /> + <param name="jawt.platform.header" value="${stub.includes.dir}/jni/macosx/jawt_md.h" /> + </antcall> + + <!-- Inform the user that the generators have successfully created + - the necessary Java files --> + <echo message="" /> + <echo message="GlueGen and BuildStaticGLInfo have successfully generated files." /> + + </target> + + <!-- ================================================================== --> + <!-- + - Compile the original and generated source. The composable pipelines + - will be generated. + --> + <target name="java.compile.1" depends="java.generate" if="javac.bootclasspath.jar"> + <!-- Perform the first pass Java compile; everything --> + <javac destdir="${classes}" + excludes="${java.excludes.all}" + source="${nwi.sourcelevel}" + classpath="${gluegen-rt.jar}" + bootclasspath="${javac.bootclasspath.jar}" + fork="yes" + memoryMaximumSize="128m" + debug="${javacdebug}" debuglevel="${javacdebuglevel}"> + <src path="${src.java}" /> + <src path="${src.generated.java}" /> + </javac> + </target> + + <target name="java.compile.2" depends="java.generate" unless="javac.bootclasspath.jar"> + <!-- Perform the second pass Java compile; everything. --> + <javac destdir="${classes}" + excludes="${java.excludes.all}" + source="${nwi.sourcelevel}" + classpath="${gluegen-rt.jar}" + fork="yes" + memoryMaximumSize="128m" + debug="${javacdebug}" debuglevel="${javacdebuglevel}"> + <src path="${src.java}" /> + <src path="${src.generated.java}" /> + </javac> + </target> + + <target name="java.compile" depends="java.compile.1,java.compile.2" /> + + <!-- ================================================================== --> + <!-- + - Compile the native C code for JOGL (and optionally the Cg binding). + --> + + <target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler" unless="nwi.compiler.present"> + <!-- compiler configuration --> + <!-- Note that we can use the base setups in the gluegen-cpptasks for most of these --> + + <compiler id="compiler.cfg.freebsd.nwi" extends="compiler.cfg.freebsd"> + <!-- Need to force X11R6 headers on to include path after stub_includes --> + <includepath path="/usr/X11R6/include" /> + </compiler> + + <!-- linker configuration --> + + <linker id="linker.cfg.linux.nwi.x11" extends="linker.cfg.linux"> + <syslibset dir="/usr/X11R6/lib" libs="X11"/> + <syslibset dir="/usr/X11R6/lib" libs="Xxf86vm" /> + </linker> + + <linker id="linker.cfg.linux.amd64.nwi.x11" extends="linker.cfg.linux.amd64"> + <syslibset dir="/usr/X11R6/lib64" libs="X11"/> + <syslibset dir="/usr/X11R6/lib64" libs="Xxf86vm" /> + </linker> + + <linker id="linker.cfg.solaris.nwi.x11" extends="linker.cfg.solaris"> + <syslibset libs="X11"/> + </linker> + + <linker id="linker.cfg.win32.mingw.nwi" extends="linker.cfg.win32.mingw"> + <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names --> + <syslibset libs="gdi32, kernel32"/> + </linker> + + <linker id="linker.cfg.win32.msvc.nwi" extends="linker.cfg.win32.msvc"> + <syslibset libs="gdi32, user32, kernel32" /> + </linker> + + <linker id="linker.cfg.macosx.nwi" extends="linker.cfg.macosx"> + <linkerarg value="-framework" /> + <linkerarg value="Cocoa" /> + </linker> + + <linker id="linker.cfg.hpux.nwi" extends="linker.cfg.hpux"> + <syslibset dir="/usr/lib" libs="X11"/> + </linker> + </target> + + <target name="c.configure.win32.vc" if="isVCFamily"> + <echo message="Win32.VC" /> + <property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" /> + <property name="linker.cfg.id.core" value="linker.cfg.win32.msvc" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.win32.msvc.nwi" /> + </target> + + <target name="c.configure.win32.mingw" if="isMingW"> + <echo message="Win32.MingW" /> + <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" /> + <property name="linker.cfg.id.core" value="linker.cfg.win32.mingw" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.win32.mingw.nwi" /> + </target> + + <target name="c.configure.linux.x86" if="isLinuxX86"> + <echo message="Linux.x86" /> + <property name="compiler.cfg.id" value="compiler.cfg.linux" /> + <property name="linker.cfg.id.core" value="linker.cfg.linux" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.linux.nwi.x11" /> + </target> + + <target name="c.configure.linux.amd64" if="isLinuxAMD64"> + <echo message="Linux.AMD64" /> + <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" /> + <property name="linker.cfg.id.core" value="linker.cfg.linux.amd64" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.linux.amd64.nwi.x11" /> + </target> + + <target name="c.configure.linux.ia64" if="isLinuxIA64"> + <echo message="Linux.IA64" /> + <property name="compiler.cfg.id" value="compiler.cfg.linux" /> + <property name="linker.cfg.id.core" value="linker.cfg.linux" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.linux.nwi.x11" /> + </target> + + <target name="c.configure.linux" depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.x11" if="isLinux" /> + + <target name="c.configure.solaris32" depends="c.configure.x11" if="isSolaris32Bit"> + <echo message="Solaris" /> + <property name="compiler.cfg.id" value="compiler.cfg.solaris" /> + <property name="linker.cfg.id.core" value="linker.cfg.solaris" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.nwi.x11" /> + </target> + + + <target name="c.configure.solaris.sparcv9" depends="c.configure.x11" if="isSolarisSparcv9"> + <echo message="SolarisSparcv9" /> + <property name="compiler.cfg.id" value="compiler.cfg.solaris.sparcv9" /> + <property name="linker.cfg.id.core" value="linker.cfg.solaris.sparcv9" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.sparcv9.nwi.x11" /> + </target> + + + <target name="c.configure.solaris.amd64" depends="c.configure.x11" if="isSolarisAMD64"> + <echo message="SolarisAMD64" /> + <property name="compiler.cfg.id" value="compiler.cfg.solaris.amd64" /> + <property name="linker.cfg.id.core" value="linker.cfg.solaris.amd64" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.amd64.nwi.x11" /> + </target> + + <target name="c.configure.freebsd" depends="c.configure.x11" if="isFreeBSD"> + <echo message="FreeBSD" /> + <property name="compiler.cfg.id" value="compiler.cfg.freebsd.nwi" /> + <property name="linker.cfg.id.core" value="linker.cfg.linux" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.linux.nwi.x11" /> + </target> + + <target name="c.configure.hpux" depends="c.configure.x11" if="isHPUX"> + <echo message="HP-UX" /> + <property name="compiler.cfg.id" value="compiler.cfg.hpux" /> + <property name="linker.cfg.id.core" value="linker.cfg.hpux" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.hpux.nwi.x11" /> + </target> + + <target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw" if="isWindows" /> + + <target name="c.configure.x11" if="isX11" /> + + <target name="c.configure.macosx" if="isOSX"> + <property name="compiler.cfg.id" value="compiler.cfg.macosx" /> + <property name="linker.cfg.id.core" value="linker.cfg.macosx" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.macosx.nwi" /> + </target> + + <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" /> + + <target name="c.configure" depends="c.configure.1,c.configure.2" /> + + <target name="rename.mingw.dll" if="isMingW"> + <move file="${src}" tofile="${dest}" /> + </target> + + <target name="rename.dylib" if="isOSX"> + <move file="${src}" tofile="${dest}" /> + </target> + + <macrodef name="c.build"> + <attribute name="c.compiler.src.files" /> + <attribute name="compiler.cfg.id" /> + <attribute name="linker.cfg.id" /> + <attribute name="output.lib.name" /> + <attribute name="c.compiler.use-jawt" default="false"/> + <sequential> + <echo message="Output lib name = @{output.lib.name}" /> + + <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally --> + <property name="c.compiler.debug" value="false" /> + <!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } --> + <property name="c.compiler.optimise" value="none" /> + + <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition> + + <!-- since properties are immutable, we need one for each target --> + <condition property="@{output.lib.name}.useLibJAWT"> + <istrue value="@{c.compiler.use-jawt}" /> + </condition> + <echo message="c.compiler.use-jawt @{c.compiler.use-jawt}"/> + <echo message="@{output.lib.name}.useLibJAWT ${@{output.lib.name}.useLibJAWT}"/> + + <condition property="@{output.lib.name}.useLibJVM"> + <and> + <isset property="isHPUX"/> + <isset property="@{output.lib.name}.useLibJAWT"/> + </and> + </condition> + + <patternset id="c.src.files.awt"> + <include name="${rootrel.src.c}/JAWT*.c"/> + <include name="${rootrel.generated.c}/X11/JAWT*.c" if="isX11"/> + <include name="${rootrel.generated.c}/MacOSX/JAWT*.c" if="isOSX"/> + <include name="${rootrel.generated.c}/Windows/JAWT*.c" if="isWindows"/> + </patternset> + + <patternset id="c.src.files.x11"> + <include name="${rootrel.src.c}/x11/*.c" if="isX11"/> + <include name="${rootrel.generated.c}/X11/X11*.c" if="isX11"/> + </patternset> + + <echo message="Compiling @{output.lib.name}" /> + + <cc outtype="shared" + objdir="${obj}" + outfile="${obj}/@{output.lib.name}" + optimize="${c.compiler.optimise}" + debug="${c.compiler.debug}" + multithreaded="true" + exceptions="false" + rtti="false"> + + <!-- TODO: versioninfo companyname="java.net" + legalcopyright="Copyright" + productname="JOGL" + productversion="x.y.z" + description="Description" + fileversion="x.y.z" + filecomments="File Comment" /--> + + <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset> + + <compiler extends="@{compiler.cfg.id}" > + <sysincludepath path="${java.includes.dir}"/> + <sysincludepath path="${java.includes.dir.platform}"/> + <!-- This is for the generated headers for handwritten C code --> + <includepath path="${src.generated.c}" /> + <includepath path="${src.generated.c}/X11" if="isX11"/> + <includepath path="${src.generated.c}/MacOSX" if="isOSX"/> + <includepath path="${src.generated.c}/Windows" if="isWindows"/> + + <!-- This must come last to not override real include paths --> + <!-- includepath path="stub_includes/macosx" if="isOSX" / --> + </compiler> + + <linker extends="@{linker.cfg.id}"> + <syslibset dir="${java.lib.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/> + <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/> + </linker> + </cc> + + <!-- FIXME: this is a hack; the cpptask should have an option to change the + suffix or at least understand the override from dylib to jnilib --> + <antcall target="rename.dylib" inheritRefs="true"> + <param name="src" value="${build}/obj/lib@{output.lib.name}.dylib" /> + <param name="dest" value="${build}/obj/lib@{output.lib.name}.jnilib" /> + </antcall> + + <!-- FIXME: this is a hack; the cpptask should have an option to change the + suffix or at least understand the override from dylib to jnilib --> + <antcall target="rename.mingw.dll" inheritRefs="true"> + <param name="src" value="${build}/obj/lib@{output.lib.name}.so" /> + <param name="dest" value="${build}/obj/@{output.lib.name}.dll" /> + </antcall> + </sequential> + </macrodef> + + <target name="c.fixup.jawt.version.macosx" if="isOSX"> + <!-- Edit the link to the JAWT version in the resulting jnilib + file; this isn't strictly needed but seems to allow the + universal binaries to work on 10.3 machines as well, which + is desirable for some end users --> + <apply executable="install_name_tool"> + <arg value="-change" /> + <arg value="/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries/libjawt.dylib" /> + <arg value="/System/Library/Frameworks/JavaVM.framework/Libraries/libjawt.dylib" /> + <srcfile /> + <fileset dir="${obj}" includes="libnwi_awt.jnilib" /> + </apply> + </target> + + <target name="c.build.nwi.awt"> + <c.build c.compiler.src.files="c.src.files.awt" + c.compiler.use-jawt="true" + output.lib.name="nwi_awt" + compiler.cfg.id="${compiler.cfg.id}" + linker.cfg.id="${linker.cfg.id.oswin}"/> + </target> + + <target name="c.build.nwi.windowlib.x11" if="isX11"> + <c.build c.compiler.src.files="c.src.files.x11" + output.lib.name="nwi_x11" + compiler.cfg.id="${compiler.cfg.id}" + linker.cfg.id="${linker.cfg.id.oswin}"/> + </target> + + <target name="c.build.nwi.windowlib" depends="c.build.nwi.windowlib.x11"/> + + <target name="c.manifest" if="isVC8Family"> + <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll --> + <exec executable="mt"> + <arg value="-manifest"/> + <arg value="${obj}/nwi.dll.manifest"/> + <arg value="-outputresource:${obj}/nwi.dll;#2"/> + </exec> + <exec executable="mt"> + <arg value="-manifest"/> + <arg value="${obj}/nwi_awt.dll.manifest"/> + <arg value="-outputresource:${obj}/nwi_awt.dll;#2"/> + </exec> + <antcall target="c.manifest.cg" inheritRefs="true" /> + </target> + + <target name="c.build.nwi" depends="c.configure,c.build.nwi.windowlib,c.build.nwi.awt"> + <antcall target="c.fixup.jawt.version.macosx" inheritrefs="true" /> + <antcall target="c.manifest" inheritRefs="true" /> + </target> + + <!-- ================================================================== --> + <!-- + - Build the nwi.jar files. + --> + <target name="jar" depends="java.compile,cond-if-RImanifest,cond-else-RImanifest"/> + + <target name="check-RIcond"> + <condition property="RIcond-is-true"> + <isset property="RImanifestfile"/> + </condition> + </target> + + <target name="cond-if-RImanifest" depends="check-RIcond" if="RIcond-is-true"> + <copy file="nwiRIversion" + tofile="tempversion" + overwrite="true"> + <filterset> + <filter token="VERSION" value="${base_version}-pre-${timestamp}"/> + <filter token="BASEVERSION" value="${base_version}"/> + </filterset> + </copy> + + <jar manifest="tempversion" destfile="${nwi.core.jar}"> + <fileset dir="${classes}" + includes="${java.part.core}" + excludes="${java.part.awt}"/> + </jar> + <jar manifest="tempversion" destfile="${nwi.awt.jar}"> + <fileset dir="${classes}" + includes="${java.part.awt}"/> + </jar> + <jar manifest="tempversion" destfile="${nwi.all.jar}"> + <fileset dir="${classes}"> + <include name="javax/media/nwi/**" /> + <include name="com/sun/nwi/**" /> + <include name="com/sun/gluegen/runtime/**" /> + </fileset> + </jar> + <delete file="tempversion"/> + </target> + + + <target name="cond-else-RImanifest" depends="check-RIcond" unless="RIcond-is-true"> + <tstamp> + <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/> + </tstamp> + <copy file="nwiversion" + tofile="tempversion" + overwrite="true"> + <filterset> + <filter token="VERSION" value="${base_version}-pre-${timestamp}"/> + <filter token="BASEVERSION" value="${base_version}"/> + </filterset> + </copy> + <jar manifest="tempversion" destfile="${nwi.jar}"> + <fileset dir="${classes}"> + <include name="javax/media/nwi/**" /> + <include name="com/sun/gluegen/runtime/**" /> + <include name="com/sun/nwi/**" /> + </fileset> + </jar> + <delete file="tempversion"/> + </target> + + <!-- ================================================================== --> + <!-- + - Build the Javadocs for the sources. + - NOTE: these are not entirely correct as the javadocs targets depend + - on the platform specific build targets. To circumvent any + - errors, ensure that the source is built first. + --> + <target name="javadoc" depends="load.user.properties,init"> + <!-- Build the general Javadoc --> + <javadoc packagenames="${javadoc.packagenames}" + excludepackagenames="${java.excludes.javadoc.packagenames}" + sourcepath="${src.java};${src.generated.java}" + classpath="${gluegen-rt.jar}" + destdir="${javadoc}" windowtitle="${javadoc.windowtitle}" + overview="${javadoc.overview}" + source="1.4" + linkoffline="${javadoc.link} 142-packages" + bottom="${javadoc.bottom}" > + </javadoc> + </target> + + <target name="javadoc.spec" depends="load.user.properties,init"> + <!-- Build the general Javadoc --> + <javadoc packagenames="${javadoc.spec.packagenames}" + excludepackagenames="${java.excludes.javadoc.packagenames}" + sourcepath="${src.java};${src.generated.java}" + classpath="${gluegen-rt.jar}" + destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}" + overview="${javadoc.overview}" + source="1.4" + linkoffline="${javadoc.link} 142-packages" + bottom="${javadoc.bottom}" > + </javadoc> + </target> + + <target name="javadoc.dev" depends="load.user.properties,init"> + <!-- Build the internal developer Javadoc --> + <javadoc packagenames="${javadoc.dev.packagenames}" + excludepackagenames="${java.excludes.javadoc.packagenames}" + sourcepath="${src.java};${src.generated.java}" + classpath="${gluegen-rt.jar}" + destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}" + overview="${javadoc.overview}" + source="1.4" + linkoffline="${javadoc.link} 142-packages" + bottom="${javadoc.bottom}" > + </javadoc> + </target> + + <target name="all.doc" description="Build NWI docs" depends="init,javadoc,javadoc.spec,javadoc.dev" /> + + <!-- ================================================================== --> + <!-- + - Build the platform-independent distribution out of jars built for + - Windows, Linux and Mac OS X; the Java sources for Jogl can't be + - fully cross-compiled at this time. To run this target, you need to + - specify the property nwi.dist.dir as a System property (i.e., + - "ant -Dnwi.dist.dir=../dist dist"); directories named nwi-linux, + - nwi-win, and nwi-macosx need to be inside that directory and each + - of those directories needs to contain both the nwi.jar for that + - platform as well as the native code (libnwi.so, nwi.dll, or + - libnwi.jnilib). Also builds jars containing the native code for + - Windows, Linux, Mac OS X, Solaris/SPARC and Solaris/x86. + --> + <target name="dist.dir.check" unless="nwi.dist.dir"> + <fail> + + ****************************************************************** + ** To build the Jogl distribution out of the platform-specific ** + ** component jars and native code, the property nwi.dist.dir ** + ** needs to be specified on the command line. Please read the ** + ** comments associated with the "dist" target in the build.xml. ** + ****************************************************************** + </fail> + </target> + + <target name="dist.check.windows" if="nwi.dist.dir"> + <condition property="windows.complete"> + <and> + <available file="${nwi.dist.dir}/nwi-win/nwi.jar" /> + <available file="${nwi.dist.dir}/nwi-win/32/nwi.dll" /> + <available file="${nwi.dist.dir}/nwi-win/32/nwi_awt.dll" /> + <available file="${nwi.dist.dir}/nwi-win/32/gluegen-rt.dll" /> + <available file="${nwi.dist.dir}/nwi-win/32/gluegen-rt-natives-windows-i586.jar" /> + </and> + </condition> + <fail unless="windows.complete"> + ****************************************************************** + ** Files are missing from the Windows build. This will cause ** + ** the distribution to be incomplete. Please check the status ** + ** of the Windows build and try again. ** + ****************************************************************** + </fail> + </target> + + <target name="dist.check.windows-amd64" if="nwi.dist.dir"> + <condition property="windows-amd64.complete"> + <and> + <available file="${nwi.dist.dir}/nwi-win/64/nwi.dll" /> + <available file="${nwi.dist.dir}/nwi-win/64/nwi_awt.dll" /> + <available file="${nwi.dist.dir}/nwi-win/64/gluegen-rt.dll" /> + <available file="${nwi.dist.dir}/nwi-win/64/gluegen-rt-natives-windows-amd64.jar" /> + </and> + </condition> + <fail unless="windows-amd64.complete"> + ********************************************************************* + ** Files are missing from the Windows/AMD64 build. This will cause ** + ** the distribution to be incomplete. Please check the status ** + ** of the Windows/AMD64 build and try again. ** + ********************************************************************* + </fail> + </target> + + <target name="dist.check.linux" if="nwi.dist.dir"> + <condition property="linux.complete"> + <and> + <available file="${nwi.dist.dir}/nwi-linux/nwi.jar" /> + <available file="${nwi.dist.dir}/nwi-linux/32/libnwi.so" /> + <available file="${nwi.dist.dir}/nwi-linux/32/libnwi_awt.so" /> + <available file="${nwi.dist.dir}/nwi-linux/32/libgluegen-rt.so" /> + <available file="${nwi.dist.dir}/nwi-linux/32/gluegen-rt-natives-linux-i586.jar" /> + </and> + </condition> + <fail unless="linux.complete"> + ****************************************************************** + ** Files are missing from the Linux build. This will cause ** + ** the distribution to be incomplete. Please check the status ** + ** of the Linux build and try again. ** + ****************************************************************** + </fail> + </target> + + <target name="dist.check.linux-amd64" if="nwi.dist.dir"> + <condition property="linux-amd64.complete"> + <and> + <available file="${nwi.dist.dir}/nwi-linux/64/libnwi.so" /> + <available file="${nwi.dist.dir}/nwi-linux/64/libnwi_awt.so" /> + <available file="${nwi.dist.dir}/nwi-linux/64/libgluegen-rt.so" /> + <available file="${nwi.dist.dir}/nwi-linux/64/gluegen-rt-natives-linux-amd64.jar" /> + </and> + </condition> + <fail unless="linux-amd64.complete"> + ******************************************************************* + ** Files are missing from the Linux/AMD64 build. This will cause ** + ** the distribution to be incomplete. Please check the status ** + ** of the Linux/AMD64 build and try again. ** + ******************************************************************* + </fail> + </target> + + <target name="dist.check.macosx" if="nwi.dist.dir"> + <condition property="macosx.complete"> + <and> + <available file="${nwi.dist.dir}/nwi-macosx/nwi.jar" /> + <available file="${nwi.dist.dir}/nwi-macosx/ppc/libnwi.jnilib" /> + <available file="${nwi.dist.dir}/nwi-macosx/ppc/libnwi_awt.jnilib" /> + <available file="${nwi.dist.dir}/nwi-macosx/ppc/libgluegen-rt.jnilib" /> + <available file="${nwi.dist.dir}/nwi-macosx/ppc/gluegen-rt-natives-macosx-ppc.jar" /> + </and> + </condition> + <fail unless="macosx.complete"> + ****************************************************************** + ** Files are missing from the Mac OS X build. This will cause ** + ** the distribution to be incomplete. Please check the status ** + ** of the Mac OS X build and try again. ** + ****************************************************************** + </fail> + </target> + + + <target name="dist.check.macosxfat" if="nwi.dist.dir"> + <condition property="macosxfat.complete"> + <and> + <available file="${nwi.dist.dir}/nwi-macosx/nwi.jar" /> + <available file="${nwi.dist.dir}/nwi-macosx/fat/libnwi.jnilib" /> + <available file="${nwi.dist.dir}/nwi-macosx/fat/libnwi_awt.jnilib" /> + <available file="${nwi.dist.dir}/nwi-macosx/fat/libgluegen-rt.jnilib" /> + <available file="${nwi.dist.dir}/nwi-macosx/fat/gluegen-rt-natives-macosx-universal.jar" /> + </and> + </condition> + <fail unless="macosxfat.complete"> + ****************************************************************** + ** Files are missing from the Mac OS X build. This will cause ** + ** the distribution to be incomplete. Please check the status ** + ** of the Mac OS X build and try again. ** + ****************************************************************** + </fail> + </target> + + + + <target name="dist.check.solsparc" if="nwi.dist.dir"> + <condition property="solsparc.complete"> + <and> + <available file="${nwi.dist.dir}/nwi-solsparc/nwi.jar" /> + <available file="${nwi.dist.dir}/nwi-solsparc/32/libnwi.so" /> + <available file="${nwi.dist.dir}/nwi-solsparc/32/libnwi_awt.so" /> + <available file="${nwi.dist.dir}/nwi-solsparc/32/libgluegen-rt.so" /> + <available file="${nwi.dist.dir}/nwi-solsparc/32/gluegen-rt-natives-solaris-sparc.jar" /> + </and> + </condition> + <fail unless="solsparc.complete"> + ****************************************************************** + ** Files are missing from the Solaris/SPARC build. This will ** + ** cause the distribution to be incomplete. Please check the ** + ** status of the Solaris/SPARC build and try again. ** + ****************************************************************** + </fail> + </target> + + <target name="dist.check.solsparcv9" if="nwi.dist.dir"> + <condition property="solsparcv9.complete"> + <and> + <available file="${nwi.dist.dir}/nwi-solsparc/nwi.jar" /> + <available file="${nwi.dist.dir}/nwi-solsparc/64/libnwi.so" /> + <available file="${nwi.dist.dir}/nwi-solsparc/64/libnwi_awt.so" /> + <available file="${nwi.dist.dir}/nwi-solsparc/64/libgluegen-rt.so" /> + <available file="${nwi.dist.dir}/nwi-solsparc/64/gluegen-rt-natives-solaris-sparcv9.jar" /> + </and> + </condition> + <fail unless="solsparcv9.complete"> + ****************************************************************** + ** Files are missing from the Solaris/SPARCv9 build. This will ** + ** cause the distribution to be incomplete. Please check the ** + ** status of the Solaris/SPARCv9 build and try again. ** + ****************************************************************** + </fail> + </target> + + <target name="dist.check.solx86" if="nwi.dist.dir"> + <condition property="solx86.complete"> + <and> + <available file="${nwi.dist.dir}/nwi-solx86/nwi.jar" /> + <available file="${nwi.dist.dir}/nwi-solx86/32/libnwi.so" /> + <available file="${nwi.dist.dir}/nwi-solx86/32/libnwi_awt.so" /> + <available file="${nwi.dist.dir}/nwi-solx86/32/libgluegen-rt.so" /> + <available file="${nwi.dist.dir}/nwi-solx86/32/gluegen-rt-natives-solaris-i586.jar" /> + </and> + </condition> + <fail unless="solx86.complete"> + ****************************************************************** + ** Files are missing from the Solaris/x86 build. This will ** + ** cause the distribution to be incomplete. Please check the ** + ** status of the Solaris/x86 build and try again. ** + ****************************************************************** + </fail> + </target> + + <target name="dist.check.solamd64" if="nwi.dist.dir"> + <condition property="solamd64.complete"> + <and> + <available file="${nwi.dist.dir}/nwi-solx86/64/libnwi.so" /> + <available file="${nwi.dist.dir}/nwi-solx86/64/libnwi_awt.so" /> + <available file="${nwi.dist.dir}/nwi-solx86/64/libgluegen-rt.so" /> + <available file="${nwi.dist.dir}/nwi-solx86/64/gluegen-rt-natives-solaris-amd64.jar" /> + </and> + </condition> + <fail unless="solamd64.complete"> + ****************************************************************** + ** Files are missing from the Solaris/x86/64 (amd64) build. This * + ** will cause the distribution ** + ** to be incomplete. Please check the ** + ** status of the Solaris/x86 (amd64) build and try again. ** + ****************************************************************** + </fail> + </target> + + <!-- Helper task for dist target below --> + <!-- Required parameters: --> + <!-- zip.os.arch = the os/arch combination for this zip file (i.e., "windows-i586") --> + <!-- zip.src.so.dir = the directory containing the .so's / .dll's / .jnilib's for this platform--> + <target name="dist.build.zip"> + <property name="nwi.tmp.version" value="nwi-${tmp.version}-${zip.os.arch}" /> + <!-- Create all needed directories --> + <delete dir="${nwi.dist.dir}/tmp" failonerror="false" /> + <mkdir dir="${nwi.dist.dir}/tmp/${nwi.tmp.version}/lib" /> + <!-- Copy in files --> + <copy todir="${nwi.dist.dir}/tmp/${nwi.tmp.version}/lib"> + <fileset dir="${zip.src.so.dir}" includes="*${zip.so.suffix}" /> + </copy> + <copy file="${nwi.dist.dir}/nwi.jar" todir="${nwi.dist.dir}/tmp/${nwi.tmp.version}/lib" /> + <copy file="${nwi.dist.dir}/gluegen-rt.jar" todir="${nwi.dist.dir}/tmp/${nwi.tmp.version}/lib" /> + <copy file="../CHANGELOG.txt" todir="${nwi.dist.dir}/tmp/${nwi.tmp.version}" /> + <copy file="../COPYRIGHT.txt" todir="${nwi.dist.dir}/tmp/${nwi.tmp.version}" /> + <copy file="../LICENSE.txt" tofile="${nwi.dist.dir}/tmp/${nwi.tmp.version}/LICENSE-NWI-${tmp.version}.txt" /> + <copy file="README-zip-bundles.txt" + tofile="${nwi.dist.dir}/tmp/${nwi.tmp.version}/README.txt" + overwrite="true"> + <filterset> + <filter token="VERSION" value="${tmp.version}"/> + </filterset> + </copy> + <copy file="../doc/userguide/index.html" tofile="${nwi.dist.dir}/tmp/${nwi.tmp.version}/Userguide.html" /> + <!-- zip it up --> + <zip destfile="${nwi.dist.dir}/${nwi.tmp.version}.zip" + basedir="${nwi.dist.dir}/tmp" + includes="${nwi.tmp.version}/**" /> + </target> + + <target name="setup-version-RI" if="RImanifestfile"> + <property name="tmp.version" value="${base_version}" /> + </target> + + <target name="setup-version-non-RI" unless="RImanifestfile"> + <tstamp> + <format property="timestamp" pattern="yyyyMMdd"/> + </tstamp> + <property name="tmp.version" value="${base_version}-pre-${timestamp}" /> + </target> + + <target name="dist" depends="dist.dir.check,dist.check.windows,dist.check.windows-amd64,dist.check.linux,dist.check.linux-amd64,dist.check.macosx,dist.check.macosxfat,dist.check.solsparc,dist.check.solsparcv9,dist.check.solx86,dist.check.solamd64,setup-version-RI,setup-version-non-RI"> + <delete> + <fileset dir="${nwi.dist.dir}" includes="*.jar" /> + </delete> + <delete> + <fileset dir="${nwi.dist.dir}" includes="*.zip" /> + </delete> + <delete dir="${nwi.dist.dir}/tmp" failonerror="false" /> + <delete dir="${nwi.dist.dir}/META-INF" failonerror="false" /> + <!-- Extract manifest from one of the jars to re-use it in the dist jar --> + <unjar src="${nwi.dist.dir}/nwi-win/nwi.jar" dest="${nwi.dist.dir}" > + <patternset> + <include name="META-INF/MANIFEST.MF" /> + </patternset> + </unjar> + <!-- Build jar files suitable for Java Web Start --> + <jar manifest="${nwi.dist.dir}/META-INF/MANIFEST.MF" destfile="${nwi.dist.dir}/nwi.jar" duplicate="preserve"> + <zipgroupfileset dir="${nwi.dist.dir}" + includes="nwi-win/nwi.jar, nwi-linux/nwi.jar, nwi-macosx/nwi.jar" /> + </jar> + <!-- Apply Pack200 repacking to allow later compression by that mechanism --> + <apply executable="pack200" verbose="true" > + <arg value="--repack" /> + <fileset file="${nwi.dist.dir}/nwi.jar" /> + </apply> + <jar destfile="${nwi.dist.dir}/nwi-natives-windows-i586.jar" + basedir="${nwi.dist.dir}/nwi-win/32" + includes="nwi.dll,nwi_awt.dll" /> + <jar destfile="${nwi.dist.dir}/nwi-natives-windows-amd64.jar" + basedir="${nwi.dist.dir}/nwi-win/64" + includes="nwi.dll,nwi_awt.dll" /> + <jar destfile="${nwi.dist.dir}/nwi-natives-linux-i586.jar" + basedir="${nwi.dist.dir}/nwi-linux/32" + includes="libnwi.so,libnwi_awt.so" /> + <jar destfile="${nwi.dist.dir}/nwi-natives-linux-amd64.jar" + basedir="${nwi.dist.dir}/nwi-linux/64" + includes="libnwi.so,libnwi_awt.so" /> + <jar destfile="${nwi.dist.dir}/nwi-natives-macosx-ppc.jar" + basedir="${nwi.dist.dir}/nwi-macosx/ppc" + includes="libnwi.jnilib,libnwi_awt.jnilib" /> + <jar destfile="${nwi.dist.dir}/nwi-natives-macosx-universal.jar" + basedir="${nwi.dist.dir}/nwi-macosx/fat" + includes="libnwi.jnilib,libnwi_awt.jnilib" /> + <jar destfile="${nwi.dist.dir}/nwi-natives-solaris-sparc.jar" + basedir="${nwi.dist.dir}/nwi-solsparc/32" + includes="libnwi.so,libnwi_awt.so" /> + <jar destfile="${nwi.dist.dir}/nwi-natives-solaris-sparcv9.jar" + basedir="${nwi.dist.dir}/nwi-solsparc/64" + includes="libnwi.so,libnwi_awt.so" /> + <jar destfile="${nwi.dist.dir}/nwi-natives-solaris-i586.jar" + basedir="${nwi.dist.dir}/nwi-solx86/32" + includes="libnwi.so,libnwi_awt.so" /> + <jar destfile="${nwi.dist.dir}/nwi-natives-solaris-amd64.jar" + basedir="${nwi.dist.dir}/nwi-solx86/64" + includes="libnwi.so,libnwi_awt.so" /> + <!-- Copy gluegen-rt.jar from Linux build (arbitrary; this jar is platform-independent) --> + <copy file="${nwi.dist.dir}/nwi-linux/gluegen-rt.jar" todir="${nwi.dist.dir}" /> + <!-- Copy gluegen-rt native jars out of platform-specific subdirectories --> + <copy todir="${nwi.dist.dir}"> + <fileset dir="${nwi.dist.dir}/nwi-win/32" includes="gluegen-natives-*.jar" /> + </copy> + <copy todir="${nwi.dist.dir}"> + <fileset dir="${nwi.dist.dir}/nwi-win/64" includes="gluegen-natives-*.jar" /> + </copy> + <copy todir="${nwi.dist.dir}"> + <fileset dir="${nwi.dist.dir}/nwi-linux/32" includes="gluegen-natives-*.jar" /> + </copy> + <copy todir="${nwi.dist.dir}"> + <fileset dir="${nwi.dist.dir}/nwi-linux/64" includes="gluegen-natives-*.jar" /> + </copy> + <copy todir="${nwi.dist.dir}"> + <fileset dir="${nwi.dist.dir}/nwi-macosx/ppc" includes="gluegen-natives-*.jar" /> + </copy> + <copy todir="${nwi.dist.dir}"> + <fileset dir="${nwi.dist.dir}/nwi-macosx/fat" includes="gluegen-natives-*.jar" /> + </copy> + <copy todir="${nwi.dist.dir}"> + <fileset dir="${nwi.dist.dir}/nwi-solsparc/32" includes="gluegen-natives-*.jar" /> + </copy> + <copy todir="${nwi.dist.dir}"> + <fileset dir="${nwi.dist.dir}/nwi-solsparc/64" includes="gluegen-natives-*.jar" /> + </copy> + <copy todir="${nwi.dist.dir}"> + <fileset dir="${nwi.dist.dir}/nwi-solx86/32" includes="gluegen-natives-*.jar" /> + </copy> + <copy todir="${nwi.dist.dir}"> + <fileset dir="${nwi.dist.dir}/nwi-solx86/64" includes="gluegen-natives-*.jar" /> + </copy> + + <zip destfile="${nwi.dist.dir}/nwi-${tmp.version}-src.zip" + basedir="../.." + includes="jogl/*.txt,jogl/${rootrel.build.nwi}/gensrc/classes/javax/media/nwi/**,jogl/doc/**,jogl/make/**,jogl/src/nwi/**" + excludes="**/*.class,**/*~" + /> + <!-- Create zip archives suitable for developers --> + <!-- Unfortunately, we have to replicate the os/arch name combinations from + gluegen-cpptasks.xml. The reason for this is that we can't generate these + zip archives on the platform where the builds run; we have to run the dist + target in order to get the platform-independent nwi.jar. --> + <antcall target="dist.build.zip" inheritAll="true"> + <param name="zip.os.arch" value="linux-i586" /> + <param name="zip.so.suffix" value=".so" /> + <param name="zip.src.so.dir" value="${nwi.dist.dir}/nwi-linux/32" /> + </antcall> + <antcall target="dist.build.zip" inheritAll="true"> + <param name="zip.os.arch" value="linux-amd64" /> + <param name="zip.so.suffix" value=".so" /> + <param name="zip.src.so.dir" value="${nwi.dist.dir}/nwi-linux/64" /> + </antcall> + <antcall target="dist.build.zip" inheritAll="true"> + <param name="zip.os.arch" value="macosx-ppc" /> + <param name="zip.so.suffix" value=".jnilib" /> + <param name="zip.src.so.dir" value="${nwi.dist.dir}/nwi-macosx/ppc" /> + </antcall> + <antcall target="dist.build.zip" inheritAll="true"> + <param name="zip.os.arch" value="macosx-universal" /> + <param name="zip.so.suffix" value=".jnilib" /> + <param name="zip.src.so.dir" value="${nwi.dist.dir}/nwi-macosx/fat" /> + </antcall> + <antcall target="dist.build.zip" inheritAll="true"> + <param name="zip.os.arch" value="solaris-i586" /> + <param name="zip.so.suffix" value=".so" /> + <param name="zip.src.so.dir" value="${nwi.dist.dir}/nwi-solx86/32" /> + </antcall> + <antcall target="dist.build.zip" inheritAll="true"> + <param name="zip.os.arch" value="solaris-amd64" /> + <param name="zip.so.suffix" value=".so" /> + <param name="zip.src.so.dir" value="${nwi.dist.dir}/nwi-solx86/64" /> + </antcall> + <antcall target="dist.build.zip" inheritAll="true"> + <param name="zip.os.arch" value="solaris-sparc" /> + <param name="zip.so.suffix" value=".so" /> + <param name="zip.src.so.dir" value="${nwi.dist.dir}/nwi-solsparc/32" /> + </antcall> + <antcall target="dist.build.zip" inheritAll="true"> + <param name="zip.os.arch" value="solaris-sparcv9" /> + <param name="zip.so.suffix" value=".so" /> + <param name="zip.src.so.dir" value="${nwi.dist.dir}/nwi-solsparc/64" /> + </antcall> + <antcall target="dist.build.zip" inheritAll="true"> + <param name="zip.os.arch" value="windows-i586" /> + <param name="zip.so.suffix" value=".dll" /> + <param name="zip.src.so.dir" value="${nwi.dist.dir}/nwi-win/32" /> + </antcall> + <antcall target="dist.build.zip" inheritAll="true"> + <param name="zip.os.arch" value="windows-amd64" /> + <param name="zip.so.suffix" value=".dll" /> + <param name="zip.src.so.dir" value="${nwi.dist.dir}/nwi-win/64" /> + </antcall> + <!-- Create one last zip archive by hand, this one containing all of the --> + <!-- Java Web Start jar files (for easier redistribution) --> + <zip destfile="${nwi.dist.dir}/nwi-${tmp.version}-webstart.zip" + basedir="${nwi.dist.dir}" + includes="*.jar" /> + <!-- Create a version.txt file indicating which version we just built --> + <echo message="${tmp.version}" file="${nwi.dist.dir}/version.txt" /> + </target> + + <!-- ================================================================== --> + <!-- + - Clean up all that is built. + --> + <target name="clean" description="Remove all build products" depends="declare.common"> + <delete includeEmptyDirs="true" quiet="true"> + <fileset dir="${build}" /> + <fileset dir="${javadoc}" /> + <fileset dir="${javadoc.spec}" /> + <fileset dir="${javadoc.dev}" /> + </delete> + </target> + + <!-- ================================================================== --> + <!-- + - Build everything. + --> + <target name="all" description="Build NWI JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.nwi" /> + + <!-- ================================================================== --> + <!-- + - Build everything and use Sun's Implementation tag in the manifest to + - indicate this is the Reference Implementation. + --> + <target name="RI"> + <!-- Set property for using the RI manifest file so nwi.jar is versioned + - properly + --> + <property name="RImanifestfile" value="nwiRIversion" /> + <antcall target="all" inheritRefs="true" /> + </target> +</project> |