forked from njh/twolame
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
184 lines (137 loc) · 4.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
dnl Require autoconf version >= 2.68
AC_PREREQ([2.68])
dnl ############# Initialization
AC_INIT(
[TwoLAME],
[0.4.0],
[twolame-discuss@lists.sourceforge.net],
[twolame],
[http://www.twolame.org/])
AC_CONFIG_SRCDIR(libtwolame/twolame.h)
AC_CONFIG_AUX_DIR(build-scripts)
AC_CONFIG_MACRO_DIR(build-scripts)
AM_INIT_AUTOMAKE([1.10])
LT_PREREQ([2.2])
AM_MAINTAINER_MODE
dnl ############# Library Version
dnl
dnl libtool version: current:revision:age
dnl
dnl If the library source code has changed at all since the last update, then
dnl increment revision (`c:r:a' becomes `c:r+1:a').
dnl
dnl If any interfaces have been added, removed, or changed since the last update,
dnl increment current, and set revision to 0.
dnl
dnl If any interfaces have been added since the last public release, then
dnl increment age.
dnl
dnl If any interfaces have been removed since the last public release, then set
dnl age to 0.
dnl
TWOLAME_SO_VERSION=0:0:0
AC_SUBST(TWOLAME_SO_VERSION)
dnl ############# Compiler and tools Checks
AM_PROG_AR
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_INSTALL
AC_PROG_LN_S
LT_INIT([win32-dll])
AC_C_BIGENDIAN
AC_C_INLINE
AC_C_CONST
if test "$USE_MAINTAINER_MODE" = yes; then
AC_PATH_PROG([PATH_ASCIIDOC], [asciidoc])
if test -z "$PATH_ASCIIDOC"; then
AC_MSG_ERROR([asciidoc is not available and maintainer mode is enabled])
fi
AC_PATH_PROG([PATH_DOXYGEN], [doxygen])
if test -z "$PATH_DOXYGEN"; then
AC_MSG_ERROR([doxygen is not available and maintainer mode is enabled])
fi
AC_PATH_PROG([PATH_XMLTO], [xmlto])
if test -z "$PATH_XMLTO"; then
AC_MSG_ERROR([xmlto is not available and maintainer mode is enabled])
fi
fi
AC_PATH_PROG(PERL, perl)
if test -z "$PERL"; then
AC_MSG_WARN([perl is needed to run the test suite])
fi
dnl ############## Check that types are the right size
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(float)
if test "$ac_cv_sizeof_short" != "2"; then
AC_MSG_ERROR([Size of short isn't 16-bits - please report this to $PACKAGE_BUGREPORT])
fi
if test "$ac_cv_sizeof_float" != "4"; then
AC_MSG_ERROR([Size of float isn't 32-bits - please report this to $PACKAGE_BUGREPORT])
fi
dnl ############## Library Checks
AC_CHECK_LIB([m], [sqrt])
AC_CHECK_LIB([m], [lrintf])
AC_CHECK_LIB([mx], [powf])
AC_ARG_ENABLE(sndfile,
[ --enable-sndfile libsndfile support (default: enabled)])
if test "${enable_sndfile}" != "no" ; then
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
[ HAVE_SNDFILE="yes" ],
[ AC_CHECK_LIB( [sndfile], [sf_command],
[ AC_CHECK_HEADER( [sndfile.h],
[ HAVE_SNDFILE="yes"
SNDFILE_CFLAGS=""
SNDFILE_LIBS="-lsndfile" ],
[ AC_MSG_WARN([Can't find sndfile.h on your system]) ] ) ],
[ AC_MSG_WARN([Can't find libsndfile library on your system]) ]
) ]
)
fi
AC_SUBST(SNDFILE_CFLAGS)
AC_SUBST(SNDFILE_LIBS)
dnl ############## Header Checks
AC_HEADER_STDC
AC_CHECK_HEADERS(malloc.h assert.h unistd.h inttypes.h)
AC_CHECK_HEADER(getopt.h,
[ HAVE_GETOPT_H="yes" ],
[ HAVE_GETOPT_H="no"
AC_MSG_WARN([getopt.h is unavailable on your system]) ]
)
dnl ############## Only compile frontend if sndfile is available
TWOLAME_BIN=""
if test "x$HAVE_SNDFILE" = "xyes"; then
if test "$HAVE_GETOPT_H" = "yes"; then
TWOLAME_BIN="twolame${EXEEXT}"
else
AC_MSG_WARN([Not building twolame frontend because getopt.h is missing.])
fi
else
AC_MSG_WARN([Not building twolame frontend because libsndfile is missing.])
fi
AC_SUBST(TWOLAME_BIN)
dnl ############## Compiler and Linker Flags
# If maintainer mode is enabled then make warnings errors
if test "$USE_MAINTAINER_MODE" = yes; then
WARNING_CFLAGS="-Wall -Werror -pedantic -Wunused"
WARNING_CFLAGS="$WARNING_CFLAGS -Wmissing-prototypes -Wmissing-declarations"
AC_SUBST(WARNING_CFLAGS)
fi
dnl Required for linking binaries to static lib
if test $enable_static = yes; then
CFLAGS+=" -DLIBTWOLAME_STATIC"
fi
dnl ############## Output files
AC_CONFIG_HEADERS([libtwolame/config.h])
AC_CONFIG_FILES([
Makefile \
twolame.pc \
twolame.spec \
doc/Makefile \
doc/html/Makefile \
doc/html/Doxyfile \
libtwolame/Makefile \
frontend/Makefile \
simplefrontend/Makefile \
tests/Makefile \
])
AC_OUTPUT