altosui: Attempt to make both 32- and 64-bit windows DLLs
authorKeith Packard <keithp@keithp.com>
Mon, 22 Aug 2011 05:52:45 +0000 (22:52 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 23 Aug 2011 00:20:06 +0000 (17:20 -0700)
We'll see if they work...

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/Altos.java
altosui/Makefile.am
altosui/libaltos/Makefile.am
altosui/libaltos/altos.dll

index d3f8fa6..ddf1005 100644 (file)
@@ -366,7 +366,13 @@ public class Altos {
                                libaltos.altos_init();
                                loaded_library = true;
                        } catch (UnsatisfiedLinkError e) {
-                               loaded_library = false;
+                               try {
+                                       System.loadLibrary("altos64");
+                                       libaltos.altos_init();
+                                       loaded_library = true;
+                               } catch (UnsatisfiedLinkError e2) {
+                                       loaded_library = false;
+                               }
                        }
                        initialized = true;
                }
index e4986ba..f626d3f 100644 (file)
@@ -191,7 +191,7 @@ LINUX_EXTRA=altosui-fat
 MACOSX_FILES=$(FAT_FILES) libaltos.dylib
 MACOSX_EXTRA=$(FIRMWARE)
 
-WINDOWS_FILES=$(FAT_FILES) altos.dll $(top_srcdir)/telemetrum.inf $(WINDOWS_ICON)
+WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(top_srcdir)/telemetrum.inf $(WINDOWS_ICON)
 
 all-local: classes/altosui $(JAR) altosui altosui-test altosui-jdb
 
@@ -282,10 +282,24 @@ libaltos.dylib:
        -rm -f "$@"
        $(LN_S) libaltos/"$@" .
 
-altos.dll:
+altos.dll: libaltos/altos.dll
        -rm -f "$@"
        $(LN_S) libaltos/"$@" .
 
+altos64.dll: libaltos/altos64.dll
+       -rm -f "$@"
+       $(LN_S) libaltos/"$@" .
+
+libaltos/altos.dll: build-altos-dll
+
+libaltos/altos64.dll: build-altos64-dll
+
+build-altos-dll:
+       +cd libaltos && make altos.dll
+
+build-altos64-dll:
+       +cd libaltos && make altos64.dll
+
 $(FREETTS_CLASS):
        -rm -f "$@"
        $(LN_S) "$(FREETTS)"/"$@" .
index 3f5f3ee..b5ab1dd 100644 (file)
@@ -37,5 +37,18 @@ classlibaltos.stamp: $(SWIG_FILE)
        $(JAVAC) -d . $(AM_JAVACFLAGS) $(JAVACFLAGS) *.java && \
        touch classlibaltos.stamp
 
+MINGCC32=i686-w64-mingw32-gcc
+MINGCC64=x86_64-w64-mingw32-gcc
+MINGFLAGS=-Wall -DWINDOWS -DBUILD_DLL -I$(JVM_INCLUDE)
+MINGLIBS=-lsetupapi
+
+fat: altos.dll altos64.dll
+
+altos.dll: $(libaltos_la_SOURCES)
+       $(MINGCC32) -o $@ $(MINGFLAGS) -shared $(libaltos_la_SOURCES) $(MINGLIBS)
+
+altos64.dll: $(libaltos_la_SOURCES)
+       $(MINGCC64) -o $@ $(MINGFLAGS) -shared $(libaltos_la_SOURCES) $(MINGLIBS)
+
 clean-local:
-       -rm -rf libaltosJNI *.class *.java classlibaltos.stamp $(SWIG_FILE) libaltos_wrap.c
+       -rm -rf libaltosJNI *.class *.java classlibaltos.stamp $(SWIG_FILE) libaltos_wrap.c altos.dll altos64.dll
index 28e9b4a..a96d312 100755 (executable)
Binary files a/altosui/libaltos/altos.dll and b/altosui/libaltos/altos.dll differ