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-beta2)
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)
47 AC_CHECK_TYPES(socklen_t, [], [])
49 dnl check for getopt in standard library
50 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
51 AC_CHECK_FUNCS(getopt_long, [], [])
56 AC_DEFINE(FLAC__CPU_IA32)
57 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
61 AC_DEFINE(FLAC__CPU_PPC)
62 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
66 AC_DEFINE(FLAC__CPU_SPARC)
67 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
70 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
71 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
72 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
74 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
75 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
82 AC_DEFINE(FLAC__SYS_LINUX)
83 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
87 AC_DEFINE(FLAC__SYS_DARWIN)
88 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
91 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
92 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
94 if test "x$cpu_ia32" = xtrue ; then
95 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
96 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
99 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
100 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
101 if test "x$asm_opt" = xno ; then
102 AC_DEFINE(FLAC__NO_ASM)
103 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
107 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
108 [case "${enableval}" in
111 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
113 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
116 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
117 [case "${enableval}" in
120 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
121 esac],[sse_os=false])
122 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
123 if test "x$sse_os" = xtrue ; then
124 AC_DEFINE(FLAC__SSE_OS)
125 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
129 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
130 [case "${enableval}" in
131 yes) use_3dnow=true ;;
132 no) use_3dnow=false ;;
133 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
134 esac],[use_3dnow=true])
135 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
136 if test "x$use_3dnow" = xtrue ; then
137 AC_DEFINE(FLAC__USE_3DNOW)
138 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
141 AC_ARG_ENABLE(altivec,
142 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
143 [case "${enableval}" in
144 yes) use_altivec=true ;;
145 no) use_altivec=false ;;
146 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
147 esac],[use_altivec=true])
148 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
149 if test "x$use_altivec" = xtrue ; then
150 AC_DEFINE(FLAC__USE_ALTIVEC)
151 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
154 AC_ARG_ENABLE(thorough-tests,
155 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
156 [case "${enableval}" in
157 yes) thorough_tests=true ;;
158 no) thorough_tests=false ;;
159 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
160 esac],[thorough_tests=true])
161 AC_ARG_ENABLE(exhaustive-tests,
162 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
163 [case "${enableval}" in
164 yes) exhaustive_tests=true ;;
165 no) exhaustive_tests=false ;;
166 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
167 esac],[exhaustive_tests=false])
168 if test "x$thorough_tests" = xfalse ; then
170 elif test "x$exhaustive_tests" = xfalse ; then
175 AC_SUBST(FLAC__TEST_LEVEL)
177 AC_ARG_ENABLE(valgrind-testing,
178 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
179 [case "${enableval}" in
180 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
181 no) FLAC__TEST_WITH_VALGRIND=no ;;
182 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
183 esac],[FLAC__TEST_WITH_VALGRIND=no])
184 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
186 AC_ARG_ENABLE(doxygen-docs,
187 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
188 [case "${enableval}" in
189 yes) enable_doxygen_docs=true ;;
190 no) enable_doxygen_docs=false ;;
191 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
192 esac],[enable_doxygen_docs=true])
193 if test "x$enable_doxygen_docs" != xfalse ; then
194 AC_CHECK_PROGS(DOXYGEN, doxygen)
196 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
198 AC_ARG_ENABLE(local-xmms-plugin,
199 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
200 [case "${enableval}" in
201 yes) install_xmms_plugin_locally=true ;;
202 no) install_xmms_plugin_locally=false ;;
203 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
204 esac],[install_xmms_plugin_locally=false])
205 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
207 AC_ARG_ENABLE(xmms-plugin,
208 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
209 [case "${enableval}" in
210 yes) enable_xmms_plugin=true ;;
211 no) enable_xmms_plugin=false ;;
212 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
213 esac],[enable_xmms_plugin=true])
214 if test "x$enable_xmms_plugin" != xfalse ; then
215 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
217 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
219 dnl check for ogg library
220 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
221 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
222 if test "x$have_ogg" = xyes ; then
223 AC_DEFINE(FLAC__HAS_OGG)
224 AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
227 dnl check for i18n(internationalization); these are from libiconv/gettext
231 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
232 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
233 if test -n "$DOCBOOK_TO_MAN" ; then
234 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
235 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
238 # only matters for x86
239 AC_CHECK_PROGS(NASM, nasm)
240 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
241 if test -n "$NASM" ; then
242 AC_DEFINE(FLAC__HAS_NASM)
243 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
246 # only matters for PowerPC
247 AC_CHECK_PROGS(AS, as, as)
248 AC_CHECK_PROGS(GAS, gas, gas)
250 test "$AS" = "as" && as --version | grep GNU >/dev/null && AS=gas
252 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
253 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
254 if test "$AS" = "as" ; then
255 AC_DEFINE(FLAC__HAS_AS)
256 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
258 if test "$AS" = "gas" ; then
259 # funniest. macro. ever.
260 AC_DEFINE(FLAC__HAS_GAS)
261 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
264 OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
265 if test "x$debug" = xtrue; then
266 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
268 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O2 -DNDEBUG"
269 if test "x$GCC" = xyes; then
270 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
273 CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"
274 CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS"
277 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
278 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
283 src/libFLAC/Makefile \
284 src/libFLAC/ia32/Makefile \
285 src/libFLAC/ppc/Makefile \
286 src/libFLAC/ppc/as/Makefile \
287 src/libFLAC/ppc/gas/Makefile \
288 src/libFLAC/include/Makefile \
289 src/libFLAC/include/private/Makefile \
290 src/libFLAC/include/protected/Makefile \
291 src/libFLAC++/Makefile \
293 src/metaflac/Makefile \
294 src/monkeys_audio_utilities/Makefile \
295 src/monkeys_audio_utilities/flac_mac/Makefile \
296 src/monkeys_audio_utilities/flac_ren/Makefile \
297 src/plugin_common/Makefile \
298 src/plugin_winamp2/Makefile \
299 src/plugin_winamp2/include/Makefile \
300 src/plugin_winamp2/include/winamp2/Makefile \
301 src/plugin_xmms/Makefile \
303 src/share/getopt/Makefile \
304 src/share/grabbag/Makefile \
305 src/share/replaygain_analysis/Makefile \
306 src/share/replaygain_synthesis/Makefile \
307 src/share/replaygain_synthesis/include/Makefile \
308 src/share/replaygain_synthesis/include/private/Makefile \
309 src/share/utf8/Makefile \
310 src/test_grabbag/Makefile \
311 src/test_grabbag/cuesheet/Makefile \
312 src/test_grabbag/picture/Makefile \
313 src/test_libs_common/Makefile \
314 src/test_libFLAC/Makefile \
315 src/test_libFLAC++/Makefile \
316 src/test_seeking/Makefile \
317 src/test_streams/Makefile \
319 include/FLAC/Makefile \
320 include/FLAC++/Makefile \
321 include/share/Makefile \
322 include/share/grabbag/Makefile \
323 include/test_libs_common/Makefile \
326 doc/html/images/Makefile \
327 doc/html/ru/Makefile \
330 test/cuesheets/Makefile \
331 test/flac-to-flac-metadata-test-files/Makefile \
332 test/metaflac-test-files/Makefile \
333 test/pictures/Makefile \
337 obj/debug/bin/Makefile \
338 obj/debug/lib/Makefile \
339 obj/release/Makefile \
340 obj/release/bin/Makefile \
341 obj/release/lib/Makefile \
342 flac.pbproj/Makefile \