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 -Wall tar-pax no-dist-gzip dist-xz subdir-objects])
26 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
29 #Prefer whatever the current ISO standard is.
31 AC_USE_SYSTEM_EXTENSIONS
32 LT_INIT([win32-dll disable-static pic-only])
40 AC_CHECK_SIZEOF(void*,0)
41 AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)])
42 #@@@ new name is AC_CONFIG_HEADERS
43 AM_CONFIG_HEADER(config.h)
48 if test $ac_cv_c_vararrays = yes; then
49 AC_DEFINE([HAVE_CXX_VARARRAYS], 1, [Define to 1 if C++ supports variable-length arrays.])
60 AC_CHECK_HEADERS(stdint.h)
61 AC_SUBST(HAVE_STDINT_H)
62 AC_CHECK_HEADERS(inttypes.h)
63 AC_SUBST(HAVE_INTTYPES_H)
64 AC_CHECK_HEADERS(byteswap.h)
65 AC_SUBST(HAVE_BYTESWAP_H)
67 AC_CHECK_HEADERS([sys/param.h])
72 AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
73 [Target processor is big endian.])
74 AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
75 [Target processor is little endian.])
76 AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian},
77 [Target processor is big endian.])
79 # For the XMMS plugin.
80 AC_CHECK_TYPES(socklen_t, [], [])
82 dnl check for getopt in standard library
83 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
84 AC_CHECK_FUNCS(getopt_long, [], [])
89 AC_DEFINE(FLAC__CPU_IA32)
90 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
94 AC_DEFINE(FLAC__CPU_PPC)
95 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
99 AC_DEFINE(FLAC__CPU_SPARC)
100 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
103 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
104 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
105 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
108 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
109 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
110 *-*-darwin*) OBJ_FORMAT=macho ;;
111 *emx*) OBJ_FORMAT=aout ;;
118 AC_DEFINE(FLAC__CPU_PPC_SPE)
119 AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI])
122 AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
125 *-*-cygwin|*mingw*|*emx*)
126 # define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
127 LT_NO_UNDEFINED="-no-undefined"
133 AC_SUBST(LT_NO_UNDEFINED)
138 AC_DEFINE(FLAC__SYS_LINUX)
139 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
143 AC_DEFINE(FLAC__SYS_DARWIN)
144 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
147 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
148 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
150 if test "x$cpu_ia32" = xtrue ; then
151 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
152 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
155 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
156 dnl ' Terminate the damn single quote
157 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
158 if test "x$asm_opt" = xno ; then
159 AC_DEFINE(FLAC__NO_ASM)
160 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
164 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
165 [case "${enableval}" in
168 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
170 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
173 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
174 [case "${enableval}" in
177 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
178 esac],[sse_os=false])
179 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
180 if test "x$sse_os" = xtrue ; then
181 AC_DEFINE(FLAC__SSE_OS)
182 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
186 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
187 [case "${enableval}" in
188 yes) use_3dnow=true ;;
189 no) use_3dnow=false ;;
190 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
191 esac],[use_3dnow=true])
192 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
193 if test "x$use_3dnow" = xtrue ; then
194 AC_DEFINE(FLAC__USE_3DNOW)
195 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
198 AC_ARG_ENABLE(altivec,
199 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
200 [case "${enableval}" in
201 yes) use_altivec=true ;;
202 no) use_altivec=false ;;
203 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
204 esac],[use_altivec=true])
205 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
206 if test "x$use_altivec" = xtrue ; then
207 AC_DEFINE(FLAC__USE_ALTIVEC)
208 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
211 AC_ARG_ENABLE(thorough-tests,
212 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
213 [case "${enableval}" in
214 yes) thorough_tests=true ;;
215 no) thorough_tests=false ;;
216 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
217 esac],[thorough_tests=true])
218 AC_ARG_ENABLE(exhaustive-tests,
219 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
220 [case "${enableval}" in
221 yes) exhaustive_tests=true ;;
222 no) exhaustive_tests=false ;;
223 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
224 esac],[exhaustive_tests=false])
225 if test "x$thorough_tests" = xfalse ; then
227 elif test "x$exhaustive_tests" = xfalse ; then
232 AC_SUBST(FLAC__TEST_LEVEL)
234 AC_ARG_ENABLE(gcc-werror,
235 AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]))
237 AC_ARG_ENABLE(valgrind-testing,
238 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
239 [case "${enableval}" in
240 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
241 no) FLAC__TEST_WITH_VALGRIND=no ;;
242 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
243 esac],[FLAC__TEST_WITH_VALGRIND=no])
244 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
246 AC_ARG_ENABLE(doxygen-docs,
247 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
248 [case "${enableval}" in
249 yes) enable_doxygen_docs=true ;;
250 no) enable_doxygen_docs=false ;;
251 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
252 esac],[enable_doxygen_docs=true])
253 if test "x$enable_doxygen_docs" != xfalse ; then
254 AC_CHECK_PROGS(DOXYGEN, doxygen)
256 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
258 AC_ARG_ENABLE(local-xmms-plugin,
259 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
260 [case "${enableval}" in
261 yes) install_xmms_plugin_locally=true ;;
262 no) install_xmms_plugin_locally=false ;;
263 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
264 esac],[install_xmms_plugin_locally=false])
265 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
267 AC_ARG_ENABLE(xmms-plugin,
268 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
269 [case "${enableval}" in
270 yes) enable_xmms_plugin=true ;;
271 no) enable_xmms_plugin=false ;;
272 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
273 esac],[enable_xmms_plugin=true])
274 if test "x$enable_xmms_plugin" != xfalse ; then
275 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
277 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
279 dnl build FLAC++ or not
280 AC_ARG_ENABLE([cpplibs],
281 AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
282 [case "${enableval}" in
283 yes) disable_cpplibs=false ;;
284 no) disable_cpplibs=true ;;
285 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
286 esac], [disable_cpplibs=false])
287 AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
289 dnl check for ogg library
291 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
292 [ want_ogg=$enableval ], [ want_ogg=yes ] )
294 if test "x$want_ogg" != "xno"; then
295 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
298 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
299 if test "x$have_ogg" = xyes ; then
300 AC_DEFINE(FLAC__HAS_OGG)
301 AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
304 dnl check for i18n(internationalization); these are from libiconv/gettext
308 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
309 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
310 if test -n "$DOCBOOK_TO_MAN" ; then
311 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
312 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
315 # only matters for x86
316 AC_CHECK_PROGS(NASM, nasm)
317 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
318 if test -n "$NASM" ; then
319 AC_DEFINE(FLAC__HAS_NASM)
320 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
323 # only matters for PowerPC
324 AC_CHECK_PROGS(AS, as, as)
325 AC_CHECK_PROGS(GAS, gas, gas)
327 # try -v (apple as) and --version (gas) at the same time
328 test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
330 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
331 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
332 if test "$AS" = "as" ; then
333 AC_DEFINE(FLAC__HAS_AS)
334 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
336 if test "$AS" = "gas" ; then
337 # funniest. macro. ever.
338 AC_DEFINE(FLAC__HAS_GAS)
339 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
342 if test "x$debug" = xtrue; then
343 CPPFLAGS="-DDEBUG $CPPFLAGS"
346 CPPFLAGS="-DNDEBUG $CPPFLAGS"
347 if test "x$GCC" = xyes; then
348 CFLAGS="-O3 -funroll-loops -Wall -W -Winline $CFLAGS"
354 if test x$ac_cv_c_compiler_gnu = xyes ; then
355 if test x$enable_gcc_werror = "xyes" ; then
356 CFLAGS="-Werror $CFLAGS"
357 CXXFLAGS="-Werror $CXXFLAGS"
363 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
364 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
369 src/libFLAC/Makefile \
370 src/libFLAC/flac.pc \
371 src/libFLAC/ia32/Makefile \
372 src/libFLAC/ppc/Makefile \
373 src/libFLAC/ppc/as/Makefile \
374 src/libFLAC/ppc/gas/Makefile \
375 src/libFLAC/include/Makefile \
376 src/libFLAC/include/private/Makefile \
377 src/libFLAC/include/protected/Makefile \
378 src/libFLAC++/Makefile \
379 src/libFLAC++/flac++.pc \
381 src/metaflac/Makefile \
382 src/monkeys_audio_utilities/Makefile \
383 src/monkeys_audio_utilities/flac_mac/Makefile \
384 src/monkeys_audio_utilities/flac_ren/Makefile \
385 src/plugin_common/Makefile \
386 src/plugin_xmms/Makefile \
388 src/share/getopt/Makefile \
389 src/share/grabbag/Makefile \
390 src/share/replaygain_analysis/Makefile \
391 src/share/replaygain_synthesis/Makefile \
392 src/share/replaygain_synthesis/include/Makefile \
393 src/share/replaygain_synthesis/include/private/Makefile \
394 src/share/utf8/Makefile \
395 src/test_grabbag/Makefile \
396 src/test_grabbag/cuesheet/Makefile \
397 src/test_grabbag/picture/Makefile \
398 src/test_libs_common/Makefile \
399 src/test_libFLAC/Makefile \
400 src/test_libFLAC++/Makefile \
401 src/test_seeking/Makefile \
402 src/test_streams/Makefile \
404 src/utils/flacdiff/Makefile \
405 src/utils/flactimer/Makefile \
407 examples/c/Makefile \
408 examples/c/decode/Makefile \
409 examples/c/decode/file/Makefile \
410 examples/c/encode/Makefile \
411 examples/c/encode/file/Makefile \
412 examples/cpp/Makefile \
413 examples/cpp/decode/Makefile \
414 examples/cpp/decode/file/Makefile \
415 examples/cpp/encode/Makefile \
416 examples/cpp/encode/file/Makefile \
418 include/FLAC/Makefile \
419 include/FLAC++/Makefile \
420 include/share/Makefile \
421 include/share/grabbag/Makefile \
422 include/test_libs_common/Makefile \
425 doc/html/images/Makefile \
426 doc/html/images/hw/Makefile \
427 doc/html/ru/Makefile \
431 test/cuesheets/Makefile \
432 test/flac-to-flac-metadata-test-files/Makefile \
433 test/metaflac-test-files/Makefile \
434 test/pictures/Makefile \
438 obj/debug/bin/Makefile \
439 obj/debug/lib/Makefile \
440 obj/release/Makefile \
441 obj/release/bin/Makefile \
442 obj/release/lib/Makefile \
447 -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
449 Configuration summary :
451 FLAC version : ........................ ${VERSION}
453 Host CPU : ............................ ${host_cpu}
454 Host Vendor : ......................... ${host_vendor}
455 Host OS : ............................. ${host_os}
458 if test x$ac_cv_c_compiler_gnu = xyes ; then
459 echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
460 echo " GCC version : ......................... ${GCC_VERSION}"