forked from mpruett/audiofile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
171 lines (145 loc) · 4.11 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT([audiofile], [0.3.6])
AC_CONFIG_SRCDIR([libaudiofile/AIFF.cpp])
dnl Set libtool version information.
AUDIOFILE_VERSION_INFO=1:0:0
AUDIOFILE_VERSION=$PACKAGE_VERSION
AC_SUBST(AUDIOFILE_VERSION)
AC_SUBST(AUDIOFILE_VERSION_INFO)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([config.h])
dnl Checks for programs.
AC_PROG_CC_C99
AC_PROG_CXX
AC_PROG_INSTALL
AM_PROG_LIBTOOL
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_BIGENDIAN
dnl Enable large file support by default.
AC_SYS_LARGEFILE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
dnl Set up platform specific stuff
platform=none
AC_MSG_CHECKING([for platform specific tests to compile])
case "$host_os" in
linux*)
TEST_BIN="linuxtest alsaplay"
platform=linux
;;
irix5* | irix6*)
TEST_BIN="irixread irixtestloop"
platform=irix
;;
darwin*)
if test -e /System/Library/Frameworks/CoreAudio.framework; then
TEST_BIN="osxplay"
platform="Mac OS X"
fi
;;
esac
AC_MSG_RESULT($platform)
AC_SUBST(TEST_BIN)
AC_ARG_ENABLE(werror,
AS_HELP_STRING([--enable-werror], [treat compiler warnings as errors]),
[enable_werror=$enableval],
[enable_werror=no])
AM_CONDITIONAL(ENABLE_WERROR, [test "$enable_werror" = "yes"])
AS_IF([test "$enable_werror" = "yes"],
[WERROR_CFLAGS="-Werror"
AC_SUBST(WERROR_CFLAGS)])
AC_ARG_ENABLE(coverage,
AS_HELP_STRING([--enable-coverage], [enable code coverage]),
[enable_coverage=$enableval],
[enable_coverage=no])
AM_CONDITIONAL(ENABLE_COVERAGE, [test "$enable_coverage" = "yes"])
AS_IF([test "$enable_coverage" = "yes"],
[COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
COVERAGE_LIBS="-lgcov"
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_LIBS)
AC_PATH_PROG(LCOV, lcov, :)
AC_PATH_PROG(GENHTML, genhtml, :)
AC_SUBST(LCOV)
AC_SUBST(GENHTML)
AS_IF([test "$LCOV" = :],
[AC_MSG_ERROR([lcov must be installed for code coverage: http://ltp.sourceforge.net/coverage/lcov.php])]
)]
)
AC_ARG_ENABLE(valgrind,
AS_HELP_STRING([--enable-valgrind], [enable testing with Valgrind]),
[enable_valgrind=$enableval],
[enable_valgrind=no])
AM_CONDITIONAL(ENABLE_VALGRIND, [test "$enable_valgrind" = "yes"])
AS_IF([test "$enable_valgrind" = "yes"],
[AC_PATH_PROG(VALGRIND, valgrind, :)
AC_SUBST(VALGRIND)
AS_IF([test "$VALGRIND" = :],
[AC_MSG_ERROR([Could not find Valgrind.])]
)]
)
AC_ARG_ENABLE(docs,
AS_HELP_STRING([--disable-docs], [disable documentation]),
[enable_documentation=$enableval],
[enable_documentation=yes])
AM_CONDITIONAL(ENABLE_DOCUMENTATION, [test "$enable_documentation" = "yes"])
AS_IF([test "$enable_documentation" = "yes"],
[AC_PATH_PROG(A2X, a2x, :)
AC_PATH_PROG(ASCIIDOC, asciidoc, :)
AS_IF([test "$A2X" = :],
[AC_MSG_WARN([Could not find a2x.])]
)
AS_IF([test "$ASCIIDOC" = :],
[AC_MSG_WARN([Could not find asciidoc.])]
)]
)
AC_ARG_ENABLE(examples,
AS_HELP_STRING([--disable-examples], [disable examples]),
[enable_examples=$enableval],
[enable_examples=yes])
AS_IF([test "$enable_examples" != "yes"], [TEST_BIN=""])
AC_ARG_ENABLE(flac,
AS_HELP_STRING([--disable-flac], [disable FLAC]),
[enable_flac=$enableval],
[enable_flac=yes])
PKG_PROG_PKG_CONFIG
PKG_INSTALLDIR
FLAC_CFLAGS=""
FLAC_LIBS=""
if test -n "$PKG_CONFIG" ; then
if test "$enable_flac" = "yes" ; then
PKG_CHECK_MODULES([FLAC], [flac >= 1.2.1], [ac_cv_flac=yes], [ac_cv_flac=no])
FLAC_CFLAGS=`echo $FLAC_CFLAGS | $SED "s:include/FLAC:include:"`
if test "$ac_cv_flac" = "no" ; then
enable_flac=no
fi
fi
else
enable_flac=no
fi
AC_SUBST(FLAC_CFLAGS)
AC_SUBST(FLAC_LIBS)
AM_CONDITIONAL(ENABLE_FLAC, [test "$enable_flac" = "yes"])
if test "$enable_flac" = "yes" ; then
AC_DEFINE_UNQUOTED([ENABLE_FLAC], [1], [Whether FLAC is enabled.])
else
AC_DEFINE_UNQUOTED([ENABLE_FLAC], [0], [Whether FLAC is enabled.])
fi
AC_CONFIG_FILES([
audiofile.spec
audiofile.pc
audiofile-uninstalled.pc
sfcommands/Makefile
test/Makefile
gtest/Makefile
examples/Makefile
libaudiofile/Makefile
libaudiofile/alac/Makefile
libaudiofile/modules/Makefile
docs/Makefile
Makefile])
AC_OUTPUT