bump version number to 1.2.0
[platform/upstream/flac.git] / configure.in
1 #  FLAC - Free Lossless Audio Codec
2 #  Copyright (C) 2001,2002,2003,2004,2005,2006,2007  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.2.0)
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_SYS_LARGEFILE
42 AC_FUNC_FSEEKO
43
44 AC_CHECK_SIZEOF(void*,0)
45
46 #@@@ new name is AC_CONFIG_HEADERS
47 AM_CONFIG_HEADER(config.h)
48
49 AC_C_BIGENDIAN
50
51 AC_CHECK_TYPES(socklen_t, [], [])
52
53 dnl check for getopt in standard library
54 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
55 AC_CHECK_FUNCS(getopt_long, [], [])
56
57 case "$host_cpu" in
58         i*86)
59                 cpu_ia32=true
60                 AC_DEFINE(FLAC__CPU_IA32)
61                 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
62                 ;;
63         powerpc)
64                 cpu_ppc=true
65                 AC_DEFINE(FLAC__CPU_PPC)
66                 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
67                 ;;
68         sparc)
69                 cpu_sparc=true
70                 AC_DEFINE(FLAC__CPU_SPARC)
71                 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
72                 ;;
73 esac
74 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
75 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
76 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
77 case "$host" in
78         i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
79         *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
80         *-*-darwin*) OBJ_FORMAT=macho ;;
81         *) OBJ_FORMAT=elf ;;
82 esac
83 AC_SUBST(OBJ_FORMAT)
84 case "$host" in
85         *-pc-linux-gnu)
86                 sys_linux=true
87                 AC_DEFINE(FLAC__SYS_LINUX)
88                 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
89                 ;;
90         *-*-darwin*)
91                 sys_darwin=true
92                 AC_DEFINE(FLAC__SYS_DARWIN)
93                 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
94                 ;;
95 esac
96 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
97 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
98
99 if test "x$cpu_ia32" = xtrue ; then
100 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
101 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
102 fi
103
104 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
105 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
106 if test "x$asm_opt" = xno ; then
107 AC_DEFINE(FLAC__NO_ASM)
108 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
109 fi
110
111 AC_ARG_ENABLE(debug,
112 AC_HELP_STRING([--enable-debug], [Turn on debugging]),
113 [case "${enableval}" in
114         yes) debug=true ;;
115         no)  debug=false ;;
116         *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
117 esac],[debug=false])
118 AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
119
120 AC_ARG_ENABLE(sse,
121 AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
122 [case "${enableval}" in
123         yes) sse_os=true ;;
124         no)  sse_os=false ;;
125         *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
126 esac],[sse_os=false])
127 AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
128 if test "x$sse_os" = xtrue ; then
129 AC_DEFINE(FLAC__SSE_OS)
130 AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
131 fi
132
133 AC_ARG_ENABLE(3dnow,
134 AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
135 [case "${enableval}" in
136         yes) use_3dnow=true ;;
137         no)  use_3dnow=false ;;
138         *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
139 esac],[use_3dnow=true])
140 AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
141 if test "x$use_3dnow" = xtrue ; then
142 AC_DEFINE(FLAC__USE_3DNOW)
143 AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
144 fi
145
146 AC_ARG_ENABLE(altivec,
147 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
148 [case "${enableval}" in
149         yes) use_altivec=true ;;
150         no)  use_altivec=false ;;
151         *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
152 esac],[use_altivec=true])
153 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
154 if test "x$use_altivec" = xtrue ; then
155 AC_DEFINE(FLAC__USE_ALTIVEC)
156 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
157 fi
158
159 AC_ARG_ENABLE(thorough-tests,
160 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
161 [case "${enableval}" in
162         yes) thorough_tests=true ;;
163         no)  thorough_tests=false ;;
164         *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
165 esac],[thorough_tests=true])
166 AC_ARG_ENABLE(exhaustive-tests,
167 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
168 [case "${enableval}" in
169         yes) exhaustive_tests=true ;;
170         no)  exhaustive_tests=false ;;
171         *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
172 esac],[exhaustive_tests=false])
173 if test "x$thorough_tests" = xfalse ; then
174 FLAC__TEST_LEVEL=0
175 elif test "x$exhaustive_tests" = xfalse ; then
176 FLAC__TEST_LEVEL=1
177 else
178 FLAC__TEST_LEVEL=2
179 fi
180 AC_SUBST(FLAC__TEST_LEVEL)
181
182 AC_ARG_ENABLE(valgrind-testing,
183 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
184 [case "${enableval}" in
185         yes) FLAC__TEST_WITH_VALGRIND=yes ;;
186         no)  FLAC__TEST_WITH_VALGRIND=no ;;
187         *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
188 esac],[FLAC__TEST_WITH_VALGRIND=no])
189 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
190
191 AC_ARG_ENABLE(doxygen-docs,
192 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
193 [case "${enableval}" in
194         yes) enable_doxygen_docs=true ;;
195         no)  enable_doxygen_docs=false ;;
196         *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
197 esac],[enable_doxygen_docs=true])
198 if test "x$enable_doxygen_docs" != xfalse ; then
199         AC_CHECK_PROGS(DOXYGEN, doxygen)
200 fi
201 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
202
203 AC_ARG_ENABLE(local-xmms-plugin,
204 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
205 [case "${enableval}" in
206         yes) install_xmms_plugin_locally=true ;;
207         no)  install_xmms_plugin_locally=false ;;
208         *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
209 esac],[install_xmms_plugin_locally=false])
210 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
211
212 AC_ARG_ENABLE(xmms-plugin,
213 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
214 [case "${enableval}" in
215         yes) enable_xmms_plugin=true ;;
216         no)  enable_xmms_plugin=false ;;
217         *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
218 esac],[enable_xmms_plugin=true])
219 if test "x$enable_xmms_plugin" != xfalse ; then
220         AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
221 fi
222 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
223
224 dnl check for ogg library
225 AC_ARG_ENABLE([ogg],
226         AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
227         [ want_ogg=$enableval ], [ want_ogg=yes ] )
228
229 if test "x$want_ogg" != "xno"; then
230         XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
231 fi
232  
233 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
234 if test "x$have_ogg" = xyes ; then
235 AC_DEFINE(FLAC__HAS_OGG)
236 AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library])
237 fi
238
239 dnl check for i18n(internationalization); these are from libiconv/gettext
240 AM_ICONV
241 AM_LANGINFO_CODESET
242
243 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
244 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
245 if test -n "$DOCBOOK_TO_MAN" ; then
246 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
247 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
248 fi
249
250 # only matters for x86
251 AC_CHECK_PROGS(NASM, nasm)
252 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
253 if test -n "$NASM" ; then
254 AC_DEFINE(FLAC__HAS_NASM)
255 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
256 fi
257
258 # only matters for PowerPC
259 AC_CHECK_PROGS(AS, as, as)
260 AC_CHECK_PROGS(GAS, gas, gas)
261
262 # try -v (apple as) and --version (gas) at the same time
263 test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
264
265 AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
266 AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
267 if test "$AS" = "as" ; then
268 AC_DEFINE(FLAC__HAS_AS)
269 AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
270 fi
271 if test "$AS" = "gas" ; then
272 # funniest. macro. ever.
273 AC_DEFINE(FLAC__HAS_GAS)
274 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
275 fi
276
277 OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
278 if test "x$debug" = xtrue; then
279         OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -DDEBUG"
280 else
281         OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -DNDEBUG"
282         if test "x$GCC" = xyes; then
283                 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
284         fi
285 fi
286 CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"
287 CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS"
288
289 #@@@
290 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
291 AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
292
293 AC_CONFIG_FILES([ \
294         Makefile \
295         src/Makefile \
296         src/libFLAC/Makefile \
297         src/libFLAC/flac.pc \
298         src/libFLAC/ia32/Makefile \
299         src/libFLAC/ppc/Makefile \
300         src/libFLAC/ppc/as/Makefile \
301         src/libFLAC/ppc/gas/Makefile \
302         src/libFLAC/include/Makefile \
303         src/libFLAC/include/private/Makefile \
304         src/libFLAC/include/protected/Makefile \
305         src/libFLAC++/Makefile \
306         src/libFLAC++/flac++.pc \
307         src/flac/Makefile \
308         src/metaflac/Makefile \
309         src/monkeys_audio_utilities/Makefile \
310         src/monkeys_audio_utilities/flac_mac/Makefile \
311         src/monkeys_audio_utilities/flac_ren/Makefile \
312         src/plugin_common/Makefile \
313         src/plugin_winamp2/Makefile \
314         src/plugin_winamp2/include/Makefile \
315         src/plugin_winamp2/include/winamp2/Makefile \
316         src/plugin_xmms/Makefile \
317         src/share/Makefile \
318         src/share/getopt/Makefile \
319         src/share/grabbag/Makefile \
320         src/share/replaygain_analysis/Makefile \
321         src/share/replaygain_synthesis/Makefile \
322         src/share/replaygain_synthesis/include/Makefile \
323         src/share/replaygain_synthesis/include/private/Makefile \
324         src/share/utf8/Makefile \
325         src/test_grabbag/Makefile \
326         src/test_grabbag/cuesheet/Makefile \
327         src/test_grabbag/picture/Makefile \
328         src/test_libs_common/Makefile \
329         src/test_libFLAC/Makefile \
330         src/test_libFLAC++/Makefile \
331         src/test_seeking/Makefile \
332         src/test_streams/Makefile \
333         include/Makefile \
334         include/FLAC/Makefile \
335         include/FLAC++/Makefile \
336         include/share/Makefile \
337         include/share/grabbag/Makefile \
338         include/test_libs_common/Makefile \
339         doc/Makefile \
340         doc/html/Makefile \
341         doc/html/images/Makefile \
342         doc/html/images/hw/Makefile \
343         doc/html/ru/Makefile \
344         m4/Makefile \
345         man/Makefile \
346         test/Makefile \
347         test/cuesheets/Makefile \
348         test/flac-to-flac-metadata-test-files/Makefile \
349         test/metaflac-test-files/Makefile \
350         test/pictures/Makefile \
351         build/Makefile \
352         obj/Makefile \
353         obj/debug/Makefile \
354         obj/debug/bin/Makefile \
355         obj/debug/lib/Makefile \
356         obj/release/Makefile \
357         obj/release/bin/Makefile \
358         obj/release/lib/Makefile \
359 ])
360 AC_OUTPUT