diff options
author | kbr <[email protected]> | 2005-12-22 08:01:04 +0000 |
---|---|---|
committer | kbr <[email protected]> | 2005-12-22 08:01:04 +0000 |
commit | 7d4baa0cff089699b7e17c71a2609d5f1b58c969 (patch) | |
tree | 11b99dad5f256b5ad50b3b406e274a8d1fb3ee1e /make/build.xml | |
parent | db347e8cb651a73b7609fbf98eefd1b0c8efc6c6 (diff) |
Revived gluegen-branch-1-0 branch of JOAL source tree, which was a
never-productized port of the JOAL workspace using GlueGen to
autogenerate its code. Brought branch up to current version of GlueGen
and OpenAL 1.1 headers. Changed code generation style to use
call-through-function-pointer nearly everywhere; resulted in
significant refactoring of GlueGen's GLEmitter into generic
ProcAddressEmitter, checked in separately. Worked around bug in
current OpenAL implementation where alGetProcAddress doesn't work
properly for core routines; uses dlsym or similar for function lookup.
Revised build.xml to use cpptasks as in JOGL. Cleaned up API to match
JOGL's more closely; renamed OpenALException to ALException and made
it a RuntimeException, cleaned up ALFactory and ALut, deleted
Sound3DException in favor of ALException, moved JOALVersion to
util/Version, etc. Added BufferUtils from GlueGen workspace (really
need shared project used among all Java Games APIs). Revised ALut,
WAVLoader and demos; demos will be checked in later (no Developer
rights yet on joal-demos workspace).
git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/git-svn/../svn-server-sync/joal/branches/gluegen-branch-1-0@96 03bf7f67-59de-4072-a415-9a990d468a3f
Diffstat (limited to 'make/build.xml')
-rwxr-xr-x | make/build.xml | 700 |
1 files changed, 304 insertions, 396 deletions
diff --git a/make/build.xml b/make/build.xml index 3d2eea3..1649856 100755 --- a/make/build.xml +++ b/make/build.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - - Ant build for JOAL. This build has been tested with ANT 1.5.3. The + - Ant build for JOAL. This build has been tested with ANT 1.6.2. The - optional.jar that contains the optional ANT tasks must be in the ANT - classpath (typically the ant/lib directory). - @@ -31,12 +31,6 @@ - win32.mingw: build everything (jar, DSOs) for the current platform - clean: clean all built - javadoc: create the standard developer Javadoc - - javadoc.dev.win32: - - javadoc.dev.x11: - - javadoc.dev.macosx: 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. - - Optional properties: - -Djoal.cg=1 when combined with the build or javadoc targets will cause @@ -84,22 +78,33 @@ <condition property="isWindows"> <os family="windows" /> </condition> + <condition property="isFreeBSD"> + <os name="FreeBSD" /> + </condition> + <condition property="isLinuxAMD64"> + <and> + <istrue value="${isLinux}" /> + <os arch="AMD64" /> + </and> + </condition> + <condition property="isIA64"> + <os arch="IA64" /> + </condition> + <echo message="OS X=${isOSX}" /> + <echo message="Windows=${isWindows}" /> + <echo message="Unix=${isUnix}" /> + <echo message="Linux=${isLinux}" /> + <echo message="Solaris=${isSolaris}" /> + <echo message="FreeBSD=${isFreeBSD}" /> + <echo message="LinuxAMD64=${isLinuxAMD64}" /> + <echo message="IA64=${isIA64}" /> </target> <!-- ================================================================== --> <!-- - Load user properties which override build defaults. --> - <target name="load.user.properties.nonmacosx" depends="base.init" unless="isOSX"> - <!-- 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}/joal.properties" /> - <property file="${user.properties.file}" /> - <echo message="Loaded ${user.properties.file}." /> - <echo message="antlr.jar=${antlr.jar}" /> - </target> - <target name="load.user.properties.macosx" depends="base.init" if="isOSX"> + <target name="load.user.properties" depends="base.init"> <!-- Load the user specified properties file that defines various host - specific paths. The user will be notified if this is does not - exist. --> @@ -107,10 +112,29 @@ <property file="${user.properties.file}" /> <echo message="Loaded ${user.properties.file}." /> <echo message="antlr.jar=${antlr.jar}" /> - </target> - <target name="load.user.properties" depends="load.user.properties.nonmacosx,load.user.properties.macosx"> - <fail message="antlr.jar was not specified in joal.properties. Please see README.txt for instructions" unless="antlr.jar"/> - <fail message="joal.lib.dir was not specified in joal.properties. Please see README.txt for instructions" unless="joal.lib.dir"/> + <fail message="antlr.jar was not specified in joal.properties. Please see README.txt for instructions" unless="antlr.jar"/> + <fail message="joal.lib.dir was not specified in joal.properties. Please see README.txt for instructions" unless="joal.lib.dir"/> + <condition property="isVC6"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="vc6" /> + </and> + </condition> + <condition property="isVC7"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="vc7" /> + </and> + </condition> + <condition property="isMingw"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="mingw" /> + </and> + </condition> + <echo message="VC6=${isVC6}" /> + <echo message="VC7=${isVC7}" /> + <echo message="MingW=${isMingw}" /> </target> <!-- ================================================================== --> @@ -143,8 +167,8 @@ This build.xml expects that GlueGen has already been built and that its classes are in the build/classes subdirectory of this other workspace. Currently we expect that it is contained in the JOGL project. --> - <property name="gluegen.root" value="../../jogl" /> - <property name="gluegen.classes" value="${gluegen.root}/build/classes" /> + <property name="jogl.root" value="../../jogl" /> + <property name="gluegen.classes" value="${jogl.root}/build/classes" /> <!-- Names of directories relative to the project root. Some of these are used in FileMappers later for dependence information @@ -195,11 +219,6 @@ <property name="java.includes.dir.solaris" value="${java.includes.dir}/solaris" /> <property name="java.includes.dir.macosx" value="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers" /> - <!-- Java files to exclude based on platform (relative to "src") --> - <property name="java.excludes.win32" value="net/java/games/joal/impl/x11/**, net/java/games/joal/impl/macosx/**" /> - <property name="java.excludes.x11" value="net/java/games/joal/impl/windows/**, net/java/games/joal/impl/macosx/**" /> - <property name="java.excludes.macosx" value="net/java/games/joal/impl/x11/**, net/java/games/joal/impl/windows/**" /> - <!-- Create the classpath that includes ANTLR and any already - compiled classes. This requires the user-defined "antlr.jar" - property. --> @@ -218,10 +237,7 @@ <property name="javadoc.dev" value="${project.root}/javadoc_joal_dev" /> <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" /> <property name="javadoc.packagenames" value="net.java.games.joal,net.java.games.joal.util" /> - <property name="javadoc.dev.packagenames.win32" value="net.java.games.joal.impl.windows" /> - <property name="javadoc.dev.packagenames.x11" value="net.java.games.joal.impl.x11" /> - <property name="javadoc.dev.packagenames.macosx" value="net.java.games.joal.impl.macosx" /> - <property name="javadoc.dev.packagenames" value="net.java.games.joal,net.java.games.joal.impl,net.java.games.joal.util" /> + <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},net.java.games.joal.impl" /> <!-- Names of configuration files used during glue code generation. --> <property name="joal.cfg" value="${config}/joal.cfg" /> @@ -234,164 +250,82 @@ <!-- - Platform specific declares. --> - <target name="declare.win32.pre" depends="init" if="isWindows"> - <!-- Set platform directories. --> - <property name="stub.includes.platform" value="${stub.includes}/win32" /> - <property name="java.includes.dir.platform" value="${java.includes.dir.win32}" /> - <property name="java.lib.dir.platform" value="${java.lib.dir.win32}" /> - <property name="java.excludes.platform" value="${java.excludes.win32}" /> - - <!-- Set Javadoc properties. --> - <property name="javadoc.dev.packagenames.platform" value="${javadoc.dev.packagenames.win32}" /> - - <!-- Choose the C compiler being used. --> - <condition property="isMingw"> - <equals arg1="${win32.c.compiler}" arg2="mingw" /> - </condition> - <condition property="isVC6"> - <equals arg1="${win32.c.compiler}" arg2="vc6" /> - </condition> - <condition property="isVC7"> - <equals arg1="${win32.c.compiler}" arg2="vc7" /> - </condition> - </target> - - <target name="declare.win32.vc.common"> - <property name="c.compiler" value="cl.exe" /> - <property name="c.compiler.flags" value="${c.compiler.optflags} /nologo /TC /c" /> - <property name="c.compiler.obj.suffix" value="obj" /> - <property name="c.compiler.joal.outputfile.expr" value="/Fo${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="/I"make/stub_includes/openal" /I"${rootrel.src.c}" /I"${c.compiler.include.root}/PlatformSDK/Include" /I"${c.compiler.include.root}/include" /I"${java.includes.dir}" /I"${java.includes.dir.platform}"" /> - <property name="c.linker" value="link.exe" /> - <property name="c.linker.flags" value="/DLL /LIBPATH:"${c.linker.lib.root}/PlatformSDK/lib" /LIBPATH:"${c.linker.lib.root}/lib" /LIBPATH:"${java.lib.dir.platform}" /LIBPATH:"${joal.lib.dir}" /INCREMENTAL:NO /NOLOGO /MACHINE:IX86 /OPT:REF /OPT:ICF /SUBSYSTEM:WINDOWS" /> - <property name="c.linker.joal.libs" value="openal32.lib" /> - <property name="rootrel.c.linker.joal.dso" value="${rootrel.obj}/joal.dll" /> - <property name="c.linker.joal.dso" value="${project.root}/${rootrel.c.linker.joal.dso}" /> - <property name="c.linker.joal.flags" value="/OUT:"${c.linker.joal.dso}"" /> + <target name="declare.win32.vc6" if="isVC6"> + <echo message="Win32.VC6" /> + <property name="c.compiler.include.root" value="${vc6.root}" /> + <property name="c.linker.lib.root" value="${vc6.root}" /> + <property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" /> + <property name="linker.cfg.id" value="linker.cfg.win32.msvc" /> </target> + + <target name="declare.win32.vc7" if="isVC7"> + <echo message="Win32.VC7" /> + <property name="c.compiler.include.root" value="${vc7.root}" /> + <property name="c.linker.lib.root" value="${vc7.root}" /> - <target name="declare.win32.vc6.debug" if="debug"> - <!-- FIXME: put in debug flags --> - <property name="c.compiler.optflags" value="/MD /W3 /O2 /Ob1 /GF /Gy" /> + <property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" /> + <property name="linker.cfg.id" value="linker.cfg.win32.msvc" /> </target> - <target name="declare.win32.vc6.optimized" unless="debug"> - <property name="c.compiler.optflags" value="/MD /W3 /O2 /Ob1 /GF /Gy" /> + + <target name="declare.win32.mingw" if="isMingw"> + <echo message="Win32.MingW" /> + <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" /> + <property name="linker.cfg.id" value="linker.cfg.win32.mingw" /> </target> - <target name="declare.win32.vc6.pre" depends="declare.win32.pre,declare.win32.vc6.debug,declare.win32.vc6.optimized"> - <property name="c.compiler.include.root" value="${vc6.root}" /> - <property name="c.linker.lib.root" value="${vc6.root}" /> + <target name="declare.win32" depends="declare.win32.vc6,declare.win32.vc7,declare.win32.mingw" if="isWindows"> + <property name="java.includes.dir.platform" value="${java.includes.dir.win32}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.win32}" /> </target> - <target name="declare.win32.vc6" depends="declare.win32.vc6.pre, declare.win32.vc.common" if="isVC6" /> - - <target name="declare.win32.vc7.debug" if="debug"> - <property name="c.compiler.optflags" value="/MDd /Yd /GS /RTCs /RTCu /RTCc /W3 /Od /GF /EHsc /Zi /GS /Gy /Wp64 /Zi /D "_DEBUG"" /> - </target> - <target name="declare.win32.vc7.optimized" unless="debug"> - <property name="c.compiler.optflags" value="/MD /W3 /O2 /Ob1 /GF /EHsc /GS /Gy /Wp64 /D "NDEBUG"" /> - </target> + <target name="declare.linux.x86" if="isLinux" unless="isLinuxAMD64"> + <echo message="Linux.x86" /> + <property name="java.includes.dir.platform" value="${java.includes.dir.linux}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.linux}" /> - <target name="declare.win32.vc7.pre" depends="declare.win32.pre,declare.win32.vc7.debug,declare.win32.vc7.optimized"> - <property name="c.compiler.include.root" value="${vc7.root}" /> - <property name="c.linker.lib.root" value="${vc7.root}" /> + <property name="compiler.cfg.id" value="compiler.cfg.linux" /> + <property name="linker.cfg.id" value="linker.cfg.linux" /> </target> + + <target name="declare.linux.amd64" if="isLinuxAMD64"> + <echo message="Linux.AMD64" /> + <property name="java.includes.dir.platform" value="${java.includes.dir.linux}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.linux.amd64}" /> - <target name="declare.win32.vc7" depends="declare.win32.vc7.pre, declare.win32.vc.common" if="isVC7" /> - - <target name="declare.win32.mingw" depends="declare.win32.pre" if="isMingw" > - <property name="c.compiler" value="gcc.exe" /> - <property name="c.compiler.optflags" value="-O3" /> - <property name="c.compiler.flags" value="${c.compiler.optflags} -c -DBUILD_DLL -D_WINGDI_ -D_STRICT_ANSI -D_JNI_IMPLEMENTATION_ -o" /> - <property name="c.compiler.obj.suffix" value="o" /> - <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> - <property name="c.linker" value="gcc.exe" /> - <property name="c.linker.flags" value="-shared" /> - <property name="c.linker.joal.libs" value="-Wl,--kill-at -L"${java.lib.dir.platform}" -L"${joal.lib.dir}" -lopenal32" /> - <property name="rootrel.c.linker.joal.dso" value="${rootrel.obj}/joal.dll" /> - <property name="c.linker.joal.dso" value="${project.root}/${rootrel.c.linker.joal.dso}" /> - <property name="c.linker.joal.flags" value="-o ${c.linker.joal.dso}" /> + <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" /> + <property name="linker.cfg.id" value="linker.cfg.linux.amd64" /> </target> - <target name="declare.win32" depends="declare.win32.pre,declare.win32.vc6,declare.win32.vc7,declare.win32.mingw" /> + <target name="declare.linux" depends="declare.linux.x86,declare.linux.amd64" if="isLinux" /> - <target name="declare.x11" depends="init"> - <!-- Set platform directories. --> - <property name="stub.includes.platform" value="${stub.includes.x11}" /> - <property name="java.excludes.platform" value="${java.excludes.x11}" /> + <target name="declare.solaris" if="isSolaris"> + <echo message="Solaris" /> + <property name="java.includes.dir.platform" value="${java.includes.dir.solaris}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.solaris}" /> - <!-- Set Javadoc properties. --> - <property name="javadoc.dev.packagenames.platform" value="${javadoc.dev.packagenames.x11}" /> + <property name="compiler.cfg.id" value="compiler.cfg.solaris" /> + <property name="linker.cfg.id" value="linker.cfg.solaris" /> </target> - <target name="declare.linux" depends="declare.x11" if="isLinux"> - <property name="java.includes.dir.platform" value="${java.includes.dir.linux}" /> - <property name="java.lib.dir.platform" value="${java.lib.dir.linux}" /> - - <!-- Set up gcc --> - <property name="c.compiler" value="gcc" /> - <property name="c.compiler.optflags" value="-O2" /> - <property name="c.compiler.flags" value="${c.compiler.optflags} -c -o" /> - <property name="c.compiler.obj.suffix" value="o" /> - <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> - <property name="c.linker" value="gcc" /> - <property name="c.linker.flags" value="-shared" /> - <property name="c.linker.joal.libs" value="-L"${java.lib.dir.platform}" -L"${joal.lib.dir}" -lopenal" /> - <property name="rootrel.c.linker.joal.dso" value="${rootrel.obj}/libjoal.so" /> - <property name="c.linker.joal.dso" value="${project.root}/${rootrel.c.linker.joal.dso}" /> - <property name="c.linker.joal.flags" value="-o ${c.linker.joal.dso}" /> - </target> + <target name="declare.macosx" if="isOSX"> + <echo message="MacOSX" /> + <property name="java.includes.dir.platform" value="${java.includes.dir.macosx}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.macosx}" /> - <target name="declare.solaris" depends="declare.x11" if="isSolaris"> - <property name="java.includes.dir.platform" value="${java.includes.dir.solaris}" /> - <property name="java.lib.dir.platform" value="${java.lib.dir.solaris}" /> - - <!-- Set up Solaris CC --> - <property name="c.compiler" value="cc" /> - <property name="c.compiler.optflags" value="-xO0 -KPIC" /> - <property name="c.compiler.flags" value="${c.compiler.optflags} -c -o" /> - <property name="c.compiler.obj.suffix" value="o" /> - <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> - <property name="c.linker" value="cc" /> - <property name="c.linker.flags" value="-G" /> - <property name="c.linker.joal.libs" value="-L"${java.lib.dir.platform}" -L"${joal.lib.dir}" -lopenal" /> - <property name="rootrel.c.linker.joal.dso" value="${rootrel.obj}/libjoal.so" /> - <property name="c.linker.joal.dso" value="${project.root}/${rootrel.c.linker.joal.dso}" /> - <property name="c.linker.joal.flags" value="-o ${c.linker.joal.dso}" /> + <property name="compiler.cfg.id" value="compiler.cfg.macosx" /> + <property name="linker.cfg.id" value="linker.cfg.macosx" /> </target> - <target name="declare.macosx" depends="init" if="isOSX"> - <!-- Set platform directories. --> - <property name="stub.includes.platform" value="${stub.includes}/macosx" /> - <property name="java.includes.dir.platform" value="${java.includes.dir.macosx}" /> - <property name="java.lib.dir.platform" value="${java.lib.dir.macosx}" /> - <property name="java.excludes.platform" value="${java.excludes.macosx}" /> - - <!-- Set Javadoc properties. --> - <property name="javadoc.dev.packagenames.platform" value="${javadoc.dev.packagenames.macosx}" /> - - <!-- Set up gcc --> - <property name="c.compiler" value="gcc" /> - <property name="c.compiler.optflags" value="-Os -arch ppc -Dmacosx" /> - <!-- Note: specifying -ObjC for all files is sloppy (only needed for --> - <!-- JAWT-related .c files) but this doesn't break anything and is easier --> - <!-- than rewriting the whole Makefile --> - <property name="c.compiler.flags" value="${c.compiler.optflags} -fno-common -fpascal-strings -Wmost -ObjC -c -o" /> - <property name="c.compiler.obj.suffix" value="o" /> - <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> - <property name="c.linker" value="gcc" /> - <property name="c.linker.flags" value="-arch ppc -prebind -Wl,-single_module -dynamiclib -compatibility_version 1 -current_version 1 -prebind_all_twolevel_modules" /> - <property name="c.linker.joal.libs" value="-framework OpenAL" /> - <property name="rootrel.c.linker.joal.dso" value="${rootrel.obj}/libjoal.jnilib" /> - <property name="c.linker.joal.dso" value="${project.root}/${rootrel.c.linker.joal.dso}" /> - <property name="c.linker.joal.flags" value="-o ${c.linker.joal.dso}" /> + <target name="declare.freebsd" if="isFreeBSD"> + <echo message="FreeBSD" /> + <property name="java.includes.dir.platform" value="${java.includes.dir.freebsd}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.linux}" /> + + <property name="compiler.cfg.id" value="compiler.cfg.freebsd" /> + <property name="linker.cfg.id" value="linker.cfg.linux" /> </target> - + <!-- ================================================================== --> <!-- - Initialize all parameters required for the build and create any @@ -409,7 +343,7 @@ <mkdir dir="${obj.joal}" /> </target> - <target name="declare" depends="init,declare.win32,declare.linux,declare.solaris,declare.macosx" /> + <target name="declare" depends="init,declare.win32,declare.linux,declare.solaris,declare.macosx,declare.freebsd" /> <!-- ================================================================== --> <!-- Java file generation --> @@ -445,7 +379,7 @@ --> <target name="java.generate" depends="java.generate.check" unless="java.generate.skip"> <!-- Add the GlueGen task to ANT --> - <taskdef name="gluegen" classname="net.java.games.gluegen.ant.GlueGenTask" + <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask" classpathref="antlr.classpath" /> <!-- Use the GlueGen task to generate the Java files --> @@ -454,7 +388,7 @@ <gluegen src="${stub.includes.openal}/al.h" config="${joal.cfg}" includeRefid="stub.includes.fileset.all" - emitter="net.java.games.gluegen.JavaEmitter"> + emitter="com.sun.gluegen.procaddress.ProcAddressEmitter"> <classpath refid="antlr.classpath" /> </gluegen> @@ -462,7 +396,7 @@ <gluegen src="${stub.includes.openal}/al.h" config="${joal.constants.cfg}" includeRefid="stub.includes.fileset.all" - emitter="net.java.games.gluegen.JavaEmitter"> + emitter="com.sun.gluegen.JavaEmitter"> <classpath refid="antlr.classpath" /> </gluegen> @@ -470,7 +404,7 @@ <gluegen src="${stub.includes.openal}/alc.h" config="${joal.alc.cfg}" includeRefid="stub.includes.fileset.all" - emitter="net.java.games.gluegen.JavaEmitter"> + emitter="com.sun.gluegen.procaddress.ProcAddressEmitter"> <classpath refid="antlr.classpath" /> </gluegen> @@ -478,7 +412,7 @@ <gluegen src="${stub.includes.openal}/alc.h" config="${joal.alc.constants.cfg}" includeRefid="stub.includes.fileset.all" - emitter="net.java.games.gluegen.JavaEmitter"> + emitter="com.sun.gluegen.JavaEmitter"> <classpath refid="antlr.classpath" /> </gluegen> @@ -491,13 +425,10 @@ <!-- ================================================================== --> <!-- - - Compile the original and generated source. The composable pipelines - - will be generated. + - Compile the original and generated source. --> <target name="java.compile" depends="java.generate"> - <!-- Perform the first pass Java compile. --> - <javac destdir="${classes}" - excludes="${java.excludes.platform}" source="1.4" debug="true" debuglevel="source,lines"> + <javac destdir="${classes}" source="1.4" debug="true" debuglevel="source,lines"> <src path="${src}" /> <src path="${src.generated.java}" /> <classpath refid="antlr.classpath" /> @@ -509,157 +440,187 @@ - Compile the native C code for JOAL. --> - <!-- - - Check dependencies to see whether we need to recompile .c or .m files - --> - <target name="c.compile.joal.check.nonmacosx" unless="isOSX"> - <condition property="c.compile.joal.skip"> - <and> - <uptodate> - <srcfiles dir="${project.root}" includes="${rootrel.src.c}/*.c" /> - <mapper type="glob" from="${rootrel.src.c}${sep}*.c" to="${rootrel.obj.joal}${sep}*.${c.compiler.obj.suffix}" /> - </uptodate> - <uptodate> - <srcfiles dir="${project.root}" includes="${rootrel.generated.c.joal}/*.c" /> - <mapper type="glob" from="${rootrel.generated.c.joal}${sep}*.c" to="${rootrel.obj.joal}${sep}*.${c.compiler.obj.suffix}" /> - </uptodate> - </and> - </condition> - </target> - - <target name="c.compile.joal.check.macosx" if="isOSX"> - <condition property="c.compile.joal.skip"> - <and> - <uptodate> - <srcfiles dir="${project.root}" includes="${rootrel.src.c}/*.c" /> - <mapper type="glob" from="${rootrel.src.c}${sep}*.c" to="${rootrel.obj.joal}${sep}*.${c.compiler.obj.suffix}" /> - </uptodate> - <uptodate> - <srcfiles dir="${project.root}" includes="${rootrel.generated.c.joal}/*.c" /> - <mapper type="glob" from="${rootrel.generated.c.joal}${sep}*.c" to="${rootrel.obj.joal}${sep}*.${c.compiler.obj.suffix}" /> - </uptodate> - <uptodate> - <srcfiles dir="${project.root}" includes="${rootrel.src.c}/*.m" /> - <mapper type="glob" from="${rootrel.src.c}${sep}*.m" to="${rootrel.obj.joal}${sep}*.${c.compiler.obj.suffix}" /> - </uptodate> - </and> - </condition> - </target> - - <target name="c.compile.joal.check" depends="c.compile.joal.check.nonmacosx,c.compile.joal.check.macosx"> - </target> - - <!-- - - Compile source files - --> - <target name="c.compile.joal.macosx.objs" if="isOSX"> - <apply executable="${c.compiler}" dest="${rootrel.obj.joal}" dir="${project.root}" relative="true" failonerror="true"> - <arg line="${c.compiler.includes}" /> - <arg line="${c.compiler.flags}" /> - <fileset dir="${project.root}"> - <include name="${rootrel.src.c}/*.m"/> - </fileset> - <targetfile /> - <srcfile /> - <mapper type="glob" from="${rootrel.src.c}${sep}*.m" to="${c.compiler.joal.outputfile.expr}" /> - </apply> - </target> - - <target name="c.compile.joal" depends="c.compile.joal.check" unless="c.compile.joal.skip"> - - <!-- Note: commented out for now since we currently don't have any hand-generated C, - but we might later when we add back in EAX and other support --> - - <!-- -- -- <apply executable="${c.compiler}" dest="${rootrel.obj.joal}" dir="${project.root}" relative="true" failonerror="true"> -- <arg line="${c.compiler.includes}" /> -- <arg line="${c.compiler.flags}" /> -- <fileset dir="${project.root}"> -- <include name="${rootrel.src.c}/*.c"/> -- </fileset> -- <targetfile /> -- <srcfile /> -- <mapper type="glob" from="${rootrel.src.c}${sep}*.c" to="${c.compiler.joal.outputfile.expr}" /> -- </apply> ---> - <apply executable="${c.compiler}" dest="${rootrel.obj.joal}" dir="${project.root}" relative="true" failonerror="true"> - <arg line="${c.compiler.includes}" /> - <arg line="${c.compiler.flags}" /> - <fileset dir="${project.root}"> - <include name="${rootrel.generated.c.joal}/*.c"/> - </fileset> - <targetfile /> - <srcfile /> - <mapper type="glob" from="${rootrel.generated.c.joal}${sep}*.c" to="${c.compiler.joal.outputfile.expr}" /> - </apply> - - <apply executable="${c.compiler}" dest="${rootrel.obj.joal}" dir="${project.root}" relative="true" failonerror="true"> - <arg line="${c.compiler.includes}" /> - <arg line="${c.compiler.flags}" /> - <fileset dir="${project.root}"> - <include name="${rootrel.src.c}/*.c"/> - </fileset> - <targetfile /> - <srcfile /> - <mapper type="glob" from="${rootrel.src.c}${sep}*.c" to="${c.compiler.joal.outputfile.expr}" /> - </apply> - - <antcall target="c.compile.joal.macosx.objs" inheritRefs="true" /> - </target> - + <target name="c.configure"> - <!-- - - Link object files - --> - <target name="c.link.joal.check"> - <!-- Check object files against resulting DSO/DLL --> - <uptodate property="c.link.joal.skip"> - <srcfiles id="c.link.joal.obj.fileset" dir="${project.root}" includes="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <mapper type="merge" to="${rootrel.c.linker.joal.dso}" /> - </uptodate> - </target> - - <target name="c.link.joal" depends="c.link.joal.check" unless="c.link.joal.skip"> - <pathconvert pathsep=" " property="c.link.joal.obj.files" refid="c.link.joal.obj.fileset" /> - <exec dir="." executable="${c.linker}" failonerror="true"> - <arg line="${c.linker.joal.flags}" /> - <arg line="${c.linker.flags}" /> - <arg line="${c.link.joal.obj.files}" /> - <arg line="${c.linker.joal.libs}" /> - </exec> - </target> - - <target name="c.compile.joal.win32.vc6" depends="declare.win32.vc6"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> - </target> - - <target name="c.compile.joal.win32.vc7" depends="declare.win32.vc7"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> - </target> - - <target name="c.compile.joal.win32.mingw" depends="declare.win32.mingw"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> + <!-- import cpptasks --> + <typedef resource="net/sf/antcontrib/cpptasks/antlib.xml" classpath="${jogl.root}/make/lib/cpptasks.jar"/> + <!--typedef resource="net/sf/antcontrib/cpptasks/antlib.xml"/--> + + <!-- compiler configuration --> + <compiler id="compiler.cfg.linux" name="gcc" /> + + <compiler id="compiler.cfg.linux.amd64" name="gcc"> + <compilerarg value="-fPIC"/> + </compiler> + + <compiler id="compiler.cfg.solaris" name="suncc"> + </compiler> + + <compiler id="compiler.cfg.win32.mingw" name="gcc"> + <defineset> + <define name="_DEBUG" if="c.compiler.use-debug"/> + <define name="DEBUG" if="c.compiler.use-debug"/> + <define name="NDEBUG" unless="c.compiler.use-debug"/> + + <define name="DBUILD_DLL" /> + <define name="_WINGDI_" /> + <define name="_STRICT_ANSI" /> + <define name="_JNI_IMPLEMENTATION_" /> + </defineset> + </compiler> + + <compiler id="compiler.cfg.win32.msvc" name="msvc"> + <compilerarg value="/W3"/> <!-- set warning level --> + <compilerarg value="/Ob1"/> <!-- inline only functions marked inline --> + <compilerarg value="/GF"/> <!-- enable string pooling --> + <compilerarg value="/Gy"/> <!-- enable function level linking --> + <compilerarg value="/GS" if="isVC7"/> <!-- buffer security checks --> + <compilerarg value="/Wp64" if="isVC7"/> <!-- detect 64-bit port problems --> + <compilerarg value="/RTCcsu" if="isVC7"/> <!-- various runtime checks --> + <!-- Note: previous compiler options for VC7 were: + Debug: /MDd /Yd /GS /RTCs /RTCu /RTCc /W3 /Od /GF /EHsc /Zi /GS /Gy /Wp64 /Zi /D "_DEBUG" + Optimized: /MD /W3 /O2 /Ob1 /GF /EHsc /GS /Gy /Wp64 /D "NDEBUG" --> + + <sysincludepath path="${c.compiler.include.root}/PlatformSDK/Include"/> + <sysincludepath path="${c.compiler.include.root}/include"/> + + <defineset> + <define name="_DEBUG" if="c.compiler.use-debug"/> + <define name="DEBUG" if="c.compiler.use-debug"/> + <define name="NDEBUG" unless="c.compiler.use-debug"/> + </defineset> + </compiler> + + <compiler id="compiler.cfg.macosx" name="gcc"> + <compilerarg value="-arch" if="macosxfat"/> + <compilerarg value="ppc" if="macosxfat"/> + <compilerarg value="-arch" if="macosxfat"/> + <compilerarg value="i386" if="macosxfat"/> + <compilerarg value="-Wmost" /> + <compilerarg value="-ObjC" /> + <defineset> + <define name="macosx" /> + </defineset> + </compiler> + + <compiler id="compiler.cfg.freebsd" name="gcc"> + <includepath path="/usr/X11R6/include" /> + </compiler> + + <!-- linker configuration --> + + <linker id="linker.cfg.linux" name="gcc"> + <syslibset dir="${joal.lib.dir}" libs="openal"/> + </linker> + + <linker id="linker.cfg.linux.amd64" name="gcc"> + <syslibset dir="${joal.lib.dir}" libs="openal"/> + </linker> + + <linker id="linker.cfg.solaris" name="suncc"> + <syslibset dir="${joal.lib.dir}" libs="openal"/> + </linker> + + <linker id="linker.cfg.win32.mingw" name="gcc" incremental="false"> + <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names --> + <syslibset dir="${joal.lib.dir}" libs="openal32, kernel32"/> + </linker> + + <linker id="linker.cfg.win32.msvc" name="msvc" incremental="false"> + <linkerarg value="/OPT:REF,ICF" /> <!-- enable link-time optimisations --> + <linkerarg value="/SUBSYSTEM:WINDOWS" /> <!-- output is not a console app as uses WinMain entry point --> + <linkerarg value="/MACHINE:IX86" /> <!-- explicity set target platform --> + + <syslibset dir="${joal.lib.dir}" libs="openal32" /> + <syslibset dir="${c.linker.lib.root}/lib" libs="kernel32" unless="isVC7"/> + <syslibset dir="${c.linker.lib.root}/PlatformSDK/lib" libs="kernel32" if="isVC7"/> + </linker> + + <linker id="linker.cfg.macosx" name="gcc"> + <linkerarg value="-arch" if="macosxfat"/> + <linkerarg value="ppc" if="macosxfat"/> + <linkerarg value="-arch" if="macosxfat"/> + <linkerarg value="i386" if="macosxfat"/> + <linkerarg value="-framework" /> + <linkerarg value="Cocoa" /> + <linkerarg value="-framework" /> + <linkerarg value="OpenGL" /> + <linkerarg value="-framework" if="c.compiler.use-cglib" /> + <linkerarg value="Cg" if="c.compiler.use-cglib" /> + </linker> + + <patternset id="c.src.files.joal"> + <include name="${rootrel.src.c}/*.c"/> + <include name="${rootrel.generated.c.joal}/*.c"/> + </patternset> + + </target> + + <target name="c.build" depends="c.configure"> + <fail message="Requires '${c.compiler.src.files}'" unless="c.compiler.src.files"/> + <fail message="Requires '${compiler.cfg.id}'" unless="compiler.cfg.id"/> + <fail message="Requires '${linker.cfg.id}'" unless="linker.cfg.id"/> + <fail message="Requires '${output.lib.name}'" unless="output.lib.name"/> + + <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> + + <cc outtype="shared" + objdir="${obj.joal}" + 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="JOAL" + 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}"/> + <includepath path="stub_includes/openal"/> + </compiler> + + <linker extends="${linker.cfg.id}" /> + </cc> + </target> + + <target name="c.rename.joal.lib.mingw" if="isMingw"> + <!-- FIXME: this is a hack; the cpptask should have an option to change the + suffix or at least understand the override from .so to .dll --> + <move file="${obj}/libjoal.so" tofile="${obj}/joal.dll" failonerror="false" /> + </target> + + <target name="c.rename.joal.lib.macosx" if="isOSX"> + <!-- 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 --> + <move file="${obj}/libjoal.dylib" tofile="${obj}/libjoal.jnilib" /> + </target> + + <target name="c.build.joal"> + <antcall target="c.build" inheritRefs="true"> + <param name="c.compiler.src.files" value="c.src.files.joal"/> + <param name="output.lib.name" value="joal"/> + </antcall> + <antcall target="c.rename.joal.lib.mingw" inheritRefs="true" /> + <antcall target="c.rename.joal.lib.macosx" inheritRefs="true" /> </target> - <target name="c.compile.joal.linux" depends="declare.linux"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> - </target> - - <target name="c.compile.joal.solaris" depends="declare.solaris"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> - </target> - - <target name="c.compile.joal.macosx" depends="declare.macosx"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> - </target> - <!-- ================================================================== --> <!-- - Build the joal.jar file. @@ -668,10 +629,10 @@ <!-- Build the jar excluding any build specific classes. --> <jar destfile="${joal.jar}"> <fileset dir="${classes}"> - <include name="net/java/games/joal/**" /> + <include name="net/java/games/**" /> </fileset> <fileset dir="${gluegen.classes}"> - <include name="net/java/games/gluegen/runtime/**" /> + <include name="com/sun/gluegen/runtime/**" /> </fileset> </jar> @@ -686,7 +647,7 @@ --> <target name="javadoc" depends="setup.java.home.dir,init"> <javadoc packagenames="${javadoc.packagenames}" - sourcepath="${src};${src.generated.java}" + sourcepath="${src};${src.generated.java}" destdir="${javadoc}" windowtitle="JOAL API" source="1.4" link="${javadoc.link}" /> @@ -695,16 +656,12 @@ <target name="javadoc.dev" depends="init"> <!-- Build the internal developer Javadoc --> <javadoc packagenames="${javadoc.dev.packagenames},${javadoc.dev.packagenames.platform}" - sourcepath="${src};${src.generated.java}" + sourcepath="${src};${src.generated.java}" destdir="${javadoc.dev}" windowtitle="JOAL API" source="1.4" link="${javadoc.link}" /> </target> - <target name="javadoc.dev.win32" depends="setup.java.home.dir,declare.win32,javadoc.dev" if="isWindows" /> - <target name="javadoc.dev.x11" depends="setup.java.home.dir,declare.x11,javadoc.dev" if="isUnix" /> - <target name="javadoc.dev.macosx" depends="setup.java.home.dir,declare.macosx,javadoc.dev" if="isOSX" /> - <!-- ================================================================== --> <!-- - Build the platform-independent distribution out of jars built for @@ -768,78 +725,29 @@ <fileset dir="${javadoc}" /> <fileset dir="${javadoc.dev}" /> </delete> - + <ant dir="../unit_tests" target="clean"/> </target> <!-- ================================================================== --> <!-- - - Inform the user that one of the platform targets should be used. - --> - <target name="all" depends="setup.java.home.dir,init,win32.vc6,win32.vc7,win32.mingw,linux,solaris,macosx" /> - - <!-- - - Win32 with MS VC6 - --> - <target name="win32.vc6" depends="declare.win32.pre" if="isVC6"> - <!-- Generate, compile, and build the jar for the Java sources. --> - <antcall target="jar" inheritRefs="true" /> - - <!-- Compile the native C sources and build the joal.dll. --> - <antcall target="c.compile.joal.win32.vc6" /> - </target> - - <!-- - - Win32 with MS VC7 + - Build everything. --> - <target name="win32.vc7" depends="declare.win32.pre" if="isVC7"> + <target name="all" depends="setup.java.home.dir,init,declare"> <!-- Generate, compile, and build the jar for the Java sources. --> <antcall target="jar" inheritRefs="true" /> - <!-- Compile the native C sources and build the joal.dll. --> - <antcall target="c.compile.joal.win32.vc7" /> - </target> - - <!-- - - Win32 with mingw32 - --> - <target name="win32.mingw" depends="declare.win32.pre" if="isMingw"> - <!-- Generate, compile, and build the jar for the Java sources. --> - <antcall target="jar" inheritRefs="true" /> - - <!-- Compile the native C sources and build the joal.dll. --> - <antcall target="c.compile.joal.win32.mingw" /> - </target> - - <!-- - - Linux (assuming GCC) - --> - <target name="linux" depends="declare.linux" if="isLinux"> - <!-- Generate, compile, and build the jar for the Java sources. --> - <antcall target="jar" inheritRefs="true" /> - - <!-- Compile the native C sources and build the joal lib. --> - <antcall target="c.compile.joal.linux" /> + <!-- Compile the native C sources . --> + <antcall target="c.build.joal" inheritRefs="true" /> </target> + <!-- ================================================================== --> <!-- - - Solaris (assuming Solaris CC) + - Build and run tests. --> - <target name="solaris" depends="declare.solaris" if="isSolaris"> - <!-- Generate, compile, and build the jar for the Java sources. --> - <antcall target="jar" inheritRefs="true" /> - - <!-- Compile the native C sources and build the joal lib. --> - <antcall target="c.compile.joal.solaris" /> - </target> - <!-- - - Mac OSX - --> - <target name="macosx" depends="declare.macosx" if="isOSX"> - <!-- Generate, compile, and build the jar for the Java sources. --> - <antcall target="jar" inheritRefs="true" /> - - <!-- Compile the native C sources and build the joal lib. --> - <antcall target="c.compile.joal.macosx" /> + <target name="runtests" depends="all"> + <ant dir="../unit_tests" target="compile"/> + <ant dir="../unit_tests" target="runOpenALTest"/> + <ant dir="../unit_tests" target="runSound3DTest"/> </target> </project> |