update changelogs for Debian build
[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], 0.7.1)
22 AC_CONFIG_SRCDIR([src/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 dnl ==========================================================================
30
31 AM_CONFIG_HEADER(config.h)
32
33 AC_ARG_WITH(freetts, AS_HELP_STRING([--with-freetts=PATH],
34         [Set freetts class path (default /usr/share/java)]),
35         [FREETTS=$withval], [FREETTS=/usr/share/java])
36
37 AC_SUBST(FREETTS)
38
39 AC_ARG_WITH(jvm, AS_HELP_STRING([--with-jvm-include=PATH],
40         [Set jvm include path for jni builds (default searches in /usr/lib/jvm)]),
41         [JVM_INCLUDE=$withval], [JVM_INCLUDE=auto])
42
43 if test "x$JVM_INCLUDE" = "xauto"; then
44         AC_MSG_CHECKING([JVM include files])
45         for jvm in default-java java-6-openjdk java-6-sun; do
46                 if test "x$JVM_INCLUDE" = "xauto"; then
47                         INCLUDE="/usr/lib/jvm/$jvm/include"
48                         if test -f "$INCLUDE"/jni.h; then
49                                 JVM_INCLUDE="$INCLUDE"
50                         fi
51                 fi
52         done
53         if test "x$JVM_INCLUDE" = "xauto"; then
54                 AC_MSG_ERROR([no JVM include files found])
55         fi
56         AC_MSG_RESULT([$JVM_INCLUDE])
57 fi
58
59 AC_SUBST(JVM_INCLUDE)
60
61 AC_ARG_WITH(fat-dir, AS_HELP_STRING([--with-fat-dir=PATH],
62             [Set the directory to install the 'fat' distribution files to (defaults to not installing)]),
63             [FATDIR=$withval], [FATDIR=none])
64
65 AM_CONDITIONAL(FATINSTALL, [test "x$FATDIR" != "xnone"])
66
67 AC_SUBST(FATDIR)
68
69 AC_PROG_CC
70 AC_PROG_INSTALL
71 AC_PROG_LN_S
72 AC_PROG_LIBTOOL
73 PKG_PROG_PKG_CONFIG
74
75 CFLAGS="-g"
76 WARN_CFLAGS=""
77 if test "x$GCC" = "xyes"; then
78         WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
79         -Wmissing-prototypes -Wmissing-declarations \
80         -Wnested-externs -fno-strict-aliasing"
81         AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
82         [Can use #warning in C files])
83 fi
84 AC_SUBST(WARN_CFLAGS)
85
86 AC_CHECK_HEADERS(flite/flite.h,HAVE_FLITE_H=yes,HAVE_FLITE_H=no)
87 AC_CHECK_LIB(flite, flite_init,HAVE_LIBFLITE=yes,HAVE_LIBFLITE=no,-lasound -lm)
88
89 if test "x$HAVE_FLITE_H" = "xyes" -a "x$HAVE_LIBFLITE" = "xyes"; then
90         AC_DEFINE(HAVE_FLITE,1,[Define if the flite library is usable])
91         AC_SUBST(FLITE_LIBS,"-lflite_cmu_us_kal16 -lflite_usenglish -lflite_cmulex -lflite -lasound -lm")
92         AC_SUBST(FLITE_INCS,-Iflite)
93         save_LIBS="$LIBS"
94         LIBS="$LIBS $FLITE_LIBS"
95         AC_CHECK_FUNCS([register_cmu_us_kal16 register_cmu_us_kal],break)
96         LIBS="$save_LIBS"
97 fi
98 AM_CONDITIONAL(USE_FLITE,test "x$HAVE_FLITE_H" = "xyes" -a "x$HAVE_LIBFLITE" = "xyes")
99
100 AC_CHECK_PROG([HAVE_SDCC], [sdcc], yes, no)
101 if test "x$HAVE_SDCC" = "xno"; then
102         AC_MSG_ERROR([Please install sdcc to build AltOs])
103 fi
104
105 AC_CHECK_PROG([HAVE_NICKLE], [nickle], yes, no)
106 if test "x$HAVE_NICKLE" = "xno"; then
107         AC_MSG_ERROR([Please install nickle to build AltOs])
108 fi
109
110 AC_CHECK_LIB(readline, readline)
111
112 PKG_CHECK_MODULES([GNOME], [gtk+-2.0 libglade-2.0 gconf-2.0])
113
114 PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
115
116 PKG_CHECK_MODULES([ALSA], [alsa])
117
118 PKG_CHECK_MODULES([PLPLOT], [plplotd])
119
120 PKG_CHECK_MODULES([SNDFILE], [sndfile])
121
122 AC_OUTPUT([
123 Makefile
124 ao-tools/Makefile
125 ao-tools/lib/Makefile
126 ao-tools/ao-rawload/Makefile
127 ao-tools/ao-dbg/Makefile
128 ao-tools/ao-dumplog/Makefile
129 ao-tools/ao-bitbang/Makefile
130 ao-tools/ao-eeprom/Makefile
131 ao-tools/ao-list/Makefile
132 ao-tools/ao-load/Makefile
133 ao-tools/ao-postflight/Makefile
134 ao-tools/ao-view/Makefile
135 ao-tools/libaltos/Makefile
136 ao-tools/altosui/Makefile
137 ao-utils/Makefile
138 src/Version
139 ])