altosuilib/micropeak: Add state markers to micropeak graph
[fw/altos] / configure.ac
1 dnl
2 dnl  Copyright © 2008,2009 Keith Packard <keithp@keithp.com>
3 dnl
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.
8 dnl
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.
13 dnl
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.
17 dnl
18 dnl Process this file with autoconf to create configure.
19
20 AC_PREREQ(2.57)
21 AC_INIT([altos], 1.1.9.3)
22 AC_CONFIG_SRCDIR([src/core/ao.h])
23 AM_INIT_AUTOMAKE([foreign dist-bzip2])
24 AM_MAINTAINER_MODE
25
26 VERSION_DASH=`echo $VERSION | sed 's/\./-/g'`
27 AC_SUBST(VERSION_DASH)
28
29
30 dnl ==========================================================================
31 dnl Java library versions
32
33 ALTOSUILIB_VERSION=1
34 ALTOSLIB_VERSION=1
35
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])
40
41 dnl ==========================================================================
42
43 AM_CONFIG_HEADER(config.h)
44
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])
48
49 AC_SUBST(FREETTS)
50
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])
54
55 AC_SUBST(JFREECHART)
56
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])
60
61 AC_SUBST(JCOMMON)
62
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])
66
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"
74                         fi
75                 fi
76         done
77         if test "x$JVM_INCLUDE" = "xauto"; then
78                 AC_MSG_ERROR([no JVM include files found])
79         fi
80         AC_MSG_RESULT([$JVM_INCLUDE])
81 fi
82
83 AC_SUBST(JVM_INCLUDE)
84
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}])
88
89 echo ANDROID_SDK set to $ANDROID_SDK
90
91 if test "x$ANDROID_SDK" = "xauto"; then
92         AC_MSG_CHECKING([Android SDK files])
93         for sdk in ../android/android-sdk-linux ../android/android-sdk ../android-sdk ../android-sdk-linux $HOME/android; do
94                 if test "x$ANDROID_SDK" = "xauto"; then
95                         SDK="$sdk"
96                         if test -f "$SDK/SDK Readme.txt"; then
97                                 ANDROID_SDK=`readlink -m "$SDK"`
98                         fi
99                 fi
100         done
101         if test "x$ANDROID_SDK" = "xauto"; then
102                 AC_MSG_NOTICE([no Android SDK found])
103                 ANDROID_SDK=no
104         fi
105         AC_MSG_RESULT([$ANDROID_SDK])
106 fi
107
108 AM_CONDITIONAL([ANDROID], [test x$ANDROID_SDK != xno])
109
110 AC_SUBST(ANDROID_SDK)
111
112 AC_ARG_WITH(fat-dir, AS_HELP_STRING([--with-fat-dir=PATH],
113             [Set the directory to install the 'fat' distribution files to (defaults to not installing)]),
114             [FATDIR=$withval], [FATDIR=none])
115
116 AM_CONDITIONAL(FATINSTALL, [test "x$FATDIR" != "xnone"])
117
118 AC_SUBST(FATDIR)
119
120 AC_PROG_CC
121 AC_PROG_INSTALL
122 AC_PROG_LN_S
123 AC_PROG_LIBTOOL
124 PKG_PROG_PKG_CONFIG
125
126 CFLAGS="-g"
127 WARN_CFLAGS=""
128 if test "x$GCC" = "xyes"; then
129         WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
130         -Wmissing-prototypes -Wmissing-declarations \
131         -Wnested-externs -fno-strict-aliasing"
132         AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
133         [Can use #warning in C files])
134 fi
135 AC_SUBST(WARN_CFLAGS)
136
137 AC_CHECK_PROG([HAVE_SDCC], [sdcc], yes, no)
138 if test "x$HAVE_SDCC" = "xno"; then
139         AC_MSG_ERROR([Please install sdcc to build AltOs])
140 fi
141
142 AC_CHECK_PROG([HAVE_NICKLE], [nickle], yes, no)
143 if test "x$HAVE_NICKLE" = "xno"; then
144         AC_MSG_ERROR([Please install nickle to build AltOs])
145 fi
146
147 AC_CHECK_LIB(readline, readline)
148
149 PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
150
151 AC_CHECK_HEADERS(libelf.h libelf/libelf.h, [break])
152 AC_CHECK_HEADERS(gelf.h libelf/gelf.h, [break])
153
154 PKG_CHECK_MODULES([LIBSTLINK], [stlink], [HAVE_STLINK=yes], [HAVE_STLINK=no])
155
156 AM_CONDITIONAL([LIBSTLINK], [test x$HAVE_STLINK != xno])
157
158 AC_OUTPUT([
159 Makefile
160 altoslib/Makefile
161 altosuilib/Makefile
162 altosuilib/AltosUIVersion.java
163 altosui/Makefile
164 altosui/Info.plist
165 libaltos/Makefile
166 micropeak/Makefile
167 micropeak/Info.plist
168 altosdroid/Makefile
169 altosdroid/local.properties
170 ao-tools/Makefile
171 ao-tools/lib/Makefile
172 ao-tools/ao-rawload/Makefile
173 ao-tools/ao-dbg/Makefile
174 ao-tools/ao-bitbang/Makefile
175 ao-tools/ao-eeprom/Makefile
176 ao-tools/ao-list/Makefile
177 ao-tools/ao-load/Makefile
178 ao-tools/ao-telem/Makefile
179 ao-tools/ao-stmload/Makefile
180 ao-tools/ao-send-telem/Makefile
181 ao-tools/ao-sky-flash/Makefile
182 ao-utils/Makefile
183 src/Version
184 ])