summaryrefslogtreecommitdiff
path: root/altosuilib/AltosUILib.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-01-01 22:02:56 -0800
committerKeith Packard <keithp@keithp.com>2014-01-01 22:02:56 -0800
commit8bff2822c242d2878b408b9c0d8a7647108ea4b1 (patch)
tree88d29b0cc1a9488d05657119f5fda5a4fa221f7c /altosuilib/AltosUILib.java
parent95d77eaff708397d8b1e29904dc47d8ea09e8754 (diff)
libaltos: Build -m64 and -m32 for fat tarball when possible
Check to see if we can compile libaltos for both 32 bit and 64 bit systems, and then use those when generating the linux tarball. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosuilib/AltosUILib.java')
-rw-r--r--altosuilib/AltosUILib.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/altosuilib/AltosUILib.java b/altosuilib/AltosUILib.java
index 307ef19d..18c4c3d9 100644
--- a/altosuilib/AltosUILib.java
+++ b/altosuilib/AltosUILib.java
@@ -81,18 +81,20 @@ public class AltosUILib extends AltosLib {
static public boolean initialized = false;
static public boolean loaded_library = false;
+ static final String[] library_names = { "altos", "altos32", "altos64" };
+
public static boolean load_library() {
if (!initialized) {
- try {
- System.loadLibrary("altos");
- libaltos.altos_init();
- loaded_library = true;
- } catch (UnsatisfiedLinkError e) {
+ for (String name : library_names) {
try {
- System.loadLibrary("altos64");
+ System.out.printf ("Trying library %s\n", name);
+ System.loadLibrary(name);
libaltos.altos_init();
loaded_library = true;
- } catch (UnsatisfiedLinkError e2) {
+ System.out.printf ("Using library %s\n", name);
+ break;
+ } catch (UnsatisfiedLinkError e) {
+ System.out.printf("Link error %s\n", e.getMessage());
loaded_library = false;
}
}