1 # FLAC - Free Lossless Audio Codec
2 # Copyright (C) 2001,2002,2003,2004,2005 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-beta)
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
39 AC_CHECK_TYPES(socklen_t, [], [])
41 dnl check for getopt in standard library
42 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
43 AC_CHECK_FUNCS(getopt_long, [], [])
46 i*86) cpu_ia32=true ; AC_DEFINE(FLAC__CPU_IA32) ;;
47 powerpc) cpu_ppc=true ; AC_DEFINE(FLAC__CPU_PPC) ;;
48 sparc) cpu_sparc=true ; AC_DEFINE(FLAC__CPU_SPARC) ;;
50 AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue)
51 AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue)
52 AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue)
54 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
59 *-pc-linux-gnu) sys_linux=true ; AC_DEFINE(FLAC__SYS_LINUX) ;;
60 *-*-darwin*) sys_darwin=true ; AC_DEFINE(FLAC__SYS_DARWIN) ;;
62 AM_CONDITIONAL(FLaC__SYS_DARWIN, test x$sys_darwin = xtrue)
63 AM_CONDITIONAL(FLaC__SYS_LINUX, test x$sys_linux = xtrue)
65 if test x$cpu_ia32 = xtrue ; then
66 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
69 AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
70 AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
71 if test x$asm_opt = xno ; then
72 AC_DEFINE(FLAC__NO_ASM)
76 [ --enable-debug Turn on debugging],
77 [case "${enableval}" in
80 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
82 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
85 [ --enable-sse Enable SSE support by asserting that the OS supports SSE instructions],
86 [case "${enableval}" in
89 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
91 AM_CONDITIONAL(FLaC__SSE_OS, test x$sse_os = xtrue)
92 if test x$sse_os = xtrue ; then
93 AC_DEFINE(FLAC__SSE_OS)
97 [ --disable-3dnow Disable 3DNOW! optimizations],
98 [case "${enableval}" in
99 yes) use_3dnow=true ;;
100 no) use_3dnow=false ;;
101 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
102 esac],[use_3dnow=true])
103 AM_CONDITIONAL(FLaC__USE_3DNOW, test x$use_3dnow = xtrue)
104 if test x$use_3dnow = xtrue ; then
105 AC_DEFINE(FLAC__USE_3DNOW)
108 AC_ARG_ENABLE(altivec,
109 [ --disable-altivec Disable Altivec optimizations],
110 [case "${enableval}" in
111 yes) use_altivec=true ;;
112 no) use_altivec=false ;;
113 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
114 esac],[use_altivec=true])
115 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test x$use_altivec = xtrue)
116 if test x$use_altivec = xtrue ; then
117 AC_DEFINE(FLAC__USE_ALTIVEC)
120 AC_ARG_ENABLE(local-xmms-plugin,
121 [ --enable-local-xmms-plugin Install XMMS plugin to ~/.xmms/Plugins instead of system location],
122 [case "${enableval}" in
123 yes) install_xmms_plugin_locally=true ;;
124 no) install_xmms_plugin_locally=false ;;
125 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
126 esac],[install_xmms_plugin_locally=false])
127 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test x$install_xmms_plugin_locally = xtrue)
129 AC_ARG_ENABLE(exhaustive-tests,
130 [ --enable-exhaustive-tests Enable exhaustive testing],
131 [case "${enableval}" in
132 yes) exhaustive_tests=true ;;
133 no) exhaustive_tests=false ;;
134 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
135 esac],[exhaustive_tests=false])
136 AM_CONDITIONAL(FLaC__EXHAUSTIVE_TESTS, test x$exhaustive_tests = xtrue)
137 if test x$exhaustive_tests = xtrue ; then
138 AC_DEFINE(FLAC__EXHAUSTIVE_TESTS)
141 AC_ARG_ENABLE(valgrind-testing,
142 [ --enable-valgrind-testing Run all tests inside Valgrind],
143 [case "${enableval}" in
144 yes) valgrind_testing=true ;;
145 no) valgrind_testing=false ;;
146 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
147 esac],[valgrind_testing=false])
148 AM_CONDITIONAL(FLaC__VALGRIND_TESTING, test x$valgrind_testing = xtrue)
149 if test x$valgrind_testing = xtrue ; then
150 AC_DEFINE(FLAC__VALGRIND_TESTING)
153 dnl check for ogg library
154 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
155 AM_CONDITIONAL(FLaC__HAS_OGG, [test x$have_ogg = xyes])
156 if test x$have_ogg = xyes ; then
157 AC_DEFINE(FLAC__HAS_OGG)
160 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built]))
161 AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
163 dnl check for i18n(internationalization); these are from libiconv/gettext
167 AC_CHECK_PROGS(DOXYGEN, doxygen)
168 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
169 if test -n "$DOXYGEN" ; then
170 AC_DEFINE(FLAC__HAS_DOXYGEN)
173 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
174 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
175 if test -n "$DOCBOOK_TO_MAN" ; then
176 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
179 # only matters for x86
180 AC_CHECK_PROGS(NASM, nasm)
181 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
182 if test -n "$NASM" ; then
183 AC_DEFINE(FLAC__HAS_NASM)
186 # only matters for PowerPC
187 AC_CHECK_PROGS(AS, as)
188 AC_CHECK_PROGS(GAS, gas)
189 AM_CONDITIONAL(FLaC__HAS_AS, test -n "$AS")
190 AM_CONDITIONAL(FLaC__HAS_GAS, test -n "$GAS")
191 if test -n "$AS" ; then
192 AC_DEFINE(FLAC__HAS_AS)
194 if test -n "$GAS" ; then
195 # funniest. macro. ever.
196 AC_DEFINE(FLAC__HAS_GAS)
199 OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
200 if test x$debug = xtrue; then
201 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
203 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O2 -DNDEBUG"
204 if test x$GCC = xyes; then
205 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
208 CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"
209 CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS"
212 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
213 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
215 AM_CONFIG_HEADER(config.h)
216 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
217 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
218 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
219 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
220 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
221 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
222 AH_TEMPLATE(FLAC__EXHAUSTIVE_TESTS, [define to run even more tests])
223 AH_TEMPLATE(FLAC__VALGRIND_TESTING, [define to enable use of Valgrind in testers])
224 AH_TEMPLATE(FLAC__HAS_DOXYGEN, [define if you have Doxygen])
225 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
226 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
227 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
228 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
229 AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
230 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
231 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
232 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
233 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
238 src/libFLAC/Makefile \
239 src/libFLAC/ia32/Makefile \
240 src/libFLAC/ppc/Makefile \
241 src/libFLAC/ppc/as/Makefile \
242 src/libFLAC/ppc/gas/Makefile \
243 src/libFLAC/include/Makefile \
244 src/libFLAC/include/private/Makefile \
245 src/libFLAC/include/protected/Makefile \
246 src/libFLAC++/Makefile \
247 src/libOggFLAC/Makefile \
248 src/libOggFLAC/include/Makefile \
249 src/libOggFLAC/include/private/Makefile \
250 src/libOggFLAC/include/protected/Makefile \
251 src/libOggFLAC++/Makefile \
253 src/metaflac/Makefile \
254 src/monkeys_audio_utilities/Makefile \
255 src/monkeys_audio_utilities/flac_mac/Makefile \
256 src/monkeys_audio_utilities/flac_ren/Makefile \
257 src/plugin_common/Makefile \
258 src/plugin_winamp2/Makefile \
259 src/plugin_winamp2/include/Makefile \
260 src/plugin_winamp2/include/winamp2/Makefile \
261 src/plugin_xmms/Makefile \
263 src/share/getopt/Makefile \
264 src/share/grabbag/Makefile \
265 src/share/replaygain_analysis/Makefile \
266 src/share/replaygain_synthesis/Makefile \
267 src/share/replaygain_synthesis/include/Makefile \
268 src/share/replaygain_synthesis/include/private/Makefile \
269 src/share/utf8/Makefile \
270 src/test_grabbag/Makefile \
271 src/test_grabbag/cuesheet/Makefile \
272 src/test_libFLAC/Makefile \
273 src/test_libFLAC++/Makefile \
274 src/test_libOggFLAC/Makefile \
275 src/test_libOggFLAC++/Makefile \
276 src/test_seeking/Makefile \
277 src/test_streams/Makefile \
279 include/FLAC/Makefile \
280 include/FLAC++/Makefile \
281 include/OggFLAC/Makefile \
282 include/OggFLAC++/Makefile \
283 include/share/Makefile \
284 include/share/grabbag/Makefile \
287 doc/html/images/Makefile \
288 doc/html/ru/Makefile \
291 test/cuesheets/Makefile \
295 obj/debug/bin/Makefile \
296 obj/debug/lib/Makefile \
297 obj/release/Makefile \
298 obj/release/bin/Makefile \
299 obj/release/lib/Makefile \
300 flac.pbproj/Makefile \