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.8.2)
23 AC_CONFIG_SRCDIR([src/kernel/ao.h])
24 AM_INIT_AUTOMAKE([foreign dist-bzip2])
27 RELEASE_DATE=2017-09-18
28 AC_SUBST(RELEASE_DATE)
30 VERSION_DASH=`echo $VERSION | sed 's/\./-/g'`
31 AC_SUBST(VERSION_DASH)
32 AC_SUBST(ANDROID_VERSION)
34 dnl ==========================================================================
35 dnl Java library versions
40 AC_SUBST(ALTOSLIB_VERSION)
41 AC_DEFINE(ALTOSLIB_VERSION,$ALTOSLIB_VERSION,[Version of the AltosLib package])
42 AC_SUBST(ALTOSUILIB_VERSION)
43 AC_DEFINE(ALTOSUILIB_VERSION,$ALTOSUILIB_VERSION,[Version of the AltosUILib package])
45 dnl ==========================================================================
47 AM_CONFIG_HEADER(config.h)
49 AC_ARG_WITH(freetts, AS_HELP_STRING([--with-freetts=PATH],
50 [Set freetts class path (default /usr/share/java)]),
51 [FREETTS=$withval], [FREETTS=/usr/share/java])
55 AC_ARG_WITH(jfreechart, AS_HELP_STRING([--with-jfreechart=PATH],
56 [Set jfreechart class path (default /usr/share/java)]),
57 [JFREECHART=$withval], [JFREECHART=/usr/share/java])
61 AC_ARG_WITH(jcommon, AS_HELP_STRING([--with-jcommon=PATH],
62 [Set jcommon class path (default /usr/share/java)]),
63 [JCOMMON=$withval], [JCOMMON=/usr/share/java])
67 AC_ARG_WITH(jvm, AS_HELP_STRING([--with-jvm-include=PATH],
68 [Set jvm include path for jni builds (default searches in /usr/lib/jvm)]),
69 [JVM_INCLUDE=$withval], [JVM_INCLUDE=auto])
71 if test "x$JVM_INCLUDE" = "xauto"; then
72 AC_MSG_CHECKING([JVM include files])
73 for jvm in default-java java-6-openjdk java-6-sun; do
74 if test "x$JVM_INCLUDE" = "xauto"; then
75 INCLUDE="/usr/lib/jvm/$jvm/include"
76 if test -f "$INCLUDE"/jni.h; then
77 JVM_INCLUDE="$INCLUDE"
81 if test "x$JVM_INCLUDE" = "xauto"; then
82 AC_MSG_ERROR([no JVM include files found])
84 AC_MSG_RESULT([$JVM_INCLUDE])
89 AC_ARG_WITH(android, AS_HELP_STRING([--with-android=PATH],
90 [Set android SDK path (default searches in a variety of places)]),
91 [ANDROID_SDK=$withval], [ANDROID_SDK=${ANDROID_SDK:-auto}])
93 if test "x$ANDROID_SDK" = "xauto"; then
94 AC_MSG_CHECKING([Android SDK])
95 for sdk in ../android/android-sdk-linux ../android/android-sdk ../android-sdk ../android-sdk-linux $HOME/android; do
96 if test "x$ANDROID_SDK" = "xauto"; then
98 if test -f "$SDK/SDK Readme.txt"; then
99 ANDROID_SDK=`readlink -m "$SDK"`
103 if test "x$ANDROID_SDK" = "xauto"; then
104 AC_MSG_NOTICE([no Android SDK found])
107 AC_MSG_RESULT([$ANDROID_SDK])
109 if test "x$ANDROID_SDK" != "xno"; then
110 AC_MSG_CHECKING([Android SDK version])
111 SDK_VERSION=`grep -i '^Pkg.Revision=' $ANDROID_SDK/tools/source.properties | cut -f2- -d= | sed s/^r//`
112 SDK_MAJOR_VERSION="`echo $SDK_VERSION | sed 's/[[^0-9]].*//'`"
113 if test "$SDK_MAJOR_VERSION" -lt 17 ; then
114 AC_MSG_NOTICE([SDK version $SDK_VERSION is too old. Need >= r17])
117 AC_MSG_RESULT([$SDK_VERSION])
120 if test "x$ANDROID_SDK" != "xno"; then
121 AC_MSG_CHECKING([Android SDK API Level])
122 if test -f "$ANDROID_SDK/platforms/android-10/source.properties"; then
123 API_LEVEL=`sed -ne 's/^AndroidVersion.ApiLevel=//p' $ANDROID_SDK/platforms/android-10/source.properties`
124 if test "$API_LEVEL" = "10"; then
125 AC_MSG_RESULT([$API_LEVEL])
127 AC_MSG_NOTICE([API Level 10 not installed correctly.])
131 AC_MSG_NOTICE([API Level 10 not installed, but is required.])
135 if test "x$ANDROID_SDK" != "xno"; then
136 AC_MSG_CHECKING([Android SDK required extras])
137 if test -f "$ANDROID_SDK/extras/android/support/source.properties"; then
138 ANDROID_SUPPORT_LIB_NAME=`sed -ne 's/^Extra.NameDisplay=//p' $ANDROID_SDK/extras/android/support/source.properties`
139 if test -f "$ANDROID_SDK/extras/google/google_play_services/source.properties"; then
140 GOOGLE_PLAY_SERVICES_NAME=`sed -ne 's/^Extra.NameDisplay=//p' $ANDROID_SDK/extras/google/google_play_services/source.properties`
141 AC_MSG_RESULT([$ANDROID_SUPPORT_LIB_NAME, $GOOGLE_PLAY_SERVICES_NAME])
143 AC_MSG_NOTICE([Google Play Services library not installed.])
147 AC_MSG_NOTICE([Android Support Library not installed.])
153 if test "x$ANDROID_SDK" != "xno"; then
154 HAVE_ANDROID_SDK="yes"
155 if test -f "$HOME/altusmetrumllc/google-play-release.keystore" -a -f "$HOME/altusmetrumllc/google-play-passphrase"; then
159 HAVE_ANDROID_SDK="no"
162 AM_CONDITIONAL([ANDROID], [test x$ANDROID_SDK != xno])
163 AM_CONDITIONAL([ANDROID_RELEASE], [test x$ANDROID_RELEASE = xyes])
165 AC_SUBST(ANDROID_SDK)
167 AC_ARG_WITH(fat-dir, AS_HELP_STRING([--with-fat-dir=PATH],
168 [Set the directory to install the 'fat-install' distribution files to (defaults to no such target)]),
169 [FATDIR=$withval], [FATDIR=none])
171 AM_CONDITIONAL(FATINSTALL, [test "x$FATDIR" != "xnone"])
175 AC_ARG_WITH(google-key, AS_HELP_STRING([--with-google-key=PATH],
176 [Set the file to read the google maps API key from (defaults to ~/altusmetrumllc/google-maps-api-key)]),
177 [GOOGLEKEYFILE=$withval], [GOOGLEKEYFILE=$HOME/altusmetrumllc/google-maps-api-key])
179 if test -r "$GOOGLEKEYFILE" -a -s "$GOOGLEKEYFILE"; then
180 GOOGLEKEY=`cat "$GOOGLEKEYFILE"`
181 HAVE_GOOGLE_KEY="yes"
197 if test "x$GCC" = "xyes"; then
198 WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
199 -Wmissing-prototypes -Wmissing-declarations \
200 -Wnested-externs -fno-strict-aliasing"
201 AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
202 [Can use #warning in C files])
204 AC_SUBST(WARN_CFLAGS)
211 [AS_HELP_STRING([--with-sdcc],
216 if test "x$with_sdcc" != "xno"; then
217 if test "x$with_sdcc" = "xauto"; then
219 AC_CHECK_PROG([HAVE_SDCC],[$with_sdcc], yes, no)
227 if test "x$HAVE_SDCC" = "xno"; then
228 AC_MSG_WARN([SDCC not found, cc1111 binaries will not be built])
237 # Configure ARM compiler for STM32L and LPC11U14
240 AC_ARG_WITH([arm-cc],
241 [AS_HELP_STRING([--with-arm-cc],
242 [Name of ARM C compiler])],
246 if test "x$with_arm_cc" != "xno"; then
247 if test "x$with_arm_cc" = "xauto"; then
248 with_arm_cc="arm-none-eabi-gcc"
249 AC_CHECK_PROG([HAVE_ARM_CC],[$with_arm_cc], yes, no)
257 if test "x$HAVE_ARM_CC" = "xno"; then
258 AC_MSG_WARN([Arm compiler not found, ARM binaries will not be built])
262 AC_SUBST(HAVE_ARM_CC)
265 if test -d pdclib -a x"$HAVE_ARM_CC" = xyes; then
266 PDCLIB_ROOT='$(TOPDIR)/../pdclib-root'
267 PDCLIB_INCLUDES='-I$(TOPDIR)/../pdclib-root/include'
268 PDCLIB_LIBS_M0='-L$(TOPDIR)/../pdclib-root/lib -lpdclib-cortex-m0'
269 PDCLIB_LIBS_M3='-L$(TOPDIR)/../pdclib-root/lib -lpdclib-cortex-m3'
273 PDCLIB_LIBS_M0='-lpdclib-cortex-m0'
274 PDCLIB_LIBS_M3='-lpdclib-cortex-m3'
278 AM_CONDITIONAL(PDCLIB, [test x$HAVE_PDCLIB = xyes])
280 AC_SUBST(PDCLIB_INCLUDES)
281 AC_SUBST(PDCLIB_LIBS_M0)
282 AC_SUBST(PDCLIB_LIBS_M3)
283 AC_SUBST(PDCLIB_ROOT)
284 AC_SUBST(HAVE_PDCLIB)
286 if test "x$HAVE_ARM_CC" = "xyes"; then
288 save_CFLAGS="$CFLAGS"
291 CFLAGS="-mthumb -mcpu=cortex-m0"
292 LIBS="-ffreestanding -nostdlib"
295 AC_MSG_CHECKING([if ]$ARM_CC[ supports cortex-m0])
296 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int i;])],
297 [HAVE_ARM_M0_CC=yes],
299 AC_MSG_RESULT([$HAVE_ARM_M0_CC])
301 CFLAGS="-mthumb -mcpu=cortex-m3"
302 AC_MSG_CHECKING([if ]$ARM_CC[ supports cortex-m3])
303 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int i;])],
304 [HAVE_ARM_M3_CC=yes],
306 AC_MSG_RESULT([$HAVE_ARM_M3_CC])
308 if test x$HAVE_PDCLIB != xyes; then
309 AC_CHECK_LIB(pdclib-cortex-m0,memcpy,
313 AC_CHECK_LIB(pdclib-cortex-m3,memcpy,
320 CFLAGS="$save_CFLAGS"
326 AC_SUBST(HAVE_ARM_M3_CC)
327 AC_SUBST(HAVE_ARM_M0_CC)
329 if test "x$HAVE_ARM_M3_CC" = "xno"; then
330 AC_MSG_WARN([No cortex-m3 arm compiler found, STM32L binaries will not be built])
333 if test "x$HAVE_ARM_M0_CC" = "xno"; then
334 AC_MSG_WARN([No cortex-m0 arm compiler found, LPC11U14 binaries will not be built])
338 # Configure AVR compiler
341 AC_ARG_WITH([avr-cc],
342 [AS_HELP_STRING([--with-avr-cc],
343 [Name of AVR C compiler])],
347 if test "x$with_avr_cc" != "xno"; then
348 if test "x$with_avr_cc" = "xauto"; then
349 with_avr_cc="avr-gcc"
350 AC_CHECK_PROG([HAVE_AVR_CC],[$with_avr_cc], yes, no)
358 AC_ARG_WITH([avr-objcopy],
359 [AS_HELP_STRING([--with-avr-objcopy],
360 [Name of AVR objcopy])],
362 [with_avr_objcopy=auto])
364 if test "x$with_avr_objcopy" != "xno"; then
365 if test "x$with_avr_objcopy" = "xauto"; then
366 with_avr_objcopy="avr-objcopy"
367 AC_CHECK_PROG([HAVE_AVR_OBJCOPY],[$with_avr_objcopy], yes, no)
375 if test "x$HAVE_AVR_CC" = "xno" -o "x$HAVE_AVR_OBJCOPY" = "xno"; then
376 AC_MSG_WARN([AVR compiler and objcopy not found, atmel binaries will not be built])
380 save_CFLAGS="$CFLAGS"
384 CFLAGS="-mmcu=attiny85"
386 AC_MSG_CHECKING([if ]$with_avr_cc[ can link programs])
387 AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
390 AC_MSG_RESULT([$AVR_LINK])
394 CFLAGS="$save_CFLAGS"
397 if test "x$AVR_LINK" = xyes; then
399 AVR_OBJCOPY=$with_avr_objcopy
406 AC_SUBST(AVR_OBJCOPY)
407 AC_SUBST(HAVE_AVR_CC)
409 AC_CHECK_PROG([HAVE_NICKLE], [nickle], yes, no)
410 if test "x$HAVE_NICKLE" = "xno"; then
411 AC_MSG_ERROR([Please install nickle to build AltOs])
414 AC_ARG_WITH([readline],
415 [AS_HELP_STRING([--with-readline],
416 [enable readline functionality in ao-dbg @<:@default=auto@:>@])],
418 [with_readline=auto])
422 if test x"$with_readline" != "xno"; then
423 AC_CHECK_LIB([readline], [main],
424 [AC_SUBST([LIBREADLINE], ["-lreadline -lncurses"])
425 AC_DEFINE([HAVE_LIBREADLINE], [1],
426 [Define if you have libreadline])],
427 [if test "x$with_readline" != xauto; then
428 AC_MSG_ERROR([--with-readline was given, but test for readline failed])
433 PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
435 AC_CHECK_HEADERS(libelf.h libelf/libelf.h, [break])
436 AC_CHECK_HEADERS(gelf.h libelf/gelf.h, [break])
438 AC_ARG_WITH([stlink],
439 [AS_HELP_STRING([--with-stlink],
440 [Build tools that use the stlink library (default: auto)])],
444 if test x"$with_stlink" != "xno"; then
445 PKG_CHECK_MODULES([STLINK], [stlink], [HAVE_STLINK=yes], [HAVE_STLINK=no])
446 if test x"$HAVE_STLINK" = "xno" -a x"$with_stlink" != "xauto"; then
447 AC_MSG_ERROR([--with-stlink was given, but stlink was not found])
453 if test x"$HAVE_STLINK" = "xyes"; then
454 AC_DEFINE(HAVE_STLINK,1,[Using STlink library])
457 AM_CONDITIONAL([LIBSTLINK], [test x$HAVE_STLINK = xyes])
459 AC_ARG_ENABLE([multi-arch],
460 [AS_HELP_STRING([--enable-multi-arch],
461 [enable building both i386 and amd64 libraries (default=auto)])],
462 [MULTI_ARCH=$enableval],
465 case x"$MULTI_ARCH" in
470 save_CFLAGS="$CFLAGS"
474 AC_MSG_CHECKING([if ]$CC[ ]$CFLAGS[ can link programs])
475 AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
478 AC_MSG_RESULT([$M64_LINK])
480 AC_MSG_CHECKING([if ]$CC[ ]$CFLAGS[ can link programs])
481 AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
484 AC_MSG_RESULT([$M32_LINK])
485 CFLAGS="$save_CFLAGS"
487 case x"$M64_LINK"x"$M32_LINK" in
508 AM_CONDITIONAL([MULTI_ARCH], [test x$MULTI_ARCH = xyes])
510 AC_ARG_ENABLE([install-shared-mime-info],
511 [AS_HELP_STRING([--disable-install-shared-mime-info],
512 [disable installing shared mime info files (default=yes)])],
513 [INSTALL_SHARED_MIME_INFO=$enableval],
514 [INSTALL_SHARED_MIME_INFO=yes])
516 AM_CONDITIONAL([INSTALL_SHARED_MIME_INFO], [test x$INSTALL_SHARED_MIME_INFO = xyes])
521 src/chaoskey-v1.0/org.altusmetrum.ChaosKey.metainfo.xml
523 altoslib/AltosVersion.java
528 altosui/altos-windows.nsi
532 micropeak/micropeak-windows.nsi
535 telegps/telegps-windows.nsi
537 altosdroid/local.properties
538 altosdroid/AndroidManifest.xml
540 ao-tools/lib/Makefile
541 ao-tools/ao-rawload/Makefile
542 ao-tools/ao-dbg/Makefile
543 ao-tools/ao-bitbang/Makefile
544 ao-tools/ao-eeprom/Makefile
545 ao-tools/ao-list/Makefile
546 ao-tools/ao-load/Makefile
547 ao-tools/ao-telem/Makefile
548 ao-tools/ao-stmload/Makefile
549 ao-tools/ao-send-telem/Makefile
550 ao-tools/ao-sky-flash/Makefile
551 ao-tools/ao-dumpflash/Makefile
552 ao-tools/ao-edit-telem/Makefile
553 ao-tools/ao-dump-up/Makefile
554 ao-tools/ao-elftohex/Makefile
555 ao-tools/ao-usbload/Makefile
556 ao-tools/ao-flash/Makefile
557 ao-tools/ao-test-igniter/Makefile
558 ao-tools/ao-test-baro/Makefile
559 ao-tools/ao-test-flash/Makefile
560 ao-tools/ao-cal-accel/Makefile
561 ao-tools/ao-cal-freq/Makefile
562 ao-tools/ao-test-gps/Makefile
563 ao-tools/ao-usbtrng/Makefile
564 ao-tools/ao-chaosread/Makefile
565 ao-tools/ao-makebin/Makefile
571 echo " Package: ${PACKAGE_NAME} ${PACKAGE_VERSION}"
573 echo " Configuration"
574 echo " Arm compiler................: ${ARM_CC}"
575 echo " STM32L support..............: ${HAVE_ARM_M3_CC}"
576 echo " LPC11U14 support............: ${HAVE_ARM_M0_CC}"
577 echo " SDCC........................: ${SDCC}"
578 echo " CC1111 support..............: ${HAVE_SDCC}"
579 echo " AVR compiler................: ${AVR_CC} ${AVR_OBJCOPY}"
580 echo " AVR support.................: ${HAVE_AVR_CC}"
581 echo " Android support.............: ${HAVE_ANDROID_SDK}"
582 echo " Android release support.....: ${ANDROID_RELEASE}"
583 echo " STlink support..............: ${HAVE_STLINK}"
584 echo " Local pdclib................: ${HAVE_PDCLIB}"
585 echo " i386 and amd64 libaltos.....: ${MULTI_ARCH}"
586 echo " install shared mime info....: ${INSTALL_SHARED_MIME_INFO}"
589 echo " freetts.....................: ${FREETTS}"
590 echo " jfreechart..................: ${JFREECHART}"
591 echo " jcommon.....................: ${JCOMMON}"
592 echo " JVM include.................: ${JVM_INCLUDE}"
593 echo " Google maps API key.........: ${HAVE_GOOGLE_KEY}"
594 if test x${ANDROID_SDK} != "xno"; then
597 echo " Android SDK.................: ${ANDROID_SDK}"