aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/linux
diff options
context:
space:
mode:
authorelias <[email protected]>2006-07-11 21:02:46 +0000
committerelias <[email protected]>2006-07-11 21:02:46 +0000
commit6e6a6dbfd8068dd71bd94ef7f72e809277006f3c (patch)
tree4f8de8bf46d275cf9e8fc9f99101468565fe3b1f /plugins/linux
parente7a4d6e386bfec3f2d89c138dae5d99bfa799fd9 (diff)
Linux: Implemented support for libjinput-linux64.so 64 bit library
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@149 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins/linux')
-rw-r--r--plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java15
-rw-r--r--plugins/linux/src/native/build.xml18
2 files changed, 25 insertions, 8 deletions
diff --git a/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java b/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java
index 7ad3439..d4f7f31 100644
--- a/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java
+++ b/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java
@@ -39,12 +39,25 @@ import java.security.PrivilegedAction;
* @author Jeremy Booth ([email protected])
*/
public final class LinuxEnvironmentPlugin extends ControllerEnvironment implements Plugin {
+ private final static String LIBNAME = "jinput-linux";
+ private final static String POSTFIX64BIT = "64";
+
private final Controller[] controllers;
private final List devices = new ArrayList();
private final static LinuxDeviceThread device_thread = new LinuxDeviceThread();
static {
- DefaultControllerEnvironment.loadLibrary("jinput-linux");
+ try {
+ DefaultControllerEnvironment.loadLibrary(LIBNAME);
+ } catch (UnsatisfiedLinkError e) {
+ try {
+ DefaultControllerEnvironment.loadLibrary(LIBNAME + POSTFIX64BIT);
+ } catch (UnsatisfiedLinkError e2) {
+ ControllerEnvironment.logln("Failed to load 64 bit library: " + e2.getMessage());
+ // throw original error
+ throw e;
+ }
+ }
}
public final static Object execute(LinuxDeviceTask task) throws IOException {
diff --git a/plugins/linux/src/native/build.xml b/plugins/linux/src/native/build.xml
index c323163..c88a6ef 100644
--- a/plugins/linux/src/native/build.xml
+++ b/plugins/linux/src/native/build.xml
@@ -6,12 +6,10 @@
<!-- The idea is that both Ant and NetBeans have to know what the package root is -->
<!-- for the classes in your application. -->
<project name="JInput Linux port, Native code" basedir="." default="compileNativeJinputLib">
- <property name="libname" value="libjinput-linux.so"/>
+ <property name="libname64" value="libjinput-linux64.so"/>
+ <property name="libname32" value="libjinput-linux.so"/>
- <target name="init">
- </target>
-
- <target depends="init" name="createNativeDefinitions.java">
+ <target name="createNativeDefinitions.java">
<exec dir="." executable="gawk" os="Linux" output="../java/net/java/games/input/NativeDefinitions.java">
<arg line="-f"/>
<arg line="getDefinitions"/>
@@ -22,11 +20,17 @@
<target name="clean">
<delete>
<fileset dir="." includes="*.o"/>
- <fileset file="${libname}"/>
+ <fileset dir="." includes="*.so"/>
</delete>
</target>
- <target name="compileNativeJinputLib" depends="init">
+ <target name="compileNativeJinputLib">
+ <exec executable="uname" outputproperty="hwplatform">
+ <arg value="-i"/>
+ </exec>
+ <condition property="libname" value="${libname64}" else="${libname32}">
+ <equals arg1="${hwplatform}" arg2="x86_64"/>
+ </condition>
<apply dir="." executable="cc" os="Linux" dest="." skipemptyfilesets="true" failonerror="true">
<arg line="-O2 -Wall -c -fPIC"/>
<arg value="-I${java.home}/include"/>