aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/build.xml
diff options
context:
space:
mode:
authorathomas <[email protected]>2003-07-08 21:14:25 +0000
committerathomas <[email protected]>2003-07-08 21:14:25 +0000
commitce70965ea04ae7d8bebd6aa44d872219670235c5 (patch)
tree1e20eea235ccdbe4ef3529dc922e1471a5d5d167 /src/native/build.xml
parent4805d819e5b99ed2dd5ca4c7be757900c4d6b429 (diff)
added support for compiling under Linux
git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/git-svn/../svn-server-sync/joal/trunk@46 03bf7f67-59de-4072-a415-9a990d468a3f
Diffstat (limited to 'src/native/build.xml')
-rw-r--r--src/native/build.xml48
1 files changed, 35 insertions, 13 deletions
diff --git a/src/native/build.xml b/src/native/build.xml
index 531da19..7f28128 100644
--- a/src/native/build.xml
+++ b/src/native/build.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="iso-8859-1"?>
<!--
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
@@ -39,22 +39,43 @@
<target name="init">
<property name="cc" value ="gcc"/>
<property name="no_cygwin" value="-mno-cygwin"/>
- <property name="include" value="-I${jdk.home}/include -I${jdk.home}/include/win32 -I'${openal.home}'/include" />
- <property name="compilerflags" value ="-O3 -Wl,--add-stdcall-alias -shared"/>
- <property name="output" value="../../lib/joal.dll"/>
<property name="sources" value="extal.c eaxfactory.c eaxbind.c alfactory.c alcbind.c albind.c"/>
<property name="specs" value="-specs='./specs.new'"/>
+ <condition property="isUnix">
+ <os family="unix" />
+ </condition>
+ <condition property="isWindows">
+ <os family="windows" />
+ </condition>
</target>
- <target name="compile" depends="init">
- <exec executable="${cc}" os="Windows 2000, Windows XP">
- <arg line=" ${no_cygwin}"/>
- <arg line=" ${include}"/>
- <arg line=" ${compilerflags}"/>
- <arg line=" -o ${output}"/>
- <arg line=" ${sources}"/>
- </exec>
+ <target name="compile-dll" depends="init" if="isWindows">
+ <echo message="Compiling DLL for Windows." />
+ <antcall target="compile-native-lib">
+ <param name="include" value="-I${jdk.home}/include -I${jdk.home}/include/win32 -I'${openal.home}'/include" />
+ <param name="compilerflags" value ="${no_cygwin} -O3 -Wl,--add-stdcall-alias -shared"/>
+ <param name="output" value="../../lib/joal.dll"/>
+ </antcall>
</target>
+
+ <target name="compile-so" depends="init" if="isUnix">
+ <echo message="Compiling shared library for Unix." />
+ <antcall target="compile-native-lib">
+ <param name="include" value="-I${jdk.home}/include -I${jdk.home}/include/linux -I'${openal.home}'/include -I'${openal.home}'/include/AL" />
+ <param name="compilerflags" value ="-O3 -D_X11 -shared -Wl,-soname -Wl,libjoal.so -Wl,-export-dynamic "/>
+ <param name="output" value="../../lib/libjoal.so"/>
+ </antcall>
+ </target>
+
+ <target name="compile-native-lib">
+ <echo message="${cc} ${include} ${compilerflags} -o ${output} ${sources}" />
+ <exec executable="${cc}">
+ <arg line=" ${include} ${compilerflags} -o ${output} ${sources}"/>
+ </exec>
+ </target>
+
+ <target name="compile" depends="compile-so, compile-dll">
+ </target>
<target name="javadoc" depends="init">
<ant dir="src/java" target="javadoc"/>
@@ -66,6 +87,7 @@
</target>
<target name="clean" description="Clean all build products.">
- <delete file="../../bin/joal.dll" />
+ <delete file="../../lib/joal.dll" />
+ <delete file="../../lib/libjoal.so" />
</target>
</project>