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.3.0pre2], [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])
67 ac_cv_c_little_endian=0
68 AC_C_BIGENDIAN([ac_cv_c_big_endian=1], [ac_cv_c_little_endian=1], [
69 AC_MSG_WARN([[*****************************************************************]])
70 AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]])
71 AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]])
72 AC_MSG_WARN([[*** config.h may need to be hand editied. ]])
73 AC_MSG_WARN([[*****************************************************************]])
75 AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
76 [Target processor is big endian.])
77 AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
78 [Target processor is little endian.])
79 AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian},
80 [Target processor is big endian.])
82 # For the XMMS plugin.
83 AC_CHECK_TYPES(socklen_t, [], [])
85 dnl check for getopt in standard library
86 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
87 AC_CHECK_FUNCS(getopt_long, [], [])
92 AC_DEFINE(FLAC__CPU_IA32)
93 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
97 AC_DEFINE(FLAC__CPU_PPC)
98 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
102 AC_DEFINE(FLAC__CPU_SPARC)
103 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
106 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
107 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
108 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
111 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
112 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
113 *-*-darwin*) OBJ_FORMAT=macho ;;
114 *emx*) OBJ_FORMAT=aout ;;
121 AC_DEFINE(FLAC__CPU_PPC_SPE)
122 AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI])
125 AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
128 *-*-cygwin|*mingw*|*emx*)
129 # define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
130 LT_NO_UNDEFINED="-no-undefined"
136 AC_SUBST(LT_NO_UNDEFINED)
141 AC_DEFINE(FLAC__SYS_LINUX)
142 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
146 AC_DEFINE(FLAC__SYS_DARWIN)
147 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
150 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
151 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
153 if test "x$cpu_ia32" = xtrue ; then
154 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
155 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
158 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
159 dnl ' Terminate the damn single quote
160 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
161 if test "x$asm_opt" = xno ; then
162 AC_DEFINE(FLAC__NO_ASM)
163 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
167 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
168 [case "${enableval}" in
171 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
173 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
176 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
177 [case "${enableval}" in
180 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
181 esac],[sse_os=false])
182 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
183 if test "x$sse_os" = xtrue ; then
184 AC_DEFINE(FLAC__SSE_OS)
185 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
189 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
190 [case "${enableval}" in
191 yes) use_3dnow=true ;;
192 no) use_3dnow=false ;;
193 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
194 esac],[use_3dnow=true])
195 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
196 if test "x$use_3dnow" = xtrue ; then
197 AC_DEFINE(FLAC__USE_3DNOW)
198 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
201 AC_ARG_ENABLE(altivec,
202 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
203 [case "${enableval}" in
204 yes) use_altivec=true ;;
205 no) use_altivec=false ;;
206 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
207 esac],[use_altivec=true])
208 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
209 if test "x$use_altivec" = xtrue ; then
210 AC_DEFINE(FLAC__USE_ALTIVEC)
211 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
214 AC_ARG_ENABLE(thorough-tests,
215 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
216 [case "${enableval}" in
217 yes) thorough_tests=true ;;
218 no) thorough_tests=false ;;
219 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
220 esac],[thorough_tests=true])
221 AC_ARG_ENABLE(exhaustive-tests,
222 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
223 [case "${enableval}" in
224 yes) exhaustive_tests=true ;;
225 no) exhaustive_tests=false ;;
226 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
227 esac],[exhaustive_tests=false])
228 if test "x$thorough_tests" = xfalse ; then
230 elif test "x$exhaustive_tests" = xfalse ; then
235 AC_SUBST(FLAC__TEST_LEVEL)
237 AC_ARG_ENABLE(gcc-werror,
238 AC_HELP_STRING([--enable-gcc-werror], [Enable -Werror in all Makefiles]))
240 AC_ARG_ENABLE(stack-smash-protection,
241 AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection]))
243 AC_ARG_ENABLE(valgrind-testing,
244 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
245 [case "${enableval}" in
246 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
247 no) FLAC__TEST_WITH_VALGRIND=no ;;
248 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
249 esac],[FLAC__TEST_WITH_VALGRIND=no])
250 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
252 AC_ARG_ENABLE(doxygen-docs,
253 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
254 [case "${enableval}" in
255 yes) enable_doxygen_docs=true ;;
256 no) enable_doxygen_docs=false ;;
257 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
258 esac],[enable_doxygen_docs=true])
259 if test "x$enable_doxygen_docs" != xfalse ; then
260 AC_CHECK_PROGS(DOXYGEN, doxygen)
262 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
264 AC_ARG_ENABLE(local-xmms-plugin,
265 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
266 [case "${enableval}" in
267 yes) install_xmms_plugin_locally=true ;;
268 no) install_xmms_plugin_locally=false ;;
269 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
270 esac],[install_xmms_plugin_locally=false])
271 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
273 AC_ARG_ENABLE(xmms-plugin,
274 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
275 [case "${enableval}" in
276 yes) enable_xmms_plugin=true ;;
277 no) enable_xmms_plugin=false ;;
278 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
279 esac],[enable_xmms_plugin=true])
280 if test "x$enable_xmms_plugin" != xfalse ; then
281 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
283 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
285 dnl build FLAC++ or not
286 AC_ARG_ENABLE([cpplibs],
287 AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
288 [case "${enableval}" in
289 yes) disable_cpplibs=false ;;
290 no) disable_cpplibs=true ;;
291 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
292 esac], [disable_cpplibs=false])
293 AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
295 dnl check for ogg library
297 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
298 [ want_ogg=$enableval ], [ want_ogg=yes ] )
300 if test "x$want_ogg" != "xno"; then
301 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
304 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
305 if test "x$have_ogg" = xyes ; then
306 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],1,[define if you have the ogg library])
308 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],0)
311 dnl check for i18n(internationalization); these are from libiconv/gettext
315 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
316 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
317 if test -n "$DOCBOOK_TO_MAN" ; then
318 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
319 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
322 # only matters for x86
323 AC_CHECK_PROGS(NASM, nasm)
324 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
325 if test -n "$NASM" ; then
326 AC_DEFINE(FLAC__HAS_NASM)
327 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
330 # only matters for PowerPC
331 AC_CHECK_PROGS(AS, as, as)
332 AC_CHECK_PROGS(GAS, gas, gas)
334 # try -v (apple as) and --version (gas) at the same time
335 test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
337 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
338 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
339 if test "$AS" = "as" ; then
340 AC_DEFINE(FLAC__HAS_AS)
341 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
343 if test "$AS" = "gas" ; then
344 # funniest. macro. ever.
345 AC_DEFINE(FLAC__HAS_GAS)
346 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
349 if test "x$debug" = xtrue; then
350 CPPFLAGS="-DDEBUG $CPPFLAGS"
353 CPPFLAGS="-DNDEBUG $CPPFLAGS"
354 if test "x$GCC" = xyes; then
355 if test "x$user_cflags" = x; then
356 CFLAGS="-O3 -funroll-loops -Wall -W -Winline"
363 if test x$ac_cv_c_compiler_gnu = xyes ; then
364 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
365 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
368 if test x$enable_gcc_werror = "xyes" ; then
369 CFLAGS="$CFLAGS -Wall -Wextra -Werror "
370 CXXFLAGS="$CXXFLAGS -Wall -Wextra -Werror "
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"
379 if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
380 XIPH_ADD_CFLAGS([-fgnu89-inline])
385 XIPH_ADD_CFLAGS([-Wextra])
386 XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
387 XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
389 if test x$enable_stack_smash_protection = "xyes" ; then
390 XIPH_GCC_STACK_PROTECTOR
391 XIPH_GXX_STACK_PROTECTOR
395 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
396 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
401 src/libFLAC/Makefile \
402 src/libFLAC/flac.pc \
403 src/libFLAC/ia32/Makefile \
404 src/libFLAC/ppc/Makefile \
405 src/libFLAC/ppc/as/Makefile \
406 src/libFLAC/ppc/gas/Makefile \
407 src/libFLAC/include/Makefile \
408 src/libFLAC/include/private/Makefile \
409 src/libFLAC/include/protected/Makefile \
410 src/libFLAC++/Makefile \
411 src/libFLAC++/flac++.pc \
413 src/metaflac/Makefile \
414 src/monkeys_audio_utilities/Makefile \
415 src/monkeys_audio_utilities/flac_mac/Makefile \
416 src/monkeys_audio_utilities/flac_ren/Makefile \
417 src/plugin_common/Makefile \
418 src/plugin_xmms/Makefile \
420 src/share/getopt/Makefile \
421 src/share/grabbag/Makefile \
422 src/share/replaygain_analysis/Makefile \
423 src/share/replaygain_synthesis/Makefile \
424 src/share/replaygain_synthesis/include/Makefile \
425 src/share/replaygain_synthesis/include/private/Makefile \
426 src/share/utf8/Makefile \
427 src/test_grabbag/Makefile \
428 src/test_grabbag/cuesheet/Makefile \
429 src/test_grabbag/picture/Makefile \
430 src/test_libs_common/Makefile \
431 src/test_libFLAC/Makefile \
432 src/test_libFLAC++/Makefile \
433 src/test_seeking/Makefile \
434 src/test_streams/Makefile \
436 src/utils/flacdiff/Makefile \
437 src/utils/flactimer/Makefile \
439 examples/c/Makefile \
440 examples/c/decode/Makefile \
441 examples/c/decode/file/Makefile \
442 examples/c/encode/Makefile \
443 examples/c/encode/file/Makefile \
444 examples/cpp/Makefile \
445 examples/cpp/decode/Makefile \
446 examples/cpp/decode/file/Makefile \
447 examples/cpp/encode/Makefile \
448 examples/cpp/encode/file/Makefile \
450 include/FLAC/Makefile \
451 include/FLAC++/Makefile \
452 include/share/Makefile \
453 include/share/grabbag/Makefile \
454 include/test_libs_common/Makefile \
458 doc/html/images/Makefile \
459 doc/html/images/hw/Makefile \
460 doc/html/ru/Makefile \
464 test/cuesheets/Makefile \
465 test/flac-to-flac-metadata-test-files/Makefile \
466 test/metaflac-test-files/Makefile \
467 test/pictures/Makefile \
470 objs/debug/Makefile \
471 objs/debug/bin/Makefile \
472 objs/debug/lib/Makefile \
473 objs/release/Makefile \
474 objs/release/bin/Makefile \
475 objs/release/lib/Makefile \
480 -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
482 Configuration summary :
484 FLAC version : ........................ ${VERSION}
486 Host CPU : ............................ ${host_cpu}
487 Host Vendor : ......................... ${host_vendor}
488 Host OS : ............................. ${host_os}
491 echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
492 if test x$ac_cv_c_compiler_gnu = xyes ; then
493 echo " GCC version : ......................... ${GCC_VERSION}"