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 AM_SILENT_RULES([yes])
25 # Don't automagically regenerate autoconf/automake generated files unless
26 # explicitly requested. Eases autobuilding -mdz
29 # Enable the generation of shared libraries under Win32
32 # We need two libtools, one that builds both shared and static, and
33 # one that builds only static. This is because the resulting libtool
34 # does not allow us to choose which to build at runtime.
36 sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
37 chmod +x libtool-disable-static
39 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
48 AC_CHECK_SIZEOF(void*,0)
50 #@@@ new name is AC_CONFIG_HEADERS
51 AM_CONFIG_HEADER(config.h)
56 if test $ac_cv_c_vararrays = yes; then
57 AC_DEFINE([HAVE_CXX_VARARRAYS], 1, [Define to 1 if C++ supports variable-length arrays.])
63 AC_CHECK_HEADERS(inttypes.h)
70 AC_CHECK_TYPES(socklen_t, [], [])
72 dnl check for getopt in standard library
73 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
74 AC_CHECK_FUNCS(getopt_long, [], [])
79 AC_DEFINE(FLAC__CPU_IA32)
80 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
84 AC_DEFINE(FLAC__CPU_PPC)
85 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
89 AC_DEFINE(FLAC__CPU_SPARC)
90 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
93 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
94 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
95 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
98 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
99 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
100 *-*-darwin*) OBJ_FORMAT=macho ;;
107 # define this variable for enabling strict exports with libtool; for now, it's only supported by Win32
108 LT_NO_UNDEFINED="-no-undefined"
109 # -lwsock32 only needed because of ntohl() usage, can get rid of after that's gone:
110 MINGW_WINSOCK_LIBS=-lwsock32
117 AC_SUBST(LT_NO_UNDEFINED)
118 AC_SUBST(MINGW_WINSOCK_LIBS)
123 AC_DEFINE(FLAC__SYS_LINUX)
124 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
128 AC_DEFINE(FLAC__SYS_DARWIN)
129 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
132 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
133 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
135 if test "x$cpu_ia32" = xtrue ; then
136 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
137 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
140 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
141 dnl ' Terminate the damn single quote
142 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
143 if test "x$asm_opt" = xno ; then
144 AC_DEFINE(FLAC__NO_ASM)
145 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
149 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
150 [case "${enableval}" in
153 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
155 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
158 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
159 [case "${enableval}" in
162 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
163 esac],[sse_os=false])
164 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
165 if test "x$sse_os" = xtrue ; then
166 AC_DEFINE(FLAC__SSE_OS)
167 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
171 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
172 [case "${enableval}" in
173 yes) use_3dnow=true ;;
174 no) use_3dnow=false ;;
175 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
176 esac],[use_3dnow=true])
177 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
178 if test "x$use_3dnow" = xtrue ; then
179 AC_DEFINE(FLAC__USE_3DNOW)
180 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
183 AC_ARG_ENABLE(altivec,
184 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
185 [case "${enableval}" in
186 yes) use_altivec=true ;;
187 no) use_altivec=false ;;
188 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
189 esac],[use_altivec=true])
190 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
191 if test "x$use_altivec" = xtrue ; then
192 AC_DEFINE(FLAC__USE_ALTIVEC)
193 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
196 AC_ARG_ENABLE(thorough-tests,
197 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
198 [case "${enableval}" in
199 yes) thorough_tests=true ;;
200 no) thorough_tests=false ;;
201 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
202 esac],[thorough_tests=true])
203 AC_ARG_ENABLE(exhaustive-tests,
204 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
205 [case "${enableval}" in
206 yes) exhaustive_tests=true ;;
207 no) exhaustive_tests=false ;;
208 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
209 esac],[exhaustive_tests=false])
210 if test "x$thorough_tests" = xfalse ; then
212 elif test "x$exhaustive_tests" = xfalse ; then
217 AC_SUBST(FLAC__TEST_LEVEL)
219 AC_ARG_ENABLE(gcc-werror,
220 AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]))
222 AC_ARG_ENABLE(valgrind-testing,
223 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
224 [case "${enableval}" in
225 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
226 no) FLAC__TEST_WITH_VALGRIND=no ;;
227 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
228 esac],[FLAC__TEST_WITH_VALGRIND=no])
229 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
231 AC_ARG_ENABLE(doxygen-docs,
232 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
233 [case "${enableval}" in
234 yes) enable_doxygen_docs=true ;;
235 no) enable_doxygen_docs=false ;;
236 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
237 esac],[enable_doxygen_docs=true])
238 if test "x$enable_doxygen_docs" != xfalse ; then
239 AC_CHECK_PROGS(DOXYGEN, doxygen)
241 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
243 AC_ARG_ENABLE(local-xmms-plugin,
244 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
245 [case "${enableval}" in
246 yes) install_xmms_plugin_locally=true ;;
247 no) install_xmms_plugin_locally=false ;;
248 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
249 esac],[install_xmms_plugin_locally=false])
250 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
252 AC_ARG_ENABLE(xmms-plugin,
253 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
254 [case "${enableval}" in
255 yes) enable_xmms_plugin=true ;;
256 no) enable_xmms_plugin=false ;;
257 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
258 esac],[enable_xmms_plugin=true])
259 if test "x$enable_xmms_plugin" != xfalse ; then
260 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
262 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
264 dnl build FLAC++ or not
265 AC_ARG_ENABLE([cpplibs],
266 AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
267 [case "${enableval}" in
268 yes) disable_cpplibs=false ;;
269 no) disable_cpplibs=true ;;
270 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
271 esac], [disable_cpplibs=false])
272 AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
274 dnl check for ogg library
276 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
277 [ want_ogg=$enableval ], [ want_ogg=yes ] )
279 if test "x$want_ogg" != "xno"; then
280 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
283 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
284 if test "x$have_ogg" = xyes ; then
285 AC_DEFINE(FLAC__HAS_OGG)
286 AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
289 dnl check for i18n(internationalization); these are from libiconv/gettext
293 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
294 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
295 if test -n "$DOCBOOK_TO_MAN" ; then
296 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
297 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
300 # only matters for x86
301 AC_CHECK_PROGS(NASM, nasm)
302 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
303 if test -n "$NASM" ; then
304 AC_DEFINE(FLAC__HAS_NASM)
305 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
308 # only matters for PowerPC
309 AC_CHECK_PROGS(AS, as, as)
310 AC_CHECK_PROGS(GAS, gas, gas)
312 # try -v (apple as) and --version (gas) at the same time
313 test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
315 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
316 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
317 if test "$AS" = "as" ; then
318 AC_DEFINE(FLAC__HAS_AS)
319 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
321 if test "$AS" = "gas" ; then
322 # funniest. macro. ever.
323 AC_DEFINE(FLAC__HAS_GAS)
324 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
327 CPPFLAGS='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'" $CPPFLAGS"
328 if test "x$debug" = xtrue; then
329 CPPFLAGS="-DDEBUG -DFLaC__INLINE= $CPPFLAGS"
332 CPPFLAGS="-DNDEBUG $CPPFLAGS"
333 # $ac_cv_c_inline from AC_C_INLINE
334 if test "x$ac_cv_c_inline" != xno ; then
335 CPPFLAGS="-DFLaC__INLINE=$ac_cv_c_inline $CPPFLAGS"
337 if test "x$GCC" = xyes; then
338 CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS"
343 if test x$ac_cv_c_compiler_gnu = xyes ; then
344 if test x$enable_gcc_werror = "xyes" ; then
345 CFLAGS="-Werror $CFLAGS"
346 CXXFLAGS="-Werror $CXXFLAGS"
352 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
353 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
358 src/libFLAC/Makefile \
359 src/libFLAC/flac.pc \
360 src/libFLAC/ia32/Makefile \
361 src/libFLAC/ppc/Makefile \
362 src/libFLAC/ppc/as/Makefile \
363 src/libFLAC/ppc/gas/Makefile \
364 src/libFLAC/include/Makefile \
365 src/libFLAC/include/private/Makefile \
366 src/libFLAC/include/protected/Makefile \
367 src/libFLAC++/Makefile \
368 src/libFLAC++/flac++.pc \
370 src/metaflac/Makefile \
371 src/monkeys_audio_utilities/Makefile \
372 src/monkeys_audio_utilities/flac_mac/Makefile \
373 src/monkeys_audio_utilities/flac_ren/Makefile \
374 src/plugin_common/Makefile \
375 src/plugin_winamp2/Makefile \
376 src/plugin_winamp2/include/Makefile \
377 src/plugin_winamp2/include/winamp2/Makefile \
378 src/plugin_xmms/Makefile \
380 src/share/getopt/Makefile \
381 src/share/grabbag/Makefile \
382 src/share/replaygain_analysis/Makefile \
383 src/share/replaygain_synthesis/Makefile \
384 src/share/replaygain_synthesis/include/Makefile \
385 src/share/replaygain_synthesis/include/private/Makefile \
386 src/share/utf8/Makefile \
387 src/test_grabbag/Makefile \
388 src/test_grabbag/cuesheet/Makefile \
389 src/test_grabbag/picture/Makefile \
390 src/test_libs_common/Makefile \
391 src/test_libFLAC/Makefile \
392 src/test_libFLAC++/Makefile \
393 src/test_seeking/Makefile \
394 src/test_streams/Makefile \
396 src/utils/flacdiff/Makefile \
397 src/utils/flactimer/Makefile \
399 examples/c/Makefile \
400 examples/c/decode/Makefile \
401 examples/c/decode/file/Makefile \
402 examples/c/encode/Makefile \
403 examples/c/encode/file/Makefile \
404 examples/cpp/Makefile \
405 examples/cpp/decode/Makefile \
406 examples/cpp/decode/file/Makefile \
407 examples/cpp/encode/Makefile \
408 examples/cpp/encode/file/Makefile \
410 include/FLAC/Makefile \
411 include/FLAC++/Makefile \
412 include/share/Makefile \
413 include/share/grabbag/Makefile \
414 include/test_libs_common/Makefile \
417 doc/html/images/Makefile \
418 doc/html/images/hw/Makefile \
419 doc/html/ru/Makefile \
423 test/cuesheets/Makefile \
424 test/flac-to-flac-metadata-test-files/Makefile \
425 test/metaflac-test-files/Makefile \
426 test/pictures/Makefile \
430 obj/debug/bin/Makefile \
431 obj/debug/lib/Makefile \
432 obj/release/Makefile \
433 obj/release/bin/Makefile \
434 obj/release/lib/Makefile \