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 different 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.3.0], [flac-dev@xiph.org], [flac], [https://www.xiph.org/flac/])
23 AC_CONFIG_HEADERS([config.h])
24 AC_CONFIG_SRCDIR([src/flac/main.c])
25 AC_CONFIG_MACRO_DIR([m4])
26 AM_INIT_AUTOMAKE([foreign 1.11 -Wall tar-pax no-dist-gzip dist-xz subdir-objects])
27 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31 #Prefer whatever the current ISO standard is.
33 AC_USE_SYSTEM_EXTENSIONS
34 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
35 LT_INIT([win32-dll disable-static pic-only])
43 AC_CHECK_SIZEOF(off_t,1) # Fake default value.
44 AC_CHECK_SIZEOF([void*])
45 AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)])
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 inttypes.h byteswap.h sys/param.h termios.h])
69 ac_cv_c_little_endian=0
70 AC_C_BIGENDIAN([ac_cv_c_big_endian=1], [ac_cv_c_little_endian=1], [
71 AC_MSG_WARN([[*****************************************************************]])
72 AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]])
73 AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]])
74 AC_MSG_WARN([[*** config.h may need to be hand editied. ]])
75 AC_MSG_WARN([[*****************************************************************]])
77 AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
78 [Target processor is big endian.])
79 AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
80 [Target processor is little endian.])
81 AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian},
82 [Target processor is big endian.])
84 # For the XMMS plugin.
85 AC_CHECK_TYPES(socklen_t, [], [])
87 dnl check for getopt in standard library
88 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
89 AC_CHECK_FUNCS(getopt_long, [], [])
94 AC_DEFINE(FLAC__CPU_IA32)
95 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
99 AC_DEFINE(FLAC__CPU_PPC)
100 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
104 AC_DEFINE(FLAC__CPU_SPARC)
105 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
108 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
109 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
110 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
113 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
114 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
115 *-*-darwin*) OBJ_FORMAT=macho ;;
116 *emx*) OBJ_FORMAT=aout ;;
123 AC_DEFINE(FLAC__CPU_PPC_SPE)
124 AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI])
127 AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
132 # define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
133 LT_NO_UNDEFINED="-no-undefined"
134 CPPFLAGS="-D__MSVCRT_VERSION__=0x0601 $CPPFLAGS"
138 LT_NO_UNDEFINED="-no-undefined"
144 AC_SUBST(LT_NO_UNDEFINED)
145 AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes)
150 AC_DEFINE(FLAC__SYS_LINUX)
151 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
155 AC_DEFINE(FLAC__SYS_DARWIN)
156 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
159 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
160 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
162 if test "x$cpu_ia32" = xtrue ; then
163 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
164 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
167 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
168 dnl ' Terminate the damn single quote
169 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
170 if test "x$asm_opt" = xno ; then
171 AC_DEFINE(FLAC__NO_ASM)
172 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
176 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
177 [case "${enableval}" in
180 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
182 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
185 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
186 [case "${enableval}" in
189 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
190 esac],[sse_os=false])
191 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
192 if test "x$sse_os" = xtrue ; then
193 AC_DEFINE(FLAC__SSE_OS)
194 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
198 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
199 [case "${enableval}" in
200 yes) use_3dnow=true ;;
201 no) use_3dnow=false ;;
202 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
203 esac],[use_3dnow=true])
204 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
205 if test "x$use_3dnow" = xtrue ; then
206 AC_DEFINE(FLAC__USE_3DNOW)
207 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
210 AC_ARG_ENABLE(altivec,
211 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
212 [case "${enableval}" in
213 yes) use_altivec=true ;;
214 no) use_altivec=false ;;
215 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
216 esac],[use_altivec=true])
217 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
218 if test "x$use_altivec" = xtrue ; then
219 AC_DEFINE(FLAC__USE_ALTIVEC)
220 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
223 AC_ARG_ENABLE(thorough-tests,
224 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
225 [case "${enableval}" in
226 yes) thorough_tests=true ;;
227 no) thorough_tests=false ;;
228 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
229 esac],[thorough_tests=true])
230 AC_ARG_ENABLE(exhaustive-tests,
231 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
232 [case "${enableval}" in
233 yes) exhaustive_tests=true ;;
234 no) exhaustive_tests=false ;;
235 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
236 esac],[exhaustive_tests=false])
237 if test "x$thorough_tests" = xfalse ; then
239 elif test "x$exhaustive_tests" = xfalse ; then
244 AC_SUBST(FLAC__TEST_LEVEL)
246 AC_ARG_ENABLE(gcc-werror,
247 AC_HELP_STRING([--enable-gcc-werror], [Enable -Werror in all Makefiles]))
249 AC_ARG_ENABLE(stack-smash-protection,
250 AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection]))
252 AC_ARG_ENABLE(valgrind-testing,
253 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
254 [case "${enableval}" in
255 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
256 no) FLAC__TEST_WITH_VALGRIND=no ;;
257 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
258 esac],[FLAC__TEST_WITH_VALGRIND=no])
259 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
261 AC_ARG_ENABLE(doxygen-docs,
262 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
263 [case "${enableval}" in
264 yes) enable_doxygen_docs=true ;;
265 no) enable_doxygen_docs=false ;;
266 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
267 esac],[enable_doxygen_docs=true])
268 if test "x$enable_doxygen_docs" != xfalse ; then
269 AC_CHECK_PROGS(DOXYGEN, doxygen)
271 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
273 AC_ARG_ENABLE(local-xmms-plugin,
274 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
275 [case "${enableval}" in
276 yes) install_xmms_plugin_locally=true ;;
277 no) install_xmms_plugin_locally=false ;;
278 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
279 esac],[install_xmms_plugin_locally=false])
280 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
282 AC_ARG_ENABLE(xmms-plugin,
283 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
284 [case "${enableval}" in
285 yes) enable_xmms_plugin=true ;;
286 no) enable_xmms_plugin=false ;;
287 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
288 esac],[enable_xmms_plugin=true])
289 if test "x$enable_xmms_plugin" != xfalse ; then
290 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
292 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
294 dnl build FLAC++ or not
295 AC_ARG_ENABLE([cpplibs],
296 AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
297 [case "${enableval}" in
298 yes) disable_cpplibs=false ;;
299 no) disable_cpplibs=true ;;
300 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
301 esac], [disable_cpplibs=false])
302 AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
304 dnl check for ogg library
306 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
307 [ want_ogg=$enableval ], [ want_ogg=yes ] )
309 if test "x$want_ogg" != "xno"; then
310 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
313 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
314 if test "x$have_ogg" = xyes ; then
315 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],1,[define if you have the ogg library])
318 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],0)
320 AC_SUBST(OGG_PACKAGE)
322 dnl check for i18n(internationalization); these are from libiconv/gettext
326 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
327 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
328 if test -n "$DOCBOOK_TO_MAN" ; then
329 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
330 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
333 # only matters for x86
334 AC_CHECK_PROGS(NASM, nasm)
335 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
336 if test -n "$NASM" ; then
337 AC_DEFINE(FLAC__HAS_NASM)
338 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
341 # only matters for PowerPC
342 AC_CHECK_PROGS(AS, as, as)
343 AC_CHECK_PROGS(GAS, gas, gas)
345 # try -v (apple as) and --version (gas) at the same time
346 test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
348 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
349 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
350 if test "$AS" = "as" ; then
351 AC_DEFINE(FLAC__HAS_AS)
352 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
354 if test "$AS" = "gas" ; then
355 # funniest. macro. ever.
356 AC_DEFINE(FLAC__HAS_GAS)
357 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
360 if test "x$debug" = xtrue; then
361 CPPFLAGS="-DDEBUG $CPPFLAGS"
364 CPPFLAGS="-DNDEBUG $CPPFLAGS"
365 if test "x$GCC" = xyes; then
366 if test "x$user_cflags" = x; then
367 CFLAGS="-O3 -funroll-loops -Wall -W -Winline"
374 if test x$ac_cv_c_compiler_gnu = xyes ; then
375 CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Winline -Wconversion
376 CXXFLAGS="$CXXFLAGS -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Woverloaded-virtual -Wmissing-declarations
379 if test x$enable_gcc_werror = "xyes" ; then
380 CFLAGS="$CFLAGS -Wall -Wextra -Werror "
381 CXXFLAGS="$CXXFLAGS -Wall -Wextra -Werror "
384 if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elf; then
385 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
386 CFLAGS="$CFLAGS -fvisibility=hidden"
387 CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
390 if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
391 XIPH_ADD_CFLAGS([-fgnu89-inline])
396 XIPH_ADD_CFLAGS([-Wextra])
397 XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
398 XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
400 if test x$enable_stack_smash_protection = "xyes" ; then
401 XIPH_GCC_STACK_PROTECTOR
402 XIPH_GXX_STACK_PROTECTOR
406 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
407 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
412 src/libFLAC/Makefile \
413 src/libFLAC/flac.pc \
414 src/libFLAC/ia32/Makefile \
415 src/libFLAC/ppc/Makefile \
416 src/libFLAC/ppc/as/Makefile \
417 src/libFLAC/ppc/gas/Makefile \
418 src/libFLAC/include/Makefile \
419 src/libFLAC/include/private/Makefile \
420 src/libFLAC/include/protected/Makefile \
421 src/libFLAC++/Makefile \
422 src/libFLAC++/flac++.pc \
424 src/metaflac/Makefile \
425 src/monkeys_audio_utilities/Makefile \
426 src/monkeys_audio_utilities/flac_mac/Makefile \
427 src/monkeys_audio_utilities/flac_ren/Makefile \
428 src/plugin_common/Makefile \
429 src/plugin_xmms/Makefile \
431 src/test_grabbag/Makefile \
432 src/test_grabbag/cuesheet/Makefile \
433 src/test_grabbag/picture/Makefile \
434 src/test_libs_common/Makefile \
435 src/test_libFLAC/Makefile \
436 src/test_libFLAC++/Makefile \
437 src/test_seeking/Makefile \
438 src/test_streams/Makefile \
440 src/utils/flacdiff/Makefile \
441 src/utils/flactimer/Makefile \
443 examples/c/Makefile \
444 examples/c/decode/Makefile \
445 examples/c/decode/file/Makefile \
446 examples/c/encode/Makefile \
447 examples/c/encode/file/Makefile \
448 examples/cpp/Makefile \
449 examples/cpp/decode/Makefile \
450 examples/cpp/decode/file/Makefile \
451 examples/cpp/encode/Makefile \
452 examples/cpp/encode/file/Makefile \
454 include/FLAC/Makefile \
455 include/FLAC++/Makefile \
456 include/share/Makefile \
457 include/share/grabbag/Makefile \
458 include/test_libs_common/Makefile \
462 doc/html/images/Makefile \
463 doc/html/images/hw/Makefile \
464 doc/html/ru/Makefile \
468 test/cuesheets/Makefile \
469 test/flac-to-flac-metadata-test-files/Makefile \
470 test/metaflac-test-files/Makefile \
471 test/pictures/Makefile \
474 objs/debug/Makefile \
475 objs/debug/bin/Makefile \
476 objs/debug/lib/Makefile \
477 objs/release/Makefile \
478 objs/release/bin/Makefile \
479 objs/release/lib/Makefile \
484 -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
486 Configuration summary :
488 FLAC version : ........................ ${VERSION}
490 Host CPU : ............................ ${host_cpu}
491 Host Vendor : ......................... ${host_vendor}
492 Host OS : ............................. ${host_os}
495 echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
496 if test x$ac_cv_c_compiler_gnu = xyes ; then
497 echo " GCC version : ......................... ${GCC_VERSION}"