blob: b6b8e67fe4a31e643385146da8d506714aafd91d [file] [log] [blame]
Josh Coalson6b05bc52001-06-08 00:13:21 +00001# FLAC - Free Lossless Audio Codec
Josh Coalson95643902004-01-17 04:14:43 +00002# Copyright (C) 2001,2002,2003,2004 Josh Coalson
Josh Coalson6b05bc52001-06-08 00:13:21 +00003#
Josh Coalsone8a76012003-02-07 00:14:32 +00004# 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
11# distributed.
Josh Coalson6b05bc52001-06-08 00:13:21 +000012#
Josh Coalsone8a76012003-02-07 00:14:32 +000013# 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
16# distribution.
Josh Coalson6b05bc52001-06-08 00:13:21 +000017
Josh Coalson0e3576e2001-05-25 00:07:51 +000018# NOTE that for many of the AM_CONDITIONALs we use the prefix FLaC__
Josh Coalsoncf030c82001-05-23 20:59:48 +000019# instead of FLAC__ since autoconf triggers off 'AC_' in strings
20
Josh Coalson9f429ba2001-01-19 22:39:39 +000021AC_INIT(src/flac/main.c)
Josh Coalsonc28ec322004-09-10 00:20:04 +000022AM_INIT_AUTOMAKE(flac, 1.1.1)
Josh Coalson9f429ba2001-01-19 22:39:39 +000023
Matt Zimmerman057b5322002-10-05 14:41:19 +000024# Don't automagically regenerate autoconf/automake generated files unless
25# explicitly requested. Eases autobuilding -mdz
26AM_MAINTAINER_MODE
27
Josh Coalson9f429ba2001-01-19 22:39:39 +000028# 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.
31AM_PROG_LIBTOOL
32sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
33chmod +x libtool-disable-static
34
Josh Coalson985dd8d2004-07-29 05:25:36 +000035AM_PROG_AS
Josh Coalson57ba6f42002-06-07 05:27:37 +000036AC_PROG_CXX
Josh Coalson9f429ba2001-01-19 22:39:39 +000037AC_PROG_MAKE_SET
38
Josh Coalson5a804ca2002-05-17 06:08:13 +000039dnl check for getopt in standard library
40dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
41AC_CHECK_FUNCS(getopt_long, [], [])
42
Josh Coalsondef8eb82001-05-23 22:08:27 +000043AC_CANONICAL_HOST
Josh Coalson5a804ca2002-05-17 06:08:13 +000044case "$host_cpu" in
Josh Coalson0e3576e2001-05-25 00:07:51 +000045 i*86) cpu_ia32=true ; AC_DEFINE(FLAC__CPU_IA32) ;;
46 powerpc) cpu_ppc=true ; AC_DEFINE(FLAC__CPU_PPC) ;;
47 sparc) cpu_sparc=true ; AC_DEFINE(FLAC__CPU_SPARC) ;;
Josh Coalsoncf030c82001-05-23 20:59:48 +000048esac
49AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue)
50AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue)
51AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue)
Josh Coalsonda0adb22001-06-18 23:07:19 +000052case "$host" in
Josh Coalsonc0852172003-04-27 08:32:41 +000053 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
Josh Coalsonda0adb22001-06-18 23:07:19 +000054 *) OBJ_FORMAT=elf ;;
55esac
56AC_SUBST(OBJ_FORMAT)
Josh Coalsoncf030c82001-05-23 20:59:48 +000057
Josh Coalson0e3576e2001-05-25 00:07:51 +000058if test x$cpu_ia32 = xtrue ; then
59AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
60fi
Josh Coalsoncf030c82001-05-23 20:59:48 +000061
62AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
63AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
Josh Coalson0e3576e2001-05-25 00:07:51 +000064if test x$asm_opt = xno ; then
65AC_DEFINE(FLAC__NO_ASM)
66fi
Josh Coalsoncf030c82001-05-23 20:59:48 +000067
Josh Coalson9f429ba2001-01-19 22:39:39 +000068AC_ARG_ENABLE(debug,
Josh Coalsonda0adb22001-06-18 23:07:19 +000069[ --enable-debug Turn on debugging],
70[case "${enableval}" in
71 yes) debug=true ;;
72 no) debug=false ;;
73 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
74esac],[debug=false])
Josh Coalson9f429ba2001-01-19 22:39:39 +000075AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
76
Josh Coalsonbb14ae82001-12-04 06:46:35 +000077AC_ARG_ENABLE(sse,
78[ --enable-sse Enable SSE support by asserting that the OS supports SSE instructions],
Josh Coalsond01b13a2001-07-18 00:27:06 +000079[case "${enableval}" in
80 yes) sse_os=true ;;
81 no) sse_os=false ;;
Josh Coalsonbb14ae82001-12-04 06:46:35 +000082 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
Josh Coalsond01b13a2001-07-18 00:27:06 +000083esac],[sse_os=false])
84AM_CONDITIONAL(FLaC__SSE_OS, test x$sse_os = xtrue)
85if test x$sse_os = xtrue ; then
86AC_DEFINE(FLAC__SSE_OS)
87fi
88
Josh Coalson28311cf2002-12-26 19:35:19 +000089AC_ARG_ENABLE(3dnow,
90[ --disable-3dnow Disable 3DNOW! optimizations],
91[case "${enableval}" in
92 yes) use_3dnow=true ;;
93 no) use_3dnow=false ;;
94 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
95esac],[use_3dnow=true])
96AM_CONDITIONAL(FLaC__USE_3DNOW, test x$use_3dnow = xtrue)
97if test x$use_3dnow = xtrue ; then
Josh Coalsonc69f8782001-11-13 23:08:22 +000098AC_DEFINE(FLAC__USE_3DNOW)
99fi
100
Josh Coalson3aadd102004-07-27 01:13:16 +0000101AC_ARG_ENABLE(altivec,
102[ --disable-altivec Disable Altivec optimizations],
103[case "${enableval}" in
104 yes) use_altivec=true ;;
105 no) use_altivec=false ;;
106 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
107esac],[use_altivec=true])
108AM_CONDITIONAL(FLaC__USE_ALTIVEC, test x$use_altivec = xtrue)
109if test x$use_altivec = xtrue ; then
110AC_DEFINE(FLAC__USE_ALTIVEC)
111fi
112
Josh Coalson3d730722003-01-14 06:59:50 +0000113AC_ARG_ENABLE(local-xmms-plugin,
114[ --enable-local-xmms-plugin Install XMMS plugin to ~/.xmms/Plugins instead of system location],
115[case "${enableval}" in
116 yes) install_xmms_plugin_locally=true ;;
117 no) install_xmms_plugin_locally=false ;;
118 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
119esac],[install_xmms_plugin_locally=false])
120AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test x$install_xmms_plugin_locally = xtrue)
121
Josh Coalson9b145182002-08-30 05:39:36 +0000122AC_ARG_ENABLE(exhaustive-tests,
Josh Coalsonb7767932002-09-17 05:36:39 +0000123[ --enable-exhaustive-tests Enable exhaustive testing],
Josh Coalson9b145182002-08-30 05:39:36 +0000124[case "${enableval}" in
125 yes) exhaustive_tests=true ;;
126 no) exhaustive_tests=false ;;
127 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
128esac],[exhaustive_tests=false])
129AM_CONDITIONAL(FLaC__EXHAUSTIVE_TESTS, test x$exhaustive_tests = xtrue)
Josh Coalson962bb3b2002-12-28 07:08:31 +0000130if test x$exhaustive_tests = xtrue ; then
131AC_DEFINE(FLAC__EXHAUSTIVE_TESTS)
132fi
Josh Coalsond1923622002-12-05 06:36:12 +0000133
134AC_ARG_ENABLE(valgrind-testing,
135[ --enable-valgrind-testing Run all tests inside Valgrind],
136[case "${enableval}" in
137 yes) valgrind_testing=true ;;
138 no) valgrind_testing=false ;;
139 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
140esac],[valgrind_testing=false])
141AM_CONDITIONAL(FLaC__VALGRIND_TESTING, test x$valgrind_testing = xtrue)
Josh Coalson962bb3b2002-12-28 07:08:31 +0000142if test x$valgrind_testing = xtrue ; then
143AC_DEFINE(FLAC__VALGRIND_TESTING)
144fi
Josh Coalson9b145182002-08-30 05:39:36 +0000145
Josh Coalsone2fece22002-09-09 21:54:28 +0000146dnl check for ogg library
Josh Coalson3f6c9982002-09-05 05:40:58 +0000147XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
Josh Coalsonc8a7d352001-11-11 03:59:46 +0000148AM_CONDITIONAL(FLaC__HAS_OGG, [test x$have_ogg = xyes])
149if test x$have_ogg = xyes ; then
150AC_DEFINE(FLAC__HAS_OGG)
151fi
Josh Coalsonf7fc5c82001-10-31 18:31:36 +0000152
Josh Coalson9f429ba2001-01-19 22:39:39 +0000153AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built]))
Josh Coalsoncf030c82001-05-23 20:59:48 +0000154AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
155
Josh Coalson130cbb52002-07-16 16:12:27 +0000156dnl check for i18n(internationalization); these are from libiconv/gettext
Josh Coalson412fa3b2002-07-11 06:15:30 +0000157AM_ICONV
158AM_LANGINFO_CODESET
159
Josh Coalson20809742003-01-10 04:39:20 +0000160AC_CHECK_PROGS(DOXYGEN, doxygen)
161AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
162if test -n "$DOXYGEN" ; then
163AC_DEFINE(FLAC__HAS_DOXYGEN)
164fi
165
Josh Coalson90e57162004-07-30 00:46:39 +0000166AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
167AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
168if test -n "$DOCBOOK_TO_MAN" ; then
169AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
170fi
171
Josh Coalsonb9900222004-12-30 01:13:03 +0000172# only matters for x86
Josh Coalsoncf030c82001-05-23 20:59:48 +0000173AC_CHECK_PROGS(NASM, nasm)
174AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
Josh Coalson0e3576e2001-05-25 00:07:51 +0000175if test -n "$NASM" ; then
176AC_DEFINE(FLAC__HAS_NASM)
177fi
Josh Coalson9f429ba2001-01-19 22:39:39 +0000178
Josh Coalsonb9900222004-12-30 01:13:03 +0000179# only matters for PowerPC
180AC_CHECK_PROGS(AS, as)
181AC_CHECK_PROGS(GAS, gas)
182AM_CONDITIONAL(FLaC__HAS_AS, test -n "$AS")
183AM_CONDITIONAL(FLaC__HAS_GAS, test -n "$GAS")
184if test -n "$AS" ; then
185AC_DEFINE(FLAC__HAS_AS)
186fi
187if test -n "$GAS" ; then
188# funniest. macro. ever.
189AC_DEFINE(FLAC__HAS_GAS)
190fi
191
Josh Coalson57ba6f42002-06-07 05:27:37 +0000192OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
Josh Coalson9f429ba2001-01-19 22:39:39 +0000193if test x$debug = xtrue; then
Josh Coalson20809742003-01-10 04:39:20 +0000194 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
Josh Coalson9f429ba2001-01-19 22:39:39 +0000195else
Josh Coalson1e704552003-05-19 23:59:49 +0000196 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O2 -DNDEBUG"
Josh Coalsonda0adb22001-06-18 23:07:19 +0000197 if test x$GCC = xyes; then
Josh Coalson1e704552003-05-19 23:59:49 +0000198 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
Josh Coalsonda0adb22001-06-18 23:07:19 +0000199 fi
Josh Coalson9f429ba2001-01-19 22:39:39 +0000200fi
Josh Coalson20809742003-01-10 04:39:20 +0000201CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"
202CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS"
Josh Coalson9f429ba2001-01-19 22:39:39 +0000203
Matt Zimmermane5259172002-10-10 16:51:06 +0000204AM_CONFIG_HEADER(config.h)
Josh Coalsonf0a8c4f2003-01-15 03:17:51 +0000205AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
Matt Zimmermane5259172002-10-10 16:51:06 +0000206AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
207AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
208AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
Josh Coalson32386732003-01-02 07:29:58 +0000209AH_TEMPLATE(FLAC__EXHAUSTIVE_TESTS, [define to run even more tests])
210AH_TEMPLATE(FLAC__VALGRIND_TESTING, [define to enable use of Valgrind in testers])
Josh Coalson20809742003-01-10 04:39:20 +0000211AH_TEMPLATE(FLAC__HAS_DOXYGEN, [define if you have Doxygen])
Josh Coalson90e57162004-07-30 00:46:39 +0000212AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
Josh Coalsonb9900222004-12-30 01:13:03 +0000213AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
214AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
215AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
Matt Zimmermane5259172002-10-10 16:51:06 +0000216AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
217AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
Josh Coalson20809742003-01-10 04:39:20 +0000218AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
Matt Zimmermane5259172002-10-10 16:51:06 +0000219AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
Josh Coalson3aadd102004-07-27 01:13:16 +0000220AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
Matt Zimmermane5259172002-10-10 16:51:06 +0000221
uid38180b4bc14b2002-09-09 20:53:08 +0000222AC_OUTPUT( \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000223 Makefile \
224 src/Makefile \
225 src/libFLAC/Makefile \
226 src/libFLAC/ia32/Makefile \
Josh Coalson3aadd102004-07-27 01:13:16 +0000227 src/libFLAC/ppc/Makefile \
Josh Coalsonb9900222004-12-30 01:13:03 +0000228 src/libFLAC/ppc/as/Makefile \
229 src/libFLAC/ppc/gas/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000230 src/libFLAC/include/Makefile \
231 src/libFLAC/include/private/Makefile \
232 src/libFLAC/include/protected/Makefile \
233 src/libFLAC++/Makefile \
Josh Coalsonc49380d2002-08-07 17:38:08 +0000234 src/libOggFLAC/Makefile \
235 src/libOggFLAC/include/Makefile \
Josh Coalsonce3dd362003-12-17 05:26:34 +0000236 src/libOggFLAC/include/private/Makefile \
Josh Coalsonc49380d2002-08-07 17:38:08 +0000237 src/libOggFLAC/include/protected/Makefile \
238 src/libOggFLAC++/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000239 src/flac/Makefile \
240 src/metaflac/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000241 src/monkeys_audio_utilities/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000242 src/monkeys_audio_utilities/flac_mac/Makefile \
243 src/monkeys_audio_utilities/flac_ren/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000244 src/plugin_common/Makefile \
245 src/plugin_winamp2/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000246 src/plugin_winamp2/include/Makefile \
247 src/plugin_winamp2/include/winamp2/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000248 src/plugin_xmms/Makefile \
249 src/share/Makefile \
Josh Coalson3c043fd2002-10-25 04:57:05 +0000250 src/share/getopt/Makefile \
Josh Coalsonb8f8a072002-11-07 05:07:30 +0000251 src/share/grabbag/Makefile \
Josh Coalson9c650a52003-12-17 04:51:06 +0000252 src/share/replaygain_analysis/Makefile \
253 src/share/replaygain_synthesis/Makefile \
Josh Coalsone2999b72003-12-17 04:54:20 +0000254 src/share/replaygain_synthesis/include/Makefile \
255 src/share/replaygain_synthesis/include/private/Makefile \
Josh Coalson3c043fd2002-10-25 04:57:05 +0000256 src/share/utf8/Makefile \
Josh Coalson1dca1c22002-12-03 06:30:14 +0000257 src/test_grabbag/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000258 src/test_grabbag/cuesheet/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000259 src/test_libFLAC/Makefile \
260 src/test_libFLAC++/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000261 src/test_libOggFLAC/Makefile \
262 src/test_libOggFLAC++/Makefile \
Josh Coalson94b54992004-09-21 05:41:23 +0000263 src/test_seeking/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000264 src/test_streams/Makefile \
Josh Coalsonda0adb22001-06-18 23:07:19 +0000265 include/Makefile \
266 include/FLAC/Makefile \
Josh Coalson5a804ca2002-05-17 06:08:13 +0000267 include/FLAC++/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000268 include/OggFLAC/Makefile \
269 include/OggFLAC++/Makefile \
Josh Coalson5a804ca2002-05-17 06:08:13 +0000270 include/share/Makefile \
Josh Coalsonb8f8a072002-11-07 05:07:30 +0000271 include/share/grabbag/Makefile \
Josh Coalson4c8f73a2001-07-22 07:27:45 +0000272 doc/Makefile \
Josh Coalson130cbb52002-07-16 16:12:27 +0000273 doc/html/Makefile \
274 doc/html/images/Makefile \
275 doc/html/ru/Makefile \
Josh Coalson4c8f73a2001-07-22 07:27:45 +0000276 man/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000277 test/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000278 test/cuesheets/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000279 build/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000280 obj/Makefile \
281 obj/debug/Makefile \
Josh Coalsonb74fc982002-11-20 06:40:08 +0000282 obj/debug/bin/Makefile \
283 obj/debug/lib/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000284 obj/release/Makefile \
Josh Coalsonb74fc982002-11-20 06:40:08 +0000285 obj/release/bin/Makefile \
286 obj/release/lib/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000287 flac.pbproj/Makefile \
Josh Coalsonda0adb22001-06-18 23:07:19 +0000288)