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