go back to using COMMENT tag instead of DESCRIPTION
[platform/upstream/flac.git] / configure.in
1 #  FLAC - Free Lossless Audio Codec
2 #  Copyright (C) 2001,2002,2003,2004  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.1)
23
24 dnl In order to have access to any available wcsdup() and wcscasecmp()
25 AC_GNU_SOURCE
26
27 # Don't automagically regenerate autoconf/automake generated files unless
28 # explicitly requested.  Eases autobuilding -mdz
29 AM_MAINTAINER_MODE
30
31 # 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.
34 AM_PROG_LIBTOOL
35 sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
36 chmod +x libtool-disable-static
37
38 AM_PROG_AS
39 AC_PROG_CXX
40 AC_PROG_MAKE_SET
41
42 dnl check for getopt in standard library
43 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
44 AC_CHECK_FUNCS(getopt_long, [], [])
45
46 dnl Check for uncommon wide char functions
47 AC_CHECK_FUNCS(wcsdup, wcscasecmp, [], [])
48
49 AC_CANONICAL_HOST
50 case "$host_cpu" in
51         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) ;;
54 esac
55 AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue)
56 AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue)
57 AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue)
58 case "$host" in
59         i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
60         *) OBJ_FORMAT=elf ;;
61 esac
62 AC_SUBST(OBJ_FORMAT)
63
64 if test x$cpu_ia32 = xtrue ; then
65 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
66 fi
67
68 AC_ARG_ENABLE(asm-optimizations, [  --disable-asm-optimizations    Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
69 AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
70 if test x$asm_opt = xno ; then
71 AC_DEFINE(FLAC__NO_ASM)
72 fi
73
74 AC_ARG_ENABLE(debug,
75 [  --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) ;;
80 esac],[debug=false])
81 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
82
83 AC_ARG_ENABLE(sse,
84 [  --enable-sse                   Enable SSE support by asserting that the OS supports SSE instructions],
85 [case "${enableval}" in
86         yes) sse_os=true ;;
87         no)  sse_os=false ;;
88         *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
89 esac],[sse_os=false])
90 AM_CONDITIONAL(FLaC__SSE_OS, test x$sse_os = xtrue)
91 if test x$sse_os = xtrue ; then
92 AC_DEFINE(FLAC__SSE_OS)
93 fi
94
95 AC_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) ;;
101 esac],[use_3dnow=true])
102 AM_CONDITIONAL(FLaC__USE_3DNOW, test x$use_3dnow = xtrue)
103 if test x$use_3dnow = xtrue ; then
104 AC_DEFINE(FLAC__USE_3DNOW)
105 fi
106
107 AC_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) ;;
113 esac],[use_altivec=true])
114 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test x$use_altivec = xtrue)
115 if test x$use_altivec = xtrue ; then
116 AC_DEFINE(FLAC__USE_ALTIVEC)
117 fi
118
119 AC_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) ;;
125 esac],[install_xmms_plugin_locally=false])
126 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test x$install_xmms_plugin_locally = xtrue)
127
128 AC_ARG_ENABLE(exhaustive-tests,
129 [  --enable-exhaustive-tests      Enable exhaustive testing],
130 [case "${enableval}" in
131         yes) exhaustive_tests=true ;;
132         no)  exhaustive_tests=false ;;
133         *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
134 esac],[exhaustive_tests=false])
135 AM_CONDITIONAL(FLaC__EXHAUSTIVE_TESTS, test x$exhaustive_tests = xtrue)
136 if test x$exhaustive_tests = xtrue ; then
137 AC_DEFINE(FLAC__EXHAUSTIVE_TESTS)
138 fi
139
140 AC_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) ;;
146 esac],[valgrind_testing=false])
147 AM_CONDITIONAL(FLaC__VALGRIND_TESTING, test x$valgrind_testing = xtrue)
148 if test x$valgrind_testing = xtrue ; then
149 AC_DEFINE(FLAC__VALGRIND_TESTING)
150 fi
151
152 dnl check for ogg library
153 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
154 AM_CONDITIONAL(FLaC__HAS_OGG, [test x$have_ogg = xyes])
155 if test x$have_ogg = xyes ; then
156 AC_DEFINE(FLAC__HAS_OGG)
157 fi
158
159 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built]))
160 AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
161
162 dnl check for i18n(internationalization); these are from libiconv/gettext
163 AM_ICONV
164 AM_LANGINFO_CODESET
165
166 AC_CHECK_PROGS(DOXYGEN, doxygen)
167 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
168 if test -n "$DOXYGEN" ; then
169 AC_DEFINE(FLAC__HAS_DOXYGEN)
170 fi
171
172 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
173 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
174 if test -n "$DOCBOOK_TO_MAN" ; then
175 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
176 fi
177
178 AC_CHECK_PROGS(NASM, nasm)
179 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
180 if test -n "$NASM" ; then
181 AC_DEFINE(FLAC__HAS_NASM)
182 fi
183
184 OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
185 if test x$debug = xtrue; then
186         OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
187 else
188         OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O2 -DNDEBUG"
189         if test x$GCC = xyes; then
190                 OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__"
191         fi
192 fi
193 CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS"
194 CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS"
195
196 AM_CONFIG_HEADER(config.h)
197 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA,  [define to align allocated memory on 32-byte boundaries])
198 AH_TEMPLATE(FLAC__CPU_IA32,  [define if building for ia32/i386])
199 AH_TEMPLATE(FLAC__CPU_PPC,  [define if building for PowerPC])
200 AH_TEMPLATE(FLAC__CPU_SPARC,  [define if building for SPARC])
201 AH_TEMPLATE(FLAC__EXHAUSTIVE_TESTS,  [define to run even more tests])
202 AH_TEMPLATE(FLAC__VALGRIND_TESTING,  [define to enable use of Valgrind in testers])
203 AH_TEMPLATE(FLAC__HAS_DOXYGEN,  [define if you have Doxygen])
204 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN,  [define if you have docbook-to-man or docbook2man])
205 AH_TEMPLATE(FLAC__HAS_NASM,  [define if you have the NASM assembler])
206 AH_TEMPLATE(FLAC__HAS_OGG,  [define if you have the ogg library])
207 AH_TEMPLATE(FLAC__NO_ASM,  [define to disable use of assembly code])
208 AH_TEMPLATE(FLAC__SSE_OS,  [define if your operating system supports SSE instructions])
209 AH_TEMPLATE(FLAC__USE_3DNOW,  [define to enable use of 3Dnow! instructions])
210 AH_TEMPLATE(FLAC__USE_ALTIVEC,  [define to enable use of Altivec instructions])
211
212 AC_OUTPUT( \
213         Makefile \
214         src/Makefile \
215         src/libFLAC/Makefile \
216         src/libFLAC/ia32/Makefile \
217         src/libFLAC/ppc/Makefile \
218         src/libFLAC/include/Makefile \
219         src/libFLAC/include/private/Makefile \
220         src/libFLAC/include/protected/Makefile \
221         src/libFLAC++/Makefile \
222         src/libOggFLAC/Makefile \
223         src/libOggFLAC/include/Makefile \
224         src/libOggFLAC/include/private/Makefile \
225         src/libOggFLAC/include/protected/Makefile \
226         src/libOggFLAC++/Makefile \
227         src/flac/Makefile \
228         src/metaflac/Makefile \
229         src/monkeys_audio_utilities/Makefile \
230         src/monkeys_audio_utilities/flac_mac/Makefile \
231         src/monkeys_audio_utilities/flac_ren/Makefile \
232         src/plugin_common/Makefile \
233         src/plugin_winamp2/Makefile \
234         src/plugin_winamp2/include/Makefile \
235         src/plugin_winamp2/include/winamp2/Makefile \
236         src/plugin_xmms/Makefile \
237         src/share/Makefile \
238         src/share/getopt/Makefile \
239         src/share/grabbag/Makefile \
240         src/share/replaygain_analysis/Makefile \
241         src/share/replaygain_synthesis/Makefile \
242         src/share/replaygain_synthesis/include/Makefile \
243         src/share/replaygain_synthesis/include/private/Makefile \
244         src/share/utf8/Makefile \
245         src/test_grabbag/Makefile \
246         src/test_grabbag/cuesheet/Makefile \
247         src/test_libFLAC/Makefile \
248         src/test_libFLAC++/Makefile \
249         src/test_libOggFLAC/Makefile \
250         src/test_libOggFLAC++/Makefile \
251         src/test_seeking/Makefile \
252         src/test_streams/Makefile \
253         include/Makefile \
254         include/FLAC/Makefile \
255         include/FLAC++/Makefile \
256         include/OggFLAC/Makefile \
257         include/OggFLAC++/Makefile \
258         include/share/Makefile \
259         include/share/grabbag/Makefile \
260         doc/Makefile \
261         doc/html/Makefile \
262         doc/html/images/Makefile \
263         doc/html/ru/Makefile \
264         man/Makefile \
265         test/Makefile \
266         test/cuesheets/Makefile \
267         build/Makefile \
268         obj/Makefile \
269         obj/debug/Makefile \
270         obj/debug/bin/Makefile \
271         obj/debug/lib/Makefile \
272         obj/release/Makefile \
273         obj/release/bin/Makefile \
274         obj/release/lib/Makefile \
275         flac.pbproj/Makefile \
276 )