1 # FLAC - Free Lossless Audio Codec
2 # Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson
4 # This file is part the FLAC project. FLAC is comprised of several
5 # components distributed under difference licenses. The codec libraries
6 # are distributed under Xiph.Org's BSD-like license (see the file
7 # COPYING.Xiph in this distribution). All other programs, libraries, and
8 # plugins are distributed under the GPL (see COPYING.GPL). The documentation
9 # is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
10 # FLAC distribution contains at the top the terms under which it may be
13 # Since this particular file is relevant to all components of FLAC,
14 # it may be distributed under the Xiph.Org license, which is the least
15 # restrictive of those mentioned above. See the file COPYING.Xiph in this
18 # NOTE that for many of the AM_CONDITIONALs we use the prefix FLaC__
19 # instead of FLAC__ since autoconf triggers off 'AC_' in strings
21 AC_INIT(src/flac/main.c)
22 AM_INIT_AUTOMAKE(flac, 1.2.1)
24 # Don't automagically regenerate autoconf/automake generated files unless
25 # explicitly requested. Eases autobuilding -mdz
28 # We need two libtools, one that builds both shared and static, and
29 # one that builds only static. This is because the resulting libtool
30 # does not allow us to choose which to build at runtime.
32 sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
33 chmod +x libtool-disable-static
35 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
44 AC_CHECK_SIZEOF(void*,0)
46 #@@@ new name is AC_CONFIG_HEADERS
47 AM_CONFIG_HEADER(config.h)
51 AC_CHECK_TYPES(socklen_t, [], [])
53 dnl check for getopt in standard library
54 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
55 AC_CHECK_FUNCS(getopt_long, [], [])
60 AC_DEFINE(FLAC__CPU_IA32)
61 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
65 AC_DEFINE(FLAC__CPU_PPC)
66 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
70 AC_DEFINE(FLAC__CPU_SPARC)
71 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
74 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
75 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
76 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
79 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
80 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
81 *-*-darwin*) OBJ_FORMAT=macho ;;
86 # only needed because of ntohl() usage, can get rid of after that's gone:
88 *-*-cygwin|*mingw*) MINGW_WINSOCK_LIBS=-lwsock32 ;;
89 *) MINGW_WINSOCK_LIBS= ;;
91 AC_SUBST(MINGW_WINSOCK_LIBS)
96 AC_DEFINE(FLAC__SYS_LINUX)
97 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
101 AC_DEFINE(FLAC__SYS_DARWIN)
102 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
105 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
106 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
108 if test "x$cpu_ia32" = xtrue ; then
109 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
110 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
113 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
114 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
115 if test "x$asm_opt" = xno ; then
116 AC_DEFINE(FLAC__NO_ASM)
117 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
121 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
122 [case "${enableval}" in
125 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
127 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
130 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
131 [case "${enableval}" in
134 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
135 esac],[sse_os=false])
136 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
137 if test "x$sse_os" = xtrue ; then
138 AC_DEFINE(FLAC__SSE_OS)
139 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
143 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
144 [case "${enableval}" in
145 yes) use_3dnow=true ;;
146 no) use_3dnow=false ;;
147 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
148 esac],[use_3dnow=true])
149 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
150 if test "x$use_3dnow" = xtrue ; then
151 AC_DEFINE(FLAC__USE_3DNOW)
152 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
155 AC_ARG_ENABLE(altivec,
156 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
157 [case "${enableval}" in
158 yes) use_altivec=true ;;
159 no) use_altivec=false ;;
160 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
161 esac],[use_altivec=true])
162 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
163 if test "x$use_altivec" = xtrue ; then
164 AC_DEFINE(FLAC__USE_ALTIVEC)
165 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
168 AC_ARG_ENABLE(thorough-tests,
169 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
170 [case "${enableval}" in
171 yes) thorough_tests=true ;;
172 no) thorough_tests=false ;;
173 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
174 esac],[thorough_tests=true])
175 AC_ARG_ENABLE(exhaustive-tests,
176 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
177 [case "${enableval}" in
178 yes) exhaustive_tests=true ;;
179 no) exhaustive_tests=false ;;
180 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
181 esac],[exhaustive_tests=false])
182 if test "x$thorough_tests" = xfalse ; then
184 elif test "x$exhaustive_tests" = xfalse ; then
189 AC_SUBST(FLAC__TEST_LEVEL)
191 AC_ARG_ENABLE(valgrind-testing,
192 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
193 [case "${enableval}" in
194 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
195 no) FLAC__TEST_WITH_VALGRIND=no ;;
196 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
197 esac],[FLAC__TEST_WITH_VALGRIND=no])
198 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
200 AC_ARG_ENABLE(doxygen-docs,
201 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
202 [case "${enableval}" in
203 yes) enable_doxygen_docs=true ;;
204 no) enable_doxygen_docs=false ;;
205 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
206 esac],[enable_doxygen_docs=true])
207 if test "x$enable_doxygen_docs" != xfalse ; then
208 AC_CHECK_PROGS(DOXYGEN, doxygen)
210 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
212 AC_ARG_ENABLE(local-xmms-plugin,
213 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
214 [case "${enableval}" in
215 yes) install_xmms_plugin_locally=true ;;
216 no) install_xmms_plugin_locally=false ;;
217 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
218 esac],[install_xmms_plugin_locally=false])
219 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
221 AC_ARG_ENABLE(xmms-plugin,
222 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
223 [case "${enableval}" in
224 yes) enable_xmms_plugin=true ;;
225 no) enable_xmms_plugin=false ;;
226 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
227 esac],[enable_xmms_plugin=true])
228 if test "x$enable_xmms_plugin" != xfalse ; then
229 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
231 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
233 dnl build FLAC++ or not
234 AC_ARG_ENABLE([cpplibs],
235 AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
236 [case "${enableval}" in
237 yes) disable_cpplibs=false ;;
238 no) disable_cpplibs=true ;;
239 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
240 esac], [disable_cpplibs=false])
241 AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
243 dnl check for ogg library
245 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
246 [ want_ogg=$enableval ], [ want_ogg=yes ] )
248 if test "x$want_ogg" != "xno"; then
249 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
252 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
253 if test "x$have_ogg" = xyes ; then
254 AC_DEFINE(FLAC__HAS_OGG)
255 AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
258 dnl check for i18n(internationalization); these are from libiconv/gettext
262 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
263 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
264 if test -n "$DOCBOOK_TO_MAN" ; then
265 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
266 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
269 # only matters for x86
270 AC_CHECK_PROGS(NASM, nasm)
271 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
272 if test -n "$NASM" ; then
273 AC_DEFINE(FLAC__HAS_NASM)
274 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
277 # only matters for PowerPC
278 AC_CHECK_PROGS(AS, as, as)
279 AC_CHECK_PROGS(GAS, gas, gas)
281 # try -v (apple as) and --version (gas) at the same time
282 test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
284 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
285 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
286 if test "$AS" = "as" ; then
287 AC_DEFINE(FLAC__HAS_AS)
288 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
290 if test "$AS" = "gas" ; then
291 # funniest. macro. ever.
292 AC_DEFINE(FLAC__HAS_GAS)
293 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
296 CPPFLAGS='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'" $CPPFLAGS"
297 if test "x$debug" = xtrue; then
298 CPPFLAGS="-DDEBUG $CPPFLAGS"
301 CPPFLAGS="-DNDEBUG $CPPFLAGS"
302 if test "x$GCC" = xyes; then
303 CPPFLAGS="-DFLaC__INLINE=__inline__ $CPPFLAGS"
304 CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS"
309 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
310 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
315 src/libFLAC/Makefile \
316 src/libFLAC/flac.pc \
317 src/libFLAC/ia32/Makefile \
318 src/libFLAC/ppc/Makefile \
319 src/libFLAC/ppc/as/Makefile \
320 src/libFLAC/ppc/gas/Makefile \
321 src/libFLAC/include/Makefile \
322 src/libFLAC/include/private/Makefile \
323 src/libFLAC/include/protected/Makefile \
324 src/libFLAC++/Makefile \
325 src/libFLAC++/flac++.pc \
327 src/metaflac/Makefile \
328 src/monkeys_audio_utilities/Makefile \
329 src/monkeys_audio_utilities/flac_mac/Makefile \
330 src/monkeys_audio_utilities/flac_ren/Makefile \
331 src/plugin_common/Makefile \
332 src/plugin_winamp2/Makefile \
333 src/plugin_winamp2/include/Makefile \
334 src/plugin_winamp2/include/winamp2/Makefile \
335 src/plugin_xmms/Makefile \
337 src/share/getopt/Makefile \
338 src/share/grabbag/Makefile \
339 src/share/replaygain_analysis/Makefile \
340 src/share/replaygain_synthesis/Makefile \
341 src/share/replaygain_synthesis/include/Makefile \
342 src/share/replaygain_synthesis/include/private/Makefile \
343 src/share/utf8/Makefile \
344 src/test_grabbag/Makefile \
345 src/test_grabbag/cuesheet/Makefile \
346 src/test_grabbag/picture/Makefile \
347 src/test_libs_common/Makefile \
348 src/test_libFLAC/Makefile \
349 src/test_libFLAC++/Makefile \
350 src/test_seeking/Makefile \
351 src/test_streams/Makefile \
353 examples/c/Makefile \
354 examples/c/decode/Makefile \
355 examples/c/decode/file/Makefile \
356 examples/c/encode/Makefile \
357 examples/c/encode/file/Makefile \
358 examples/cpp/Makefile \
359 examples/cpp/decode/Makefile \
360 examples/cpp/decode/file/Makefile \
361 examples/cpp/encode/Makefile \
362 examples/cpp/encode/file/Makefile \
364 include/FLAC/Makefile \
365 include/FLAC++/Makefile \
366 include/share/Makefile \
367 include/share/grabbag/Makefile \
368 include/test_libs_common/Makefile \
371 doc/html/images/Makefile \
372 doc/html/images/hw/Makefile \
373 doc/html/ru/Makefile \
377 test/cuesheets/Makefile \
378 test/flac-to-flac-metadata-test-files/Makefile \
379 test/metaflac-test-files/Makefile \
380 test/pictures/Makefile \
384 obj/debug/bin/Makefile \
385 obj/debug/lib/Makefile \
386 obj/release/Makefile \
387 obj/release/bin/Makefile \
388 obj/release/lib/Makefile \