-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure.ac
500 lines (410 loc) · 11.1 KB
/
configure.ac
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
#
# vStuff main Makefile
#
# Copyright (C) 2004-2007 Daniele Orlandi
#
# Authors: Daniele "Vihai" Orlandi <[email protected]>
#
# This program is free software and may be modified and distributed
# under the terms and conditions of the GNU General Public License.
#
AC_PREREQ(2.59)
AC_INIT(vstuff, head, [email protected])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(-Wall)
AC_CONFIG_SRCDIR([chan_visdn/chan_visdn.c])
AC_CONFIG_HEADER([config.h])
## Checks for libraries.
## FIXME: Replace `main' with a function in `-lq931':
#AC_CHECK_LIB([q931], [main])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PROG_AWK
AC_PROG_YACC
AC_PROG_LEX
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gettimeofday memset select socket strcasecmp strchr strdup strerror strncasecmp strrchr strstr])
visdnhwconfdir="$sysconfdir/visdn"
AC_SUBST(visdnhwconfdir)
#-------------------------------------------------------------------------
AC_ARG_WITH(zlib,
AC_HELP_STRING( [--with-zlib@<:@=DIR@:>@],
[use zlib (located in directory DIR, if supplied). @<:@default=yes, if available@:>@]),
[
if test $withval = no
then
want_zlib=no
elif test $withval = yes
then
want_zlib=yes
else
want_zlib=yes
zlib_dir=$withval
fi
],[
want_zlib=yes
zlib_dir=
])
AC_MSG_CHECKING([zlib])
AC_VSTUFF_ZLIB_CHECK
if test "x$want_zlib" = "xno" ; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([zlib not found])
fi
#-----------------------------------------------------------------------------
AC_ARG_ENABLE(
[kernel-modules],
AC_HELP_STRING(
[--enable-kernel-modules],
[Enable kernel modules]),
[enable_kernel_modules="$enableval"],
[enable_kernel_modules="auto"])
if [[ "$enable_kernel_modules" != "no" ]]; then
AC_MSG_CHECKING([kernel build directory])
AC_ARG_WITH(
[kernel-build],
AC_HELP_STRING(
[--with-kernel-build=DIR],
[Specify kernel build environment for external modules \ compilation]),
[kblddir=$withval],
[
if [[ -d "/lib/modules/`uname -r`/build" ]]; then
kblddir="/lib/modules/`uname -r`/build"
elif [[ -d "/usr/src/linux" ]]; then
kblddir="/usr/src/linux"
fi
])
if [[ "$enable_kernel_modules" = "yes" -o \
"$enable_kernel_modules" = "auto" ]]; then
if [[ ! -d "$kblddir" ]]; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([Cannot locate kernel sources])
fi
if [[ ! -f "$kblddir/.config" ]]; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([Kernel build environment is missing .config \
(missing .config)])
fi
if [[ ! -f "$kblddir/include/linux/kernel.h" ]]; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([Kernel build environment is missing \
include/linux/kernel.h])
fi
fi
AC_SUBST(kblddir)
AC_MSG_RESULT([$kblddir])
fi
AM_CONDITIONAL(kernel_modules, test "$enable_kernel_modules" != "no")
#-----------------------------------------------------------------------------
AC_ARG_ENABLE(
[asterisk-modules],
AC_HELP_STRING(
[--enable-asterisk-modules],
[Enable asterisk modules]),
[enable_asterisk_modules="$enableval"],
[enable_asterisk_modules="auto"])
if [[ "$enable_asterisk_modules" != "no" ]]; then
AC_MSG_CHECKING([asterisk modules directory])
AC_ARG_WITH(
[asterisk-modules],
AC_HELP_STRING(
[--with-asterisk-modules=DIR],
[Specify asterisk modules directory]),
[astmoddir=$withval],
[
if [[ -d "/usr/lib/asterisk/modules" ]]; then
astmoddir="/usr/lib/asterisk/modules"
else
enable_asterisk_modules="no"
fi
])
if [[ "$enable_asterisk_modules" = "yes" ]]; then
if [[ ! -d "$astmoddir" ]]; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([Cannot locate asterisk modules directory])
fi
fi
AC_SUBST(astmoddir)
AC_MSG_RESULT([$astmoddir])
#----------------
AC_MSG_CHECKING([asterisk includes])
AC_ARG_WITH(
[asterisk-includes],
AC_HELP_STRING(
[--with-asterisk-includes=DIR],
[Specify asterisk includes directory (the prefix before \
asterisk/)]),
[astincdir=$withval],
[
if [[ -d "/usr/include/asterisk" ]]; then
astincdir="/usr/include/"
else
enable_asterisk_modules="no"
fi
])
if [[ "$enable_asterisk_modules" = "yes" ]]; then
if [[ ! -d "$astincdir/asterisk" ]]; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([Cannot locate asterisk includes directory])
fi
fi
CPPFLAGS="$CPPFLAGS -I$astincdir"
AC_SUBST(astincdir)
AC_MSG_RESULT([$astincdir])
AC_CHECK_HEADERS(asterisk/version.h)
#---------------
AC_MSG_CHECKING([asterisk configuration directory])
AC_ARG_WITH(
[asterisk-config],
AC_HELP_STRING(
[--with-asterisk-config=DIR],
[Specify asterisk configuration directory]),
[astconfdir=$withval],
[
if [[ -d "/etc/asterisk" ]]; then
astconfdir="/etc/asterisk"
else
enable_asterisk_modules="no"
fi
])
if [[ "$enable_asterisk_modules" = "yes" ]]; then
if [[ ! -d "$astconfdir" ]]; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([Cannot locate asterisk config directory])
fi
fi
AC_MSG_RESULT([$astconfdir])
AC_SUBST(astconfdir)
fi
AM_CONDITIONAL(asterisk_modules, test "$enable_asterisk_modules" != "no")
#-----------------------------------------------------------------------------
AC_ARG_ENABLE(
[pppd-plugin],
AC_HELP_STRING(
[--enable-pppd-plugin],
[Enable pppd plugin]),
[enable_pppd="$enableval"],
[enable_pppd="auto"])
if [[ "$enable_pppd" != "no" ]]; then
AC_MSG_CHECKING([pppd plugins directory])
AC_ARG_WITH(
[pppd-plugins],
AC_HELP_STRING(
[--with-pppd-plugins=DIR],
[Specify PPPD plugins directory]),
[pppdpluginsdir="$withval"],
[
if [[ -d "/usr/lib/pppd/" -a \
-d "/usr/lib/pppd/`/bin/ls -Ar1 /usr/lib/pppd/ \
| head -n 1`" ]]; then
pppdpluginsdir="/usr/lib/pppd/`/bin/ls -Ar1 \
/usr/lib/pppd/ | head -n 1`"
else
enable_pppd="no"
fi
])
if [[ "$enable_pppd" = "yes" ]]; then
if [[ ! -d "$pppdpluginsdir" ]]; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([Cannot locate pppd plugins directory])
fi
fi
AC_SUBST(pppdpluginsdir)
AC_MSG_RESULT([$pppdpluginsdir])
#----------
AC_MSG_CHECKING([pppd includes directory])
AC_ARG_WITH(
[pppd-includes],
AC_HELP_STRING(
[--with-pppd-includes],
[Specify pppd includes directory]),
[pppdincdir=$withval],
[
if [[ -d "/usr/include/pppd/" ]]; then
pppdincdir="/usr/include/pppd/"
if [[ ! -f "$pppdincdir/pppd.h" -o \
! -f "$pppdincdir/fsm.h" -o \
! -f "$pppdincdir/lcp.h" ]]; then
enable_pppd="no"
fi
else
enable_pppd="no"
fi
])
if [[ "$enable_pppd" = "yes" ]]; then
if [[ ! -d "$pppdincdir" ]]; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([Cannot locate pppd includes directory])
fi
if [[ ! -f "$pppdincdir/pppd.h" -o \
! -f "$pppdincdir/fsm.h" -o \
! -f "$pppdincdir/lcp.h" ]]; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([Missing pppd headers])
fi
fi
AC_MSG_RESULT([$pppdincdir])
AC_SUBST(pppdincdir)
#------------
AC_MSG_CHECKING([pppd config directory])
AC_ARG_WITH(
[pppd-config],
AC_HELP_STRING(
[--with-pppd-config],
[Specify pppd configuration directory]),
[pppdconfdir=$withval],
[
if [[ -d "/etc/ppp/" ]]; then
pppdconfdir="/etc/ppp/"
else
enable_pppd="no"
fi
]
)
if [[ "$enable_pppd" = "yes" ]]; then
if [[ ! -d $pppdconfdir ]]; then
AC_MSG_RESULT([failed!])
AC_MSG_ERROR([Cannot locate pppd configuration directory])
fi
fi
AC_SUBST(pppdconfdir)
AC_MSG_RESULT([$pppdconfdir])
fi
AM_CONDITIONAL(pppd_plugin, test "$enable_pppd" != "no")
#-----------------------------------------------------------------------------
AC_ARG_ENABLE(
[tests],
AC_HELP_STRING(
[--enable-tests],
[Enable testing tools]),
[enable_tests="$enableval"],
[enable_tests="no"])
AM_CONDITIONAL(tests, test "$enable_tests" != "no")
#-----------------------------------------------------------------------------
enable_debug_code="yes"
AC_ARG_ENABLE(
[debug-code],
AC_HELP_STRING(
[--enable-debug],
[Debugging code]))
AC_SUBST(enable_debug_code)
if [[ "$enable_debug_code" = "yes" ]]; then
AC_DEFINE(DEBUG_CODE, 1, [Debugging code])
fi
#-----------------------------------------------------------------------------
AC_ARG_ENABLE(
[debug-defaults],
AC_HELP_STRING(
[--enable-debug-defaults],
[Debugging defaults]))
AC_SUBST(enable_debug_defaults)
if [[ "$enable_debug_defaults" = "yes" ]]; then
AC_DEFINE(DEBUG_DEFAULTS, 1, [Debugging defaults])
fi
#-----------------------------------------------------------------------------
AC_ARG_ENABLE(
[inline],
AC_HELP_STRING(
[--disable-inline],
[Disable code inlining where possible (for debugging)]))
AM_CONDITIONAL(inline, test "$enable_inline" != no)
#-----------------------------------------------------------------------------
AC_ARG_ENABLE(
[astmm],
AC_HELP_STRING(
[--enable-astmm],
[Enable Asterisk's Memory Debugger]))
AM_CONDITIONAL(astmm, test "$enable_astmm" = yes)
#-----------------------------------------------------------------------------
drivers="hfc-pci, hfc-4s, hfc-usb"
AC_ARG_ENABLE(
[drivers],
AC_HELP_STRING(
[--enable-drivers=<list>],
[Enable drivers (comma separated list of driver names), \
currently supported: hfc-usb, hfc-pci, hfc-4s, hfc-e1, vgsm, vgsm2, vdsp]),
drivers="$enableval")
AM_CONDITIONAL(driver_hfc_usb,
test -n "`echo $drivers | grep hfc-usb`" || test "$drivers" = "all")
AM_CONDITIONAL(driver_hfc_pci,
test -n "`echo $drivers | grep hfc-pci`" || test "$drivers" = "all")
AM_CONDITIONAL(driver_hfc_4s,
test -n "`echo $drivers | grep hfc-4s`" || test "$drivers" = "all")
AM_CONDITIONAL(driver_hfc_e1,
test -n "`echo $drivers | grep hfc-e1`" || test "$drivers" = "all")
AM_CONDITIONAL(driver_vgsm,
test -n "`echo $drivers | grep vgsm`" || test "$drivers" = "all")
AM_CONDITIONAL(driver_vgsm2,
test -n "`echo $drivers | grep vgsm2`" || test "$drivers" = "all")
AM_CONDITIONAL(driver_vdsp,
test -n "`echo $drivers | grep vdsp`" || test "$drivers" = "all")
AC_CONFIG_FILES([Makefile
tools/Makefile
libskb/Makefile
libkstreamer/Makefile
libq931/Makefile
res_kstreamer/Makefile
chan_visdn/Makefile
chan_vgsm/Makefile
app_pipe/Makefile
kstool/Makefile
visdn_netdev_ctl/Makefile
vgsmctl/Makefile
vgsm2test/Makefile
pppd_plugin/Makefile
samples/Makefile
unsupported/Makefile
tests/Makefile
modules/include/kernel_config.h
modules/Makefile
modules/kstreamer/Makefile
modules/visdn/Makefile
modules/lapd/Makefile
modules/softswitch/Makefile
modules/userport/Makefile
modules/netdev/Makefile
modules/ppp/Makefile
modules/ec/Makefile
modules/milliwatt/Makefile
modules/hfc-4s/Makefile
modules/hfc-e1/Makefile
modules/hfc-pci/Makefile
modules/hfc-usb/Makefile
modules/vgsm/Makefile
modules/vgsm2/Makefile
modules/vdsp/Makefile
scripts/Makefile
scripts/visdn_configurator
doxygen.conf
rpm/vstuff-centos-kmod-el5.spec
rpm/vstuff-centos.spec
rpm/vstuff-suse.spec
])
# modules/hfc-e1/Makefile
AC_OUTPUT