forked from skiphansen/thelinkbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
executable file
·219 lines (171 loc) · 5.48 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# $Id: configure.in,v 1.37 2012/12/09 18:57:52 wb6ymh Exp $
#
AC_INIT(src/thebridge.c)
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(thelinkbox,0.56)
AM_CONDITIONAL(LINK_BOX,true)
AC_ARG_ENABLE(usb,
[ --enable-usb Build thelinkbox with usb support ],
[case "${enableval}" in
yes) usb=true ;;
no) usb=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-usb) ;;
esac], [usb=false])
AC_ARG_ENABLE(debug,
[ --enable-debug Build thelinkbox with debug support ],
[case "${enableval}" in
yes) export CFLAGS="-O0 -g";export CXXFLAGS="-O0 -g" ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac], )
AC_ARG_ENABLE(profiling,
[ --enable-profiling Build thelinkbox with profiling support ],
[case "${enableval}" in
yes) opts="-finstrument-functions -falign-functions=4 -DPROFILED_BUILD"
export CFLAGS="$CFLAGS $opts";export CXXFLAGS="$CXXFLAGS $opts"
profiling=true ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
esac], )
AC_ARG_WITH([readline],
[AS_HELP_STRING([--with-readline],
[enable support for readline])],
[],
[with_readline=no])
AC_ARG_WITH([dmalloc],
[AS_HELP_STRING([--with-dmalloc],
[enable dmalloc memory debugging support])],
[],
[with_dmalloc=no])
AC_CANONICAL_HOST
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
AC_CHECK_PROG(have_c,[$CC],y,n)
if test "have_c" = n; then
AC_MSG_ERROR([C compiler not found. Please install C (and C++) development tools.])
fi
AC_CHECK_PROG(have_cplus_plus,[$CXX],y,n)
if test "$have_cplus_plus" = n; then
AC_MSG_ERROR([C++ compiler not found. Please install C++ tools.])
fi
dnl Checks for libraries.
AC_CHECK_LIB(socket,socket)
AC_C_BIGENDIAN([AC_DEFINE([BIG_ENDIAN_MACHINE], [1],[Define if your target is a big endian machine])],,
[AC_MSG_WARN([Target endian unknown.
Please define BIG_ENDIAN_MACHINE in config.h for big endian targets])])
if test x$usb = xtrue; then
AM_CONDITIONAL(USB_SUPPORT,true)
AC_CHECK_LIB(usb, usb_init, , AC_MSG_ERROR("Can't build without libusb (does your system require a libusb-devel package?)"))
else
AM_CONDITIONAL(USB_SUPPORT,false)
fi
if test x$debug_build = xtrue; then
AM_CONDITIONAL(DEBUG_BUILD,true)
else
AM_CONDITIONAL(DEBUG_BUILD,false)
fi
if test x$profiling = xtrue; then
AM_CONDITIONAL(PROFILED_BUILD,true)
else
AM_CONDITIONAL(PROFILED_BUILD,false)
fi
LIBREADLINE=
AS_IF([test "x$with_readline" != xno],
[AC_CHECK_LIB([readline], [main],
[AC_SUBST([LIBREADLINE], ["-lreadline -lncurses"])
AC_DEFINE([HAVE_LIBREADLINE], [1],
[Define if you have libreadline])
],
[AC_MSG_FAILURE(
[readline test failed (--without-readline to disable or install readline-devel)])],
[-lncurses])])
LIBDMALLOC=
AS_IF([test "x$with_dmalloc" != xno],
[AC_CHECK_LIB([dmalloc], [main],
[AC_SUBST([LIBDMALLOC], ["-ldmalloc"])
AC_DEFINE([HAVE_LIBDMALLOC], [1],
[Define if you have libdmalloc])
],
[AC_MSG_FAILURE(
[dmalloc test failed])],
[-ldmalloc])])
if test "x$with_dmalloc" != xno; then
AM_CONDITIONAL(USE_DMALLOC,true)
else
AM_CONDITIONAL(USE_DMALLOC,false)
fi
AC_MSG_CHECKING(for EVIOCGUNIQ)
AC_TRY_COMPILE([
#include <linux/input.h>
], [
#ifndef EVIOCGUNIQ
#error EVIOCGUNIQ not defined
#endif
], HAVE_EVIOCGUNIQ=1,HAVE_EVIOCGUNIQ=0)
AC_SUBST(HAVE_EVIOCGUNIQ)
if test "x${HAVE_EVIOCGUNIQ}" != "x0" ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_EVIOCGUNIQ, [], [Define if <linux/input.h> has EVIOCGUNIQ])
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for int8_t...int64_t)
AC_TRY_COMPILE([
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#define HAVE_SIGNED_BITTYPES
#include "soundmodem/modem.h"
], [], HAVE_SIGNED_BITTYPES=0,HAVE_SIGNED_BITTYPES=1)
AC_SUBST(HAVE_SIGNED_BITTYPES)
if test "x${HAVE_SIGNED_BITTYPES}" != "x0" ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SIGNED_BITTYPES, [],
[change if the typedefs in modem.h cause errors])
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for u_int8_t...u_int64_t)
AC_TRY_COMPILE([
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#define HAVE_UNSIGNED_BITTYPES
#include "soundmodem/modem.h"
], [], HAVE_UNSIGNED_BITTYPES=0,HAVE_UNSIGNED_BITTYPES=1)
AC_SUBST(HAVE_UNSIGNED_BITTYPES)
if test "x${HAVE_SIGNED_BITTYPES}" != "x0" ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_UNSIGNED_BITTYPES, [],
[change if the typedefs in modem.h cause errors])
else
AC_MSG_RESULT(no)
fi
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h sys/signal.h sys/timeb.h)
AC_CHECK_HEADERS(grp.h)
AC_CHECK_HEADERS(math.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
dnl Checks for library functions.
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(getopt)
AC_CHECK_FUNCS(ftime gettimeofday, break)
AC_CHECK_FUNCS(stricmp strcasecmp, break)
AC_DEFINE_UNQUOTED(OUR_HOST,"${host}",
[Set to a text string describing your operating system and hardware])
AC_OUTPUT(Makefile src/Makefile common/Makefile inc/Makefile zlib/Makefile
gsm/Makefile gsm/src/Makefile gsm/inc/Makefile tlbcmd/Makefile
spandsp/Makefile adpcm/Makefile linkbox/Makefile scripts/Makefile
soundmodem/Makefile hrprof/Makefile)