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([void*])
44 AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)])
49 if test $ac_cv_c_vararrays = yes; then
50 AC_DEFINE([HAVE_CXX_VARARRAYS], 1, [Define to 1 if C++ supports variable-length arrays.])
61 AC_CHECK_HEADERS([stdint.h inttypes.h byteswap.h sys/param.h])
66 ac_cv_c_little_endian=0
67 AC_C_BIGENDIAN([ac_cv_c_big_endian=1], [ac_cv_c_little_endian=1], [
68 AC_MSG_WARN([[*****************************************************************]])
69 AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]])
70 AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]])
71 AC_MSG_WARN([[*** config.h may need to be hand editied. ]])
72 AC_MSG_WARN([[*****************************************************************]])
74 AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
75 [Target processor is big endian.])
76 AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
77 [Target processor is little endian.])
78 AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian},
79 [Target processor is big endian.])
81 # For the XMMS plugin.
82 AC_CHECK_TYPES(socklen_t, [], [])
84 dnl check for getopt in standard library
85 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
86 AC_CHECK_FUNCS(getopt_long, [], [])
91 AC_DEFINE(FLAC__CPU_IA32)
92 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
96 AC_DEFINE(FLAC__CPU_PPC)
97 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
101 AC_DEFINE(FLAC__CPU_SPARC)
102 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
105 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
106 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
107 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
110 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
111 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
112 *-*-darwin*) OBJ_FORMAT=macho ;;
113 *emx*) OBJ_FORMAT=aout ;;
120 AC_DEFINE(FLAC__CPU_PPC_SPE)
121 AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI])
124 AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
127 *-*-cygwin|*mingw*|*emx*)
128 # define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
129 LT_NO_UNDEFINED="-no-undefined"
135 AC_SUBST(LT_NO_UNDEFINED)
140 AC_DEFINE(FLAC__SYS_LINUX)
141 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
145 AC_DEFINE(FLAC__SYS_DARWIN)
146 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
149 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
150 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
152 if test "x$cpu_ia32" = xtrue ; then
153 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
154 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
157 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
158 dnl ' Terminate the damn single quote
159 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
160 if test "x$asm_opt" = xno ; then
161 AC_DEFINE(FLAC__NO_ASM)
162 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
166 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
167 [case "${enableval}" in
170 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
172 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
175 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
176 [case "${enableval}" in
179 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
180 esac],[sse_os=false])
181 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
182 if test "x$sse_os" = xtrue ; then
183 AC_DEFINE(FLAC__SSE_OS)
184 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
188 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
189 [case "${enableval}" in
190 yes) use_3dnow=true ;;
191 no) use_3dnow=false ;;
192 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
193 esac],[use_3dnow=true])
194 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
195 if test "x$use_3dnow" = xtrue ; then
196 AC_DEFINE(FLAC__USE_3DNOW)
197 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
200 AC_ARG_ENABLE(altivec,
201 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
202 [case "${enableval}" in
203 yes) use_altivec=true ;;
204 no) use_altivec=false ;;
205 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
206 esac],[use_altivec=true])
207 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
208 if test "x$use_altivec" = xtrue ; then
209 AC_DEFINE(FLAC__USE_ALTIVEC)
210 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
213 AC_ARG_ENABLE(thorough-tests,
214 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
215 [case "${enableval}" in
216 yes) thorough_tests=true ;;
217 no) thorough_tests=false ;;
218 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
219 esac],[thorough_tests=true])
220 AC_ARG_ENABLE(exhaustive-tests,
221 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
222 [case "${enableval}" in
223 yes) exhaustive_tests=true ;;
224 no) exhaustive_tests=false ;;
225 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
226 esac],[exhaustive_tests=false])
227 if test "x$thorough_tests" = xfalse ; then
229 elif test "x$exhaustive_tests" = xfalse ; then
234 AC_SUBST(FLAC__TEST_LEVEL)
236 AC_ARG_ENABLE(gcc-werror,
237 AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]))
239 AC_ARG_ENABLE(valgrind-testing,
240 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
241 [case "${enableval}" in
242 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
243 no) FLAC__TEST_WITH_VALGRIND=no ;;
244 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
245 esac],[FLAC__TEST_WITH_VALGRIND=no])
246 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
248 AC_ARG_ENABLE(doxygen-docs,
249 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
250 [case "${enableval}" in
251 yes) enable_doxygen_docs=true ;;
252 no) enable_doxygen_docs=false ;;
253 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
254 esac],[enable_doxygen_docs=true])
255 if test "x$enable_doxygen_docs" != xfalse ; then
256 AC_CHECK_PROGS(DOXYGEN, doxygen)
258 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
260 AC_ARG_ENABLE(local-xmms-plugin,
261 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
262 [case "${enableval}" in
263 yes) install_xmms_plugin_locally=true ;;
264 no) install_xmms_plugin_locally=false ;;
265 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
266 esac],[install_xmms_plugin_locally=false])
267 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
269 AC_ARG_ENABLE(xmms-plugin,
270 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
271 [case "${enableval}" in
272 yes) enable_xmms_plugin=true ;;
273 no) enable_xmms_plugin=false ;;
274 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
275 esac],[enable_xmms_plugin=true])
276 if test "x$enable_xmms_plugin" != xfalse ; then
277 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
279 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
281 dnl build FLAC++ or not
282 AC_ARG_ENABLE([cpplibs],
283 AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
284 [case "${enableval}" in
285 yes) disable_cpplibs=false ;;
286 no) disable_cpplibs=true ;;
287 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
288 esac], [disable_cpplibs=false])
289 AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
291 dnl check for ogg library
293 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
294 [ want_ogg=$enableval ], [ want_ogg=yes ] )
296 if test "x$want_ogg" != "xno"; then
297 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
300 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
301 if test "x$have_ogg" = xyes ; then
302 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],1,[define if you have the ogg library])
304 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],0)
307 dnl check for i18n(internationalization); these are from libiconv/gettext
311 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
312 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
313 if test -n "$DOCBOOK_TO_MAN" ; then
314 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
315 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
318 # only matters for x86
319 AC_CHECK_PROGS(NASM, nasm)
320 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
321 if test -n "$NASM" ; then
322 AC_DEFINE(FLAC__HAS_NASM)
323 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
326 # only matters for PowerPC
327 AC_CHECK_PROGS(AS, as, as)
328 AC_CHECK_PROGS(GAS, gas, gas)
330 # try -v (apple as) and --version (gas) at the same time
331 test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
333 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
334 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
335 if test "$AS" = "as" ; then
336 AC_DEFINE(FLAC__HAS_AS)
337 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
339 if test "$AS" = "gas" ; then
340 # funniest. macro. ever.
341 AC_DEFINE(FLAC__HAS_GAS)
342 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
345 if test "x$debug" = xtrue; then
346 CPPFLAGS="-DDEBUG $CPPFLAGS"
349 CPPFLAGS="-DNDEBUG $CPPFLAGS"
350 if test "x$GCC" = xyes; then
351 if test "x$user_cflags" = x; then
352 CFLAGS="-O3 -funroll-loops -Wall -W -Winline"
359 if test x$ac_cv_c_compiler_gnu = xyes ; then
360 if test x$enable_gcc_werror = "xyes" ; then
361 CFLAGS="-Wall -Wextra -Werror $CFLAGS"
362 CXXFLAGS="-Wall -Wextra -Werror $CXXFLAGS"
365 if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elf; then
366 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
367 CFLAGS="$CFLAGS -fvisibility=hidden"
368 CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
371 if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
372 XIPH_ADD_CFLAGS([-fgnu89-inline])
377 XIPH_ADD_CFLAGS([-Wextra])
378 XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
381 mingw32msvc | mingw32 | freebsd* )
382 # Stack protector not working on these platforms 2013/03/09.
385 XIPH_ADD_CFLAGS([-fstack-protector --param ssp-buffer-size=4])
390 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
391 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
396 src/libFLAC/Makefile \
397 src/libFLAC/flac.pc \
398 src/libFLAC/ia32/Makefile \
399 src/libFLAC/ppc/Makefile \
400 src/libFLAC/ppc/as/Makefile \
401 src/libFLAC/ppc/gas/Makefile \
402 src/libFLAC/include/Makefile \
403 src/libFLAC/include/private/Makefile \
404 src/libFLAC/include/protected/Makefile \
405 src/libFLAC++/Makefile \
406 src/libFLAC++/flac++.pc \
408 src/metaflac/Makefile \
409 src/monkeys_audio_utilities/Makefile \
410 src/monkeys_audio_utilities/flac_mac/Makefile \
411 src/monkeys_audio_utilities/flac_ren/Makefile \
412 src/plugin_common/Makefile \
413 src/plugin_xmms/Makefile \
415 src/share/getopt/Makefile \
416 src/share/grabbag/Makefile \
417 src/share/replaygain_analysis/Makefile \
418 src/share/replaygain_synthesis/Makefile \
419 src/share/replaygain_synthesis/include/Makefile \
420 src/share/replaygain_synthesis/include/private/Makefile \
421 src/share/utf8/Makefile \
422 src/test_grabbag/Makefile \
423 src/test_grabbag/cuesheet/Makefile \
424 src/test_grabbag/picture/Makefile \
425 src/test_libs_common/Makefile \
426 src/test_libFLAC/Makefile \
427 src/test_libFLAC++/Makefile \
428 src/test_seeking/Makefile \
429 src/test_streams/Makefile \
431 src/utils/flacdiff/Makefile \
432 src/utils/flactimer/Makefile \
434 examples/c/Makefile \
435 examples/c/decode/Makefile \
436 examples/c/decode/file/Makefile \
437 examples/c/encode/Makefile \
438 examples/c/encode/file/Makefile \
439 examples/cpp/Makefile \
440 examples/cpp/decode/Makefile \
441 examples/cpp/decode/file/Makefile \
442 examples/cpp/encode/Makefile \
443 examples/cpp/encode/file/Makefile \
445 include/FLAC/Makefile \
446 include/FLAC++/Makefile \
447 include/share/Makefile \
448 include/share/grabbag/Makefile \
449 include/test_libs_common/Makefile \
453 doc/html/images/Makefile \
454 doc/html/images/hw/Makefile \
455 doc/html/ru/Makefile \
459 test/cuesheets/Makefile \
460 test/flac-to-flac-metadata-test-files/Makefile \
461 test/metaflac-test-files/Makefile \
462 test/pictures/Makefile \
465 objs/debug/Makefile \
466 objs/debug/bin/Makefile \
467 objs/debug/lib/Makefile \
468 objs/release/Makefile \
469 objs/release/bin/Makefile \
470 objs/release/lib/Makefile \
475 -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
477 Configuration summary :
479 FLAC version : ........................ ${VERSION}
481 Host CPU : ............................ ${host_cpu}
482 Host Vendor : ......................... ${host_vendor}
483 Host OS : ............................. ${host_os}
486 echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
487 if test x$ac_cv_c_compiler_gnu = xyes ; then
488 echo " GCC version : ......................... ${GCC_VERSION}"