blob: 220fd558716213cdcd658f0861470267cd5a40a6 [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 Lopo1ec41a92013-08-11 21:46:18 +100084AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
85dnl ' Terminate the damn single quote
86AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
87if test "x$asm_opt" = xno ; then
88AC_DEFINE(FLAC__NO_ASM)
89AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
90fi
91
Erik de Castro Lopo3abb6c92012-02-05 18:58:11 +110092# For the XMMS plugin.
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +110093AC_CHECK_TYPES(socklen_t, [], [])
94
95dnl check for getopt in standard library
96dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
97AC_CHECK_FUNCS(getopt_long, [], [])
98
Erik de Castro Lopo1ec41a92013-08-11 21:46:18 +100099AC_CHECK_SIZEOF(void*,1)
100
101asm_optimisation=no
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100102case "$host_cpu" in
Erik de Castro Lopo1ec41a92013-08-11 21:46:18 +1000103 x86_64)
104 if test $ac_cv_sizeof_voidp = 4 ; then
105 cpu_ia32=true
106 AC_DEFINE(FLAC__CPU_IA32)
107 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
108 asm_optimisation=$asm_opt
109 fi
110 ;;
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100111 i*86)
112 cpu_ia32=true
113 AC_DEFINE(FLAC__CPU_IA32)
114 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
Erik de Castro Lopo1ec41a92013-08-11 21:46:18 +1000115 asm_optimisation=$asm_opt
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100116 ;;
Erik de Castro Lopo592021e2012-12-28 09:49:50 +1100117 powerpc|powerpc64)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100118 cpu_ppc=true
119 AC_DEFINE(FLAC__CPU_PPC)
120 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
Erik de Castro Lopo1ec41a92013-08-11 21:46:18 +1000121 asm_optimisation=$asm_opt
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100122 ;;
123 sparc)
124 cpu_sparc=true
125 AC_DEFINE(FLAC__CPU_SPARC)
126 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
Erik de Castro Lopo1ec41a92013-08-11 21:46:18 +1000127 asm_optimisation=$asm_opt
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100128 ;;
129esac
130AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
131AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
132AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
133
134case "$host" in
135 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
136 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
137 *-*-darwin*) OBJ_FORMAT=macho ;;
Erik de Castro Lopo0fe97672012-02-05 16:29:43 +1100138 *emx*) OBJ_FORMAT=aout ;;
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100139 *) OBJ_FORMAT=elf ;;
140esac
141AC_SUBST(OBJ_FORMAT)
Erik de Castro Lopob6e64af2012-02-13 19:46:32 +1100142case "$host" in
143 *-gnuspe)
144 abi_spe=true
145 AC_DEFINE(FLAC__CPU_PPC_SPE)
146 AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI])
147 ;;
148esac
149AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100150
Erik de Castro Lopo2199d082013-04-01 19:57:13 +1100151os_is_windows=no
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100152case "$host" in
Erik de Castro Lopoc1ebd2c2013-04-29 21:32:48 +1000153 *-*-cygwin|*mingw*)
Erik de Castro Lopof44c3532013-04-02 06:27:07 +1100154 CPPFLAGS="-D__MSVCRT_VERSION__=0x0601 $CPPFLAGS"
Erik de Castro Lopo2199d082013-04-01 19:57:13 +1100155 os_is_windows=yes
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100156 ;;
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100157esac
Cristian Rodríguez355f4aa2013-07-21 01:28:51 -0400158
Erik de Castro Lopo2199d082013-04-01 19:57:13 +1100159AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100160
161case "$host" in
162 *-pc-linux-gnu)
163 sys_linux=true
164 AC_DEFINE(FLAC__SYS_LINUX)
165 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
166 ;;
167 *-*-darwin*)
168 sys_darwin=true
169 AC_DEFINE(FLAC__SYS_DARWIN)
170 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
171 ;;
172esac
173AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
174AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
175
176if test "x$cpu_ia32" = xtrue ; then
177AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
178AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
179fi
180
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100181AC_ARG_ENABLE(debug,
182AC_HELP_STRING([--enable-debug], [Turn on debugging]),
183[case "${enableval}" in
184 yes) debug=true ;;
185 no) debug=false ;;
186 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
187esac],[debug=false])
188AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
189
190AC_ARG_ENABLE(sse,
191AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]),
192[case "${enableval}" in
193 yes) sse_os=true ;;
194 no) sse_os=false ;;
195 *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
196esac],[sse_os=false])
197AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue)
198if test "x$sse_os" = xtrue ; then
199AC_DEFINE(FLAC__SSE_OS)
200AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions])
201fi
202
203AC_ARG_ENABLE(3dnow,
204AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]),
205[case "${enableval}" in
206 yes) use_3dnow=true ;;
207 no) use_3dnow=false ;;
208 *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
209esac],[use_3dnow=true])
210AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue)
211if test "x$use_3dnow" = xtrue ; then
212AC_DEFINE(FLAC__USE_3DNOW)
213AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions])
214fi
215
216AC_ARG_ENABLE(altivec,
217AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
218[case "${enableval}" in
219 yes) use_altivec=true ;;
220 no) use_altivec=false ;;
221 *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
222esac],[use_altivec=true])
223AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
224if test "x$use_altivec" = xtrue ; then
225AC_DEFINE(FLAC__USE_ALTIVEC)
226AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
227fi
228
229AC_ARG_ENABLE(thorough-tests,
230AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
231[case "${enableval}" in
232 yes) thorough_tests=true ;;
233 no) thorough_tests=false ;;
234 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
235esac],[thorough_tests=true])
236AC_ARG_ENABLE(exhaustive-tests,
237AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
238[case "${enableval}" in
239 yes) exhaustive_tests=true ;;
240 no) exhaustive_tests=false ;;
241 *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
242esac],[exhaustive_tests=false])
243if test "x$thorough_tests" = xfalse ; then
244FLAC__TEST_LEVEL=0
245elif test "x$exhaustive_tests" = xfalse ; then
246FLAC__TEST_LEVEL=1
247else
248FLAC__TEST_LEVEL=2
249fi
250AC_SUBST(FLAC__TEST_LEVEL)
251
252AC_ARG_ENABLE(gcc-werror,
Erik de Castro Lopo195470f2013-03-13 18:58:16 +1100253 AC_HELP_STRING([--enable-gcc-werror], [Enable -Werror in all Makefiles]))
254
255AC_ARG_ENABLE(stack-smash-protection,
256 AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection]))
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100257
258AC_ARG_ENABLE(valgrind-testing,
259AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
260[case "${enableval}" in
261 yes) FLAC__TEST_WITH_VALGRIND=yes ;;
262 no) FLAC__TEST_WITH_VALGRIND=no ;;
263 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
264esac],[FLAC__TEST_WITH_VALGRIND=no])
265AC_SUBST(FLAC__TEST_WITH_VALGRIND)
266
267AC_ARG_ENABLE(doxygen-docs,
268AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
269[case "${enableval}" in
270 yes) enable_doxygen_docs=true ;;
271 no) enable_doxygen_docs=false ;;
272 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
273esac],[enable_doxygen_docs=true])
274if test "x$enable_doxygen_docs" != xfalse ; then
275 AC_CHECK_PROGS(DOXYGEN, doxygen)
276fi
277AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
278
279AC_ARG_ENABLE(local-xmms-plugin,
280AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
281[case "${enableval}" in
282 yes) install_xmms_plugin_locally=true ;;
283 no) install_xmms_plugin_locally=false ;;
284 *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
285esac],[install_xmms_plugin_locally=false])
286AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
287
288AC_ARG_ENABLE(xmms-plugin,
289AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
290[case "${enableval}" in
291 yes) enable_xmms_plugin=true ;;
292 no) enable_xmms_plugin=false ;;
293 *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
294esac],[enable_xmms_plugin=true])
295if test "x$enable_xmms_plugin" != xfalse ; then
296 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
297fi
298AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
299
300dnl build FLAC++ or not
301AC_ARG_ENABLE([cpplibs],
302AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
303[case "${enableval}" in
304 yes) disable_cpplibs=false ;;
305 no) disable_cpplibs=true ;;
306 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
307esac], [disable_cpplibs=false])
308AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
309
310dnl check for ogg library
311AC_ARG_ENABLE([ogg],
312 AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
313 [ want_ogg=$enableval ], [ want_ogg=yes ] )
314
315if test "x$want_ogg" != "xno"; then
316 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built]))
317fi
318
319AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
320if test "x$have_ogg" = xyes ; then
Erik de Castro Lopo3e2cd272012-07-04 19:53:31 +1000321 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],1,[define if you have the ogg library])
Ulrich Klauer5da86632013-04-06 20:41:12 +0200322 OGG_PACKAGE="ogg"
Erik de Castro Lopo3e2cd272012-07-04 19:53:31 +1000323else
324 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],0)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100325fi
Ulrich Klauer5da86632013-04-06 20:41:12 +0200326AC_SUBST(OGG_PACKAGE)
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100327
328dnl check for i18n(internationalization); these are from libiconv/gettext
329AM_ICONV
330AM_LANGINFO_CODESET
331
332AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
333AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
334if test -n "$DOCBOOK_TO_MAN" ; then
335AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
336AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
337fi
338
339# only matters for x86
340AC_CHECK_PROGS(NASM, nasm)
341AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
342if test -n "$NASM" ; then
343AC_DEFINE(FLAC__HAS_NASM)
344AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
345fi
346
347# only matters for PowerPC
348AC_CHECK_PROGS(AS, as, as)
349AC_CHECK_PROGS(GAS, gas, gas)
350
351# try -v (apple as) and --version (gas) at the same time
352test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas
353
354AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as")
355AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas")
356if test "$AS" = "as" ; then
357AC_DEFINE(FLAC__HAS_AS)
358AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler])
359fi
360if test "$AS" = "gas" ; then
361# funniest. macro. ever.
362AC_DEFINE(FLAC__HAS_GAS)
363AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler])
364fi
365
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100366if test "x$debug" = xtrue; then
Cristian Rodríguez9b7cb222012-04-07 19:24:21 -0300367 CPPFLAGS="-DDEBUG $CPPFLAGS"
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100368 CFLAGS="-g $CFLAGS"
369else
370 CPPFLAGS="-DNDEBUG $CPPFLAGS"
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100371 if test "x$GCC" = xyes; then
Miroslav Lichvar18e01542012-12-03 21:04:56 +0100372 if test "x$user_cflags" = x; then
373 CFLAGS="-O3 -funroll-loops -Wall -W -Winline"
374 fi
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100375 fi
376fi
377
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100378XIPH_GCC_VERSION
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100379
380if test x$ac_cv_c_compiler_gnu = xyes ; then
Erik de Castro Lopo06f38122013-03-10 22:34:18 +1100381 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
382 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
383
384
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100385 if test x$enable_gcc_werror = "xyes" ; then
Erik de Castro Lopo06f38122013-03-10 22:34:18 +1100386 CFLAGS="$CFLAGS -Wall -Wextra -Werror "
387 CXXFLAGS="$CXXFLAGS -Wall -Wextra -Werror "
Erik de Castro Lopo2860f172013-03-09 19:42:26 +1100388 fi
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100389
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100390 if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elf; then
391 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
392 CFLAGS="$CFLAGS -fvisibility=hidden"
393 CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
Erik de Castro Lopo2860f172013-03-09 19:42:26 +1100394 fi
395
396 if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
397 XIPH_ADD_CFLAGS([-fgnu89-inline])
398 fi
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100399 fi
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100400
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100401
Erik de Castro Lopod5b03bc2013-03-09 08:55:37 +1100402XIPH_ADD_CFLAGS([-Wextra])
Erik de Castro Lopo06f38122013-03-10 22:34:18 +1100403XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
Erik de Castro Lopod5b03bc2013-03-09 08:55:37 +1100404XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
405
Erik de Castro Lopo195470f2013-03-13 18:58:16 +1100406if test x$enable_stack_smash_protection = "xyes" ; then
407 XIPH_GCC_STACK_PROTECTOR
408 XIPH_GXX_STACK_PROTECTOR
409 fi
Erik de Castro Lopod5b03bc2013-03-09 08:55:37 +1100410
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100411#@@@
412AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")
413AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no")
414
415AC_CONFIG_FILES([ \
416 Makefile \
417 src/Makefile \
418 src/libFLAC/Makefile \
419 src/libFLAC/flac.pc \
420 src/libFLAC/ia32/Makefile \
421 src/libFLAC/ppc/Makefile \
422 src/libFLAC/ppc/as/Makefile \
423 src/libFLAC/ppc/gas/Makefile \
424 src/libFLAC/include/Makefile \
425 src/libFLAC/include/private/Makefile \
426 src/libFLAC/include/protected/Makefile \
427 src/libFLAC++/Makefile \
428 src/libFLAC++/flac++.pc \
429 src/flac/Makefile \
430 src/metaflac/Makefile \
431 src/monkeys_audio_utilities/Makefile \
432 src/monkeys_audio_utilities/flac_mac/Makefile \
433 src/monkeys_audio_utilities/flac_ren/Makefile \
434 src/plugin_common/Makefile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100435 src/plugin_xmms/Makefile \
436 src/share/Makefile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100437 src/test_grabbag/Makefile \
438 src/test_grabbag/cuesheet/Makefile \
439 src/test_grabbag/picture/Makefile \
440 src/test_libs_common/Makefile \
441 src/test_libFLAC/Makefile \
442 src/test_libFLAC++/Makefile \
443 src/test_seeking/Makefile \
444 src/test_streams/Makefile \
445 src/utils/Makefile \
446 src/utils/flacdiff/Makefile \
447 src/utils/flactimer/Makefile \
448 examples/Makefile \
449 examples/c/Makefile \
450 examples/c/decode/Makefile \
451 examples/c/decode/file/Makefile \
452 examples/c/encode/Makefile \
453 examples/c/encode/file/Makefile \
454 examples/cpp/Makefile \
455 examples/cpp/decode/Makefile \
456 examples/cpp/decode/file/Makefile \
457 examples/cpp/encode/Makefile \
458 examples/cpp/encode/file/Makefile \
459 include/Makefile \
460 include/FLAC/Makefile \
461 include/FLAC++/Makefile \
462 include/share/Makefile \
463 include/share/grabbag/Makefile \
464 include/test_libs_common/Makefile \
Olivier Blinf6997882012-12-28 19:58:46 +0100465 doc/Doxyfile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100466 doc/Makefile \
467 doc/html/Makefile \
468 doc/html/images/Makefile \
469 doc/html/images/hw/Makefile \
470 doc/html/ru/Makefile \
471 m4/Makefile \
472 man/Makefile \
473 test/Makefile \
474 test/cuesheets/Makefile \
475 test/flac-to-flac-metadata-test-files/Makefile \
476 test/metaflac-test-files/Makefile \
477 test/pictures/Makefile \
478 build/Makefile \
Erik de Castro Lopo55788ea2012-12-28 11:06:38 +1100479 objs/Makefile \
480 objs/debug/Makefile \
481 objs/debug/bin/Makefile \
482 objs/debug/lib/Makefile \
483 objs/release/Makefile \
484 objs/release/bin/Makefile \
485 objs/release/lib/Makefile \
Erik de Castro Lopo06ed05e2012-02-01 17:55:50 +1100486])
487AC_OUTPUT
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100488
489AC_MSG_RESULT([
490-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
491
492 Configuration summary :
493
494 FLAC version : ........................ ${VERSION}
495
496 Host CPU : ............................ ${host_cpu}
497 Host Vendor : ......................... ${host_vendor}
498 Host OS : ............................. ${host_os}
499])
500
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100501 echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
Max Horncdcb88b2012-12-12 21:33:53 +0100502if test x$ac_cv_c_compiler_gnu = xyes ; then
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +1100503 echo " GCC version : ......................... ${GCC_VERSION}"
Max Horncdcb88b2012-12-12 21:33:53 +0100504fi
Erik de Castro Lopo1ec41a92013-08-11 21:46:18 +1000505 echo " Asm optimiizations : .................. ${asm_optimisation}"
Erik de Castro Lopo592021e2012-12-28 09:49:50 +1100506echo