aboutsummaryrefslogtreecommitdiffstats
path: root/make/build-newt.xml
diff options
context:
space:
mode:
Diffstat (limited to 'make/build-newt.xml')
-rw-r--r--make/build-newt.xml211
1 files changed, 38 insertions, 173 deletions
diff --git a/make/build-newt.xml b/make/build-newt.xml
index 782ff158d..d8f8c2b60 100644
--- a/make/build-newt.xml
+++ b/make/build-newt.xml
@@ -56,27 +56,13 @@
-->
<project name="NEWT" basedir="." default="all">
- <import file="versions.xml" />
-
- <!-- Pull in GlueGen cpptasks build file -->
- <property name="gluegen.root" value="../../gluegen" />
- <import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
+ <import file="build-common.xml"/>
<!-- ================================================================== -->
<!--
- Base initialization and detection of operating system.
-->
- <target name="base.init" depends="gluegen.cpptasks.detect.os">
-
- <property name="javac.bootclasspath-cdc.jar" value="${gluegen.root}/make/lib/cdc_fp.jar"/>
-
- <condition property="setup.nodesktop">
- <and>
- <isfalse value="${isWindows}" />
- <isfalse value="${isOSX}" />
- <isfalse value="${isX11}" />
- </and>
- </condition>
+ <target name="base.init" depends="common.init">
<condition property="setup.nonatives">
<and>
@@ -89,16 +75,14 @@
</and>
</condition>
- <echo message="setup.nonatives: ${setup.nonatives}" />
- <echo message="setup.nodesktop: ${setup.nodesktop}" />
- <echo message="setup.noCDC: ${setup.noCDC}" />
- <echo message="setup.noAWT: ${setup.noAWT}" />
<echo message="setup.noOpenGL: ${setup.noOpenGL}" />
- <echo message="javac.bootclasspath-cdc.jar: ${javac.bootclasspath-cdc.jar}" />
+ <echo message="isWindows: ${isWindows}" />
+ <echo message="isOSX: ${isOSX}" />
<echo message="isX11: ${isX11}" />
<echo message="useKD: ${useKD}" />
<echo message="useIntelGDL: ${useIntelGDL}" />
<echo message="useBroadcomEGL: ${useBroadcomEGL}" />
+ <echo message="setup.nonatives: ${setup.nonatives}" />
<!-- partitioning -->
@@ -145,127 +129,28 @@
<property name="java.excludes.all" value="${java.excludes.awt}, ${java.excludes.opengl} ${java.excludes.desktop}" />
<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="newt.sourcelevel" value="1.4" />
- </target>
-
- <!--target name="base.init.sourcelevel.2" if="gluegen.nsig">
- <property name="newt.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}/newt.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." />
</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.newt" value="${rootrel.build}/newt" />
+ <target name="declare.common" description="Declare properties" depends="base.init">
<property name="rootrel.src" value="src/newt" />
<property name="rootrel.src.java" value="${rootrel.src}/classes" />
<property name="rootrel.src.c" value="${rootrel.src}/native" />
- <property name="rootrel.obj" value="${rootrel.build.newt}/obj" />
-
- <property name="gluegen-rt.jar" value="${gluegen.root}/${rootrel.build}/gluegen-rt.jar" />
- <property name="nativewindow.core.jar" value="../${rootrel.build}/nativewindow/nativewindow.core.jar" />
- <property name="nativewindow.os.x11.jar" value="../${rootrel.build}/nativewindow/nativewindow.os.x11.jar" />
- <property name="nativewindow.awt.jar" value="../${rootrel.build}/nativewindow/nativewindow.awt.jar" />
- <property name="jogl.core.jar" value="../${rootrel.build}/jogl/jogl.core.jar" />
- <property name="jogl.egl.jar" value="../${rootrel.build}/jogl/jogl.egl.jar" />
-
- <property name="gluegen-rt-cdc.jar" value="${gluegen.root}/${rootrel.build}/gluegen-rt-cdc.jar" />
- <property name="nativewindow.core.cdc.jar" value="../${rootrel.build}/nativewindow/nativewindow.core.cdc.jar" />
- <property name="nativewindow.os.x11.cdc.jar" value="../${rootrel.build}/nativewindow/nativewindow.os.x11.cdc.jar" />
- <property name="jogl.core.cdc.jar" value="../${rootrel.build}/jogl/jogl.core.cdc.jar" />
- <property name="jogl.egl.cdc.jar" value="../${rootrel.build}/jogl/jogl.egl.cdc.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.newt}" />
<!-- The generated source directories. -->
- <property name="src.generated" value="${build}/gensrc" />
+ <property name="src.generated" value="${build.newt}/gensrc" />
<property name="src.generated.c" value="${src.generated}/native/newt" />
<!-- The compiler output directories. -->
- <property name="classes" value="${build}/classes" />
- <property name="classes-cdc" value="${build}/classes-cdc" />
- <property name="obj" value="${project.root}/${rootrel.obj}" />
-
- <path id="nativewindow_gluegen_jogl.classpath">
- <pathelement location="${gluegen-rt.jar}" />
- <pathelement location="${nativewindow.core.jar}" />
- <pathelement location="${nativewindow.os.x11.jar}" />
- <pathelement location="${nativewindow.awt.jar}" />
- <pathelement location="${jogl.core.jar}" />
- <pathelement location="${jogl.egl.jar}" />
- </path>
-
- <path id="nativewindow_gluegen_jogl.classpath-cdc">
- <pathelement location="${gluegen-rt-cdc.jar}" />
- <pathelement location="${nativewindow.core.cdc.jar}" />
- <pathelement location="${nativewindow.os.x11.cdc.jar}" />
- <pathelement location="${jogl.core.cdc.jar}" />
- <pathelement location="${jogl.egl.cdc.jar}" />
- </path>
-
- <!-- The resulting newt.jar. -->
- <property name="newt.core.jar" value="${build}/newt.core.jar" />
- <property name="newt.os.x11.jar" value="${build}/newt.os.x11.jar" />
- <property name="newt.os.win.jar" value="${build}/newt.os.win.jar" />
- <property name="newt.os.osx.jar" value="${build}/newt.os.osx.jar" />
- <property name="newt.ogl.jar" value="${build}/newt.ogl.jar" />
- <property name="newt.broadcomegl.jar" value="${build}/newt.broadcomegl.jar" />
- <property name="newt.awt.jar" value="${build}/newt.awt.jar" />
- <property name="newt.all.jar" value="${build}/newt.all.jar" />
- <property name="newt.all-noawt.jar" value="${build}/newt.all-noawt.jar" />
-
- <property name="newt.core.cdc.jar" value="${build}/newt.core.cdc.jar" />
- <property name="newt.os.x11.cdc.jar" value="${build}/newt.os.x11.cdc.jar" />
- <property name="newt.os.win.cdc.jar" value="${build}/newt.os.win.cdc.jar" />
- <property name="newt.os.osx.cdc.jar" value="${build}/newt.os.osx.cdc.jar" />
- <property name="newt.ogl.cdc.jar" value="${build}/newt.ogl.cdc.jar" />
- <property name="newt.broadcomegl.cdc.jar" value="${build}/newt.broadcomegl.cdc.jar" />
- <property name="newt.all.cdc.jar" value="${build}/newt.all.cdc.jar" />
+ <property name="classes" value="${build.newt}/classes" />
+ <property name="classes-cdc" value="${build.newt}/classes-cdc" />
<!-- The javadoc dirs. -->
<property name="javadoc" value="${project.root}/javadoc_newt_public" />
@@ -288,9 +173,6 @@
- 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"/>
-
<mkdir dir="${src.generated.c}" />
<mkdir dir="${src.generated.c}/X11" />
<mkdir dir="${src.generated.c}/MacOSX" />
@@ -300,7 +182,7 @@
<mkdir dir="${src.generated.c}/BroadcomEGL" />
<mkdir dir="${classes}" />
<mkdir dir="${classes-cdc}" />
- <mkdir dir="${obj}" />
+ <mkdir dir="${obj.newt}" />
</target>
<!-- ================================================================== -->
@@ -311,9 +193,9 @@
<!-- Perform the second pass Java compile; everything. -->
<javac destdir="${classes}"
excludes="${java.excludes.all}"
- source="${newt.sourcelevel}"
+ source="${target.sourcelevel}"
fork="yes"
- memoryMaximumSize="128m"
+ memoryMaximumSize="${javac.memorymax}"
debug="${javacdebug}" debuglevel="${javacdebuglevel}">
<src path="${src.java}" />
<classpath refid="nativewindow_gluegen_jogl.classpath"/>
@@ -324,10 +206,10 @@
<!-- Perform the first pass Java compile; everything -->
<javac destdir="${classes-cdc}"
excludes="${java.excludes.all} ${java.excludes.cdcfp}"
- source="${newt.sourcelevel}"
+ source="${target.sourcelevel}"
bootclasspath="${javac.bootclasspath-cdc.jar}"
fork="yes"
- memoryMaximumSize="128m"
+ memoryMaximumSize="${javac.memorymax}"
debug="${javacdebug}" debuglevel="${javacdebuglevel}">
<classpath refid="nativewindow_gluegen_jogl.classpath-cdc"/>
<src path="${src.java}" />
@@ -531,8 +413,8 @@
<echo message="Compiling @{output.lib.name}" />
<cc outtype="shared"
- objdir="${obj}"
- outfile="${obj}/@{output.lib.name}"
+ objdir="${obj.newt}"
+ outfile="${obj.newt}/@{output.lib.name}"
optimize="${c.compiler.optimise}"
debug="${c.compiler.debug}"
multithreaded="true"
@@ -568,24 +450,24 @@
</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"/>
+ <syslibset dir="${java.lib.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
+ <syslibset dir="${java.lib.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" />
- <param name="dest-cdc" value="${build}/obj/lib@{output.lib.name}.so" />
+ <param name="src" value="${obj.newt}/lib@{output.lib.name}.dylib" />
+ <param name="dest" value="${obj.newt}/lib@{output.lib.name}.jnilib" />
+ <param name="dest-cdc" value="${obj.newt}/lib@{output.lib.name}.so" />
</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" />
+ <param name="src" value="${obj.newt}/lib@{output.lib.name}.so" />
+ <param name="dest" value="${obj.newt}/@{output.lib.name}.dll" />
</antcall>
</sequential>
</macrodef>
@@ -621,7 +503,7 @@
<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 -->
- <msvc.manifest objdir="${obj}" dllname="newt" />
+ <msvc.manifest objdir="${obj.newt}" dllname="newt" />
</target>
<target name="c.build.newt.natives" depends="c.build.newt.windowlib" unless="setup.nonatives">
@@ -629,18 +511,18 @@
<target name="c.build.newt" depends="c.configure,c.build.newt.prepare,c.build.newt.natives">
<antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
- <param name="libdir" value="${obj}"/>
+ <param name="libdir" value="${obj.newt}"/>
</antcall>
<antcall target="c.manifest" inheritRefs="true" />
<!-- Create the Java Web Start jar file for the built native code -->
- <jar destfile="${build}/newt-natives-${os.and.arch}.jar" filesonly="true">
- <fileset dir="${obj}">
+ <jar destfile="${build.newt}/newt-natives-${os.and.arch}.jar" filesonly="true">
+ <fileset dir="${obj.newt}">
<include name="*.${native.library.suffix}" />
</fileset>
</jar>
- <jar destfile="${build}/newt-natives-${os.and.arch}-cdc.jar" filesonly="true">
- <fileset dir="${obj}">
+ <jar destfile="${build.newt}/newt-natives-${os.and.arch}-cdc.jar" filesonly="true">
+ <fileset dir="${obj.newt}">
<include name="*.${native.library.suffix-cdc}" />
</fileset>
</jar>
@@ -661,14 +543,11 @@
<isset property="newt.ri" />
</not>
</condition>
- <tstamp>
- <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/>
- </tstamp>
<copy file="${manifestfile}"
tofile="tempversion"
overwrite="true">
<filterset>
- <filter token="VERSION" value="${newt_base_version}-pre-${timestamp}"/>
+ <filter token="VERSION" value="${newt.version}"/>
<filter token="BASEVERSION" value="${newt_base_version}"/>
</filterset>
</copy>
@@ -683,14 +562,11 @@
<isset property="newt.ri" />
</not>
</condition>
- <tstamp>
- <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/>
- </tstamp>
<copy file="${manifestfile}"
tofile="tempversion-cdc"
overwrite="true">
<filterset>
- <filter token="VERSION" value="${newt_base_version}-pre-${timestamp}"/>
+ <filter token="VERSION" value="${newt.version}"/>
<filter token="BASEVERSION" value="${newt_base_version}"/>
</filterset>
</copy>
@@ -800,7 +676,7 @@
- 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">
+ <target name="javadoc" depends="init">
<!-- Build the general Javadoc -->
<javadoc packagenames="${javadoc.packagenames}"
excludepackagenames="${java.excludes.javadoc.packagenames}"
@@ -814,7 +690,7 @@
</javadoc>
</target>
- <target name="javadoc.spec" depends="load.user.properties,init">
+ <target name="javadoc.spec" depends="init">
<!-- Build the general Javadoc -->
<javadoc packagenames="${javadoc.spec.packagenames}"
excludepackagenames="${java.excludes.javadoc.packagenames}"
@@ -828,7 +704,7 @@
</javadoc>
</target>
- <target name="javadoc.dev" depends="load.user.properties,init">
+ <target name="javadoc.dev" depends="init">
<!-- Build the internal developer Javadoc -->
<javadoc packagenames="${javadoc.dev.packagenames}"
excludepackagenames="${java.excludes.javadoc.packagenames}"
@@ -850,7 +726,7 @@
-->
<target name="clean" description="Remove all build products" depends="declare.common">
<delete includeEmptyDirs="true" quiet="true">
- <fileset dir="${build}" />
+ <fileset dir="${build.newt}" />
<fileset dir="${javadoc}" />
<fileset dir="${javadoc.spec}" />
<fileset dir="${javadoc.dev}" />
@@ -861,22 +737,11 @@
<!--
- Build everything.
-->
- <target name="all" description="Build NEWT JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.newt,generate.version.txt" />
-
- <target name="setup-version-RI" if="newt.ri">
- <property name="tmp.version" value="${newt_base_version}" />
- </target>
-
- <target name="setup-version-non-RI" unless="newt.ri">
- <tstamp>
- <format property="version.timestamp" pattern="yyyyMMdd"/>
- </tstamp>
- <property name="tmp.version" value="${newt_base_version}-pre-${version.timestamp}" />
- </target>
+ <target name="all" description="Build NEWT JAR file(s) and native libraries." depends="init,jar,c.build.newt,generate.version.txt" />
- <target name="generate.version.txt" depends="setup-version-RI,setup-version-non-RI">
+ <target name="generate.version.txt" depends="init">
<!-- Create a version.txt file indicating which version we just built -->
- <echo message="${tmp.version}" file="${build}/version.txt" />
+ <echo message="${newt.version}" file="${build.newt}/version.txt" />
</target>
<!-- ================================================================== -->