1 # FLAC - Free Lossless Audio Codec
2 # Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008,2009 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)
23 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25 # Enable the generation of shared libraries under Win32
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)
52 if test $ac_cv_c_vararrays = yes; then
53 AC_DEFINE([HAVE_CXX_VARARRAYS], 1, [Define to 1 if C++ supports variable-length arrays.])
59 AC_CHECK_HEADERS(stdint.h)
60 AC_SUBST(HAVE_STDINT_H)
61 AC_CHECK_HEADERS(inttypes.h)
62 AC_SUBST(HAVE_INTTYPES_H)
63 AC_CHECK_HEADERS(byteswap.h)
64 AC_SUBST(HAVE_BYTESWAP_H)
71 AC_CHECK_TYPES(socklen_t, [], [])
73 dnl check for getopt in standard library
74 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
75 AC_CHECK_FUNCS(getopt_long, [], [])
80 AC_DEFINE(FLAC__CPU_IA32)
81 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
85 AC_DEFINE(FLAC__CPU_PPC)
86 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
90 AC_DEFINE(FLAC__CPU_SPARC)
91 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
94 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
95 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
96 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
99 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
100 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
101 *-*-darwin*) OBJ_FORMAT=macho ;;
107 *-*-cygwin|*mingw*|*emx*)
108 # define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
109 LT_NO_UNDEFINED="-no-undefined"
115 AC_SUBST(LT_NO_UNDEFINED)
120 AC_DEFINE(FLAC__SYS_LINUX)
121 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
125 AC_DEFINE(FLAC__SYS_DARWIN)
126 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
129 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
130 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
132 if test "x$cpu_ia32" = xtrue ; then
133 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
134 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
137 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
138 dnl ' Terminate the damn single quote
139 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
140 if test "x$asm_opt" = xno ; then
141 AC_DEFINE(FLAC__NO_ASM)
142 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
146 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
147 [case "${enableval}" in
150 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
152 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
155 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
156 [case "${enableval}" in
159 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
160 esac],[sse_os=false])
161 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
162 if test "x$sse_os" = xtrue ; then
163 AC_DEFINE(FLAC__SSE_OS)
164 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
168 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
169 [case "${enableval}" in
170 yes) use_3dnow=true ;;
171 no) use_3dnow=false ;;
172 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
173 esac],[use_3dnow=true])
174 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
175 if test "x$use_3dnow" = xtrue ; then
176 AC_DEFINE(FLAC__USE_3DNOW)
177 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
180 AC_ARG_ENABLE(altivec,
181 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
182 [case "${enableval}" in
183 yes) use_altivec=true ;;
184 no) use_altivec=false ;;
185 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
186 esac],[use_altivec=true])
187 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
188 if test "x$use_altivec" = xtrue ; then
189 AC_DEFINE(FLAC__USE_ALTIVEC)
190 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
193 AC_ARG_ENABLE(thorough-tests,
194 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
195 [case "${enableval}" in
196 yes) thorough_tests=true ;;
197 no) thorough_tests=false ;;
198 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
199 esac],[thorough_tests=true])
200 AC_ARG_ENABLE(exhaustive-tests,
201 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
202 [case "${enableval}" in
203 yes) exhaustive_tests=true ;;
204 no) exhaustive_tests=false ;;
205 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
206 esac],[exhaustive_tests=false])
207 if test "x$thorough_tests" = xfalse ; then
209 elif test "x$exhaustive_tests" = xfalse ; then
214 AC_SUBST(FLAC__TEST_LEVEL)
216 AC_ARG_ENABLE(gcc-werror,
217 AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]))
219 AC_ARG_ENABLE(valgrind-testing,
220 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
221 [case "${enableval}" in
222 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
223 no) FLAC__TEST_WITH_VALGRIND=no ;;
224 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
225 esac],[FLAC__TEST_WITH_VALGRIND=no])
226 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
228 AC_ARG_ENABLE(doxygen-docs,
229 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
230 [case "${enableval}" in
231 yes) enable_doxygen_docs=true ;;
232 no) enable_doxygen_docs=false ;;
233 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
234 esac],[enable_doxygen_docs=true])
235 if test "x$enable_doxygen_docs" != xfalse ; then
236 AC_CHECK_PROGS(DOXYGEN, doxygen)
238 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
240 AC_ARG_ENABLE(local-xmms-plugin,
241 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
242 [case "${enableval}" in
243 yes) install_xmms_plugin_locally=true ;;
244 no) install_xmms_plugin_locally=false ;;
245 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
246 esac],[install_xmms_plugin_locally=false])
247 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
249 AC_ARG_ENABLE(xmms-plugin,
250 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
251 [case "${enableval}" in
252 yes) enable_xmms_plugin=true ;;
253 no) enable_xmms_plugin=false ;;
254 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
255 esac],[enable_xmms_plugin=true])
256 if test "x$enable_xmms_plugin" != xfalse ; then
257 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
259 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
261 dnl build FLAC++ or not
262 AC_ARG_ENABLE([cpplibs],
263 AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
264 [case "${enableval}" in
265 yes) disable_cpplibs=false ;;
266 no) disable_cpplibs=true ;;
267 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
268 esac], [disable_cpplibs=false])
269 AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
271 dnl check for ogg library
273 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
274 [ want_ogg=$enableval ], [ want_ogg=yes ] )
276 if test "x$want_ogg" != "xno"; then
277 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
280 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
281 if test "x$have_ogg" = xyes ; then
282 AC_DEFINE(FLAC__HAS_OGG)
283 AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
286 dnl check for i18n(internationalization); these are from libiconv/gettext
290 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
291 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
292 if test -n "$DOCBOOK_TO_MAN" ; then
293 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
294 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
297 # only matters for x86
298 AC_CHECK_PROGS(NASM, nasm)
299 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
300 if test -n "$NASM" ; then
301 AC_DEFINE(FLAC__HAS_NASM)
302 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
305 # only matters for PowerPC
306 AC_CHECK_PROGS(AS, as, as)
307 AC_CHECK_PROGS(GAS, gas, gas)
309 # try -v (apple as) and --version (gas) at the same time
310 test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
312 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
313 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
314 if test "$AS" = "as" ; then
315 AC_DEFINE(FLAC__HAS_AS)
316 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
318 if test "$AS" = "gas" ; then
319 # funniest. macro. ever.
320 AC_DEFINE(FLAC__HAS_GAS)
321 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
324 CPPFLAGS='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'" $CPPFLAGS"
325 if test "x$debug" = xtrue; then
326 CPPFLAGS="-DDEBUG -DFLaC__INLINE= $CPPFLAGS"
329 CPPFLAGS="-DNDEBUG $CPPFLAGS"
330 # $ac_cv_c_inline from AC_C_INLINE
331 if test "x$ac_cv_c_inline" != xno ; then
332 CPPFLAGS="-DFLaC__INLINE=$ac_cv_c_inline $CPPFLAGS"
334 if test "x$GCC" = xyes; then
335 CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS"
340 if test x$ac_cv_c_compiler_gnu = xyes ; then
341 if test x$enable_gcc_werror = "xyes" ; then
342 CFLAGS="-Werror $CFLAGS"
343 CXXFLAGS="-Werror $CXXFLAGS"
349 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
350 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
355 src/libFLAC/Makefile \
356 src/libFLAC/flac.pc \
357 src/libFLAC/ia32/Makefile \
358 src/libFLAC/ppc/Makefile \
359 src/libFLAC/ppc/as/Makefile \
360 src/libFLAC/ppc/gas/Makefile \
361 src/libFLAC/include/Makefile \
362 src/libFLAC/include/private/Makefile \
363 src/libFLAC/include/protected/Makefile \
364 src/libFLAC++/Makefile \
365 src/libFLAC++/flac++.pc \
367 src/metaflac/Makefile \
368 src/monkeys_audio_utilities/Makefile \
369 src/monkeys_audio_utilities/flac_mac/Makefile \
370 src/monkeys_audio_utilities/flac_ren/Makefile \
371 src/plugin_common/Makefile \
372 src/plugin_winamp2/Makefile \
373 src/plugin_winamp2/include/Makefile \
374 src/plugin_winamp2/include/winamp2/Makefile \
375 src/plugin_xmms/Makefile \
377 src/share/getopt/Makefile \
378 src/share/grabbag/Makefile \
379 src/share/replaygain_analysis/Makefile \
380 src/share/replaygain_synthesis/Makefile \
381 src/share/replaygain_synthesis/include/Makefile \
382 src/share/replaygain_synthesis/include/private/Makefile \
383 src/share/utf8/Makefile \
384 src/test_grabbag/Makefile \
385 src/test_grabbag/cuesheet/Makefile \
386 src/test_grabbag/picture/Makefile \
387 src/test_libs_common/Makefile \
388 src/test_libFLAC/Makefile \
389 src/test_libFLAC++/Makefile \
390 src/test_seeking/Makefile \
391 src/test_streams/Makefile \
393 src/utils/flacdiff/Makefile \
394 src/utils/flactimer/Makefile \
396 examples/c/Makefile \
397 examples/c/decode/Makefile \
398 examples/c/decode/file/Makefile \
399 examples/c/encode/Makefile \
400 examples/c/encode/file/Makefile \
401 examples/cpp/Makefile \
402 examples/cpp/decode/Makefile \
403 examples/cpp/decode/file/Makefile \
404 examples/cpp/encode/Makefile \
405 examples/cpp/encode/file/Makefile \
407 include/FLAC/Makefile \
408 include/FLAC++/Makefile \
409 include/share/Makefile \
410 include/share/grabbag/Makefile \
411 include/test_libs_common/Makefile \
414 doc/html/images/Makefile \
415 doc/html/images/hw/Makefile \
416 doc/html/ru/Makefile \
420 test/cuesheets/Makefile \
421 test/flac-to-flac-metadata-test-files/Makefile \
422 test/metaflac-test-files/Makefile \
423 test/pictures/Makefile \
427 obj/debug/bin/Makefile \
428 obj/debug/lib/Makefile \
429 obj/release/Makefile \
430 obj/release/bin/Makefile \
431 obj/release/lib/Makefile \