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
22 AC_INIT([flac], [1.2.1])
23 AC_CONFIG_SRCDIR([src/flac/main.c])
24 AC_CONFIG_MACRO_DIR([m4])
25 AM_INIT_AUTOMAKE([foreign 1.7 -Wall tar-pax no-dist-gzip dist-xz subdir-objects])
26 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
30 #Prefer whatever the current ISO standard is.
32 AC_USE_SYSTEM_EXTENSIONS
33 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
34 LT_INIT([win32-dll disable-static pic-only])
42 AC_CHECK_SIZEOF(void*,0)
43 AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)])
44 #@@@ new name is AC_CONFIG_HEADERS
45 AM_CONFIG_HEADER(config.h)
50 if test $ac_cv_c_vararrays = yes; then
51 AC_DEFINE([HAVE_CXX_VARARRAYS], 1, [Define to 1 if C++ supports variable-length arrays.])
62 AC_CHECK_HEADERS(stdint.h)
63 AC_SUBST(HAVE_STDINT_H)
64 AC_CHECK_HEADERS(inttypes.h)
65 AC_SUBST(HAVE_INTTYPES_H)
66 AC_CHECK_HEADERS(byteswap.h)
67 AC_SUBST(HAVE_BYTESWAP_H)
69 AC_CHECK_HEADERS([sys/param.h])
74 ac_cv_c_little_endian=0
75 AC_C_BIGENDIAN([ac_cv_c_big_endian=1], [ac_cv_c_little_endian=1], [
76 AC_MSG_WARN([[*****************************************************************]])
77 AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]])
78 AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]])
79 AC_MSG_WARN([[*** config.h may need to be hand editied. ]])
80 AC_MSG_WARN([[*****************************************************************]])
82 AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
83 [Target processor is big endian.])
84 AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
85 [Target processor is little endian.])
86 AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian},
87 [Target processor is big endian.])
89 # For the XMMS plugin.
90 AC_CHECK_TYPES(socklen_t, [], [])
92 dnl check for getopt in standard library
93 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
94 AC_CHECK_FUNCS(getopt_long, [], [])
99 AC_DEFINE(FLAC__CPU_IA32)
100 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
104 AC_DEFINE(FLAC__CPU_PPC)
105 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
109 AC_DEFINE(FLAC__CPU_SPARC)
110 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
113 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
114 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
115 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
118 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
119 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
120 *-*-darwin*) OBJ_FORMAT=macho ;;
121 *emx*) OBJ_FORMAT=aout ;;
128 AC_DEFINE(FLAC__CPU_PPC_SPE)
129 AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI])
132 AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
135 *-*-cygwin|*mingw*|*emx*)
136 # define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
137 LT_NO_UNDEFINED="-no-undefined"
143 AC_SUBST(LT_NO_UNDEFINED)
148 AC_DEFINE(FLAC__SYS_LINUX)
149 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
153 AC_DEFINE(FLAC__SYS_DARWIN)
154 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
157 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
158 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
160 if test "x$cpu_ia32" = xtrue ; then
161 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
162 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
165 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
166 dnl ' Terminate the damn single quote
167 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
168 if test "x$asm_opt" = xno ; then
169 AC_DEFINE(FLAC__NO_ASM)
170 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
174 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
175 [case "${enableval}" in
178 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
180 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
183 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
184 [case "${enableval}" in
187 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
188 esac],[sse_os=false])
189 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
190 if test "x$sse_os" = xtrue ; then
191 AC_DEFINE(FLAC__SSE_OS)
192 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
196 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
197 [case "${enableval}" in
198 yes) use_3dnow=true ;;
199 no) use_3dnow=false ;;
200 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
201 esac],[use_3dnow=true])
202 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
203 if test "x$use_3dnow" = xtrue ; then
204 AC_DEFINE(FLAC__USE_3DNOW)
205 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
208 AC_ARG_ENABLE(altivec,
209 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
210 [case "${enableval}" in
211 yes) use_altivec=true ;;
212 no) use_altivec=false ;;
213 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
214 esac],[use_altivec=true])
215 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
216 if test "x$use_altivec" = xtrue ; then
217 AC_DEFINE(FLAC__USE_ALTIVEC)
218 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
221 AC_ARG_ENABLE(thorough-tests,
222 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
223 [case "${enableval}" in
224 yes) thorough_tests=true ;;
225 no) thorough_tests=false ;;
226 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
227 esac],[thorough_tests=true])
228 AC_ARG_ENABLE(exhaustive-tests,
229 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
230 [case "${enableval}" in
231 yes) exhaustive_tests=true ;;
232 no) exhaustive_tests=false ;;
233 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
234 esac],[exhaustive_tests=false])
235 if test "x$thorough_tests" = xfalse ; then
237 elif test "x$exhaustive_tests" = xfalse ; then
242 AC_SUBST(FLAC__TEST_LEVEL)
244 AC_ARG_ENABLE(gcc-werror,
245 AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]))
247 AC_ARG_ENABLE(valgrind-testing,
248 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
249 [case "${enableval}" in
250 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
251 no) FLAC__TEST_WITH_VALGRIND=no ;;
252 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
253 esac],[FLAC__TEST_WITH_VALGRIND=no])
254 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
256 AC_ARG_ENABLE(doxygen-docs,
257 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
258 [case "${enableval}" in
259 yes) enable_doxygen_docs=true ;;
260 no) enable_doxygen_docs=false ;;
261 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
262 esac],[enable_doxygen_docs=true])
263 if test "x$enable_doxygen_docs" != xfalse ; then
264 AC_CHECK_PROGS(DOXYGEN, doxygen)
266 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
268 AC_ARG_ENABLE(local-xmms-plugin,
269 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
270 [case "${enableval}" in
271 yes) install_xmms_plugin_locally=true ;;
272 no) install_xmms_plugin_locally=false ;;
273 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
274 esac],[install_xmms_plugin_locally=false])
275 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
277 AC_ARG_ENABLE(xmms-plugin,
278 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
279 [case "${enableval}" in
280 yes) enable_xmms_plugin=true ;;
281 no) enable_xmms_plugin=false ;;
282 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
283 esac],[enable_xmms_plugin=true])
284 if test "x$enable_xmms_plugin" != xfalse ; then
285 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
287 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
289 dnl build FLAC++ or not
290 AC_ARG_ENABLE([cpplibs],
291 AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
292 [case "${enableval}" in
293 yes) disable_cpplibs=false ;;
294 no) disable_cpplibs=true ;;
295 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
296 esac], [disable_cpplibs=false])
297 AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
299 dnl check for ogg library
301 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
302 [ want_ogg=$enableval ], [ want_ogg=yes ] )
304 if test "x$want_ogg" != "xno"; then
305 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
308 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
309 if test "x$have_ogg" = xyes ; then
310 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],1,[define if you have the ogg library])
312 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],0)
315 dnl check for i18n(internationalization); these are from libiconv/gettext
319 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
320 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
321 if test -n "$DOCBOOK_TO_MAN" ; then
322 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
323 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
326 # only matters for x86
327 AC_CHECK_PROGS(NASM, nasm)
328 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
329 if test -n "$NASM" ; then
330 AC_DEFINE(FLAC__HAS_NASM)
331 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
334 # only matters for PowerPC
335 AC_CHECK_PROGS(AS, as, as)
336 AC_CHECK_PROGS(GAS, gas, gas)
338 # try -v (apple as) and --version (gas) at the same time
339 test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
341 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
342 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
343 if test "$AS" = "as" ; then
344 AC_DEFINE(FLAC__HAS_AS)
345 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
347 if test "$AS" = "gas" ; then
348 # funniest. macro. ever.
349 AC_DEFINE(FLAC__HAS_GAS)
350 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
353 if test "x$debug" = xtrue; then
354 CPPFLAGS="-DDEBUG $CPPFLAGS"
357 CPPFLAGS="-DNDEBUG $CPPFLAGS"
358 if test "x$GCC" = xyes; then
359 if test "x$user_cflags" = x; then
360 CFLAGS="-O3 -funroll-loops -Wall -W -Winline"
367 if test x$ac_cv_c_compiler_gnu = xyes ; then
368 if test x$enable_gcc_werror = "xyes" ; then
369 CFLAGS="-Wall -Wextra -Werror $CFLAGS"
370 CXXFLAGS="-Wall -Wextra -Werror $CXXFLAGS"
373 if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elf; then
374 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
375 CFLAGS="$CFLAGS -fvisibility=hidden"
376 CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
382 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
383 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
388 src/libFLAC/Makefile \
389 src/libFLAC/flac.pc \
390 src/libFLAC/ia32/Makefile \
391 src/libFLAC/ppc/Makefile \
392 src/libFLAC/ppc/as/Makefile \
393 src/libFLAC/ppc/gas/Makefile \
394 src/libFLAC/include/Makefile \
395 src/libFLAC/include/private/Makefile \
396 src/libFLAC/include/protected/Makefile \
397 src/libFLAC++/Makefile \
398 src/libFLAC++/flac++.pc \
400 src/metaflac/Makefile \
401 src/monkeys_audio_utilities/Makefile \
402 src/monkeys_audio_utilities/flac_mac/Makefile \
403 src/monkeys_audio_utilities/flac_ren/Makefile \
404 src/plugin_common/Makefile \
405 src/plugin_xmms/Makefile \
407 src/share/getopt/Makefile \
408 src/share/grabbag/Makefile \
409 src/share/replaygain_analysis/Makefile \
410 src/share/replaygain_synthesis/Makefile \
411 src/share/replaygain_synthesis/include/Makefile \
412 src/share/replaygain_synthesis/include/private/Makefile \
413 src/share/utf8/Makefile \
414 src/test_grabbag/Makefile \
415 src/test_grabbag/cuesheet/Makefile \
416 src/test_grabbag/picture/Makefile \
417 src/test_libs_common/Makefile \
418 src/test_libFLAC/Makefile \
419 src/test_libFLAC++/Makefile \
420 src/test_seeking/Makefile \
421 src/test_streams/Makefile \
423 src/utils/flacdiff/Makefile \
424 src/utils/flactimer/Makefile \
426 examples/c/Makefile \
427 examples/c/decode/Makefile \
428 examples/c/decode/file/Makefile \
429 examples/c/encode/Makefile \
430 examples/c/encode/file/Makefile \
431 examples/cpp/Makefile \
432 examples/cpp/decode/Makefile \
433 examples/cpp/decode/file/Makefile \
434 examples/cpp/encode/Makefile \
435 examples/cpp/encode/file/Makefile \
437 include/FLAC/Makefile \
438 include/FLAC++/Makefile \
439 include/share/Makefile \
440 include/share/grabbag/Makefile \
441 include/test_libs_common/Makefile \
444 doc/html/images/Makefile \
445 doc/html/images/hw/Makefile \
446 doc/html/ru/Makefile \
450 test/cuesheets/Makefile \
451 test/flac-to-flac-metadata-test-files/Makefile \
452 test/metaflac-test-files/Makefile \
453 test/pictures/Makefile \
457 obj/debug/bin/Makefile \
458 obj/debug/lib/Makefile \
459 obj/release/Makefile \
460 obj/release/bin/Makefile \
461 obj/release/lib/Makefile \
466 -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
468 Configuration summary :
470 FLAC version : ........................ ${VERSION}
472 Host CPU : ............................ ${host_cpu}
473 Host Vendor : ......................... ${host_vendor}
474 Host OS : ............................. ${host_os}
477 echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
478 if test x$ac_cv_c_compiler_gnu = xyes ; then
479 echo " GCC version : ......................... ${GCC_VERSION}"