blob: ba46caf68a42272481d912e591bdbe020282a4e7 [file] [log] [blame]
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +11001# FLAC - Free Lossless Audio Codec
2# Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008,2009 Josh Coalson
3#
4# This file is part the FLAC project. FLAC is comprised of several
Ulrich Klauercd4ddab2013-05-26 22:53:43 +02005# components distributed under different licenses. The codec libraries
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +11006# 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
Cristian Rodríguez9b7cb222012-04-07 19:24:21 -030021AC_PREREQ(2.60)
Erik de Castro Lopob1982fb2013-05-25 17:11:19 +100022AC_INIT([flac], [1.3.0], [flac-dev@xiph.org], [flac], [https://www.xiph.org/flac/])
Max Horn0b47ede2012-12-12 21:33:55 +010023AC_CONFIG_HEADERS([config.h])
Cristian Rodríguez9b7cb222012-04-07 19:24:21 -030024AC_CONFIG_SRCDIR([src/flac/main.c])
25AC_CONFIG_MACRO_DIR([m4])
Max Horn0b47ede2012-12-12 21:33:55 +010026AM_INIT_AUTOMAKE([foreign 1.11 -Wall tar-pax no-dist-gzip dist-xz subdir-objects])
Erik de Castro Lopo886b9602012-02-03 05:52:01 +110027m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110028
Miroslav Lichvar18e01542012-12-03 21:04:56 +010029user_cflags=$CFLAGS
30
Cristian Rodríguezf0296252012-04-05 19:39:37 -030031#Prefer whatever the current ISO standard is.
32AC_PROG_CC_STDC
33AC_USE_SYSTEM_EXTENSIONS
Cristian Rodríguez63c874f2012-06-02 17:00:56 -040034m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
Cristian Rodríguez9b7cb222012-04-07 19:24:21 -030035LT_INIT([win32-dll disable-static pic-only])
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110036AM_PROG_AS
37AC_PROG_CXX
38AC_PROG_MAKE_SET
39
40AC_SYS_LARGEFILE
41AC_FUNC_FSEEKO
42
Erik de Castro Lopo6497ce12013-03-13 21:54:15 +110043AC_CHECK_SIZEOF(off_t,1) # Fake default value.
Max Horn0b47ede2012-12-12 21:33:55 +010044AC_CHECK_SIZEOF([void*])
Cristian Rodríguez9b7cb222012-04-07 19:24:21 -030045AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)])
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110046
Max Horn0b47ede2012-12-12 21:33:55 +010047AC_LANG_PUSH([C++])
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110048# c++ flavor first
49AC_C_VARARRAYS
50if test $ac_cv_c_vararrays = yes; then
51 AC_DEFINE([HAVE_CXX_VARARRAYS], 1, [Define to 1 if C++ supports variable-length arrays.])
52fi
Max Horn0b47ede2012-12-12 21:33:55 +010053AC_LANG_POP([C++])
Erik de Castro Lopo3abb6c92012-02-05 18:58:11 +110054
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110055# c flavor
56AC_HEADER_STDC
Erik de Castro Lopoafedee12012-04-04 20:08:52 +100057AM_PROG_CC_C_O
Erik de Castro Lopo3abb6c92012-02-05 18:58:11 +110058AC_C_INLINE
59AC_C_VARARRAYS
Cristian Rodríguezf0296252012-04-05 19:39:37 -030060AC_C_TYPEOF
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110061
Dagobert Michelsen5999d812013-05-26 23:32:01 +020062AC_CHECK_HEADERS([stdint.h inttypes.h byteswap.h sys/param.h termios.h])
63
64AC_HEADER_TIOCGWINSZ
Cristian Rodríguezf0296252012-04-05 19:39:37 -030065
Erik de Castro Lopod7bfc772012-02-06 07:15:48 +110066XIPH_C_BSWAP32
67
Max Hornf20164e2012-12-12 21:33:51 +010068ac_cv_c_big_endian=0
69ac_cv_c_little_endian=0
70AC_C_BIGENDIAN([ac_cv_c_big_endian=1], [ac_cv_c_little_endian=1], [
71 AC_MSG_WARN([[*****************************************************************]])
72 AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]])
73 AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]])
74 AC_MSG_WARN([[*** config.h may need to be hand editied. ]])
75 AC_MSG_WARN([[*****************************************************************]])
76])
Erik de Castro Lopo3abb6c92012-02-05 18:58:11 +110077AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
78 [Target processor is big endian.])
79AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
80 [Target processor is little endian.])
81AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian},
82 [Target processor is big endian.])
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110083
Erik de Castro Lopo3abb6c92012-02-05 18:58:11 +110084# For the XMMS plugin.
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110085AC_CHECK_TYPES(socklen_t, [], [])
86
87dnl check for getopt in standard library
88dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
89AC_CHECK_FUNCS(getopt_long, [], [])
90
91case "$host_cpu" in
92 i*86)
93 cpu_ia32=true
94 AC_DEFINE(FLAC__CPU_IA32)
95 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
96 ;;
Erik de Castro Lopo592021e2012-12-28 09:49:50 +110097 powerpc|powerpc64)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110098 cpu_ppc=true
99 AC_DEFINE(FLAC__CPU_PPC)
100 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
101 ;;
102 sparc)
103 cpu_sparc=true
104 AC_DEFINE(FLAC__CPU_SPARC)
105 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
106 ;;
107esac
108AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
109AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
110AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
111
112case "$host" in
113 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
114 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
115 *-*-darwin*) OBJ_FORMAT=macho ;;
Erik de Castro Lopo0fe97672012-02-05 16:29:43 +1100116 *emx*) OBJ_FORMAT=aout ;;
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100117 *) OBJ_FORMAT=elf ;;
118esac
119AC_SUBST(OBJ_FORMAT)
Erik de Castro Lopob6e64af2012-02-13 19:46:32 +1100120case "$host" in
121 *-gnuspe)
122 abi_spe=true
123 AC_DEFINE(FLAC__CPU_PPC_SPE)
124 AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI])
125 ;;
126esac
127AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100128
Erik de Castro Lopo2199d082013-04-01 19:57:13 +1100129os_is_windows=no
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100130case "$host" in
Erik de Castro Lopoc1ebd2c2013-04-29 21:32:48 +1000131 *-*-cygwin|*mingw*)
Erik de Castro Lopof44c3532013-04-02 06:27:07 +1100132 CPPFLAGS="-D__MSVCRT_VERSION__=0x0601 $CPPFLAGS"
Erik de Castro Lopo2199d082013-04-01 19:57:13 +1100133 os_is_windows=yes
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100134 ;;
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100135esac
Cristian Rodríguez355f4aa2013-07-21 01:28:51 -0400136
Erik de Castro Lopo2199d082013-04-01 19:57:13 +1100137AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100138
139case "$host" in
140 *-pc-linux-gnu)
141 sys_linux=true
142 AC_DEFINE(FLAC__SYS_LINUX)
143 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
144 ;;
145 *-*-darwin*)
146 sys_darwin=true
147 AC_DEFINE(FLAC__SYS_DARWIN)
148 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
149 ;;
150esac
151AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
152AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
153
154if test "x$cpu_ia32" = xtrue ; then
155AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
156AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
157fi
158
159AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
160dnl ' Terminate the damn single quote
161AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
162if test "x$asm_opt" = xno ; then
163AC_DEFINE(FLAC__NO_ASM)
164AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
165fi
166
167AC_ARG_ENABLE(debug,
168AC_HELP_STRING([--enable-debug], [Turn on debugging]),
169[case "${enableval}" in
170 yes) debug=true ;;
171 no) debug=false ;;
172 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
173esac],[debug=false])
174AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
175
176AC_ARG_ENABLE(sse,
177AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
178[case "${enableval}" in
179 yes) sse_os=true ;;
180 no) sse_os=false ;;
181 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
182esac],[sse_os=false])
183AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
184if test "x$sse_os" = xtrue ; then
185AC_DEFINE(FLAC__SSE_OS)
186AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
187fi
188
189AC_ARG_ENABLE(3dnow,
190AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
191[case "${enableval}" in
192 yes) use_3dnow=true ;;
193 no) use_3dnow=false ;;
194 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
195esac],[use_3dnow=true])
196AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
197if test "x$use_3dnow" = xtrue ; then
198AC_DEFINE(FLAC__USE_3DNOW)
199AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
200fi
201
202AC_ARG_ENABLE(altivec,
203AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
204[case "${enableval}" in
205 yes) use_altivec=true ;;
206 no) use_altivec=false ;;
207 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
208esac],[use_altivec=true])
209AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
210if test "x$use_altivec" = xtrue ; then
211AC_DEFINE(FLAC__USE_ALTIVEC)
212AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
213fi
214
215AC_ARG_ENABLE(thorough-tests,
216AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
217[case "${enableval}" in
218 yes) thorough_tests=true ;;
219 no) thorough_tests=false ;;
220 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
221esac],[thorough_tests=true])
222AC_ARG_ENABLE(exhaustive-tests,
223AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
224[case "${enableval}" in
225 yes) exhaustive_tests=true ;;
226 no) exhaustive_tests=false ;;
227 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
228esac],[exhaustive_tests=false])
229if test "x$thorough_tests" = xfalse ; then
230FLAC__TEST_LEVEL=0
231elif test "x$exhaustive_tests" = xfalse ; then
232FLAC__TEST_LEVEL=1
233else
234FLAC__TEST_LEVEL=2
235fi
236AC_SUBST(FLAC__TEST_LEVEL)
237
238AC_ARG_ENABLE(gcc-werror,
Erik de Castro Lopo195470f2013-03-13 18:58:16 +1100239 AC_HELP_STRING([--enable-gcc-werror], [Enable -Werror in all Makefiles]))
240
241AC_ARG_ENABLE(stack-smash-protection,
242 AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection]))
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100243
244AC_ARG_ENABLE(valgrind-testing,
245AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
246[case "${enableval}" in
247 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
248 no) FLAC__TEST_WITH_VALGRIND=no ;;
249 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
250esac],[FLAC__TEST_WITH_VALGRIND=no])
251AC_SUBST(FLAC__TEST_WITH_VALGRIND)
252
253AC_ARG_ENABLE(doxygen-docs,
254AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
255[case "${enableval}" in
256 yes) enable_doxygen_docs=true ;;
257 no) enable_doxygen_docs=false ;;
258 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
259esac],[enable_doxygen_docs=true])
260if test "x$enable_doxygen_docs" != xfalse ; then
261 AC_CHECK_PROGS(DOXYGEN, doxygen)
262fi
263AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
264
265AC_ARG_ENABLE(local-xmms-plugin,
266AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
267[case "${enableval}" in
268 yes) install_xmms_plugin_locally=true ;;
269 no) install_xmms_plugin_locally=false ;;
270 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
271esac],[install_xmms_plugin_locally=false])
272AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
273
274AC_ARG_ENABLE(xmms-plugin,
275AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
276[case "${enableval}" in
277 yes) enable_xmms_plugin=true ;;
278 no) enable_xmms_plugin=false ;;
279 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
280esac],[enable_xmms_plugin=true])
281if test "x$enable_xmms_plugin" != xfalse ; then
282 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
283fi
284AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
285
286dnl build FLAC++ or not
287AC_ARG_ENABLE([cpplibs],
288AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
289[case "${enableval}" in
290 yes) disable_cpplibs=false ;;
291 no) disable_cpplibs=true ;;
292 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
293esac], [disable_cpplibs=false])
294AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
295
296dnl check for ogg library
297AC_ARG_ENABLE([ogg],
298 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
299 [ want_ogg=$enableval ], [ want_ogg=yes ] )
300
301if test "x$want_ogg" != "xno"; then
302 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
303fi
304
305AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
306if test "x$have_ogg" = xyes ; then
Erik de Castro Lopo3e2cd272012-07-04 19:53:31 +1000307 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],1,[define if you have the ogg library])
Ulrich Klauer5da86632013-04-06 20:41:12 +0200308 OGG_PACKAGE="ogg"
Erik de Castro Lopo3e2cd272012-07-04 19:53:31 +1000309else
310 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],0)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100311fi
Ulrich Klauer5da86632013-04-06 20:41:12 +0200312AC_SUBST(OGG_PACKAGE)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100313
314dnl check for i18n(internationalization); these are from libiconv/gettext
315AM_ICONV
316AM_LANGINFO_CODESET
317
318AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
319AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
320if test -n "$DOCBOOK_TO_MAN" ; then
321AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
322AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
323fi
324
325# only matters for x86
326AC_CHECK_PROGS(NASM, nasm)
327AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
328if test -n "$NASM" ; then
329AC_DEFINE(FLAC__HAS_NASM)
330AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
331fi
332
333# only matters for PowerPC
334AC_CHECK_PROGS(AS, as, as)
335AC_CHECK_PROGS(GAS, gas, gas)
336
337# try -v (apple as) and --version (gas) at the same time
338test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
339
340AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
341AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
342if test "$AS" = "as" ; then
343AC_DEFINE(FLAC__HAS_AS)
344AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
345fi
346if test "$AS" = "gas" ; then
347# funniest. macro. ever.
348AC_DEFINE(FLAC__HAS_GAS)
349AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
350fi
351
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100352if test "x$debug" = xtrue; then
Cristian Rodríguez9b7cb222012-04-07 19:24:21 -0300353 CPPFLAGS="-DDEBUG $CPPFLAGS"
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100354 CFLAGS="-g $CFLAGS"
355else
356 CPPFLAGS="-DNDEBUG $CPPFLAGS"
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100357 if test "x$GCC" = xyes; then
Miroslav Lichvar18e01542012-12-03 21:04:56 +0100358 if test "x$user_cflags" = x; then
359 CFLAGS="-O3 -funroll-loops -Wall -W -Winline"
360 fi
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100361 fi
362fi
363
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100364XIPH_GCC_VERSION
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100365
366if test x$ac_cv_c_compiler_gnu = xyes ; then
Erik de Castro Lopo06f38122013-03-10 22:34:18 +1100367 CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Winline -Wconversion
368 CXXFLAGS="$CXXFLAGS -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Woverloaded-virtual -Wmissing-declarations
369
370
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100371 if test x$enable_gcc_werror = "xyes" ; then
Erik de Castro Lopo06f38122013-03-10 22:34:18 +1100372 CFLAGS="$CFLAGS -Wall -Wextra -Werror "
373 CXXFLAGS="$CXXFLAGS -Wall -Wextra -Werror "
Erik de Castro Lopo2860f172013-03-09 19:42:26 +1100374 fi
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100375
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100376 if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elf; then
377 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
378 CFLAGS="$CFLAGS -fvisibility=hidden"
379 CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
Erik de Castro Lopo2860f172013-03-09 19:42:26 +1100380 fi
381
382 if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
383 XIPH_ADD_CFLAGS([-fgnu89-inline])
384 fi
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100385 fi
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100386
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100387
Erik de Castro Lopod5b03bc2013-03-09 08:55:37 +1100388XIPH_ADD_CFLAGS([-Wextra])
Erik de Castro Lopo06f38122013-03-10 22:34:18 +1100389XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
Erik de Castro Lopod5b03bc2013-03-09 08:55:37 +1100390XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
391
Erik de Castro Lopo195470f2013-03-13 18:58:16 +1100392if test x$enable_stack_smash_protection = "xyes" ; then
393 XIPH_GCC_STACK_PROTECTOR
394 XIPH_GXX_STACK_PROTECTOR
395 fi
Erik de Castro Lopod5b03bc2013-03-09 08:55:37 +1100396
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100397#@@@
398AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
399AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
400
401AC_CONFIG_FILES([ \
402 Makefile \
403 src/Makefile \
404 src/libFLAC/Makefile \
405 src/libFLAC/flac.pc \
406 src/libFLAC/ia32/Makefile \
407 src/libFLAC/ppc/Makefile \
408 src/libFLAC/ppc/as/Makefile \
409 src/libFLAC/ppc/gas/Makefile \
410 src/libFLAC/include/Makefile \
411 src/libFLAC/include/private/Makefile \
412 src/libFLAC/include/protected/Makefile \
413 src/libFLAC++/Makefile \
414 src/libFLAC++/flac++.pc \
415 src/flac/Makefile \
416 src/metaflac/Makefile \
417 src/monkeys_audio_utilities/Makefile \
418 src/monkeys_audio_utilities/flac_mac/Makefile \
419 src/monkeys_audio_utilities/flac_ren/Makefile \
420 src/plugin_common/Makefile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100421 src/plugin_xmms/Makefile \
422 src/share/Makefile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100423 src/test_grabbag/Makefile \
424 src/test_grabbag/cuesheet/Makefile \
425 src/test_grabbag/picture/Makefile \
426 src/test_libs_common/Makefile \
427 src/test_libFLAC/Makefile \
428 src/test_libFLAC++/Makefile \
429 src/test_seeking/Makefile \
430 src/test_streams/Makefile \
431 src/utils/Makefile \
432 src/utils/flacdiff/Makefile \
433 src/utils/flactimer/Makefile \
434 examples/Makefile \
435 examples/c/Makefile \
436 examples/c/decode/Makefile \
437 examples/c/decode/file/Makefile \
438 examples/c/encode/Makefile \
439 examples/c/encode/file/Makefile \
440 examples/cpp/Makefile \
441 examples/cpp/decode/Makefile \
442 examples/cpp/decode/file/Makefile \
443 examples/cpp/encode/Makefile \
444 examples/cpp/encode/file/Makefile \
445 include/Makefile \
446 include/FLAC/Makefile \
447 include/FLAC++/Makefile \
448 include/share/Makefile \
449 include/share/grabbag/Makefile \
450 include/test_libs_common/Makefile \
Olivier Blinf6997882012-12-28 19:58:46 +0100451 doc/Doxyfile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100452 doc/Makefile \
453 doc/html/Makefile \
454 doc/html/images/Makefile \
455 doc/html/images/hw/Makefile \
456 doc/html/ru/Makefile \
457 m4/Makefile \
458 man/Makefile \
459 test/Makefile \
460 test/cuesheets/Makefile \
461 test/flac-to-flac-metadata-test-files/Makefile \
462 test/metaflac-test-files/Makefile \
463 test/pictures/Makefile \
464 build/Makefile \
Erik de Castro Lopo55788ea2012-12-28 11:06:38 +1100465 objs/Makefile \
466 objs/debug/Makefile \
467 objs/debug/bin/Makefile \
468 objs/debug/lib/Makefile \
469 objs/release/Makefile \
470 objs/release/bin/Makefile \
471 objs/release/lib/Makefile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100472])
473AC_OUTPUT
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100474
475AC_MSG_RESULT([
476-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
477
478 Configuration summary :
479
480 FLAC version : ........................ ${VERSION}
481
482 Host CPU : ............................ ${host_cpu}
483 Host Vendor : ......................... ${host_vendor}
484 Host OS : ............................. ${host_os}
485])
486
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100487 echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
Max Horncdcb88b2012-12-12 21:33:53 +0100488if test x$ac_cv_c_compiler_gnu = xyes ; then
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100489 echo " GCC version : ......................... ${GCC_VERSION}"
Max Horncdcb88b2012-12-12 21:33:53 +0100490fi
Erik de Castro Lopo592021e2012-12-28 09:49:50 +1100491echo