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")
45 #@@@ new name is AC_CONFIG_HEADERS
46 AM_CONFIG_HEADER(config.h)
48 AC_CHECK_TYPES(socklen_t, [], [])
50 dnl check for getopt in standard library
51 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
52 AC_CHECK_FUNCS(getopt_long, [], [])
57 AC_DEFINE(FLAC__CPU_IA32)
58 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
62 AC_DEFINE(FLAC__CPU_PPC)
63 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
67 AC_DEFINE(FLAC__CPU_SPARC)
68 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
71 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
72 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
73 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
75 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
76 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
83 AC_DEFINE(FLAC__SYS_LINUX)
84 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
88 AC_DEFINE(FLAC__SYS_DARWIN)
89 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
92 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
93 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
95 if test "x$cpu_ia32" = xtrue ; then
96 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
97 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
100 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
101 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
102 if test "x$asm_opt" = xno ; then
103 AC_DEFINE(FLAC__NO_ASM)
104 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
108 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
109 [case "${enableval}" in
112 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
114 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
117 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
118 [case "${enableval}" in
121 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
122 esac],[sse_os=false])
123 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
124 if test "x$sse_os" = xtrue ; then
125 AC_DEFINE(FLAC__SSE_OS)
126 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
130 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
131 [case "${enableval}" in
132 yes) use_3dnow=true ;;
133 no) use_3dnow=false ;;
134 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
135 esac],[use_3dnow=true])
136 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
137 if test "x$use_3dnow" = xtrue ; then
138 AC_DEFINE(FLAC__USE_3DNOW)
139 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
142 AC_ARG_ENABLE(altivec,
143 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
144 [case "${enableval}" in
145 yes) use_altivec=true ;;
146 no) use_altivec=false ;;
147 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
148 esac],[use_altivec=true])
149 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
150 if test "x$use_altivec" = xtrue ; then
151 AC_DEFINE(FLAC__USE_ALTIVEC)
152 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
155 AC_ARG_ENABLE(local-xmms-plugin,
156 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
157 [case "${enableval}" in
158 yes) install_xmms_plugin_locally=true ;;
159 no) install_xmms_plugin_locally=false ;;
160 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
161 esac],[install_xmms_plugin_locally=false])
162 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
164 AC_ARG_ENABLE(thorough-tests,
165 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
166 [case "${enableval}" in
167 yes) thorough_tests=true ;;
168 no) thorough_tests=false ;;
169 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
170 esac],[thorough_tests=true])
171 AC_ARG_ENABLE(exhaustive-tests,
172 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
173 [case "${enableval}" in
174 yes) exhaustive_tests=true ;;
175 no) exhaustive_tests=false ;;
176 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
177 esac],[exhaustive_tests=false])
178 if test "x$thorough_tests" = xfalse ; then
180 elif test "x$exhaustive_tests" = xfalse ; then
185 AC_SUBST(FLAC__TEST_LEVEL)
187 AC_ARG_ENABLE(valgrind-testing,
188 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
189 [case "${enableval}" in
190 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
191 no) FLAC__TEST_WITH_VALGRIND=no ;;
192 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
193 esac],[FLAC__TEST_WITH_VALGRIND=no])
194 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
196 AC_ARG_ENABLE(doxygen-docs,
197 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
198 [case "${enableval}" in
199 yes) enable_doxygen_docs=true ;;
200 no) enable_doxygen_docs=false ;;
201 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
202 esac],[enable_doxygen_docs=true])
203 if test "x$enable_doxygen_docs" != xno ; then
204 AC_CHECK_PROGS(DOXYGEN, doxygen)
206 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
208 dnl check for ogg library
209 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
210 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
211 if test "x$have_ogg" = xyes ; then
212 AC_DEFINE(FLAC__HAS_OGG)
213 AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
216 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 i18n(internationalization); these are from libiconv/gettext
223 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
224 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
225 if test -n "$DOCBOOK_TO_MAN" ; then
226 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
227 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
230 # only matters for x86
231 AC_CHECK_PROGS(NASM, nasm)
232 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
233 if test -n "$NASM" ; then
234 AC_DEFINE(FLAC__HAS_NASM)
235 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
238 # only matters for PowerPC
239 AC_CHECK_PROGS(AS, as, as)
240 AC_CHECK_PROGS(GAS, gas, gas)
242 test "$AS" = "as" && as --version | grep GNU >/dev/null && AS=gas
244 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
245 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
246 if test "$AS" = "as" ; then
247 AC_DEFINE(FLAC__HAS_AS)
248 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
250 if test "$AS" = "gas" ; then
251 # funniest. macro. ever.
252 AC_DEFINE(FLAC__HAS_GAS)
253 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
256 OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
257 if test "x$debug" = xtrue; then
258 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
260 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O2 -DNDEBUG"
261 if test "x$GCC" = xyes; then
262 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
265 CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"
266 CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS"
269 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
270 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
275 src/libFLAC/Makefile \
276 src/libFLAC/ia32/Makefile \
277 src/libFLAC/ppc/Makefile \
278 src/libFLAC/ppc/as/Makefile \
279 src/libFLAC/ppc/gas/Makefile \
280 src/libFLAC/include/Makefile \
281 src/libFLAC/include/private/Makefile \
282 src/libFLAC/include/protected/Makefile \
283 src/libFLAC++/Makefile \
284 src/libOggFLAC/Makefile \
285 src/libOggFLAC/include/Makefile \
286 src/libOggFLAC/include/private/Makefile \
287 src/libOggFLAC/include/protected/Makefile \
288 src/libOggFLAC++/Makefile \
290 src/metaflac/Makefile \
291 src/monkeys_audio_utilities/Makefile \
292 src/monkeys_audio_utilities/flac_mac/Makefile \
293 src/monkeys_audio_utilities/flac_ren/Makefile \
294 src/plugin_common/Makefile \
295 src/plugin_winamp2/Makefile \
296 src/plugin_winamp2/include/Makefile \
297 src/plugin_winamp2/include/winamp2/Makefile \
298 src/plugin_xmms/Makefile \
300 src/share/getopt/Makefile \
301 src/share/grabbag/Makefile \
302 src/share/replaygain_analysis/Makefile \
303 src/share/replaygain_synthesis/Makefile \
304 src/share/replaygain_synthesis/include/Makefile \
305 src/share/replaygain_synthesis/include/private/Makefile \
306 src/share/utf8/Makefile \
307 src/test_grabbag/Makefile \
308 src/test_grabbag/cuesheet/Makefile \
309 src/test_libFLAC/Makefile \
310 src/test_libFLAC++/Makefile \
311 src/test_libOggFLAC/Makefile \
312 src/test_libOggFLAC++/Makefile \
313 src/test_seeking/Makefile \
314 src/test_streams/Makefile \
316 include/FLAC/Makefile \
317 include/FLAC++/Makefile \
318 include/OggFLAC/Makefile \
319 include/OggFLAC++/Makefile \
320 include/share/Makefile \
321 include/share/grabbag/Makefile \
324 doc/html/images/Makefile \
325 doc/html/ru/Makefile \
328 test/cuesheets/Makefile \
332 obj/debug/bin/Makefile \
333 obj/debug/lib/Makefile \
334 obj/release/Makefile \
335 obj/release/bin/Makefile \
336 obj/release/lib/Makefile \
337 flac.pbproj/Makefile \