blob: 29cad22d799d1abe34758d6cee66b3201efc7b83 [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
Josh Coalson3ca49da2004-09-28 00:52:46 +000024dnl In order to have access to any available wcsdup() and wcscasecmp()
25AC_GNU_SOURCE
26
Matt Zimmerman057b5322002-10-05 14:41:19 +000027# Don't automagically regenerate autoconf/automake generated files unless
28# explicitly requested. Eases autobuilding -mdz
29AM_MAINTAINER_MODE
30
Josh Coalson9f429ba2001-01-19 22:39:39 +000031# We need two libtools, one that builds both shared and static, and
32# one that builds only static. This is because the resulting libtool
33# does not allow us to choose which to build at runtime.
34AM_PROG_LIBTOOL
35sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
36chmod +x libtool-disable-static
37
Josh Coalson985dd8d2004-07-29 05:25:36 +000038AM_PROG_AS
Josh Coalson57ba6f42002-06-07 05:27:37 +000039AC_PROG_CXX
Josh Coalson9f429ba2001-01-19 22:39:39 +000040AC_PROG_MAKE_SET
41
Josh Coalson5a804ca2002-05-17 06:08:13 +000042dnl check for getopt in standard library
43dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
44AC_CHECK_FUNCS(getopt_long, [], [])
45
Josh Coalson9745f252004-09-24 13:57:40 +000046dnl Check for uncommon wide char functions
47AC_CHECK_FUNCS(wcsdup, wcscasecmp, [], [])
48
Josh Coalsondef8eb82001-05-23 22:08:27 +000049AC_CANONICAL_HOST
Josh Coalson5a804ca2002-05-17 06:08:13 +000050case "$host_cpu" in
Josh Coalson0e3576e2001-05-25 00:07:51 +000051 i*86) cpu_ia32=true ; AC_DEFINE(FLAC__CPU_IA32) ;;
52 powerpc) cpu_ppc=true ; AC_DEFINE(FLAC__CPU_PPC) ;;
53 sparc) cpu_sparc=true ; AC_DEFINE(FLAC__CPU_SPARC) ;;
Josh Coalsoncf030c82001-05-23 20:59:48 +000054esac
55AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue)
56AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue)
57AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue)
Josh Coalsonda0adb22001-06-18 23:07:19 +000058case "$host" in
Josh Coalsonc0852172003-04-27 08:32:41 +000059 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
Josh Coalsonda0adb22001-06-18 23:07:19 +000060 *) OBJ_FORMAT=elf ;;
61esac
62AC_SUBST(OBJ_FORMAT)
Josh Coalsoncf030c82001-05-23 20:59:48 +000063
Josh Coalson0e3576e2001-05-25 00:07:51 +000064if test x$cpu_ia32 = xtrue ; then
65AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
66fi
Josh Coalsoncf030c82001-05-23 20:59:48 +000067
68AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
69AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
Josh Coalson0e3576e2001-05-25 00:07:51 +000070if test x$asm_opt = xno ; then
71AC_DEFINE(FLAC__NO_ASM)
72fi
Josh Coalsoncf030c82001-05-23 20:59:48 +000073
Josh Coalson9f429ba2001-01-19 22:39:39 +000074AC_ARG_ENABLE(debug,
Josh Coalsonda0adb22001-06-18 23:07:19 +000075[ --enable-debug Turn on debugging],
76[case "${enableval}" in
77 yes) debug=true ;;
78 no) debug=false ;;
79 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
80esac],[debug=false])
Josh Coalson9f429ba2001-01-19 22:39:39 +000081AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
82
Josh Coalsonbb14ae82001-12-04 06:46:35 +000083AC_ARG_ENABLE(sse,
84[ --enable-sse Enable SSE support by asserting that the OS supports SSE instructions],
Josh Coalsond01b13a2001-07-18 00:27:06 +000085[case "${enableval}" in
86 yes) sse_os=true ;;
87 no) sse_os=false ;;
Josh Coalsonbb14ae82001-12-04 06:46:35 +000088 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
Josh Coalsond01b13a2001-07-18 00:27:06 +000089esac],[sse_os=false])
90AM_CONDITIONAL(FLaC__SSE_OS, test x$sse_os = xtrue)
91if test x$sse_os = xtrue ; then
92AC_DEFINE(FLAC__SSE_OS)
93fi
94
Josh Coalson28311cf2002-12-26 19:35:19 +000095AC_ARG_ENABLE(3dnow,
96[ --disable-3dnow Disable 3DNOW! optimizations],
97[case "${enableval}" in
98 yes) use_3dnow=true ;;
99 no) use_3dnow=false ;;
100 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
101esac],[use_3dnow=true])
102AM_CONDITIONAL(FLaC__USE_3DNOW, test x$use_3dnow = xtrue)
103if test x$use_3dnow = xtrue ; then
Josh Coalsonc69f8782001-11-13 23:08:22 +0000104AC_DEFINE(FLAC__USE_3DNOW)
105fi
106
Josh Coalson3aadd102004-07-27 01:13:16 +0000107AC_ARG_ENABLE(altivec,
108[ --disable-altivec Disable Altivec optimizations],
109[case "${enableval}" in
110 yes) use_altivec=true ;;
111 no) use_altivec=false ;;
112 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
113esac],[use_altivec=true])
114AM_CONDITIONAL(FLaC__USE_ALTIVEC, test x$use_altivec = xtrue)
115if test x$use_altivec = xtrue ; then
116AC_DEFINE(FLAC__USE_ALTIVEC)
117fi
118
Josh Coalson3d730722003-01-14 06:59:50 +0000119AC_ARG_ENABLE(local-xmms-plugin,
120[ --enable-local-xmms-plugin Install XMMS plugin to ~/.xmms/Plugins instead of system location],
121[case "${enableval}" in
122 yes) install_xmms_plugin_locally=true ;;
123 no) install_xmms_plugin_locally=false ;;
124 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
125esac],[install_xmms_plugin_locally=false])
126AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test x$install_xmms_plugin_locally = xtrue)
127
Josh Coalson9b145182002-08-30 05:39:36 +0000128AC_ARG_ENABLE(exhaustive-tests,
Josh Coalsonb7767932002-09-17 05:36:39 +0000129[ --enable-exhaustive-tests Enable exhaustive testing],
Josh Coalson9b145182002-08-30 05:39:36 +0000130[case "${enableval}" in
131 yes) exhaustive_tests=true ;;
132 no) exhaustive_tests=false ;;
133 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
134esac],[exhaustive_tests=false])
135AM_CONDITIONAL(FLaC__EXHAUSTIVE_TESTS, test x$exhaustive_tests = xtrue)
Josh Coalson962bb3b2002-12-28 07:08:31 +0000136if test x$exhaustive_tests = xtrue ; then
137AC_DEFINE(FLAC__EXHAUSTIVE_TESTS)
138fi
Josh Coalsond1923622002-12-05 06:36:12 +0000139
140AC_ARG_ENABLE(valgrind-testing,
141[ --enable-valgrind-testing Run all tests inside Valgrind],
142[case "${enableval}" in
143 yes) valgrind_testing=true ;;
144 no) valgrind_testing=false ;;
145 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
146esac],[valgrind_testing=false])
147AM_CONDITIONAL(FLaC__VALGRIND_TESTING, test x$valgrind_testing = xtrue)
Josh Coalson962bb3b2002-12-28 07:08:31 +0000148if test x$valgrind_testing = xtrue ; then
149AC_DEFINE(FLAC__VALGRIND_TESTING)
150fi
Josh Coalson9b145182002-08-30 05:39:36 +0000151
Josh Coalsone2fece22002-09-09 21:54:28 +0000152dnl check for ogg library
Josh Coalson3f6c9982002-09-05 05:40:58 +0000153XIPH_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 +0000154AM_CONDITIONAL(FLaC__HAS_OGG, [test x$have_ogg = xyes])
155if test x$have_ogg = xyes ; then
156AC_DEFINE(FLAC__HAS_OGG)
157fi
Josh Coalsonf7fc5c82001-10-31 18:31:36 +0000158
Josh Coalson9f429ba2001-01-19 22:39:39 +0000159AM_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 +0000160AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
161
Josh Coalson130cbb52002-07-16 16:12:27 +0000162dnl check for i18n(internationalization); these are from libiconv/gettext
Josh Coalson412fa3b2002-07-11 06:15:30 +0000163AM_ICONV
164AM_LANGINFO_CODESET
165
Josh Coalson20809742003-01-10 04:39:20 +0000166AC_CHECK_PROGS(DOXYGEN, doxygen)
167AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
168if test -n "$DOXYGEN" ; then
169AC_DEFINE(FLAC__HAS_DOXYGEN)
170fi
171
Josh Coalson90e57162004-07-30 00:46:39 +0000172AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
173AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
174if test -n "$DOCBOOK_TO_MAN" ; then
175AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
176fi
177
Josh Coalsoncf030c82001-05-23 20:59:48 +0000178AC_CHECK_PROGS(NASM, nasm)
179AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
Josh Coalson0e3576e2001-05-25 00:07:51 +0000180if test -n "$NASM" ; then
181AC_DEFINE(FLAC__HAS_NASM)
182fi
Josh Coalson9f429ba2001-01-19 22:39:39 +0000183
Josh Coalson57ba6f42002-06-07 05:27:37 +0000184OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
Josh Coalson9f429ba2001-01-19 22:39:39 +0000185if test x$debug = xtrue; then
Josh Coalson20809742003-01-10 04:39:20 +0000186 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
Josh Coalson9f429ba2001-01-19 22:39:39 +0000187else
Josh Coalson1e704552003-05-19 23:59:49 +0000188 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O2 -DNDEBUG"
Josh Coalsonda0adb22001-06-18 23:07:19 +0000189 if test x$GCC = xyes; then
Josh Coalson1e704552003-05-19 23:59:49 +0000190 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 +0000191 fi
Josh Coalson9f429ba2001-01-19 22:39:39 +0000192fi
Josh Coalson20809742003-01-10 04:39:20 +0000193CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"
194CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS"
Josh Coalson9f429ba2001-01-19 22:39:39 +0000195
Matt Zimmermane5259172002-10-10 16:51:06 +0000196AM_CONFIG_HEADER(config.h)
Josh Coalsonf0a8c4f2003-01-15 03:17:51 +0000197AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
Matt Zimmermane5259172002-10-10 16:51:06 +0000198AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
199AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
200AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
Josh Coalson32386732003-01-02 07:29:58 +0000201AH_TEMPLATE(FLAC__EXHAUSTIVE_TESTS, [define to run even more tests])
202AH_TEMPLATE(FLAC__VALGRIND_TESTING, [define to enable use of Valgrind in testers])
Josh Coalson20809742003-01-10 04:39:20 +0000203AH_TEMPLATE(FLAC__HAS_DOXYGEN, [define if you have Doxygen])
Josh Coalson90e57162004-07-30 00:46:39 +0000204AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
Matt Zimmermane5259172002-10-10 16:51:06 +0000205AH_TEMPLATE(FLAC__HAS_NASM, [define if you have the NASM assembler])
206AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
207AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
Josh Coalson20809742003-01-10 04:39:20 +0000208AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
Matt Zimmermane5259172002-10-10 16:51:06 +0000209AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
Josh Coalson3aadd102004-07-27 01:13:16 +0000210AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
Matt Zimmermane5259172002-10-10 16:51:06 +0000211
uid38180b4bc14b2002-09-09 20:53:08 +0000212AC_OUTPUT( \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000213 Makefile \
214 src/Makefile \
215 src/libFLAC/Makefile \
216 src/libFLAC/ia32/Makefile \
Josh Coalson3aadd102004-07-27 01:13:16 +0000217 src/libFLAC/ppc/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000218 src/libFLAC/include/Makefile \
219 src/libFLAC/include/private/Makefile \
220 src/libFLAC/include/protected/Makefile \
221 src/libFLAC++/Makefile \
Josh Coalsonc49380d2002-08-07 17:38:08 +0000222 src/libOggFLAC/Makefile \
223 src/libOggFLAC/include/Makefile \
Josh Coalsonce3dd362003-12-17 05:26:34 +0000224 src/libOggFLAC/include/private/Makefile \
Josh Coalsonc49380d2002-08-07 17:38:08 +0000225 src/libOggFLAC/include/protected/Makefile \
226 src/libOggFLAC++/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000227 src/flac/Makefile \
228 src/metaflac/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000229 src/monkeys_audio_utilities/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000230 src/monkeys_audio_utilities/flac_mac/Makefile \
231 src/monkeys_audio_utilities/flac_ren/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000232 src/plugin_common/Makefile \
233 src/plugin_winamp2/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000234 src/plugin_winamp2/include/Makefile \
235 src/plugin_winamp2/include/winamp2/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000236 src/plugin_xmms/Makefile \
237 src/share/Makefile \
Josh Coalson3c043fd2002-10-25 04:57:05 +0000238 src/share/getopt/Makefile \
Josh Coalsonb8f8a072002-11-07 05:07:30 +0000239 src/share/grabbag/Makefile \
Josh Coalson9c650a52003-12-17 04:51:06 +0000240 src/share/replaygain_analysis/Makefile \
241 src/share/replaygain_synthesis/Makefile \
Josh Coalsone2999b72003-12-17 04:54:20 +0000242 src/share/replaygain_synthesis/include/Makefile \
243 src/share/replaygain_synthesis/include/private/Makefile \
Josh Coalson3c043fd2002-10-25 04:57:05 +0000244 src/share/utf8/Makefile \
Josh Coalson1dca1c22002-12-03 06:30:14 +0000245 src/test_grabbag/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000246 src/test_grabbag/cuesheet/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000247 src/test_libFLAC/Makefile \
248 src/test_libFLAC++/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000249 src/test_libOggFLAC/Makefile \
250 src/test_libOggFLAC++/Makefile \
Josh Coalson94b54992004-09-21 05:41:23 +0000251 src/test_seeking/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000252 src/test_streams/Makefile \
Josh Coalsonda0adb22001-06-18 23:07:19 +0000253 include/Makefile \
254 include/FLAC/Makefile \
Josh Coalson5a804ca2002-05-17 06:08:13 +0000255 include/FLAC++/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000256 include/OggFLAC/Makefile \
257 include/OggFLAC++/Makefile \
Josh Coalson5a804ca2002-05-17 06:08:13 +0000258 include/share/Makefile \
Josh Coalsonb8f8a072002-11-07 05:07:30 +0000259 include/share/grabbag/Makefile \
Josh Coalson4c8f73a2001-07-22 07:27:45 +0000260 doc/Makefile \
Josh Coalson130cbb52002-07-16 16:12:27 +0000261 doc/html/Makefile \
262 doc/html/images/Makefile \
263 doc/html/ru/Makefile \
Josh Coalson4c8f73a2001-07-22 07:27:45 +0000264 man/Makefile \
Josh Coalson1d96b7e2002-07-24 06:13:33 +0000265 test/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000266 test/cuesheets/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000267 build/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000268 obj/Makefile \
269 obj/debug/Makefile \
Josh Coalsonb74fc982002-11-20 06:40:08 +0000270 obj/debug/bin/Makefile \
271 obj/debug/lib/Makefile \
Josh Coalson20809742003-01-10 04:39:20 +0000272 obj/release/Makefile \
Josh Coalsonb74fc982002-11-20 06:40:08 +0000273 obj/release/bin/Makefile \
274 obj/release/lib/Makefile \
Josh Coalson1f99eac2002-08-23 06:45:23 +0000275 flac.pbproj/Makefile \
Josh Coalsonda0adb22001-06-18 23:07:19 +0000276)