Telemetry code was mis-computing RSSI
[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_INIT(COPYING)
21
22 AM_INIT_AUTOMAKE(altos, 0.1)
23 AM_MAINTAINER_MODE
24
25 dnl ==========================================================================
26
27 AM_CONFIG_HEADER(config.h)
28
29 AC_PROG_CC
30 AC_PROG_INSTALL
31 AC_PROG_LN_S
32 AC_PROG_RANLIB
33 PKG_PROG_PKG_CONFIG
34
35 CFLAGS="-g"
36 WARN_CFLAGS=""
37 if test "x$GCC" = "xyes"; then
38         WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
39         -Wmissing-prototypes -Wmissing-declarations \
40         -Wnested-externs -fno-strict-aliasing"
41         AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
42         [Can use #warning in C files])
43 fi
44 AC_SUBST(WARN_CFLAGS)
45
46 AC_CHECK_HEADERS(flite/flite.h,HAVE_FLITE_H=yes,HAVE_FLITE_H=no)
47 AC_CHECK_LIB(flite, flite_init,HAVE_LIBFLITE=yes,HAVE_LIBFLITE=no,-lasound -lm)
48
49 if test "x$HAVE_FLITE_H" = "xyes" -a "x$HAVE_LIBFLITE" = "xyes"; then
50         AC_DEFINE(HAVE_FLITE,1,[Define if the flite library is usable])
51         AC_SUBST(FLITE_LIBS,"-lflite_cmu_us_kal16 -lflite_usenglish -lflite_cmulex -lflite -lasound -lm")
52         AC_SUBST(FLITE_INCS,-Iflite)
53         save_LIBS="$LIBS"
54         LIBS="$LIBS $FLITE_LIBS"
55         AC_CHECK_FUNCS([register_cmu_us_kal16 register_cmu_us_kal],break)
56         LIBS="$save_LIBS"
57 fi
58 AM_CONDITIONAL(USE_FLITE,test "x$HAVE_FLITE_H" = "xyes" -a "x$HAVE_LIBFLITE" = "xyes")
59
60 AC_CHECK_PROG([HAVE_SDCC], [sdcc], yes, no)
61 if test "x$HAVE_SDCC" = "xno"; then
62         AC_MSG_ERROR([Please install sdcc to build AltOs])
63 fi
64
65 AC_CHECK_PROG([HAVE_NICKLE], [nickle], yes, no)
66 if test "x$HAVE_NICKLE" = "xno"; then
67         AC_MSG_ERROR([Please install nickle to build AltOs])
68 fi
69
70 AC_CHECK_LIB(readline, readline)
71
72 PKG_CHECK_MODULES([GNOME], [gtk+-2.0 libglade-2.0 gconf-2.0])
73
74 PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
75
76 PKG_CHECK_MODULES([ALSA], [alsa])
77
78 PKG_CHECK_MODULES([PLPLOT], [plplotd])
79
80 PKG_CHECK_MODULES([SNDFILE], [sndfile])
81
82 AC_OUTPUT([
83 Makefile
84 ao-tools/Makefile
85 ao-tools/lib/Makefile
86 ao-tools/ao-rawload/Makefile
87 ao-tools/ao-dbg/Makefile
88 ao-tools/ao-dumplog/Makefile
89 ao-tools/ao-bitbang/Makefile
90 ao-tools/ao-eeprom/Makefile
91 ao-tools/ao-list/Makefile
92 ao-tools/ao-load/Makefile
93 ao-tools/ao-postflight/Makefile
94 ao-tools/ao-view/Makefile
95 ao-utils/Makefile
96 ])