1 # FLAC - Free Lossless Audio Codec
2 # Copyright (C) 2001,2002,2003,2004,2005,2006 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
21 AC_INIT(src/flac/main.c)
22 AM_INIT_AUTOMAKE(flac, 1.1.3)
24 # Don't automagically regenerate autoconf/automake generated files unless
25 # explicitly requested. Eases autobuilding -mdz
28 # We need two libtools, one that builds both shared and static, and
29 # one that builds only static. This is because the resulting libtool
30 # does not allow us to choose which to build at runtime.
32 sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
33 chmod +x libtool-disable-static
35 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
44 #@@@ new name is AC_CONFIG_HEADERS
45 AM_CONFIG_HEADER(config.h)
49 AC_CHECK_TYPES(socklen_t, [], [])
51 dnl check for getopt in standard library
52 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
53 AC_CHECK_FUNCS(getopt_long, [], [])
58 AC_DEFINE(FLAC__CPU_IA32)
59 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
63 AC_DEFINE(FLAC__CPU_PPC)
64 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
68 AC_DEFINE(FLAC__CPU_SPARC)
69 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
72 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
73 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
74 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
76 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
77 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
78 *-*-darwin*) OBJ_FORMAT=macho ;;
85 AC_DEFINE(FLAC__SYS_LINUX)
86 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
90 AC_DEFINE(FLAC__SYS_DARWIN)
91 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
94 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
95 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
97 if test "x$cpu_ia32" = xtrue ; then
98 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
99 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
102 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
103 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
104 if test "x$asm_opt" = xno ; then
105 AC_DEFINE(FLAC__NO_ASM)
106 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
110 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
111 [case "${enableval}" in
114 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
116 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
119 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
120 [case "${enableval}" in
123 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
124 esac],[sse_os=false])
125 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
126 if test "x$sse_os" = xtrue ; then
127 AC_DEFINE(FLAC__SSE_OS)
128 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
132 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
133 [case "${enableval}" in
134 yes) use_3dnow=true ;;
135 no) use_3dnow=false ;;
136 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
137 esac],[use_3dnow=true])
138 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
139 if test "x$use_3dnow" = xtrue ; then
140 AC_DEFINE(FLAC__USE_3DNOW)
141 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
144 AC_ARG_ENABLE(altivec,
145 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
146 [case "${enableval}" in
147 yes) use_altivec=true ;;
148 no) use_altivec=false ;;
149 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
150 esac],[use_altivec=true])
151 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
152 if test "x$use_altivec" = xtrue ; then
153 AC_DEFINE(FLAC__USE_ALTIVEC)
154 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
157 AC_ARG_ENABLE(thorough-tests,
158 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
159 [case "${enableval}" in
160 yes) thorough_tests=true ;;
161 no) thorough_tests=false ;;
162 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
163 esac],[thorough_tests=true])
164 AC_ARG_ENABLE(exhaustive-tests,
165 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
166 [case "${enableval}" in
167 yes) exhaustive_tests=true ;;
168 no) exhaustive_tests=false ;;
169 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
170 esac],[exhaustive_tests=false])
171 if test "x$thorough_tests" = xfalse ; then
173 elif test "x$exhaustive_tests" = xfalse ; then
178 AC_SUBST(FLAC__TEST_LEVEL)
180 AC_ARG_ENABLE(valgrind-testing,
181 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
182 [case "${enableval}" in
183 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
184 no) FLAC__TEST_WITH_VALGRIND=no ;;
185 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
186 esac],[FLAC__TEST_WITH_VALGRIND=no])
187 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
189 AC_ARG_ENABLE(doxygen-docs,
190 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
191 [case "${enableval}" in
192 yes) enable_doxygen_docs=true ;;
193 no) enable_doxygen_docs=false ;;
194 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
195 esac],[enable_doxygen_docs=true])
196 if test "x$enable_doxygen_docs" != xfalse ; then
197 AC_CHECK_PROGS(DOXYGEN, doxygen)
199 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
201 AC_ARG_ENABLE(local-xmms-plugin,
202 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
203 [case "${enableval}" in
204 yes) install_xmms_plugin_locally=true ;;
205 no) install_xmms_plugin_locally=false ;;
206 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
207 esac],[install_xmms_plugin_locally=false])
208 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
210 AC_ARG_ENABLE(xmms-plugin,
211 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
212 [case "${enableval}" in
213 yes) enable_xmms_plugin=true ;;
214 no) enable_xmms_plugin=false ;;
215 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
216 esac],[enable_xmms_plugin=true])
217 if test "x$enable_xmms_plugin" != xfalse ; then
218 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
220 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
222 dnl check for ogg library
223 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
224 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
225 if test "x$have_ogg" = xyes ; then
226 AC_DEFINE(FLAC__HAS_OGG)
227 AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
230 dnl check for i18n(internationalization); these are from libiconv/gettext
234 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
235 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
236 if test -n "$DOCBOOK_TO_MAN" ; then
237 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
238 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
241 # only matters for x86
242 AC_CHECK_PROGS(NASM, nasm)
243 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
244 if test -n "$NASM" ; then
245 AC_DEFINE(FLAC__HAS_NASM)
246 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
249 # only matters for PowerPC
250 AC_CHECK_PROGS(AS, as, as)
251 AC_CHECK_PROGS(GAS, gas, gas)
253 # try -v (apple as) and --version (gas) at the same time
254 test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
256 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
257 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
258 if test "$AS" = "as" ; then
259 AC_DEFINE(FLAC__HAS_AS)
260 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
262 if test "$AS" = "gas" ; then
263 # funniest. macro. ever.
264 AC_DEFINE(FLAC__HAS_GAS)
265 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
268 OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
269 if test "x$debug" = xtrue; then
270 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -DDEBUG"
272 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -DNDEBUG"
273 if test "x$GCC" = xyes; then
274 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
277 CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"
278 CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS"
281 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
282 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
287 src/libFLAC/Makefile \
288 src/libFLAC/ia32/Makefile \
289 src/libFLAC/ppc/Makefile \
290 src/libFLAC/ppc/as/Makefile \
291 src/libFLAC/ppc/gas/Makefile \
292 src/libFLAC/include/Makefile \
293 src/libFLAC/include/private/Makefile \
294 src/libFLAC/include/protected/Makefile \
295 src/libFLAC++/Makefile \
297 src/metaflac/Makefile \
298 src/monkeys_audio_utilities/Makefile \
299 src/monkeys_audio_utilities/flac_mac/Makefile \
300 src/monkeys_audio_utilities/flac_ren/Makefile \
301 src/plugin_common/Makefile \
302 src/plugin_winamp2/Makefile \
303 src/plugin_winamp2/include/Makefile \
304 src/plugin_winamp2/include/winamp2/Makefile \
305 src/plugin_xmms/Makefile \
307 src/share/getopt/Makefile \
308 src/share/grabbag/Makefile \
309 src/share/replaygain_analysis/Makefile \
310 src/share/replaygain_synthesis/Makefile \
311 src/share/replaygain_synthesis/include/Makefile \
312 src/share/replaygain_synthesis/include/private/Makefile \
313 src/share/utf8/Makefile \
314 src/test_grabbag/Makefile \
315 src/test_grabbag/cuesheet/Makefile \
316 src/test_grabbag/picture/Makefile \
317 src/test_libs_common/Makefile \
318 src/test_libFLAC/Makefile \
319 src/test_libFLAC++/Makefile \
320 src/test_seeking/Makefile \
321 src/test_streams/Makefile \
323 include/FLAC/Makefile \
324 include/FLAC++/Makefile \
325 include/share/Makefile \
326 include/share/grabbag/Makefile \
327 include/test_libs_common/Makefile \
330 doc/html/images/Makefile \
331 doc/html/ru/Makefile \
335 test/cuesheets/Makefile \
336 test/flac-to-flac-metadata-test-files/Makefile \
337 test/metaflac-test-files/Makefile \
338 test/pictures/Makefile \
342 obj/debug/bin/Makefile \
343 obj/debug/lib/Makefile \
344 obj/release/Makefile \
345 obj/release/bin/Makefile \
346 obj/release/lib/Makefile \
347 flac.pbproj/Makefile \