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.2)
23 AM_INIT_AUTOMAKE(flac, CVS)
25 # Don't automagically regenerate autoconf/automake generated files unless
26 # explicitly requested. Eases autobuilding -mdz
29 # We need two libtools, one that builds both shared and static, and
30 # one that builds only static. This is because the resulting libtool
31 # does not allow us to choose which to build at runtime.
33 sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
34 chmod +x libtool-disable-static
36 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
42 AC_CHECK_TYPES(socklen_t, [], [])
44 dnl check for getopt in standard library
45 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
46 AC_CHECK_FUNCS(getopt_long, [], [])
49 i*86) cpu_ia32=true ; AC_DEFINE(FLAC__CPU_IA32) ;;
50 powerpc) cpu_ppc=true ; AC_DEFINE(FLAC__CPU_PPC) ;;
51 sparc) cpu_sparc=true ; AC_DEFINE(FLAC__CPU_SPARC) ;;
53 AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue)
54 AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue)
55 AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue)
57 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
58 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
63 *-pc-linux-gnu) sys_linux=true ; AC_DEFINE(FLAC__SYS_LINUX) ;;
64 *-*-darwin*) sys_darwin=true ; AC_DEFINE(FLAC__SYS_DARWIN) ;;
66 AM_CONDITIONAL(FLaC__SYS_DARWIN, test x$sys_darwin = xtrue)
67 AM_CONDITIONAL(FLaC__SYS_LINUX, test x$sys_linux = xtrue)
69 if test x$cpu_ia32 = xtrue ; then
70 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
73 AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
74 AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
75 if test x$asm_opt = xno ; then
76 AC_DEFINE(FLAC__NO_ASM)
80 [ --enable-debug Turn on debugging],
81 [case "${enableval}" in
84 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
86 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
89 [ --enable-sse Enable SSE support by asserting that the OS supports SSE instructions],
90 [case "${enableval}" in
93 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
95 AM_CONDITIONAL(FLaC__SSE_OS, test x$sse_os = xtrue)
96 if test x$sse_os = xtrue ; then
97 AC_DEFINE(FLAC__SSE_OS)
101 [ --disable-3dnow Disable 3DNOW! optimizations],
102 [case "${enableval}" in
103 yes) use_3dnow=true ;;
104 no) use_3dnow=false ;;
105 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
106 esac],[use_3dnow=true])
107 AM_CONDITIONAL(FLaC__USE_3DNOW, test x$use_3dnow = xtrue)
108 if test x$use_3dnow = xtrue ; then
109 AC_DEFINE(FLAC__USE_3DNOW)
112 AC_ARG_ENABLE(altivec,
113 [ --disable-altivec Disable Altivec optimizations],
114 [case "${enableval}" in
115 yes) use_altivec=true ;;
116 no) use_altivec=false ;;
117 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
118 esac],[use_altivec=true])
119 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test x$use_altivec = xtrue)
120 if test x$use_altivec = xtrue ; then
121 AC_DEFINE(FLAC__USE_ALTIVEC)
124 AC_ARG_ENABLE(local-xmms-plugin,
125 [ --enable-local-xmms-plugin Install XMMS plugin to ~/.xmms/Plugins instead of system location],
126 [case "${enableval}" in
127 yes) install_xmms_plugin_locally=true ;;
128 no) install_xmms_plugin_locally=false ;;
129 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
130 esac],[install_xmms_plugin_locally=false])
131 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test x$install_xmms_plugin_locally = xtrue)
133 AC_ARG_ENABLE(exhaustive-tests,
134 [ --enable-exhaustive-tests Enable exhaustive testing],
135 [case "${enableval}" in
136 yes) exhaustive_tests=true ;;
137 no) exhaustive_tests=false ;;
138 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
139 esac],[exhaustive_tests=false])
140 AM_CONDITIONAL(FLaC__EXHAUSTIVE_TESTS, test x$exhaustive_tests = xtrue)
141 if test x$exhaustive_tests = xtrue ; then
142 AC_DEFINE(FLAC__EXHAUSTIVE_TESTS)
145 AC_ARG_ENABLE(valgrind-testing,
146 [ --enable-valgrind-testing Run all tests inside Valgrind],
147 [case "${enableval}" in
148 yes) valgrind_testing=true ;;
149 no) valgrind_testing=false ;;
150 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
151 esac],[valgrind_testing=false])
152 AM_CONDITIONAL(FLaC__VALGRIND_TESTING, test x$valgrind_testing = xtrue)
153 if test x$valgrind_testing = xtrue ; then
154 AC_DEFINE(FLAC__VALGRIND_TESTING)
157 dnl check for ogg library
158 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
159 AM_CONDITIONAL(FLaC__HAS_OGG, [test x$have_ogg = xyes])
160 if test x$have_ogg = xyes ; then
161 AC_DEFINE(FLAC__HAS_OGG)
164 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built]))
165 AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
167 dnl check for i18n(internationalization); these are from libiconv/gettext
171 AC_ARG_ENABLE(doxygen_docs, AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]))
172 if "x$enable_doxygen_docs" != "xno"; then
173 AC_CHECK_PROGS(DOXYGEN, doxygen)
175 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
176 if test -n "$DOXYGEN" ; then
177 AC_DEFINE(FLAC__HAS_DOXYGEN)
180 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
181 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
182 if test -n "$DOCBOOK_TO_MAN" ; then
183 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
186 # only matters for x86
187 AC_CHECK_PROGS(NASM, nasm)
188 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
189 if test -n "$NASM" ; then
190 AC_DEFINE(FLAC__HAS_NASM)
193 # only matters for PowerPC
194 AC_CHECK_PROGS(AS, as, as)
195 AC_CHECK_PROGS(GAS, gas, gas)
197 test "$AS" = "as" && as --version | grep GNU >/dev/null && AS=gas
199 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
200 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
201 if test "$AS" = "as" ; then
202 AC_DEFINE(FLAC__HAS_AS)
204 if test "$AS" = "gas" ; then
205 # funniest. macro. ever.
206 AC_DEFINE(FLAC__HAS_GAS)
209 OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
210 if test x$debug = xtrue; then
211 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
213 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O2 -DNDEBUG"
214 if test x$GCC = xyes; then
215 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
218 CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"
219 CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS"
222 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
223 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
225 AM_CONFIG_HEADER(config.h)
226 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
227 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
228 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
229 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
230 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
231 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
232 AH_TEMPLATE(FLAC__EXHAUSTIVE_TESTS, [define to run even more tests])
233 AH_TEMPLATE(FLAC__VALGRIND_TESTING, [define to enable use of Valgrind in testers])
234 AH_TEMPLATE(FLAC__HAS_DOXYGEN, [define if you have Doxygen])
235 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
236 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
237 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
238 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
239 AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
240 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
241 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
242 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
243 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
248 src/libFLAC/Makefile \
249 src/libFLAC/ia32/Makefile \
250 src/libFLAC/ppc/Makefile \
251 src/libFLAC/ppc/as/Makefile \
252 src/libFLAC/ppc/gas/Makefile \
253 src/libFLAC/include/Makefile \
254 src/libFLAC/include/private/Makefile \
255 src/libFLAC/include/protected/Makefile \
256 src/libFLAC++/Makefile \
257 src/libOggFLAC/Makefile \
258 src/libOggFLAC/include/Makefile \
259 src/libOggFLAC/include/private/Makefile \
260 src/libOggFLAC/include/protected/Makefile \
261 src/libOggFLAC++/Makefile \
263 src/metaflac/Makefile \
264 src/monkeys_audio_utilities/Makefile \
265 src/monkeys_audio_utilities/flac_mac/Makefile \
266 src/monkeys_audio_utilities/flac_ren/Makefile \
267 src/plugin_common/Makefile \
268 src/plugin_winamp2/Makefile \
269 src/plugin_winamp2/include/Makefile \
270 src/plugin_winamp2/include/winamp2/Makefile \
271 src/plugin_xmms/Makefile \
273 src/share/getopt/Makefile \
274 src/share/grabbag/Makefile \
275 src/share/replaygain_analysis/Makefile \
276 src/share/replaygain_synthesis/Makefile \
277 src/share/replaygain_synthesis/include/Makefile \
278 src/share/replaygain_synthesis/include/private/Makefile \
279 src/share/utf8/Makefile \
280 src/test_grabbag/Makefile \
281 src/test_grabbag/cuesheet/Makefile \
282 src/test_libFLAC/Makefile \
283 src/test_libFLAC++/Makefile \
284 src/test_libOggFLAC/Makefile \
285 src/test_libOggFLAC++/Makefile \
286 src/test_seeking/Makefile \
287 src/test_streams/Makefile \
289 include/FLAC/Makefile \
290 include/FLAC++/Makefile \
291 include/OggFLAC/Makefile \
292 include/OggFLAC++/Makefile \
293 include/share/Makefile \
294 include/share/grabbag/Makefile \
297 doc/html/images/Makefile \
298 doc/html/ru/Makefile \
301 test/cuesheets/Makefile \
305 obj/debug/bin/Makefile \
306 obj/debug/lib/Makefile \
307 obj/release/Makefile \
308 obj/release/bin/Makefile \
309 obj/release/lib/Makefile \
310 flac.pbproj/Makefile \