2 dnl Copyright © 2008,2009 Keith Packard <keithp@keithp.com>
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 2 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful, but
10 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 dnl General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License along
15 dnl with this program; if not, write to the Free Software Foundation, Inc.,
16 dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18 dnl Process this file with autoconf to create configure.
21 AC_INIT([altos], 1.2.9.1)
22 AC_CONFIG_SRCDIR([src/core/ao.h])
23 AM_INIT_AUTOMAKE([foreign dist-bzip2])
26 VERSION_DASH=`echo $VERSION | sed 's/\./-/g'`
27 AC_SUBST(VERSION_DASH)
30 dnl ==========================================================================
31 dnl Java library versions
36 AC_SUBST(ALTOSLIB_VERSION)
37 AC_DEFINE(ALTOSLIB_VERSION,$ALTOSLIB_VERSION,[Version of the AltosLib package])
38 AC_SUBST(ALTOSUILIB_VERSION)
39 AC_DEFINE(ALTOSUILIB_VERSION,$ALTOSUILIB_VERSION,[Version of the AltosUILib package])
41 dnl ==========================================================================
43 AM_CONFIG_HEADER(config.h)
45 AC_ARG_WITH(freetts, AS_HELP_STRING([--with-freetts=PATH],
46 [Set freetts class path (default /usr/share/java)]),
47 [FREETTS=$withval], [FREETTS=/usr/share/java])
51 AC_ARG_WITH(jfreechart, AS_HELP_STRING([--with-jfreechart=PATH],
52 [Set jfreechart class path (default /usr/share/java)]),
53 [JFREECHART=$withval], [JFREECHART=/usr/share/java])
57 AC_ARG_WITH(jcommon, AS_HELP_STRING([--with-jcommon=PATH],
58 [Set jcommon class path (default /usr/share/java)]),
59 [JCOMMON=$withval], [JCOMMON=/usr/share/java])
63 AC_ARG_WITH(jvm, AS_HELP_STRING([--with-jvm-include=PATH],
64 [Set jvm include path for jni builds (default searches in /usr/lib/jvm)]),
65 [JVM_INCLUDE=$withval], [JVM_INCLUDE=auto])
67 if test "x$JVM_INCLUDE" = "xauto"; then
68 AC_MSG_CHECKING([JVM include files])
69 for jvm in default-java java-6-openjdk java-6-sun; do
70 if test "x$JVM_INCLUDE" = "xauto"; then
71 INCLUDE="/usr/lib/jvm/$jvm/include"
72 if test -f "$INCLUDE"/jni.h; then
73 JVM_INCLUDE="$INCLUDE"
77 if test "x$JVM_INCLUDE" = "xauto"; then
78 AC_MSG_ERROR([no JVM include files found])
80 AC_MSG_RESULT([$JVM_INCLUDE])
85 AC_ARG_WITH(android, AS_HELP_STRING([--with-android=PATH],
86 [Set android SDK path (default searches in a variety of places)]),
87 [ANDROID_SDK=$withval], [ANDROID_SDK=${ANDROID_SDK:-auto}])
89 if test "x$ANDROID_SDK" = "xauto"; then
90 AC_MSG_CHECKING([Android SDK])
91 for sdk in ../android/android-sdk-linux ../android/android-sdk ../android-sdk ../android-sdk-linux $HOME/android; do
92 if test "x$ANDROID_SDK" = "xauto"; then
94 if test -f "$SDK/SDK Readme.txt"; then
95 ANDROID_SDK=`readlink -m "$SDK"`
99 if test "x$ANDROID_SDK" = "xauto"; then
100 AC_MSG_NOTICE([no Android SDK found])
103 AC_MSG_RESULT([$ANDROID_SDK])
105 if test "x$ANDROID_SDK" != "xno"; then
106 AC_MSG_CHECKING([Android SDK version])
107 SDK_VERSION=`grep -i '^Pkg.Revision=' $ANDROID_SDK/tools/source.properties | cut -f2- -d= | sed s/^r//`
108 SDK_MAJOR_VERSION="`echo $SDK_VERSION | sed 's/[[^0-9]].*//'`"
109 if test "$SDK_MAJOR_VERSION" -lt 17 ; then
110 AC_MSG_NOTICE([SDK version $SDK_VERSION is too old. Need >= r17])
113 AC_MSG_RESULT([$SDK_VERSION])
116 if test "x$ANDROID_SDK" != "xno"; then
117 AC_MSG_CHECKING([Android SDK API Level])
118 if test -f "$ANDROID_SDK/platforms/android-10/source.properties"; then
119 API_LEVEL=`sed -ne 's/^AndroidVersion.ApiLevel=//p' $ANDROID_SDK/platforms/android-10/source.properties`
120 if test "$API_LEVEL" = "10"; then
121 AC_MSG_RESULT([$API_LEVEL])
123 AC_MSG_NOTICE([API Level 10 not installed correctly.])
127 AC_MSG_NOTICE([API Level 10 not installed, but is required.])
131 if test "x$ANDROID_SDK" != "xno"; then
132 AC_MSG_CHECKING([Android SDK required extras])
133 if test -f "$ANDROID_SDK/extras/android/support/source.properties"; then
134 ANDROID_SUPPORT_LIB_NAME=`sed -ne 's/^Extra.NameDisplay=//p' $ANDROID_SDK/extras/android/support/source.properties`
135 if test -f "$ANDROID_SDK/extras/google/google_play_services/source.properties"; then
136 GOOGLE_PLAY_SERVICES_NAME=`sed -ne 's/^Extra.NameDisplay=//p' $ANDROID_SDK/extras/google/google_play_services/source.properties`
137 AC_MSG_RESULT([$ANDROID_SUPPORT_LIB_NAME, $GOOGLE_PLAY_SERVICES_NAME])
139 AC_MSG_NOTICE([Google Play Services library not installed.])
143 AC_MSG_NOTICE([Android Support Library not installed.])
148 if test "x$ANDROID_SDK" != "xno"; then
149 HAVE_ANDROID_SDK="yes"
151 HAVE_ANDROID_SDK="no"
154 AM_CONDITIONAL([ANDROID], [test x$ANDROID_SDK != xno])
156 AC_SUBST(ANDROID_SDK)
158 AC_ARG_WITH(fat-dir, AS_HELP_STRING([--with-fat-dir=PATH],
159 [Set the directory to install the 'fat' distribution files to (defaults to not installing)]),
160 [FATDIR=$withval], [FATDIR=none])
162 AM_CONDITIONAL(FATINSTALL, [test "x$FATDIR" != "xnone"])
174 if test "x$GCC" = "xyes"; then
175 WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
176 -Wmissing-prototypes -Wmissing-declarations \
177 -Wnested-externs -fno-strict-aliasing"
178 AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
179 [Can use #warning in C files])
181 AC_SUBST(WARN_CFLAGS)
183 AC_CHECK_PROG([HAVE_SDCC], [sdcc], yes, no)
184 if test "x$HAVE_SDCC" = "xno"; then
185 AC_MSG_WARN([No sdcc found, cc1111 binaries will not be built])
188 AC_CHECK_PROG([HAVE_ARM_GCC],[arm-none-eabi-gcc], yes, no,[/opt/cortex/bin])
189 if test "x$HAVE_ARM_GCC" = "xno"; then
190 AC_MSG_WARN([No summon toolchain arm compiler found, STM32L binaries will not be built])
193 AC_CHECK_PROG([HAVE_ARM_M0_GCC], [arm-none-eabi-gcc], yes, no,[/usr/bin])
194 if test "x$HAVE_ARM_M0_GCC" = "xno"; then
195 AC_MSG_WARN([No linaro toolchain arm cortex-m0 compiler found, LPC11U14 binaries will not be built])
198 AC_CHECK_PROG([HAVE_NICKLE], [nickle], yes, no)
199 if test "x$HAVE_NICKLE" = "xno"; then
200 AC_MSG_ERROR([Please install nickle to build AltOs])
203 AC_CHECK_LIB(readline, readline)
205 PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
207 AC_CHECK_HEADERS(libelf.h libelf/libelf.h, [break])
208 AC_CHECK_HEADERS(gelf.h libelf/gelf.h, [break])
210 PKG_CHECK_MODULES([LIBSTLINK], [stlink], [HAVE_STLINK=yes], [HAVE_STLINK=no])
212 AM_CONDITIONAL([LIBSTLINK], [test x$HAVE_STLINK != xno])
218 altosuilib/AltosUIVersion.java
221 altosui/altos-windows.nsi
225 micropeak/micropeak-windows.nsi
227 altosdroid/local.properties
229 ao-tools/lib/Makefile
230 ao-tools/ao-rawload/Makefile
231 ao-tools/ao-dbg/Makefile
232 ao-tools/ao-bitbang/Makefile
233 ao-tools/ao-eeprom/Makefile
234 ao-tools/ao-list/Makefile
235 ao-tools/ao-load/Makefile
236 ao-tools/ao-telem/Makefile
237 ao-tools/ao-stmload/Makefile
238 ao-tools/ao-send-telem/Makefile
239 ao-tools/ao-sky-flash/Makefile
240 ao-tools/ao-dumpflash/Makefile
241 ao-tools/ao-edit-telem/Makefile
242 ao-tools/ao-dump-up/Makefile
248 echo " Package: ${PACKAGE_NAME} ${PACKAGE_VERSION}"
250 echo " Configuration"
251 echo " STM32L support..............: ${HAVE_ARM_GCC}"
252 echo " LPC11U14 support............: ${HAVE_ARM_M0_GCC}"
253 echo " CC1111 support..............: ${HAVE_SDCC}"
254 echo " Android support.............: ${HAVE_ANDROID_SDK}"
255 echo " STlink support..............: ${HAVE_STLINK}"
258 echo " freetts.....................: ${FREETTS}"
259 echo " jfreechart..................: ${JFREECHART}"
260 echo " jcommon.....................: ${JCOMMON}"
261 echo " JVM include.................: ${JVM_INCLUDE}"
262 if test x${ANDROID_SDK} != "xno"; then
265 echo " Android SDK.................: ${ANDROID_SDK}"