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.
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)
29 dnl ==========================================================================
30 dnl Java library versions
35 AC_SUBST(ALTOSLIB_VERSION)
36 AC_DEFINE(ALTOSLIB_VERSION,$ALTOSLIB_VERSION,[Version of the AltosLib package])
37 AC_SUBST(ALTOSUILIB_VERSION)
38 AC_DEFINE(ALTOSUILIB_VERSION,$ALTOSUILIB_VERSION,[Version of the AltosUILib package])
40 dnl ==========================================================================
42 AM_CONFIG_HEADER(config.h)
44 AC_ARG_WITH(freetts, AS_HELP_STRING([--with-freetts=PATH],
45 [Set freetts class path (default /usr/share/java)]),
46 [FREETTS=$withval], [FREETTS=/usr/share/java])
50 AC_ARG_WITH(jfreechart, AS_HELP_STRING([--with-jfreechart=PATH],
51 [Set jfreechart class path (default /usr/share/java)]),
52 [JFREECHART=$withval], [JFREECHART=/usr/share/java])
56 AC_ARG_WITH(jcommon, AS_HELP_STRING([--with-jcommon=PATH],
57 [Set jcommon class path (default /usr/share/java)]),
58 [JCOMMON=$withval], [JCOMMON=/usr/share/java])
62 AC_ARG_WITH(jvm, AS_HELP_STRING([--with-jvm-include=PATH],
63 [Set jvm include path for jni builds (default searches in /usr/lib/jvm)]),
64 [JVM_INCLUDE=$withval], [JVM_INCLUDE=auto])
66 if test "x$JVM_INCLUDE" = "xauto"; then
67 AC_MSG_CHECKING([JVM include files])
68 for jvm in default-java java-6-openjdk java-6-sun; do
69 if test "x$JVM_INCLUDE" = "xauto"; then
70 INCLUDE="/usr/lib/jvm/$jvm/include"
71 if test -f "$INCLUDE"/jni.h; then
72 JVM_INCLUDE="$INCLUDE"
76 if test "x$JVM_INCLUDE" = "xauto"; then
77 AC_MSG_ERROR([no JVM include files found])
79 AC_MSG_RESULT([$JVM_INCLUDE])
84 AC_ARG_WITH(android, AS_HELP_STRING([--with-android=PATH],
85 [Set android SDK path (default searches in a variety of places)]),
86 [ANDROID_SDK=$withval], [ANDROID_SDK=${ANDROID_SDK:-auto}])
88 if test "x$ANDROID_SDK" = "xauto"; then
89 AC_MSG_CHECKING([Android SDK])
90 for sdk in ../android/android-sdk-linux ../android/android-sdk ../android-sdk ../android-sdk-linux $HOME/android; do
91 if test "x$ANDROID_SDK" = "xauto"; then
93 if test -f "$SDK/SDK Readme.txt"; then
94 ANDROID_SDK=`readlink -m "$SDK"`
98 if test "x$ANDROID_SDK" = "xauto"; then
99 AC_MSG_NOTICE([no Android SDK found])
102 AC_MSG_RESULT([$ANDROID_SDK])
104 if test "x$ANDROID_SDK" != "xno"; then
105 AC_MSG_CHECKING([Android SDK version])
106 SDK_VERSION=`grep -i '^Pkg.Revision=' $ANDROID_SDK/tools/source.properties | cut -f2- -d= | sed s/^r//`
107 SDK_MAJOR_VERSION="`echo $SDK_VERSION | sed 's/[[^0-9]].*//'`"
108 if test "$SDK_MAJOR_VERSION" -lt 17 ; then
109 AC_MSG_NOTICE([SDK version $SDK_VERSION is too old. Need >= r17])
112 AC_MSG_RESULT([$SDK_VERSION])
115 if test "x$ANDROID_SDK" != "xno"; then
116 AC_MSG_CHECKING([Android SDK API Level])
117 if test -f "$ANDROID_SDK/platforms/android-10/source.properties"; then
118 API_LEVEL=`sed -ne 's/^AndroidVersion.ApiLevel=//p' $ANDROID_SDK/platforms/android-10/source.properties`
119 if test "$API_LEVEL" = "10"; then
120 AC_MSG_RESULT([$API_LEVEL])
122 AC_MSG_NOTICE([API Level 10 not installed correctly.])
126 AC_MSG_NOTICE([API Level 10 not installed, but is required.])
130 if test "x$ANDROID_SDK" != "xno"; then
131 AC_MSG_CHECKING([Android SDK required extras])
132 if test -f "$ANDROID_SDK/extras/android/support/source.properties"; then
133 ANDROID_SUPPORT_LIB_NAME=`sed -ne 's/^Extra.NameDisplay=//p' $ANDROID_SDK/extras/android/support/source.properties`
134 if test -f "$ANDROID_SDK/extras/google/google_play_services/source.properties"; then
135 GOOGLE_PLAY_SERVICES_NAME=`sed -ne 's/^Extra.NameDisplay=//p' $ANDROID_SDK/extras/google/google_play_services/source.properties`
136 AC_MSG_RESULT([$ANDROID_SUPPORT_LIB_NAME, $GOOGLE_PLAY_SERVICES_NAME])
138 AC_MSG_NOTICE([Google Play Services library not installed.])
142 AC_MSG_NOTICE([Android Support Library not installed.])
147 if test "x$ANDROID_SDK" != "xno"; then
148 HAVE_ANDROID_SDK="yes"
150 HAVE_ANDROID_SDK="no"
153 AM_CONDITIONAL([ANDROID], [test x$ANDROID_SDK != xno])
155 AC_SUBST(ANDROID_SDK)
157 AC_ARG_WITH(fat-dir, AS_HELP_STRING([--with-fat-dir=PATH],
158 [Set the directory to install the 'fat' distribution files to (defaults to not installing)]),
159 [FATDIR=$withval], [FATDIR=none])
161 AM_CONDITIONAL(FATINSTALL, [test "x$FATDIR" != "xnone"])
173 if test "x$GCC" = "xyes"; then
174 WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
175 -Wmissing-prototypes -Wmissing-declarations \
176 -Wnested-externs -fno-strict-aliasing"
177 AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
178 [Can use #warning in C files])
180 AC_SUBST(WARN_CFLAGS)
187 [AS_HELP_STRING([--with-sdcc],
192 if test "x$with_sdcc" != "xno"; then
193 if test "x$with_sdcc" = "xauto"; then
195 AC_CHECK_PROG([HAVE_SDCC],[$with_sdcc], yes, no)
203 if test "x$HAVE_SDCC" = "xno"; then
204 AC_MSG_WARN([SDCC not found, cc1111 binaries will not be built])
213 # Configure ARM compiler for STM32L and LPC11U14
216 AC_ARG_WITH([arm-cc],
217 [AS_HELP_STRING([--with-arm-cc],
218 [Name of ARM C compiler])],
222 if test "x$with_arm_cc" != "xno"; then
223 if test "x$with_arm_cc" = "xauto"; then
224 with_arm_cc="arm-none-eabi-gcc"
225 AC_CHECK_PROG([HAVE_ARM_CC],[$with_arm_cc], yes, no)
233 if test "x$HAVE_ARM_CC" = "xno"; then
234 AC_MSG_WARN([Arm compiler not found, ARM binaries will not be built])
238 AC_SUBST(HAVE_ARM_CC)
241 if test "x$HAVE_ARM_CC" = "xyes"; then
243 save_CFLAGS="$CFLAGS"
246 CFLAGS="-mthumb -mcpu=cortex-m0"
247 LIBS="-ffreestanding -nostdlib"
250 AC_MSG_CHECKING([if ]$ARM_CC[ supports cortex-m0])
251 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int i;])],
252 [HAVE_ARM_M0_CC=yes],
254 AC_MSG_RESULT([$HAVE_ARM_M0_CC])
256 AC_CHECK_LIB(pdclib-cortex-m0,memcpy,
260 CFLAGS="-mthumb -mcpu=cortex-m3"
261 AC_MSG_CHECKING([if ]$ARM_CC[ supports cortex-m3])
262 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int i;])],
263 [HAVE_ARM_M3_CC=yes],
265 AC_MSG_RESULT([$HAVE_ARM_M3_CC])
267 AC_CHECK_LIB(pdclib-cortex-m3,memcpy,
273 CFLAGS="$save_CFLAGS"
279 AC_SUBST(HAVE_ARM_M3_CC)
280 AC_SUBST(HAVE_ARM_M0_CC)
282 if test "x$HAVE_ARM_M3_CC" = "xno"; then
283 AC_MSG_WARN([No cortex-m3 arm compiler found, STM32L binaries will not be built])
286 if test "x$HAVE_ARM_M0_CC" = "xno"; then
287 AC_MSG_WARN([No cortex-m0 arm compiler found, LPC11U14 binaries will not be built])
291 # Configure AVR compiler
294 AC_ARG_WITH([avr-cc],
295 [AS_HELP_STRING([--with-avr-cc],
296 [Name of AVR C compiler])],
300 if test "x$with_avr_cc" != "xno"; then
301 if test "x$with_avr_cc" = "xauto"; then
302 with_avr_cc="avr-gcc"
303 AC_CHECK_PROG([HAVE_AVR_CC],[$with_avr_cc], yes, no)
311 AC_ARG_WITH([avr-objcopy],
312 [AS_HELP_STRING([--with-avr-objcopy],
313 [Name of AVR objcopy])],
315 [with_avr_objcopy=auto])
317 if test "x$with_avr_objcopy" != "xno"; then
318 if test "x$with_avr_objcopy" = "xauto"; then
319 with_avr_objcopy="avr-objcopy"
320 AC_CHECK_PROG([HAVE_AVR_OBJCOPY],[$with_avr_objcopy], yes, no)
328 if test "x$HAVE_AVR_CC" = "xno" -o "x$HAVE_AVR_OBJCOPY" = "xno"; then
329 AC_MSG_WARN([AVR compiler and objcopy not found, atmel binaries will not be built])
333 save_CFLAGS="$CFLAGS"
337 CFLAGS="-mmcu=attiny85"
339 AC_MSG_CHECKING([if ]$with_avr_cc[ can link programs])
340 AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
343 AC_MSG_RESULT([$AVR_LINK])
347 CFLAGS="$save_CFLAGS"
350 if test "x$AVR_LINK" = xyes; then
352 AVR_OBJCOPY=$with_avr_objcopy
359 AC_SUBST(AVR_OBJCOPY)
360 AC_SUBST(HAVE_AVR_CC)
362 AC_CHECK_PROG([HAVE_NICKLE], [nickle], yes, no)
363 if test "x$HAVE_NICKLE" = "xno"; then
364 AC_MSG_ERROR([Please install nickle to build AltOs])
367 AC_ARG_WITH([readline],
368 [AS_HELP_STRING([--with-readline],
369 [enable readline functionality in ao-dbg @<:@default=auto@:>@])],
371 [with_readline=auto])
375 if test x"$with_readline" != "xno"; then
376 AC_CHECK_LIB([readline], [main],
377 [AC_SUBST([LIBREADLINE], ["-lreadline -lncurses"])
378 AC_DEFINE([HAVE_LIBREADLINE], [1],
379 [Define if you have libreadline])],
380 [if test "x$with_readline" != xauto; then
381 AC_MSG_ERROR([--with-readline was given, but test for readline failed])
386 PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
388 AC_CHECK_HEADERS(libelf.h libelf/libelf.h, [break])
389 AC_CHECK_HEADERS(gelf.h libelf/gelf.h, [break])
391 AC_ARG_WITH([stlink],
392 [AS_HELP_STRING([--with-stlink],
393 [Build tools that use the stlink library (default: auto)])],
397 if test x"$with_stlink" != "xno"; then
398 PKG_CHECK_MODULES([STLINK], [stlink], [HAVE_STLINK=yes], [HAVE_STLINK=no])
399 if test x"$HAVE_STLINK" = "xno" -a x"$with_stlink" != "xauto"; then
400 AC_MSG_ERROR([--with-stlink was given, but stlink was not found])
406 if test x"$HAVE_STLINK" = "xyes"; then
407 AC_DEFINE(HAVE_STLINK,1,[Using STlink library])
410 AM_CONDITIONAL([LIBSTLINK], [test x$HAVE_STLINK == xyes])
417 altosuilib/AltosUIVersion.java
420 altosui/altos-windows.nsi
424 micropeak/micropeak-windows.nsi
426 altosdroid/local.properties
428 ao-tools/lib/Makefile
429 ao-tools/ao-rawload/Makefile
430 ao-tools/ao-dbg/Makefile
431 ao-tools/ao-bitbang/Makefile
432 ao-tools/ao-eeprom/Makefile
433 ao-tools/ao-list/Makefile
434 ao-tools/ao-load/Makefile
435 ao-tools/ao-telem/Makefile
436 ao-tools/ao-stmload/Makefile
437 ao-tools/ao-send-telem/Makefile
438 ao-tools/ao-sky-flash/Makefile
439 ao-tools/ao-dumpflash/Makefile
440 ao-tools/ao-edit-telem/Makefile
441 ao-tools/ao-dump-up/Makefile
442 ao-tools/ao-elftohex/Makefile
443 ao-tools/ao-usbload/Makefile
444 ao-tools/ao-flash/Makefile
450 echo " Package: ${PACKAGE_NAME} ${PACKAGE_VERSION}"
452 echo " Configuration"
453 echo " Arm compiler................: ${ARM_CC}"
454 echo " STM32L support..............: ${HAVE_ARM_M3_CC}"
455 echo " LPC11U14 support............: ${HAVE_ARM_M0_CC}"
456 echo " SDCC........................: ${SDCC}"
457 echo " CC1111 support..............: ${HAVE_SDCC}"
458 echo " AVR compiler................: ${AVR_CC} ${AVR_OBJCOPY}"
459 echo " AVR support.................: ${HAVE_AVR_CC}"
460 echo " Android support.............: ${HAVE_ANDROID_SDK}"
461 echo " STlink support..............: ${HAVE_STLINK}"
464 echo " freetts.....................: ${FREETTS}"
465 echo " jfreechart..................: ${JFREECHART}"
466 echo " jcommon.....................: ${JCOMMON}"
467 echo " JVM include.................: ${JVM_INCLUDE}"
468 if test x${ANDROID_SDK} != "xno"; then
471 echo " Android SDK.................: ${ANDROID_SDK}"