add xmms.m4 to new m4/ directory as backup
[platform/upstream/flac.git] / configure.in
1 #  FLAC - Free Lossless Audio Codec
2 #  Copyright (C) 2001,2002,2003,2004,2005  Josh Coalson
3 #
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
11 #  distributed.
12 #
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
16 #  distribution.
17
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
20
21 AC_INIT(src/flac/main.c)
22 AM_INIT_AUTOMAKE(flac, 1.1.2)
23
24 # Don't automagically regenerate autoconf/automake generated files unless
25 # explicitly requested.  Eases autobuilding -mdz
26 AM_MAINTAINER_MODE
27
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.
31 AM_PROG_LIBTOOL
32 sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
33 chmod +x libtool-disable-static
34
35 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
36
37 AM_PROG_AS
38 AC_PROG_CXX
39 AC_PROG_MAKE_SET
40
41 AC_CHECK_TYPES(socklen_t, [], [])
42
43 dnl check for getopt in standard library
44 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
45 AC_CHECK_FUNCS(getopt_long, [], [])
46
47 case "$host_cpu" in
48         i*86)   cpu_ia32=true ; AC_DEFINE(FLAC__CPU_IA32) ;;
49         powerpc)        cpu_ppc=true ; AC_DEFINE(FLAC__CPU_PPC) ;;
50         sparc)  cpu_sparc=true ; AC_DEFINE(FLAC__CPU_SPARC) ;;
51 esac
52 AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue)
53 AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue)
54 AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue)
55 case "$host" in
56         i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
57         *-*-cygwin) OBJ_FORMAT=win32 ;;
58         *) OBJ_FORMAT=elf ;;
59 esac
60 AC_SUBST(OBJ_FORMAT)
61 case "$host" in
62         *-pc-linux-gnu) sys_linux=true ; AC_DEFINE(FLAC__SYS_LINUX) ;;
63         *-*-darwin*) sys_darwin=true ; AC_DEFINE(FLAC__SYS_DARWIN) ;;
64 esac
65 AM_CONDITIONAL(FLaC__SYS_DARWIN, test x$sys_darwin = xtrue)
66 AM_CONDITIONAL(FLaC__SYS_LINUX, test x$sys_linux = xtrue)
67
68 if test x$cpu_ia32 = xtrue ; then
69 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
70 fi
71
72 AC_ARG_ENABLE(asm-optimizations, [  --disable-asm-optimizations    Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
73 AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
74 if test x$asm_opt = xno ; then
75 AC_DEFINE(FLAC__NO_ASM)
76 fi
77
78 AC_ARG_ENABLE(debug,
79 [  --enable-debug                 Turn on debugging],
80 [case "${enableval}" in
81         yes) debug=true ;;
82         no)  debug=false ;;
83         *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
84 esac],[debug=false])
85 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
86
87 AC_ARG_ENABLE(sse,
88 [  --enable-sse                   Enable SSE support by asserting that the OS supports SSE instructions],
89 [case "${enableval}" in
90         yes) sse_os=true ;;
91         no)  sse_os=false ;;
92         *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
93 esac],[sse_os=false])
94 AM_CONDITIONAL(FLaC__SSE_OS, test x$sse_os = xtrue)
95 if test x$sse_os = xtrue ; then
96 AC_DEFINE(FLAC__SSE_OS)
97 fi
98
99 AC_ARG_ENABLE(3dnow,
100 [  --disable-3dnow                Disable 3DNOW! optimizations],
101 [case "${enableval}" in
102         yes) use_3dnow=true ;;
103         no)  use_3dnow=false ;;
104         *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
105 esac],[use_3dnow=true])
106 AM_CONDITIONAL(FLaC__USE_3DNOW, test x$use_3dnow = xtrue)
107 if test x$use_3dnow = xtrue ; then
108 AC_DEFINE(FLAC__USE_3DNOW)
109 fi
110
111 AC_ARG_ENABLE(altivec,
112 [  --disable-altivec              Disable Altivec optimizations],
113 [case "${enableval}" in
114         yes) use_altivec=true ;;
115         no)  use_altivec=false ;;
116         *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
117 esac],[use_altivec=true])
118 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test x$use_altivec = xtrue)
119 if test x$use_altivec = xtrue ; then
120 AC_DEFINE(FLAC__USE_ALTIVEC)
121 fi
122
123 AC_ARG_ENABLE(local-xmms-plugin,
124 [  --enable-local-xmms-plugin     Install XMMS plugin to ~/.xmms/Plugins instead of system location],
125 [case "${enableval}" in
126         yes) install_xmms_plugin_locally=true ;;
127         no)  install_xmms_plugin_locally=false ;;
128         *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
129 esac],[install_xmms_plugin_locally=false])
130 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test x$install_xmms_plugin_locally = xtrue)
131
132 AC_ARG_ENABLE(exhaustive-tests,
133 [  --enable-exhaustive-tests      Enable exhaustive testing],
134 [case "${enableval}" in
135         yes) exhaustive_tests=true ;;
136         no)  exhaustive_tests=false ;;
137         *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
138 esac],[exhaustive_tests=false])
139 AM_CONDITIONAL(FLaC__EXHAUSTIVE_TESTS, test x$exhaustive_tests = xtrue)
140 if test x$exhaustive_tests = xtrue ; then
141 AC_DEFINE(FLAC__EXHAUSTIVE_TESTS)
142 fi
143
144 AC_ARG_ENABLE(valgrind-testing,
145 [  --enable-valgrind-testing      Run all tests inside Valgrind],
146 [case "${enableval}" in
147         yes) valgrind_testing=true ;;
148         no)  valgrind_testing=false ;;
149         *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
150 esac],[valgrind_testing=false])
151 AM_CONDITIONAL(FLaC__VALGRIND_TESTING, test x$valgrind_testing = xtrue)
152 if test x$valgrind_testing = xtrue ; then
153 AC_DEFINE(FLAC__VALGRIND_TESTING)
154 fi
155
156 dnl check for ogg library
157 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
158 AM_CONDITIONAL(FLaC__HAS_OGG, [test x$have_ogg = xyes])
159 if test x$have_ogg = xyes ; then
160 AC_DEFINE(FLAC__HAS_OGG)
161 fi
162
163 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built]))
164 AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
165
166 dnl check for i18n(internationalization); these are from libiconv/gettext
167 AM_ICONV
168 AM_LANGINFO_CODESET
169
170 AC_CHECK_PROGS(DOXYGEN, doxygen)
171 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
172 if test -n "$DOXYGEN" ; then
173 AC_DEFINE(FLAC__HAS_DOXYGEN)
174 fi
175
176 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
177 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
178 if test -n "$DOCBOOK_TO_MAN" ; then
179 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
180 fi
181
182 # only matters for x86
183 AC_CHECK_PROGS(NASM, nasm)
184 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
185 if test -n "$NASM" ; then
186 AC_DEFINE(FLAC__HAS_NASM)
187 fi
188
189 # only matters for PowerPC
190 AC_CHECK_PROGS(AS, as, as)
191 AC_CHECK_PROGS(GAS, gas, gas)
192
193 test "$AS" = "as" && as --version | grep GNU >/dev/null && AS=gas
194
195 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
196 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
197 if test "$AS" = "as" ; then
198 AC_DEFINE(FLAC__HAS_AS)
199 fi
200 if test "$AS" = "gas" ; then
201 # funniest. macro. ever.
202 AC_DEFINE(FLAC__HAS_GAS)
203 fi
204
205 OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
206 if test x$debug = xtrue; then
207         OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
208 else
209         OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O2 -DNDEBUG"
210         if test x$GCC = xyes; then
211                 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
212         fi
213 fi
214 CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"
215 CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS"
216
217 #@@@@@@
218 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
219 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
220
221 AM_CONFIG_HEADER(config.h)
222 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA,  [define to align allocated memory on 32-byte boundaries])
223 AH_TEMPLATE(FLAC__CPU_IA32,  [define if building for ia32/i386])
224 AH_TEMPLATE(FLAC__CPU_PPC,  [define if building for PowerPC])
225 AH_TEMPLATE(FLAC__CPU_SPARC,  [define if building for SPARC])
226 AH_TEMPLATE(FLAC__SYS_DARWIN,  [define if building for Darwin / MacOS X])
227 AH_TEMPLATE(FLAC__SYS_LINUX,  [define if building for Linux])
228 AH_TEMPLATE(FLAC__EXHAUSTIVE_TESTS,  [define to run even more tests])
229 AH_TEMPLATE(FLAC__VALGRIND_TESTING,  [define to enable use of Valgrind in testers])
230 AH_TEMPLATE(FLAC__HAS_DOXYGEN,  [define if you have Doxygen])
231 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN,  [define if you have docbook-to-man or docbook2man])
232 AH_TEMPLATE(FLAC__HAS_NASM,  [define if you are compiling for x86 and have the NASM assembler])
233 AH_TEMPLATE(FLAC__HAS_AS,  [define if you are compiling for PowerPC and have the 'as' assembler])
234 AH_TEMPLATE(FLAC__HAS_GAS,  [define if you are compiling for PowerPC and have the 'gas' assembler])
235 AH_TEMPLATE(FLAC__HAS_OGG,  [define if you have the ogg library])
236 AH_TEMPLATE(FLAC__NO_ASM,  [define to disable use of assembly code])
237 AH_TEMPLATE(FLAC__SSE_OS,  [define if your operating system supports SSE instructions])
238 AH_TEMPLATE(FLAC__USE_3DNOW,  [define to enable use of 3Dnow! instructions])
239 AH_TEMPLATE(FLAC__USE_ALTIVEC,  [define to enable use of Altivec instructions])
240
241 AC_OUTPUT( \
242         Makefile \
243         src/Makefile \
244         src/libFLAC/Makefile \
245         src/libFLAC/ia32/Makefile \
246         src/libFLAC/ppc/Makefile \
247         src/libFLAC/ppc/as/Makefile \
248         src/libFLAC/ppc/gas/Makefile \
249         src/libFLAC/include/Makefile \
250         src/libFLAC/include/private/Makefile \
251         src/libFLAC/include/protected/Makefile \
252         src/libFLAC++/Makefile \
253         src/libOggFLAC/Makefile \
254         src/libOggFLAC/include/Makefile \
255         src/libOggFLAC/include/private/Makefile \
256         src/libOggFLAC/include/protected/Makefile \
257         src/libOggFLAC++/Makefile \
258         src/flac/Makefile \
259         src/metaflac/Makefile \
260         src/monkeys_audio_utilities/Makefile \
261         src/monkeys_audio_utilities/flac_mac/Makefile \
262         src/monkeys_audio_utilities/flac_ren/Makefile \
263         src/plugin_common/Makefile \
264         src/plugin_winamp2/Makefile \
265         src/plugin_winamp2/include/Makefile \
266         src/plugin_winamp2/include/winamp2/Makefile \
267         src/plugin_xmms/Makefile \
268         src/share/Makefile \
269         src/share/getopt/Makefile \
270         src/share/grabbag/Makefile \
271         src/share/replaygain_analysis/Makefile \
272         src/share/replaygain_synthesis/Makefile \
273         src/share/replaygain_synthesis/include/Makefile \
274         src/share/replaygain_synthesis/include/private/Makefile \
275         src/share/utf8/Makefile \
276         src/test_grabbag/Makefile \
277         src/test_grabbag/cuesheet/Makefile \
278         src/test_libFLAC/Makefile \
279         src/test_libFLAC++/Makefile \
280         src/test_libOggFLAC/Makefile \
281         src/test_libOggFLAC++/Makefile \
282         src/test_seeking/Makefile \
283         src/test_streams/Makefile \
284         include/Makefile \
285         include/FLAC/Makefile \
286         include/FLAC++/Makefile \
287         include/OggFLAC/Makefile \
288         include/OggFLAC++/Makefile \
289         include/share/Makefile \
290         include/share/grabbag/Makefile \
291         doc/Makefile \
292         doc/html/Makefile \
293         doc/html/images/Makefile \
294         doc/html/ru/Makefile \
295         man/Makefile \
296         test/Makefile \
297         test/cuesheets/Makefile \
298         build/Makefile \
299         obj/Makefile \
300         obj/debug/Makefile \
301         obj/debug/bin/Makefile \
302         obj/debug/lib/Makefile \
303         obj/release/Makefile \
304         obj/release/bin/Makefile \
305         obj/release/lib/Makefile \
306         flac.pbproj/Makefile \
307 )