Use autotools for altosui and libaltos
authorKeith Packard <keithp@keithp.com>
Sun, 5 Sep 2010 00:27:17 +0000 (17:27 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 5 Sep 2010 00:27:17 +0000 (17:27 -0700)
This switches from hand-written Makefiles to automake with libtool
for these parts of the system.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/altosui/AltosUI.java
ao-tools/altosui/Makefile [deleted file]
ao-tools/altosui/Makefile-standalone [new file with mode: 0644]
ao-tools/altosui/Makefile.am [new file with mode: 0644]
ao-tools/altosui/altos-windows.nsi
ao-tools/altosui/altosui-fat [new file with mode: 0755]
ao-tools/libaltos/.gitignore [new file with mode: 0644]
ao-tools/libaltos/Makefile [deleted file]
ao-tools/libaltos/Makefile-standalone [new file with mode: 0644]
ao-tools/libaltos/Makefile.am [new file with mode: 0644]
configure.ac

index eb376be..37625e8 100644 (file)
@@ -75,7 +75,7 @@ public class AltosUI extends JFrame {
                String[] statusNames = { "Height (m)", "State", "RSSI (dBm)", "Speed (m/s)" };
                Object[][] statusData = { { "0", "pad", "-50", "0" } };
 
-               java.net.URL imgURL = AltosUI.class.getResource("/images/altus-metrum-16x16.jpg");
+               java.net.URL imgURL = AltosUI.class.getResource("/altus-metrum-16x16.jpg");
                if (imgURL != null)
                        setIconImage(new ImageIcon(imgURL).getImage());
 
diff --git a/ao-tools/altosui/Makefile b/ao-tools/altosui/Makefile
deleted file mode 100644 (file)
index 90621f3..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-.SUFFIXES: .java .class
-
-CLASSPATH=classes:./*:/usr/share/java/*
-CLASSFILES=\
-       Altos.class \
-       AltosChannelMenu.class \
-       AltosConfig.class \
-       AltosConfigUI.class \
-       AltosConvert.class \
-       AltosCRCException.class \
-       AltosCSV.class \
-       AltosCSVUI.class \
-       AltosDebug.class \
-       AltosEepromDownload.class \
-       AltosEepromMonitor.class \
-       AltosEepromReader.class \
-       AltosEepromRecord.class \
-       AltosFile.class \
-       AltosFlash.class \
-       AltosFlashUI.class \
-       AltosFlightInfoTableModel.class \
-       AltosFlightStatusTableModel.class \
-       AltosGPS.class \
-       AltosGreatCircle.class \
-       AltosHexfile.class \
-       AltosLine.class \
-       AltosLog.class \
-       AltosLogfileChooser.class \
-       AltosParse.class \
-       AltosPreferences.class \
-       AltosReader.class \
-       AltosRecord.class \
-       AltosSerialMonitor.class \
-       AltosSerial.class \
-       AltosState.class \
-       AltosTelemetry.class \
-       AltosTelemetryReader.class \
-       AltosUI.class \
-       AltosDevice.class \
-       AltosDeviceDialog.class \
-       AltosRomconfig.class \
-       AltosRomconfigUI.class \
-       AltosVoice.class
-
-JAVA_ICON=../../icon/altus-metrum-16x16.jpg
-WINDOWS_ICON=../../icon/altus-metrum.ico
-
-# where altosui.jar gets installed
-ALTOSLIB=/usr/share/java
-
-# where freetts.jar is to be found
-FREETTSLIB=/usr/share/java
-
-# all of the freetts files
-FREETTSJAR= \
-       $(FREETTSLIB)/cmudict04.jar \
-       $(FREETTSLIB)/cmulex.jar \
-       $(FREETTSLIB)/cmu_time_awb.jar \
-       $(FREETTSLIB)/cmutimelex.jar \
-       $(FREETTSLIB)/cmu_us_kal.jar \
-       $(FREETTSLIB)/en_us.jar \
-       $(FREETTSLIB)/freetts.jar
-
-# The current hex files
-HEXLIB=../../src
-HEXFILES = \
-       $(HEXLIB)/telemetrum-v1.0.ihx \
-       $(HEXLIB)/teledongle-v0.2.ihx
-
-JAVAFLAGS=-Xlint:unchecked -Xlint:deprecation
-
-ALTOSUIJAR = altosui.jar
-FATJAR = fat/altosui.jar
-
-OS:=$(shell uname)
-
-LINUX_APP=altosui
-
-DARWIN_ZIP=Altos-Mac.zip
-
-WINDOWS_EXE=Altos-Windows.exe
-
-LINUX_TGZ=Altos-Linux.tgz
-
-all: altosui.jar $(LINUX_APP)
-fat: altosui.jar $(LINUX_APP) $(DARWIN_ZIP) $(WINDOWS_EXE) $(LINUX_TGZ)
-
-$(CLASSFILES):
-
-.java.class:
-       javac -encoding UTF8 -classpath "$(CLASSPATH)" $(JAVAFLAGS) $*.java
-
-altosui.jar: classes/images classes/altosui classes/libaltosJNI $(CLASSFILES) Manifest.txt
-       cd ./classes && jar cfm ../$@ altosui/Manifest.txt images/* altosui/*.class libaltosJNI/*.class
-
-Manifest.txt: Makefile $(CLASSFILES)
-       echo 'Main-Class: altosui.AltosUI' > $@
-       echo "Class-Path: $(FREETTSLIB)/freetts.jar" >> $@
-
-classes/altosui:
-       mkdir -p classes
-       ln -sf .. classes/altosui
-
-classes/libaltosJNI:
-       mkdir -p classes
-       ln -sf ../../libaltos/libaltosJNI classes/libaltosJNI
-
-classes/images:
-       mkdir -p classes/images
-       ln -sf ../../$(JAVA_ICON) classes/images
-
-altosui:
-       echo "#!/bin/sh" > $@
-       echo "exec java -Djava.library.path=/usr/lib/altos -jar /usr/share/java/altosui.jar" >> $@
-       chmod +x ./altosui
-
-fat/altosui:
-       echo "#!/bin/sh" > $@
-       echo 'ME=`which "$0"`' >> $@
-       echo 'DIR=`dirname "$ME"`' >> $@
-       echo 'exec java -Djava.library.path="$$DIR" -jar "$$DIR"/altosui.jar' >> $@
-       chmod +x $@
-
-fat/altosui.jar: $(CLASSFILES) $(JAVA_ICON) fat/classes/Manifest.txt
-       mkdir -p fat/classes
-       test -L fat/classes/altosui || ln -sf ../.. fat/classes/altosui
-       mkdir -p fat/classes/images
-       cp $(JAVA_ICON) fat/classes/images
-       test -L fat/classes/libaltosJNI || ln -sf ../../../libaltos/libaltosJNI fat/classes/libaltosJNI
-       cd ./fat/classes && jar cfm ../../$@ Manifest.txt images/* altosui/*.class libaltosJNI/*.class
-
-fat/classes/Manifest.txt: $(CLASSFILES) Makefile
-       mkdir -p fat/classes
-       echo 'Main-Class: altosui.AltosUI' > $@
-       echo "Class-Path: freetts.jar" >> $@
-
-install: altosui.jar altosui
-       install -m 0644 altosui.jar $(DESTDIR)/usr/share/java/altosui.jar
-       install -m 0644 altosui.1 $(DESTDIR)/usr/share/man/man1/altosui.1
-       install altosui $(DESTDIR)/usr/bin/altosui
-
-clean:
-       rm -f *.class altosui.jar
-       rm -f AltosUI.app/Contents/Resources/Java/*
-       rm -rf classes
-       rm -rf windows linux
-
-distclean:     clean
-       rm -f $(DARWIN_ZIP) $(WINDOWS_EXE) $(LINUX_TGZ)
-       rm -rf darwin fat
-
-FAT_FILES=$(FATJAR) $(FREETTSJAR) $(HEXFILES)
-
-LINUX_FILES=$(FAT_FILES) ../libaltos/libaltos.so fat/altosui
-$(LINUX_TGZ): $(LINUX_FILES)
-       rm -f $@
-       mkdir -p linux/AltOS
-       rm -f linux/AltOS/*
-       cp $(LINUX_FILES) linux/AltOS
-       cd linux && tar czf ../$@ AltOS
-
-DARWIN_RESOURCES=$(FATJAR) $(FREETTSJAR) ../libaltos/libaltos.dylib
-DARWIN_EXTRA=$(HEXFILES)
-DARWIN_FILES=$(DARWIN_RESOURCES) $(DARWIN_EXTRA)
-
-$(DARWIN_ZIP): $(DARWIN_FILES)
-       rm -f $@
-       cp -a AltosUI.app darwin/
-       mkdir -p darwin/AltosUI.app/Contents/Resources/Java
-       cp $(DARWIN_RESOURCES) darwin/AltosUI.app/Contents/Resources/Java
-       mkdir -p darwin/AltOS
-       cp $(DARWIN_EXTRA) darwin/AltOS
-       cd darwin && zip -r ../$@ AltosUI.app AltOS
-
-WINDOWS_FILES = $(FAT_FILES) ../libaltos/altos.dll ../../telemetrum.inf $(WINDOWS_ICON)
-
-$(WINDOWS_EXE): $(WINDOWS_FILES) altos-windows.nsi
-       rm -f $@
-       mkdir -p windows/AltOS
-       rm -f windows/AltOS/*
-       cp $(WINDOWS_FILES) windows/AltOS
-       makensis altos-windows.nsi
diff --git a/ao-tools/altosui/Makefile-standalone b/ao-tools/altosui/Makefile-standalone
new file mode 100644 (file)
index 0000000..90621f3
--- /dev/null
@@ -0,0 +1,182 @@
+.SUFFIXES: .java .class
+
+CLASSPATH=classes:./*:/usr/share/java/*
+CLASSFILES=\
+       Altos.class \
+       AltosChannelMenu.class \
+       AltosConfig.class \
+       AltosConfigUI.class \
+       AltosConvert.class \
+       AltosCRCException.class \
+       AltosCSV.class \
+       AltosCSVUI.class \
+       AltosDebug.class \
+       AltosEepromDownload.class \
+       AltosEepromMonitor.class \
+       AltosEepromReader.class \
+       AltosEepromRecord.class \
+       AltosFile.class \
+       AltosFlash.class \
+       AltosFlashUI.class \
+       AltosFlightInfoTableModel.class \
+       AltosFlightStatusTableModel.class \
+       AltosGPS.class \
+       AltosGreatCircle.class \
+       AltosHexfile.class \
+       AltosLine.class \
+       AltosLog.class \
+       AltosLogfileChooser.class \
+       AltosParse.class \
+       AltosPreferences.class \
+       AltosReader.class \
+       AltosRecord.class \
+       AltosSerialMonitor.class \
+       AltosSerial.class \
+       AltosState.class \
+       AltosTelemetry.class \
+       AltosTelemetryReader.class \
+       AltosUI.class \
+       AltosDevice.class \
+       AltosDeviceDialog.class \
+       AltosRomconfig.class \
+       AltosRomconfigUI.class \
+       AltosVoice.class
+
+JAVA_ICON=../../icon/altus-metrum-16x16.jpg
+WINDOWS_ICON=../../icon/altus-metrum.ico
+
+# where altosui.jar gets installed
+ALTOSLIB=/usr/share/java
+
+# where freetts.jar is to be found
+FREETTSLIB=/usr/share/java
+
+# all of the freetts files
+FREETTSJAR= \
+       $(FREETTSLIB)/cmudict04.jar \
+       $(FREETTSLIB)/cmulex.jar \
+       $(FREETTSLIB)/cmu_time_awb.jar \
+       $(FREETTSLIB)/cmutimelex.jar \
+       $(FREETTSLIB)/cmu_us_kal.jar \
+       $(FREETTSLIB)/en_us.jar \
+       $(FREETTSLIB)/freetts.jar
+
+# The current hex files
+HEXLIB=../../src
+HEXFILES = \
+       $(HEXLIB)/telemetrum-v1.0.ihx \
+       $(HEXLIB)/teledongle-v0.2.ihx
+
+JAVAFLAGS=-Xlint:unchecked -Xlint:deprecation
+
+ALTOSUIJAR = altosui.jar
+FATJAR = fat/altosui.jar
+
+OS:=$(shell uname)
+
+LINUX_APP=altosui
+
+DARWIN_ZIP=Altos-Mac.zip
+
+WINDOWS_EXE=Altos-Windows.exe
+
+LINUX_TGZ=Altos-Linux.tgz
+
+all: altosui.jar $(LINUX_APP)
+fat: altosui.jar $(LINUX_APP) $(DARWIN_ZIP) $(WINDOWS_EXE) $(LINUX_TGZ)
+
+$(CLASSFILES):
+
+.java.class:
+       javac -encoding UTF8 -classpath "$(CLASSPATH)" $(JAVAFLAGS) $*.java
+
+altosui.jar: classes/images classes/altosui classes/libaltosJNI $(CLASSFILES) Manifest.txt
+       cd ./classes && jar cfm ../$@ altosui/Manifest.txt images/* altosui/*.class libaltosJNI/*.class
+
+Manifest.txt: Makefile $(CLASSFILES)
+       echo 'Main-Class: altosui.AltosUI' > $@
+       echo "Class-Path: $(FREETTSLIB)/freetts.jar" >> $@
+
+classes/altosui:
+       mkdir -p classes
+       ln -sf .. classes/altosui
+
+classes/libaltosJNI:
+       mkdir -p classes
+       ln -sf ../../libaltos/libaltosJNI classes/libaltosJNI
+
+classes/images:
+       mkdir -p classes/images
+       ln -sf ../../$(JAVA_ICON) classes/images
+
+altosui:
+       echo "#!/bin/sh" > $@
+       echo "exec java -Djava.library.path=/usr/lib/altos -jar /usr/share/java/altosui.jar" >> $@
+       chmod +x ./altosui
+
+fat/altosui:
+       echo "#!/bin/sh" > $@
+       echo 'ME=`which "$0"`' >> $@
+       echo 'DIR=`dirname "$ME"`' >> $@
+       echo 'exec java -Djava.library.path="$$DIR" -jar "$$DIR"/altosui.jar' >> $@
+       chmod +x $@
+
+fat/altosui.jar: $(CLASSFILES) $(JAVA_ICON) fat/classes/Manifest.txt
+       mkdir -p fat/classes
+       test -L fat/classes/altosui || ln -sf ../.. fat/classes/altosui
+       mkdir -p fat/classes/images
+       cp $(JAVA_ICON) fat/classes/images
+       test -L fat/classes/libaltosJNI || ln -sf ../../../libaltos/libaltosJNI fat/classes/libaltosJNI
+       cd ./fat/classes && jar cfm ../../$@ Manifest.txt images/* altosui/*.class libaltosJNI/*.class
+
+fat/classes/Manifest.txt: $(CLASSFILES) Makefile
+       mkdir -p fat/classes
+       echo 'Main-Class: altosui.AltosUI' > $@
+       echo "Class-Path: freetts.jar" >> $@
+
+install: altosui.jar altosui
+       install -m 0644 altosui.jar $(DESTDIR)/usr/share/java/altosui.jar
+       install -m 0644 altosui.1 $(DESTDIR)/usr/share/man/man1/altosui.1
+       install altosui $(DESTDIR)/usr/bin/altosui
+
+clean:
+       rm -f *.class altosui.jar
+       rm -f AltosUI.app/Contents/Resources/Java/*
+       rm -rf classes
+       rm -rf windows linux
+
+distclean:     clean
+       rm -f $(DARWIN_ZIP) $(WINDOWS_EXE) $(LINUX_TGZ)
+       rm -rf darwin fat
+
+FAT_FILES=$(FATJAR) $(FREETTSJAR) $(HEXFILES)
+
+LINUX_FILES=$(FAT_FILES) ../libaltos/libaltos.so fat/altosui
+$(LINUX_TGZ): $(LINUX_FILES)
+       rm -f $@
+       mkdir -p linux/AltOS
+       rm -f linux/AltOS/*
+       cp $(LINUX_FILES) linux/AltOS
+       cd linux && tar czf ../$@ AltOS
+
+DARWIN_RESOURCES=$(FATJAR) $(FREETTSJAR) ../libaltos/libaltos.dylib
+DARWIN_EXTRA=$(HEXFILES)
+DARWIN_FILES=$(DARWIN_RESOURCES) $(DARWIN_EXTRA)
+
+$(DARWIN_ZIP): $(DARWIN_FILES)
+       rm -f $@
+       cp -a AltosUI.app darwin/
+       mkdir -p darwin/AltosUI.app/Contents/Resources/Java
+       cp $(DARWIN_RESOURCES) darwin/AltosUI.app/Contents/Resources/Java
+       mkdir -p darwin/AltOS
+       cp $(DARWIN_EXTRA) darwin/AltOS
+       cd darwin && zip -r ../$@ AltosUI.app AltOS
+
+WINDOWS_FILES = $(FAT_FILES) ../libaltos/altos.dll ../../telemetrum.inf $(WINDOWS_ICON)
+
+$(WINDOWS_EXE): $(WINDOWS_FILES) altos-windows.nsi
+       rm -f $@
+       mkdir -p windows/AltOS
+       rm -f windows/AltOS/*
+       cp $(WINDOWS_FILES) windows/AltOS
+       makensis altos-windows.nsi
diff --git a/ao-tools/altosui/Makefile.am b/ao-tools/altosui/Makefile.am
new file mode 100644 (file)
index 0000000..20c8b26
--- /dev/null
@@ -0,0 +1,165 @@
+JAVAROOT=classes
+
+CLASSPATH_ENV=CLASSPATH="classes/altosui/*:../libaltos/libaltosJNI/*:$(FREETTS)/*:/usr/share/java/*"
+
+altosui_JAVA = \
+       AltosChannelMenu.java \
+       AltosConfig.java \
+       AltosConfigUI.java \
+       AltosConvert.java \
+       AltosCRCException.java \
+       AltosCSV.java \
+       AltosCSVUI.java \
+       AltosDebug.java \
+       AltosDeviceDialog.java \
+       AltosDevice.java \
+       AltosEepromDownload.java \
+       AltosEepromMonitor.java \
+       AltosEepromReader.java \
+       AltosEepromRecord.java \
+       AltosFile.java \
+       AltosFlash.java \
+       AltosFlashUI.java \
+       AltosFlightInfoTableModel.java \
+       AltosFlightStatusTableModel.java \
+       AltosGPS.java \
+       AltosGreatCircle.java \
+       AltosHexfile.java \
+       Altos.java \
+       AltosLine.java \
+       AltosLogfileChooser.java \
+       AltosLog.java \
+       AltosParse.java \
+       AltosPreferences.java \
+       AltosReader.java \
+       AltosRecord.java \
+       AltosRomconfig.java \
+       AltosRomconfigUI.java \
+       AltosSerial.java \
+       AltosSerialMonitor.java \
+       AltosState.java \
+       AltosTelemetry.java \
+       AltosTelemetryReader.java \
+       AltosUI.java \
+       AltosVoice.java
+
+FREETTS_CLASS= \
+       cmudict04.jar \
+       cmulex.jar \
+       cmu_time_awb.jar \
+       cmutimelex.jar \
+       cmu_us_kal.jar \
+       en_us.jar \
+       freetts.jar
+
+LIBALTOS= \
+       libaltos.so \
+       libaltos.dylib \
+       altos.dll
+
+JAR=altosui.jar
+
+FATJAR=altosui-fat.jar
+
+# Icons
+JAVA_ICON=$(top_srcdir)/icon/altus-metrum-16x16.jpg
+WINDOWS_ICON=$(top_srcdir)/icon/altus-metrum.ico
+
+# Firmware
+FIRMWARE_TD=$(top_srcdir)/src/teledongle-v0.2.ihx
+FIRMWARE_TM=$(top_srcdir)/src/telemetrum-v1.0.ihx
+FIRMWARE=$(FIRMWARE_TM) $(FIRMWARE_TD)
+
+# Distribution targets
+LINUX_DIST=Altos-Linux-$(VERSION).tar.bz2
+MACOSX_DIST=Altos-Mac-$(VERSION).zip
+WINDOWS_DIST=Altos-Windows-$(VERSION_DASH).exe
+
+FAT_FILES=$(FATJAR) $(FREETTS_CLASS)
+
+LINUX_FILES=$(FAT_FILES) libaltos.so
+
+MACOSX_FILES=$(FAT_FILES) libaltos.dylib
+MACOSX_EXTRA=$(FIRMWARE)
+
+WINDOWS_FILES=$(FAT_FILES) altos.dll $(top_srcdir)/telemetrum.inf $(WINDOWS_ICON)
+
+all-local: classes/altosui $(JAR) $(FATJAR)
+
+clean-local:
+       -rm -rf classes/altosui $(JAR) $(FATJAR) \
+               $(LINUX_DIST) $(MACOSX_DIST) $(WINDOWS_DIST) $(FREETTS_CLASS) \
+               $(LIBALTOS) Manifest.txt Manifest-fat.txt altos-windows.log \
+               altosui altosui-test macosx linux
+
+fat: $(FATJAR) $(LINUX_DIST) $(MACOSX_DIST) $(WINDOWS_DIST)
+
+altosuidir=$(datadir)/java
+
+install-altosuiJAVA: altosui.jar
+       @$(NORMAL_INSTALL)
+       test -z "$(altosuidir)" || $(MKDIR_P) "$(DESTDIR)$(altosuidir)"
+       echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(altosuidir)/altosui.jar'"; \
+       $(INSTALL_DATA) "$<" "$(DESTDIR)$(altosuidir)"
+
+classes/altosui:
+       mkdir -p classes/altosui
+
+$(JAR): classaltosui.stamp Manifest.txt $(JAVA_ICON)
+       jar cfm $@ Manifest.txt \
+               -C $(top_srcdir)/icon altus-metrum-16x16.jpg \
+               -C classes altosui \
+               -C ../libaltos libaltosJNI
+
+$(FATJAR): classaltosui.stamp Manifest-fat.txt $(FREETTS_CLASS) $(LIBALTOS) $(JAVA_ICON)
+       jar cfm $@ Manifest-fat.txt \
+               -C $(top_srcdir)/icon altus-metrum-16x16.jpg \
+               -C classes altosui \
+               -C ../libaltos libaltosJNI
+
+Manifest.txt: Makefile
+       echo 'Main-Class: altosui.AltosUI' > $@
+       echo "Class-Path: $(FREETTS)/freetts.jar" >> $@
+
+Manifest-fat.txt:
+       echo 'Main-Class: altosui.AltosUI' > $@
+       echo "Class-Path: freetts.jar" >> $@
+
+altosui: Makefile
+       echo "#!/bin/sh" > $@
+       echo 'exec java  -cp "$(FREETTS)/*" -Djava.library.path="$(libdir)" -jar "$(altosuidir)/altosui.jar"' >> $@
+       chmod +x $@
+
+altosui-test: Makefile
+       echo "#!/bin/sh" > $@
+       echo 'exec java -cp "$(FREETTS)/*" -Djava.library.path="../libaltos" -jar altosui.jar' >> $@
+       chmod +x $@
+
+$(LIBALTOS):
+       -rm -f "$@"
+       $(LN_S) ../libaltos/"$@" .
+
+$(FREETTS_CLASS): Makefile
+       -rm -f "$@"
+       $(LN_S) "$(FREETTS)"/"$@" .
+
+$(LINUX_DIST): $(LINUX_FILES)
+       -rm -f $@
+       -rm -rf linux
+       mkdir -p linux/AltOS
+       cp -a $(LINUX_FILES) linux/AltOS
+       tar cjf $@ -C linux AltOS
+
+$(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA)
+       -rm -f $@
+       -rm -rf macosx
+       mkdir macosx
+       cp -a AltosUI.app macosx/
+       mkdir -p macosx/AltOS macosx/AltosUI.app/Contents/Resources/Java
+       cp -a $(MACOSX_FILES) macosx/AltosUI.app/Contents/Resources/Java
+       cp -a $(MACOSX_EXTRA) macosx/AltOS
+       cd macosx && zip -r ../$@ AltosUI.app AltOS
+
+$(WINDOWS_DIST): $(WINDOWS_FILES) altos-windows.nsi
+       -rm -f $@
+       makensis -Oaltos-windows.log "-XOutFile $@" altos-windows.nsi
\ No newline at end of file
index 5ac708f..6f38ac0 100644 (file)
@@ -2,8 +2,6 @@
 
 Name "Altus Metrum Installer"
 
-OutFile "Altos-Windows.exe"
-
 ; Default install directory
 InstallDir "$PROGRAMFILES\AltusMetrum"
 
@@ -47,10 +45,18 @@ SectionEnd
 Section "AltosUI Application"
        SetOutPath $INSTDIR
 
-       File "windows/AltOS/*.jar"
-       File "windows/AltOS/*.dll"
+       File "altosui.jar"
+       File "cmudict04.jar"
+       File "cmulex.jar"
+       File "cmu_time_awb.jar"
+       File "cmutimelex.jar"
+       File "cmu_us_kal.jar"
+       File "en_us.jar"
+       File "freetts.jar"
+
+       File "*.dll"
 
-       File "windows/AltOS/*.ico"
+       File "../../icon/*.ico"
 
        CreateShortCut "$SMPROGRAMS\AltusMetrum.lnk" "$INSTDIR\altosui.jar" "" "$INSTDIR\altus-metrum.ico"
 SectionEnd
@@ -63,8 +69,8 @@ Section "TeleMetrum and TeleDongle Firmware"
 
        SetOutPath $INSTDIR
 
-       File "windows/AltOS/telemetrum-v1.0.ihx"
-       File "windows/AltOS/teledongle-v0.2.ihx"
+       File "../../src/telemetrum-v1.0/telemetrum-v1.0.ihx"
+       File "../../src/teledongle-v0.2/teledongle-v0.2.ihx"
 
 SectionEnd
 
diff --git a/ao-tools/altosui/altosui-fat b/ao-tools/altosui/altosui-fat
new file mode 100755 (executable)
index 0000000..a95b78b
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+me=`which "$0"`
+dir=`dirname "$me"`
+exec java -cp "$dir/*" -Djava.library.path="$dir" -jar "$dir"/altosui.jar
diff --git a/ao-tools/libaltos/.gitignore b/ao-tools/libaltos/.gitignore
new file mode 100644 (file)
index 0000000..c490e6f
--- /dev/null
@@ -0,0 +1,12 @@
+*.so
+*.lo
+*.la
+*.java
+*.class
+.libs/
+classlibaltos.stamp
+libaltos_wrap.c
+libaltosJNI
+cjnitest
+libaltos.swig
+swig_bindings/
diff --git a/ao-tools/libaltos/Makefile b/ao-tools/libaltos/Makefile
deleted file mode 100644 (file)
index cb767c8..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-OS:=$(shell uname)
-
-#
-# Linux
-#
-ifeq ($(OS),Linux)
-
-JAVA_CFLAGS=-I/usr/lib/jvm/java-6-openjdk/include
-
-OS_LIB_CFLAGS=-DLINUX -DPOSIX_TTY $(JAVA_CFLAGS)
-
-OS_APP_CFLAGS=$(OS_LIB_CFLAGS)
-
-OS_LDFLAGS=
-
-LIBNAME=libaltos.so
-EXEEXT=
-endif
-
-#
-# Darwin (Mac OS X)
-#
-ifeq ($(OS),Darwin)
-
-OS_LIB_CFLAGS=\
-       -DDARWIN -DPOSIX_TTY -arch i386 -arch x86_64 \
-       --sysroot=/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 \
-       -iwithsysroot /System/Library/Frameworks/JavaVM.framework/Headers \
-       -iwithsysroot /System/Library/Frameworks/IOKit.framework/Headers \
-       -iwithsysroot /System/Library/Frameworks/CoreFoundation.framework/Headers
-OS_APP_CFLAGS=$(OS_LIB_CFLAGS)
-
-OS_LDFLAGS =\
-       -framework IOKit -framework CoreFoundation
-
-LIBNAME=libaltos.dylib
-EXEEXT=
-
-endif
-
-#
-# Windows
-#
-ifneq (,$(findstring MINGW,$(OS)))
-
-CC=gcc
-
-OS_LIB_CFLAGS = -DWINDOWS -mconsole -DBUILD_DLL
-OS_APP_CFLAGS = -DWINDOWS -mconsole
-
-OS_LDFLAGS = -lgdi32 -luser32 -lcfgmgr32 -lsetupapi -lole32 \
-       -ladvapi32 -lcomctl32 -mconsole -Wl,--add-stdcall-alias
-
-LIBNAME=altos.dll
-
-EXEEXT=.exe
-
-endif
-
-.SUFFIXES: .java .class
-
-CLASSPATH=".:jnitest/*:libaltosJNI:/usr/share/java/*"
-
-SWIG_DIR=swig_bindings/java
-SWIG_FILE=$(SWIG_DIR)/libaltos.swig
-SWIG_WRAP=$(SWIG_DIR)/libaltos_wrap.c
-
-JNI_DIR=libaltosJNI
-JNI_FILE=$(JNI_DIR)/libaltosJNI.java 
-JNI_SRCS=$(JNI_FILE) \
-       $(JNI_DIR)/SWIGTYPE_p_altos_file.java \
-       $(JNI_DIR)/SWIGTYPE_p_altos_list.java \
-       $(JNI_DIR)/altos_device.java \
-       $(JNI_DIR)/libaltos.java
-
-JAVAFILES=\
-       $(JNI_SRCS)
-
-CLASSFILES = $(JAVAFILES:%.java=%.class)
-
-JAVAFLAGS=-Xlint:unchecked
-
-CJNITEST=cjnitest$(EXEEXT)
-
-all: $(LIBNAME) $(CJNITEST) $(CLASSFILES)
-
-.java.class:
-       javac -encoding UTF8 -classpath "$(CLASSPATH)" $(JAVAFLAGS) $*.java
-
-CFLAGS=$(OS_LIB_CFLAGS) -O -I.
-
-LDFLAGS=$(OS_LDFLAGS)
-
-HEADERS=libaltos.h
-SRCS = libaltos.c $(SWIG_WRAP)
-OBJS = $(SRCS:%.c=%.o)
-LIBS = $(DARWIN_LIBS)
-
-$(CJNITEST): cjnitest.c $(LIBNAME)
-       $(CC) -o $@ $(OS_APP_CFLAGS) cjnitest.c $(LIBNAME) $(LIBS) $(LDFLAGS)
-
-$(LIBNAME): $(OBJS)
-       $(CC) -shared $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(LDFLAGS)
-
-clean:
-       rm -f $(CLASSFILES) $(OBJS) $(LIBNAME) $(CJNITEST) cjnitest.o
-       rm -rf swig_bindings libaltosJNI
-
-distclean:     clean
-
-$(JNI_FILE): libaltos.i0 $(HEADERS)
-       mkdir -p $(SWIG_DIR)
-       mkdir -p libaltosJNI
-       sed 's;//%;%;' libaltos.i0 $(HEADERS) > $(SWIG_FILE)
-       swig -java -package libaltosJNI $(SWIG_FILE)
-       cp swig_bindings/java/*.java libaltosJNI
-
-$(SWIG_WRAP): $(JNI_FILE)
-
-ifeq ($(OS),Linux)
-install:       $(LIBNAME)
-       install -c $(LIBNAME) $(DESTDIR)/usr/lib/altos/$(LIBNAME)
-
-endif
-
-.NOTPARALLEL:
diff --git a/ao-tools/libaltos/Makefile-standalone b/ao-tools/libaltos/Makefile-standalone
new file mode 100644 (file)
index 0000000..4e43805
--- /dev/null
@@ -0,0 +1,126 @@
+OS:=$(shell uname)
+
+#
+# Linux
+#
+ifeq ($(OS),Linux)
+
+JAVA_CFLAGS=-I/usr/lib/jvm/java-6-openjdk/include
+
+OS_LIB_CFLAGS=-DLINUX -DPOSIX_TTY $(JAVA_CFLAGS)
+
+OS_APP_CFLAGS=$(OS_LIB_CFLAGS)
+
+OS_LDFLAGS=
+
+LIBNAME=libaltos.so
+EXEEXT=
+endif
+
+#
+# Darwin (Mac OS X)
+#
+ifeq ($(OS),Darwin)
+
+OS_LIB_CFLAGS=\
+       -DDARWIN -DPOSIX_TTY -arch i386 -arch x86_64 \
+       --sysroot=/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 \
+       -iwithsysroot /System/Library/Frameworks/JavaVM.framework/Headers \
+       -iwithsysroot /System/Library/Frameworks/IOKit.framework/Headers \
+       -iwithsysroot /System/Library/Frameworks/CoreFoundation.framework/Headers
+OS_APP_CFLAGS=$(OS_LIB_CFLAGS)
+
+OS_LDFLAGS =\
+       -framework IOKit -framework CoreFoundation
+
+LIBNAME=libaltos.dylib
+EXEEXT=
+
+endif
+
+#
+# Windows
+#
+ifneq (,$(findstring MINGW,$(OS)))
+
+CC=gcc
+
+OS_LIB_CFLAGS = -DWINDOWS -mconsole -DBUILD_DLL
+OS_APP_CFLAGS = -DWINDOWS -mconsole
+
+OS_LDFLAGS = -lgdi32 -luser32 -lcfgmgr32 -lsetupapi -lole32 \
+       -ladvapi32 -lcomctl32 -mconsole -Wl,--add-stdcall-alias
+
+LIBNAME=altos.dll
+
+EXEEXT=.exe
+
+endif
+
+.SUFFIXES: .java .class
+
+CLASSPATH=".:jnitest/*:libaltosJNI:/usr/share/java/*"
+
+SWIG_DIR=swig_bindings/java
+SWIG_FILE=$(SWIG_DIR)/libaltos.swig
+SWIG_WRAP=$(SWIG_DIR)/libaltos_wrap.c
+
+JNI_DIR=libaltosJNI
+JNI_FILE=$(JNI_DIR)/libaltosJNI.java
+JNI_SRCS=$(JNI_FILE) \
+       $(JNI_DIR)/SWIGTYPE_p_altos_file.java \
+       $(JNI_DIR)/SWIGTYPE_p_altos_list.java \
+       $(JNI_DIR)/altos_device.java \
+       $(JNI_DIR)/libaltos.java
+
+JAVAFILES=\
+       $(JNI_SRCS)
+
+CLASSFILES = $(JAVAFILES:%.java=%.class)
+
+JAVAFLAGS=-Xlint:unchecked
+
+CJNITEST=cjnitest$(EXEEXT)
+
+all: $(LIBNAME) $(CJNITEST) $(CLASSFILES)
+
+.java.class:
+       javac -encoding UTF8 -classpath "$(CLASSPATH)" $(JAVAFLAGS) $*.java
+
+CFLAGS=$(OS_LIB_CFLAGS) -O -I.
+
+LDFLAGS=$(OS_LDFLAGS)
+
+HEADERS=libaltos.h
+SRCS = libaltos.c $(SWIG_WRAP)
+OBJS = $(SRCS:%.c=%.o)
+LIBS = $(DARWIN_LIBS)
+
+$(CJNITEST): cjnitest.c $(LIBNAME)
+       $(CC) -o $@ $(OS_APP_CFLAGS) cjnitest.c $(LIBNAME) $(LIBS) $(LDFLAGS)
+
+$(LIBNAME): $(OBJS)
+       $(CC) -shared $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(LDFLAGS)
+
+clean:
+       rm -f $(CLASSFILES) $(OBJS) $(LIBNAME) $(CJNITEST) cjnitest.o
+       rm -rf swig_bindings libaltosJNI
+
+distclean:     clean
+
+$(JNI_FILE): libaltos.i0 $(HEADERS)
+       mkdir -p $(SWIG_DIR)
+       mkdir -p libaltosJNI
+       sed 's;//%;%;' libaltos.i0 $(HEADERS) > $(SWIG_FILE)
+       swig -java -package libaltosJNI $(SWIG_FILE)
+       cp swig_bindings/java/*.java libaltosJNI
+
+$(SWIG_WRAP): $(JNI_FILE)
+
+ifeq ($(OS),Linux)
+install:       $(LIBNAME)
+       install -c $(LIBNAME) $(DESTDIR)/usr/lib/altos/$(LIBNAME)
+
+endif
+
+.NOTPARALLEL:
diff --git a/ao-tools/libaltos/Makefile.am b/ao-tools/libaltos/Makefile.am
new file mode 100644 (file)
index 0000000..2f1d6fc
--- /dev/null
@@ -0,0 +1,27 @@
+JAVAC=javac
+AM_CFLAGS="-I$(JVM_INCLUDE)"
+
+lib_LTLIBRARIES=libaltos.la
+
+libaltos_la_SOURCES=\
+       libaltos.c
+
+HFILES=libaltos.h
+
+SWIG_FILE=libaltos.swig
+
+CLASSDIR=libaltosJNI
+
+$(SWIG_FILE): libaltos.i0 $(HFILES)
+       sed 's;//%;%;' libaltos.i0 $(HFILES) > $(SWIG_FILE)
+
+all-local: classlibaltos.stamp
+
+classlibaltos.stamp: $(SWIG_FILE)
+       swig -java -package libaltosJNI $(SWIG_FILE)
+       mkdir -p libaltosJNI
+       $(JAVAC) -d . $(AM_JAVACFLAGS) $(JAVACFLAGS) *.java && \
+       touch classlibaltos.stamp
+
+clean-local:
+       -rm -rf libaltosJNI *.class *.java classlibaltos.stamp $(SWIG_FILE)
\ No newline at end of file
index fafc6b3..19ae0ac 100644 (file)
@@ -17,19 +17,50 @@ dnl  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 dnl
 dnl Process this file with autoconf to create configure.
 
-AC_INIT(COPYING)
-
-AM_INIT_AUTOMAKE(altos, 0.1)
+AC_PREREQ(2.57)
+AC_INIT([altos], 0.7.1)
+AC_CONFIG_SRCDIR([src/ao.h])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
+VERSION_DASH=`echo $VERSION | sed 's/\./-/g'`
+AC_SUBST(VERSION_DASH)
+
 dnl ==========================================================================
 
 AM_CONFIG_HEADER(config.h)
 
+AC_ARG_WITH(freetts, AS_HELP_STRING([--with-freetts=PATH],
+       [Set freetts class path (default /usr/share/java)]),
+       [FREETTS=$withval], [FREETTS=/usr/share/java])
+
+AC_SUBST(FREETTS)
+
+AC_ARG_WITH(jvm, AS_HELP_STRING([--with-jvm-include=PATH],
+       [Set jvm include path for jni builds (default searches in /usr/lib/jvm)]),
+       [JVM_INCLUDE=$withval], [JVM_INCLUDE=auto])
+
+if test "x$JVM_INCLUDE" = "xauto"; then
+       AC_MSG_CHECKING([JVM include files])
+       for jvm in default-java java-6-openjdk java-6-sun; do
+               if test "x$JVM_INCLUDE" = "xauto"; then
+                       INCLUDE="/usr/lib/jvm/$jvm/include"
+                       if test -f "$INCLUDE"/jni.h; then
+                               JVM_INCLUDE="$INCLUDE"
+                       fi
+               fi
+       done
+       if test "x$JVM_INCLUDE" = "xauto"; then
+               AC_MSG_ERROR([no JVM include files found])
+       fi
+       AC_MSG_RESULT([$JVM_INCLUDE])
+fi
+
 AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_RANLIB
+AC_PROG_LIBTOOL
 PKG_PROG_PKG_CONFIG
 
 CFLAGS="-g"
@@ -92,5 +123,7 @@ ao-tools/ao-list/Makefile
 ao-tools/ao-load/Makefile
 ao-tools/ao-postflight/Makefile
 ao-tools/ao-view/Makefile
+ao-tools/libaltos/Makefile
+ao-tools/altosui/Makefile
 ao-utils/Makefile
 ])