-
Notifications
You must be signed in to change notification settings - Fork 118
/
configure.ac
93 lines (80 loc) · 2.5 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
AC_PREREQ([2.64])
AC_INIT([minimodem], [0.24], [[email protected]])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/Makefile.in])
AM_INIT_AUTOMAKE
VERSION=AC_PACKAGE_VERSION
AC_SUBST(VERSION)
# Program Checks
AC_PROG_CC
# Library Checks
AC_SEARCH_LIBS([lroundf], [m])
deps_packages="fftw3f"
# ALSA
AC_ARG_WITH([alsa], [AS_HELP_STRING([--without-alsa],
[build without ALSA support])])
AS_IF([test "x$with_alsa" = "xno"], [
use_alsa=0
], [
use_alsa=1
deps_packages="$deps_packages alsa"
])
AC_DEFINE_UNQUOTED([USE_ALSA], [$use_alsa],
[Define to 1 to enable ALSA support])
# pulseaudio
AC_ARG_WITH([pulseaudio], AS_HELP_STRING([--without-pulseaudio],
[build without pulseaudio support]))
AS_IF([test "x$with_pulseaudio" = "xno"], [
use_pulseaudio=0
], [
use_pulseaudio=1
deps_packages="$deps_packages libpulse-simple"
])
AC_DEFINE_UNQUOTED([USE_PULSEAUDIO], [$use_pulseaudio],
[Define to 1 to enable pulseaudio support])
# sndio
AC_ARG_WITH([sndio], AS_HELP_STRING([--without-sndio],
[build without sndio support]))
AS_IF([test "x$with_sndio" = "xno"], [
use_sndio=0
], [
use_sndio=1
AC_LANG_PUSH(C)
AC_CHECK_LIB(sndio, sio_start)
])
AC_DEFINE_UNQUOTED([USE_SNDIO], [$use_sndio],
[Define to 1 to enable sndio support])
# sndfile
AC_ARG_WITH([sndfile], AS_HELP_STRING([--without-sndfile],
[build without sndfile support]))
AS_IF([test "x$with_sndfile" = "xno"], [
use_sndfile=0
], [
use_sndfile=1
deps_packages="$deps_packages sndfile"
])
AC_DEFINE_UNQUOTED([USE_SNDFILE], [$use_sndfile],
[Define to 1 to enable sndfile support])
# benchmarks
AC_ARG_WITH([benchmarks], AS_HELP_STRING([--disable-benchmarks],
[build without internal benchmarks]))
AS_IF([test "x$with_benchmarks" = "xno"], [
use_benchmarks=0
], [
use_benchmarks=1
])
AC_DEFINE_UNQUOTED([USE_BENCHMARKS], [$use_benchmarks],
[Define to 1 to enable internal benchmarks])
AC_MSG_RESULT([
option summary:
alsa $with_alsa ($use_alsa)
benchmarks $with_benchmarks ($use_benchmarks)
pulseaudio $with_pulseaudio ($use_pulseaudio)
sndfile $with_sndfile ($use_sndfile)
sndio $with_sndio ($use_sndio)
])
# Checks for libraries.
PKG_CHECK_MODULES(DEPS, [$deps_packages])
AC_SUBST([auto_find_tests], ['$(sort $(wildcard *.test))'])
AC_CONFIG_FILES([Makefile src/Makefile src/minimodem.1 tests/Makefile])
AC_OUTPUT