blob: c03e36b739a8f00f7f9ad011771555d0d8b095f9 [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
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
Cristian Rodríguez9b7cb222012-04-07 19:24:21 -030021AC_PREREQ(2.60)
Erik de Castro Lopo1b1d05b2013-04-28 16:29:39 +100022AC_INIT([flac], [1.3.0pre4], [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
Max Horn21f68f42012-12-12 21:33:54 +010062AC_CHECK_HEADERS([stdint.h inttypes.h byteswap.h sys/param.h])
Cristian Rodríguezf0296252012-04-05 19:39:37 -030063
Erik de Castro Lopod7bfc772012-02-06 07:15:48 +110064XIPH_C_BSWAP32
65
Max Hornf20164e2012-12-12 21:33:51 +010066ac_cv_c_big_endian=0
67ac_cv_c_little_endian=0
68AC_C_BIGENDIAN([ac_cv_c_big_endian=1], [ac_cv_c_little_endian=1], [
69 AC_MSG_WARN([[*****************************************************************]])
70 AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]])
71 AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]])
72 AC_MSG_WARN([[*** config.h may need to be hand editied. ]])
73 AC_MSG_WARN([[*****************************************************************]])
74])
Erik de Castro Lopo3abb6c92012-02-05 18:58:11 +110075AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
76 [Target processor is big endian.])
77AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
78 [Target processor is little endian.])
79AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian},
80 [Target processor is big endian.])
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110081
Erik de Castro Lopo3abb6c92012-02-05 18:58:11 +110082# For the XMMS plugin.
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110083AC_CHECK_TYPES(socklen_t, [], [])
84
85dnl check for getopt in standard library
86dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
87AC_CHECK_FUNCS(getopt_long, [], [])
88
89case "$host_cpu" in
90 i*86)
91 cpu_ia32=true
92 AC_DEFINE(FLAC__CPU_IA32)
93 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
94 ;;
Erik de Castro Lopo592021e2012-12-28 09:49:50 +110095 powerpc|powerpc64)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110096 cpu_ppc=true
97 AC_DEFINE(FLAC__CPU_PPC)
98 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
99 ;;
100 sparc)
101 cpu_sparc=true
102 AC_DEFINE(FLAC__CPU_SPARC)
103 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
104 ;;
105esac
106AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
107AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
108AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
109
110case "$host" in
111 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
112 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
113 *-*-darwin*) OBJ_FORMAT=macho ;;
Erik de Castro Lopo0fe97672012-02-05 16:29:43 +1100114 *emx*) OBJ_FORMAT=aout ;;
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100115 *) OBJ_FORMAT=elf ;;
116esac
117AC_SUBST(OBJ_FORMAT)
Erik de Castro Lopob6e64af2012-02-13 19:46:32 +1100118case "$host" in
119 *-gnuspe)
120 abi_spe=true
121 AC_DEFINE(FLAC__CPU_PPC_SPE)
122 AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI])
123 ;;
124esac
125AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100126
Erik de Castro Lopo2199d082013-04-01 19:57:13 +1100127os_is_windows=no
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100128case "$host" in
Erik de Castro Lopoc1ebd2c2013-04-29 21:32:48 +1000129 *-*-cygwin|*mingw*)
Erik de Castro Lopo8b4bc4b2012-02-05 16:28:40 +1100130 # define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100131 LT_NO_UNDEFINED="-no-undefined"
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 Lopoc1ebd2c2013-04-29 21:32:48 +1000135 *emx*)
136 LT_NO_UNDEFINED="-no-undefined"
137 ;;
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100138 *)
139 LT_NO_UNDEFINED=
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100140 ;;
141esac
142AC_SUBST(LT_NO_UNDEFINED)
Erik de Castro Lopo2199d082013-04-01 19:57:13 +1100143AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100144
145case "$host" in
146 *-pc-linux-gnu)
147 sys_linux=true
148 AC_DEFINE(FLAC__SYS_LINUX)
149 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
150 ;;
151 *-*-darwin*)
152 sys_darwin=true
153 AC_DEFINE(FLAC__SYS_DARWIN)
154 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
155 ;;
156esac
157AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
158AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
159
160if test "x$cpu_ia32" = xtrue ; then
161AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
162AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
163fi
164
165AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
166dnl ' Terminate the damn single quote
167AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
168if test "x$asm_opt" = xno ; then
169AC_DEFINE(FLAC__NO_ASM)
170AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
171fi
172
173AC_ARG_ENABLE(debug,
174AC_HELP_STRING([--enable-debug], [Turn on debugging]),
175[case "${enableval}" in
176 yes) debug=true ;;
177 no) debug=false ;;
178 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
179esac],[debug=false])
180AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
181
182AC_ARG_ENABLE(sse,
183AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
184[case "${enableval}" in
185 yes) sse_os=true ;;
186 no) sse_os=false ;;
187 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
188esac],[sse_os=false])
189AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
190if test "x$sse_os" = xtrue ; then
191AC_DEFINE(FLAC__SSE_OS)
192AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
193fi
194
195AC_ARG_ENABLE(3dnow,
196AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
197[case "${enableval}" in
198 yes) use_3dnow=true ;;
199 no) use_3dnow=false ;;
200 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
201esac],[use_3dnow=true])
202AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
203if test "x$use_3dnow" = xtrue ; then
204AC_DEFINE(FLAC__USE_3DNOW)
205AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
206fi
207
208AC_ARG_ENABLE(altivec,
209AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
210[case "${enableval}" in
211 yes) use_altivec=true ;;
212 no) use_altivec=false ;;
213 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
214esac],[use_altivec=true])
215AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
216if test "x$use_altivec" = xtrue ; then
217AC_DEFINE(FLAC__USE_ALTIVEC)
218AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
219fi
220
221AC_ARG_ENABLE(thorough-tests,
222AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
223[case "${enableval}" in
224 yes) thorough_tests=true ;;
225 no) thorough_tests=false ;;
226 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
227esac],[thorough_tests=true])
228AC_ARG_ENABLE(exhaustive-tests,
229AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
230[case "${enableval}" in
231 yes) exhaustive_tests=true ;;
232 no) exhaustive_tests=false ;;
233 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
234esac],[exhaustive_tests=false])
235if test "x$thorough_tests" = xfalse ; then
236FLAC__TEST_LEVEL=0
237elif test "x$exhaustive_tests" = xfalse ; then
238FLAC__TEST_LEVEL=1
239else
240FLAC__TEST_LEVEL=2
241fi
242AC_SUBST(FLAC__TEST_LEVEL)
243
244AC_ARG_ENABLE(gcc-werror,
Erik de Castro Lopo195470f2013-03-13 18:58:16 +1100245 AC_HELP_STRING([--enable-gcc-werror], [Enable -Werror in all Makefiles]))
246
247AC_ARG_ENABLE(stack-smash-protection,
248 AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection]))
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100249
250AC_ARG_ENABLE(valgrind-testing,
251AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
252[case "${enableval}" in
253 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
254 no) FLAC__TEST_WITH_VALGRIND=no ;;
255 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
256esac],[FLAC__TEST_WITH_VALGRIND=no])
257AC_SUBST(FLAC__TEST_WITH_VALGRIND)
258
259AC_ARG_ENABLE(doxygen-docs,
260AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
261[case "${enableval}" in
262 yes) enable_doxygen_docs=true ;;
263 no) enable_doxygen_docs=false ;;
264 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
265esac],[enable_doxygen_docs=true])
266if test "x$enable_doxygen_docs" != xfalse ; then
267 AC_CHECK_PROGS(DOXYGEN, doxygen)
268fi
269AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
270
271AC_ARG_ENABLE(local-xmms-plugin,
272AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
273[case "${enableval}" in
274 yes) install_xmms_plugin_locally=true ;;
275 no) install_xmms_plugin_locally=false ;;
276 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
277esac],[install_xmms_plugin_locally=false])
278AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
279
280AC_ARG_ENABLE(xmms-plugin,
281AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
282[case "${enableval}" in
283 yes) enable_xmms_plugin=true ;;
284 no) enable_xmms_plugin=false ;;
285 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
286esac],[enable_xmms_plugin=true])
287if test "x$enable_xmms_plugin" != xfalse ; then
288 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
289fi
290AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
291
292dnl build FLAC++ or not
293AC_ARG_ENABLE([cpplibs],
294AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
295[case "${enableval}" in
296 yes) disable_cpplibs=false ;;
297 no) disable_cpplibs=true ;;
298 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
299esac], [disable_cpplibs=false])
300AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
301
302dnl check for ogg library
303AC_ARG_ENABLE([ogg],
304 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
305 [ want_ogg=$enableval ], [ want_ogg=yes ] )
306
307if test "x$want_ogg" != "xno"; then
308 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
309fi
310
311AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
312if test "x$have_ogg" = xyes ; then
Erik de Castro Lopo3e2cd272012-07-04 19:53:31 +1000313 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],1,[define if you have the ogg library])
Ulrich Klauer5da86632013-04-06 20:41:12 +0200314 OGG_PACKAGE="ogg"
Erik de Castro Lopo3e2cd272012-07-04 19:53:31 +1000315else
316 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],0)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100317fi
Ulrich Klauer5da86632013-04-06 20:41:12 +0200318AC_SUBST(OGG_PACKAGE)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100319
320dnl check for i18n(internationalization); these are from libiconv/gettext
321AM_ICONV
322AM_LANGINFO_CODESET
323
324AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
325AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
326if test -n "$DOCBOOK_TO_MAN" ; then
327AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
328AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
329fi
330
331# only matters for x86
332AC_CHECK_PROGS(NASM, nasm)
333AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
334if test -n "$NASM" ; then
335AC_DEFINE(FLAC__HAS_NASM)
336AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
337fi
338
339# only matters for PowerPC
340AC_CHECK_PROGS(AS, as, as)
341AC_CHECK_PROGS(GAS, gas, gas)
342
343# try -v (apple as) and --version (gas) at the same time
344test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
345
346AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
347AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
348if test "$AS" = "as" ; then
349AC_DEFINE(FLAC__HAS_AS)
350AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
351fi
352if test "$AS" = "gas" ; then
353# funniest. macro. ever.
354AC_DEFINE(FLAC__HAS_GAS)
355AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
356fi
357
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100358if test "x$debug" = xtrue; then
Cristian Rodríguez9b7cb222012-04-07 19:24:21 -0300359 CPPFLAGS="-DDEBUG $CPPFLAGS"
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100360 CFLAGS="-g $CFLAGS"
361else
362 CPPFLAGS="-DNDEBUG $CPPFLAGS"
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100363 if test "x$GCC" = xyes; then
Miroslav Lichvar18e01542012-12-03 21:04:56 +0100364 if test "x$user_cflags" = x; then
365 CFLAGS="-O3 -funroll-loops -Wall -W -Winline"
366 fi
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100367 fi
368fi
369
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100370XIPH_GCC_VERSION
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100371
372if test x$ac_cv_c_compiler_gnu = xyes ; then
Erik de Castro Lopo06f38122013-03-10 22:34:18 +1100373 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
374 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
375
376
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100377 if test x$enable_gcc_werror = "xyes" ; then
Erik de Castro Lopo06f38122013-03-10 22:34:18 +1100378 CFLAGS="$CFLAGS -Wall -Wextra -Werror "
379 CXXFLAGS="$CXXFLAGS -Wall -Wextra -Werror "
Erik de Castro Lopo2860f172013-03-09 19:42:26 +1100380 fi
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100381
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100382 if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elf; then
383 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
384 CFLAGS="$CFLAGS -fvisibility=hidden"
385 CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
Erik de Castro Lopo2860f172013-03-09 19:42:26 +1100386 fi
387
388 if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
389 XIPH_ADD_CFLAGS([-fgnu89-inline])
390 fi
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100391 fi
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100392
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100393
Erik de Castro Lopod5b03bc2013-03-09 08:55:37 +1100394XIPH_ADD_CFLAGS([-Wextra])
Erik de Castro Lopo06f38122013-03-10 22:34:18 +1100395XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
Erik de Castro Lopod5b03bc2013-03-09 08:55:37 +1100396XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
397
Erik de Castro Lopo195470f2013-03-13 18:58:16 +1100398if test x$enable_stack_smash_protection = "xyes" ; then
399 XIPH_GCC_STACK_PROTECTOR
400 XIPH_GXX_STACK_PROTECTOR
401 fi
Erik de Castro Lopod5b03bc2013-03-09 08:55:37 +1100402
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100403#@@@
404AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
405AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
406
407AC_CONFIG_FILES([ \
408 Makefile \
409 src/Makefile \
410 src/libFLAC/Makefile \
411 src/libFLAC/flac.pc \
412 src/libFLAC/ia32/Makefile \
413 src/libFLAC/ppc/Makefile \
414 src/libFLAC/ppc/as/Makefile \
415 src/libFLAC/ppc/gas/Makefile \
416 src/libFLAC/include/Makefile \
417 src/libFLAC/include/private/Makefile \
418 src/libFLAC/include/protected/Makefile \
419 src/libFLAC++/Makefile \
420 src/libFLAC++/flac++.pc \
421 src/flac/Makefile \
422 src/metaflac/Makefile \
423 src/monkeys_audio_utilities/Makefile \
424 src/monkeys_audio_utilities/flac_mac/Makefile \
425 src/monkeys_audio_utilities/flac_ren/Makefile \
426 src/plugin_common/Makefile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100427 src/plugin_xmms/Makefile \
428 src/share/Makefile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100429 src/test_grabbag/Makefile \
430 src/test_grabbag/cuesheet/Makefile \
431 src/test_grabbag/picture/Makefile \
432 src/test_libs_common/Makefile \
433 src/test_libFLAC/Makefile \
434 src/test_libFLAC++/Makefile \
435 src/test_seeking/Makefile \
436 src/test_streams/Makefile \
437 src/utils/Makefile \
438 src/utils/flacdiff/Makefile \
439 src/utils/flactimer/Makefile \
440 examples/Makefile \
441 examples/c/Makefile \
442 examples/c/decode/Makefile \
443 examples/c/decode/file/Makefile \
444 examples/c/encode/Makefile \
445 examples/c/encode/file/Makefile \
446 examples/cpp/Makefile \
447 examples/cpp/decode/Makefile \
448 examples/cpp/decode/file/Makefile \
449 examples/cpp/encode/Makefile \
450 examples/cpp/encode/file/Makefile \
451 include/Makefile \
452 include/FLAC/Makefile \
453 include/FLAC++/Makefile \
454 include/share/Makefile \
455 include/share/grabbag/Makefile \
456 include/test_libs_common/Makefile \
Olivier Blinf6997882012-12-28 19:58:46 +0100457 doc/Doxyfile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100458 doc/Makefile \
459 doc/html/Makefile \
460 doc/html/images/Makefile \
461 doc/html/images/hw/Makefile \
462 doc/html/ru/Makefile \
463 m4/Makefile \
464 man/Makefile \
465 test/Makefile \
466 test/cuesheets/Makefile \
467 test/flac-to-flac-metadata-test-files/Makefile \
468 test/metaflac-test-files/Makefile \
469 test/pictures/Makefile \
470 build/Makefile \
Erik de Castro Lopo55788ea2012-12-28 11:06:38 +1100471 objs/Makefile \
472 objs/debug/Makefile \
473 objs/debug/bin/Makefile \
474 objs/debug/lib/Makefile \
475 objs/release/Makefile \
476 objs/release/bin/Makefile \
477 objs/release/lib/Makefile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100478])
479AC_OUTPUT
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100480
481AC_MSG_RESULT([
482-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
483
484 Configuration summary :
485
486 FLAC version : ........................ ${VERSION}
487
488 Host CPU : ............................ ${host_cpu}
489 Host Vendor : ......................... ${host_vendor}
490 Host OS : ............................. ${host_os}
491])
492
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100493 echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
Max Horncdcb88b2012-12-12 21:33:53 +0100494if test x$ac_cv_c_compiler_gnu = xyes ; then
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100495 echo " GCC version : ......................... ${GCC_VERSION}"
Max Horncdcb88b2012-12-12 21:33:53 +0100496fi
Erik de Castro Lopo592021e2012-12-28 09:49:50 +1100497echo