Enable components search in package config mode
[flac.git] / configure.ac
blob3d18bb91846568b419a93ba980982b06434eb046
1 #  FLAC - Free Lossless Audio Codec
2 #  Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson
4 #  This file is part the FLAC project.  FLAC is comprised of several
5 #  components distributed under different 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.
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.
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
21 AC_PREREQ(2.60)
22 AC_INIT([flac], [1.3.2], [flac-dev@xiph.org], [flac], [https://www.xiph.org/flac/])
23 AC_CONFIG_HEADERS([config.h])
24 AC_CONFIG_SRCDIR([src/flac/main.c])
25 AC_CONFIG_MACRO_DIR([m4])
26 AM_INIT_AUTOMAKE([foreign 1.10 -Wall tar-pax no-dist-gzip dist-xz subdir-objects])
27 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
29 AC_MSG_CHECKING([whether configure should try to set CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS])
30 AS_IF([test "x${CFLAGS+set}" = "xset" || test "x${CXXFLAGS+set}" = "xset" || test "x${CPPFLAGS+set}" = "xset" || test "x${LDFLAGS+set}" = "xset"],
31         [enable_flags_setting=no],
32         [enable_flags_setting=yes]
34 AC_MSG_RESULT([${enable_flags_setting}])
35 AX_CHECK_ENABLE_DEBUG
36 user_cflags=$CFLAGS
38 #Prefer whatever the current ISO standard is.
39 AC_PROG_CC_STDC
40 AC_USE_SYSTEM_EXTENSIONS
41 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
42 LT_INIT([win32-dll disable-static pic-only])
43 AM_PROG_AS
44 AC_PROG_CXX
45 XIPH_C_COMPILER_IS_CLANG
46 XIPH_GCC_REALLY_IS_GCC
47 AC_PROG_MAKE_SET
48 AC_PROG_MKDIR_P
50 AC_SYS_LARGEFILE
51 AC_FUNC_FSEEKO
53 AC_CHECK_SIZEOF(off_t,1)        # Fake default value.
54 AC_CHECK_SIZEOF([void*])
55 AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)])
57 AC_LANG_PUSH([C++])
58 # c++ flavor first
59 AC_C_VARARRAYS
60 if test $ac_cv_c_vararrays = yes; then
61         AC_DEFINE([HAVE_CXX_VARARRAYS], 1, [Define to 1 if C++ supports variable-length arrays.])
63 AC_LANG_POP([C++])
65 # c flavor
66 AC_HEADER_STDC
67 AM_PROG_CC_C_O
68 AC_C_INLINE
69 AC_C_VARARRAYS
70 AC_C_TYPEOF
72 AC_CHECK_HEADERS([stdint.h inttypes.h byteswap.h sys/param.h sys/ioctl.h termios.h x86intrin.h cpuid.h])
74 XIPH_C_BSWAP32
75 XIPH_C_BSWAP16
77 ac_cv_c_big_endian=0
78 ac_cv_c_little_endian=0
79 AC_C_BIGENDIAN([ac_cv_c_big_endian=1], [ac_cv_c_little_endian=1], [
80         AC_MSG_WARN([[*****************************************************************]])
81         AC_MSG_WARN([[*** Not able to determine endian-ness of target processor.       ]])
82         AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in  ]])
83         AC_MSG_WARN([[*** config.h may need to be hand editied.                        ]])
84         AC_MSG_WARN([[*****************************************************************]])
86 AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
87                                         [Target processor is big endian.])
88 AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
89                                         [Target processor is little endian.])
90 AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian},
91                                         [Target processor is big endian.])
93 AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes)
94 dnl ' Terminate the damn single quote
95 AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno)
96 if test "x$asm_opt" = xno ; then
97 AC_DEFINE(FLAC__NO_ASM)
98 AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code])
101 # For the XMMS plugin.
102 AC_CHECK_TYPES(socklen_t, [], [])
104 dnl check for getopt in standard library
105 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] )
106 AC_CHECK_FUNCS(getopt_long, [], [])
108 AC_CHECK_SIZEOF(void*,1)
110 asm_optimisation=no
111 case "$host_cpu" in
112         amd64|x86_64)
113                 case "$host" in
114                         *gnux32)
115                                 # x32 user space and 64 bit kernel.
116                                 cpu_x86_64=true
117                                 AC_DEFINE(FLAC__CPU_X86_64)
118                                 AH_TEMPLATE(FLAC__CPU_X86_64, [define if building for x86_64])
119                                 asm_optimisation=$asm_opt
120                                 ;;
121                         *)
122                                 if test $ac_cv_sizeof_voidp = 4 ; then
123                                         # This must be a 32 bit user space running on 64 bit kernel so treat
124                                         # this as ia32.
125                                         cpu_ia32=true
126                                         AC_DEFINE(FLAC__CPU_IA32)
127                                         AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
128                         else
129                                         # x86_64 user space and kernel.
130                                         cpu_x86_64=true
131                                         AC_DEFINE(FLAC__CPU_X86_64)
132                                         AH_TEMPLATE(FLAC__CPU_X86_64, [define if building for x86_64])
133                                 fi
134                                 asm_optimisation=$asm_opt
135                                 ;;
136                 esac
137                 ;;
138         i*86)
139                 cpu_ia32=true
140                 AC_DEFINE(FLAC__CPU_IA32)
141                 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386])
142                 asm_optimisation=$asm_opt
143                 ;;
144         powerpc64|powerpc64le)
145                 cpu_ppc64=true
146                 cpu_ppc=true
147                 AC_DEFINE(FLAC__CPU_PPC)
148                 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
149                 AC_DEFINE(FLAC__CPU_PPC64)
150                 AH_TEMPLATE(FLAC__CPU_PPC64, [define if building for PowerPC64])
151                 asm_optimisation=$asm_opt
152                 ;;
153         powerpc|powerpcle)
154                 cpu_ppc=true
155                 AC_DEFINE(FLAC__CPU_PPC)
156                 AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
157                 asm_optimisation=$asm_opt
158                 ;;
159         sparc)
160                 cpu_sparc=true
161                 AC_DEFINE(FLAC__CPU_SPARC)
162                 AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC])
163                 asm_optimisation=$asm_opt
164                 ;;
165 esac
166 AM_CONDITIONAL(FLAC__CPU_X86_64, test "x$cpu_x86_64" = xtrue)
167 AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue)
168 AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue)
169 AM_CONDITIONAL(FLaC__CPU_PPC64, test "x$cpu_ppc64" = xtrue)
170 AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue)
172 if test "x$ac_cv_header_x86intrin_h" = xyes; then
173 AC_DEFINE([FLAC__HAS_X86INTRIN], 1, [Set to 1 if <x86intrin.h> is available.])
174 else
175 AC_DEFINE([FLAC__HAS_X86INTRIN], 0)
178 if test x"$cpu_ppc64" = xtrue ; then
180 AC_C_ATTRIBUTE([target("cpu=power8")],
181   [have_cpu_power8=yes],
182   [have_cpu_power8=no])
183 if test x"$have_cpu_power8" = xyes ; then
184   AC_DEFINE(FLAC__HAS_TARGET_POWER8)
185   AH_TEMPLATE(FLAC__HAS_TARGET_POWER8, [define if compiler has __attribute__((target("cpu=power8"))) support])
188 AC_C_ATTRIBUTE([target("cpu=power9")],
189   [have_cpu_power9=yes],
190   [have_cpu_power9=no])
191 if test x"$have_cpu_power9" = xyes ; then
192   AC_DEFINE(FLAC__HAS_TARGET_POWER9)
193   AH_TEMPLATE(FLAC__HAS_TARGET_POWER9, [define if compiler has __attribute__((target("cpu=power9"))) support])
198 case "$host" in
199         i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;;
200         *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;;
201         *-*-darwin*) OBJ_FORMAT=macho ;;
202         *emx*) OBJ_FORMAT=aout ;;
203         *djgpp) OBJ_FORMAT=coff ;;
204         *) OBJ_FORMAT=elf ;;
205 esac
206 AC_SUBST(OBJ_FORMAT)
208 os_is_windows=no
209 case "$host" in
210         *mingw*)
211                 CPPFLAGS="-D__MSVCRT_VERSION__=0x0601 $CPPFLAGS"
212                 os_is_windows=yes
213                 ;;
214 esac
216 AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes)
218 case "$host" in
219         *-linux-*)
220                 sys_linux=true
221                 AC_DEFINE(FLAC__SYS_LINUX)
222                 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux])
223                 ;;
224         *-*-darwin*)
225                 sys_darwin=true
226                 AC_DEFINE(FLAC__SYS_DARWIN)
227                 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X])
228                 ;;
229 esac
230 AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue)
231 AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue)
233 if test "x$cpu_ia32" = xtrue || test "x$cpu_x86_64" = xtrue ; then
234 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
235 AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
238 AM_CONDITIONAL([DEBUG], [test "x${ax_enable_debug}" = "xyes" || test "x${ax_enable_debug}" = "xinfo"])
240 AC_ARG_ENABLE(sse,
241 AC_HELP_STRING([--disable-sse], [Disable passing of -msse2 to the compiler]),
242 [case "${enableval}" in
243         yes) sse_os=yes ;;
244         no)  sse_os=no ;;
245         *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
246 esac],[sse_os=yes])
248 AC_ARG_ENABLE(altivec,
249 AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]),
250 [case "${enableval}" in
251         yes) use_altivec=true ;;
252         no)  use_altivec=false ;;
253         *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
254 esac],[use_altivec=true])
255 AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue)
256 if test "x$use_altivec" = xtrue ; then
257 AC_DEFINE(FLAC__USE_ALTIVEC)
258 AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
261 AC_ARG_ENABLE(vsx,
262 AC_HELP_STRING([--disable-vsx], [Disable VSX optimizations]),
263 [case "${enableval}" in
264         yes) use_vsx=true ;;
265         no)  use_vsx=false ;;
266         *) AC_MSG_ERROR(bad value ${enableval} for --enable-vsx) ;;
267 esac],[use_vsx=true])
268 AM_CONDITIONAL(FLaC__USE_VSX, test "x$use_vsx" = xtrue)
269 if test "x$use_vsx" = xtrue ; then
270 AC_DEFINE(FLAC__USE_VSX)
271 AH_TEMPLATE(FLAC__USE_VSX, [define to enable use of VSX instructions])
274 AC_ARG_ENABLE(avx,
275 AC_HELP_STRING([--disable-avx], [Disable AVX, AVX2 optimizations]),
276 [case "${enableval}" in
277         yes) use_avx=true ;;
278         no)  use_avx=false ;;
279         *) AC_MSG_ERROR(bad value ${enableval} for --enable-avx) ;;
280 esac],[use_avx=true])
281 AM_CONDITIONAL(FLaC__USE_AVX, test "x$use_avx" = xtrue)
282 if test "x$use_avx" = xtrue ; then
283 AC_DEFINE(FLAC__USE_AVX)
284 AH_TEMPLATE(FLAC__USE_AVX, [define to enable use of AVX instructions])
287 AC_ARG_ENABLE(thorough-tests,
288 AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
289 [case "${enableval}" in
290         yes) thorough_tests=true ;;
291         no)  thorough_tests=false ;;
292         *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;;
293 esac],[thorough_tests=true])
294 AC_ARG_ENABLE(exhaustive-tests,
295 AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]),
296 [case "${enableval}" in
297         yes) exhaustive_tests=true ;;
298         no)  exhaustive_tests=false ;;
299         *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;;
300 esac],[exhaustive_tests=false])
301 if test "x$thorough_tests" = xfalse ; then
302 FLAC__TEST_LEVEL=0
303 elif test "x$exhaustive_tests" = xfalse ; then
304 FLAC__TEST_LEVEL=1
305 else
306 FLAC__TEST_LEVEL=2
308 AC_SUBST(FLAC__TEST_LEVEL)
310 AC_ARG_ENABLE(werror,
311         AC_HELP_STRING([--enable-werror], [Enable -Werror in all Makefiles]))
313 AC_ARG_ENABLE(stack-smash-protection,
314         AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection]))
316 AC_ARG_ENABLE(64-bit-words,
317         AC_HELP_STRING([--enable-64-bit-words], [Set FLAC__BYTES_PER_WORD to 8 (4 is the default)]))
318 if test "x$enable_64_bit_words" = xyes ; then
319         AC_DEFINE_UNQUOTED([ENABLE_64_BIT_WORDS],1,[Set FLAC__BYTES_PER_WORD to 8 (4 is the default)])
320 else
321         AC_DEFINE_UNQUOTED([ENABLE_64_BIT_WORDS],0)
322         fi
323 AC_SUBST(ENABLE_64_BIT_WORDS)
325 AC_ARG_ENABLE(valgrind-testing,
326 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
327 [case "${enableval}" in
328         yes) FLAC__TEST_WITH_VALGRIND=yes ;;
329         no)  FLAC__TEST_WITH_VALGRIND=no ;;
330         *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;;
331 esac],[FLAC__TEST_WITH_VALGRIND=no])
332 AC_SUBST(FLAC__TEST_WITH_VALGRIND)
334 AC_ARG_ENABLE(doxygen-docs,
335 AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]),
336 [case "${enableval}" in
337         yes) enable_doxygen_docs=true ;;
338         no)  enable_doxygen_docs=false ;;
339         *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;;
340 esac],[enable_doxygen_docs=true])
341 if test "x$enable_doxygen_docs" != xfalse ; then
342         AC_CHECK_PROGS(DOXYGEN, doxygen)
344 AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN")
346 AC_ARG_ENABLE(local-xmms-plugin,
347 AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]),
348 [case "${enableval}" in
349         yes) install_xmms_plugin_locally=true ;;
350         no)  install_xmms_plugin_locally=false ;;
351         *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;;
352 esac],[install_xmms_plugin_locally=false])
353 AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue)
355 AC_ARG_ENABLE(xmms-plugin,
356 AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]),
357 [case "${enableval}" in
358         yes) enable_xmms_plugin=true ;;
359         no)  enable_xmms_plugin=false ;;
360         *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;;
361 esac],[enable_xmms_plugin=true])
362 if test "x$enable_xmms_plugin" != xfalse ; then
363         AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built]))
365 AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR")
367 dnl build FLAC++ or not
368 AC_ARG_ENABLE([cpplibs],
369 AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]),
370 [case "${enableval}" in
371         yes) disable_cpplibs=false ;;
372         no)  disable_cpplibs=true ;;
373         *)   AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;;
374 esac], [disable_cpplibs=false])
375 AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue])
377 dnl check for ogg library
378 AC_ARG_ENABLE([ogg],
379         AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]),
380         [ want_ogg=$enableval ], [ want_ogg=yes ] )
382 if test "x$want_ogg" != "xno"; then
383         XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development environment not installed - Ogg support will not be built]))
386 FLAC__HAS_OGG=0
387 AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes])
388 if test "x$have_ogg" = xyes ; then
389         FLAC__HAS_OGG=1
390         OGG_PACKAGE="ogg"
391 else
392         have_ogg=no
394 AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],$FLAC__HAS_OGG,[define if you have the ogg library])
395 AC_SUBST(FLAC__HAS_OGG)
396 AC_SUBST(OGG_PACKAGE)
398 dnl Build examples?
399 AC_ARG_ENABLE([examples],
400         AS_HELP_STRING([--disable-examples], [Don't build and install examples]))
401 AM_CONDITIONAL([EXAMPLES], [test "x$enable_examples" != "xno"])
403 dnl check for i18n(internationalization); these are from libiconv/gettext
404 AM_ICONV
405 AM_LANGINFO_CODESET
407 AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man)
408 AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN")
409 if test -n "$DOCBOOK_TO_MAN" ; then
410 AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN)
411 AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man])
414 AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
415 if test x$have_clock_gettime = xyes; then
416         AC_DEFINE(HAVE_CLOCK_GETTIME)
417         AH_TEMPLATE(HAVE_CLOCK_GETTIME, [define if you have clock_gettime])
420 # only matters for x86
421 AC_CHECK_PROGS(NASM, nasm)
422 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
423 if test -n "$NASM" ; then
424 AC_DEFINE(FLAC__HAS_NASM)
425 AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
428 dnl If debugging is disabled AND no CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS
429 dnl are provided, we can set defaults to our liking
430 AS_IF([test "x${ax_enable_debug}" = "xno" && test "x${enable_flags_setting}" = "xyes"], [
431         CFLAGS="-O3 -funroll-loops"
434 XIPH_GCC_VERSION
436 if test x$ac_cv_c_compiler_gnu = xyes ; then
437         CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Winline " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Wconversion
438         CXXFLAGS="$CXXFLAGS -Wall -Wextra -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
440         XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
442         dnl some distributions (such as Gentoo) have _FORTIFY_SOURCE always
443         dnl enabled. We test for this situation in order to prevent polluting
444         dnl the console with messages of macro redefinitions.
445         AX_ADD_FORTIFY_SOURCE
447         AC_LANG_PUSH([C++])
448         XIPH_ADD_CXXFLAGS([-Weffc++])
449         AC_LANG_POP([C++])
451         if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elf; then
452                 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
453                 CFLAGS="$CFLAGS -fvisibility=hidden"
454                 CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
455                 fi
457         if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = macho; then
458                 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
459                 CFLAGS="$CFLAGS -fvisibility=hidden"
460                 CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
461                 fi
463         if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
464                 XIPH_ADD_CFLAGS([-fgnu89-inline])
465                 fi
467         if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x47" ; then
468                 XIPH_ADD_CFLAGS([-fno-inline-small-functions])
469                 fi
471         if test "x$asm_optimisation$sse_os" = "xyesyes" ; then
472                 XIPH_ADD_CFLAGS([-msse2])
473                 fi
475         fi
477 case "$host_os" in
478         "mingw32"|"os2")
479         if test "$host_cpu" = "i686"; then
480                 XIPH_ADD_CFLAGS([-mstackrealign])
481                 fi
482         esac
484 if test x$enable_werror = "xyes" ; then
485         XIPH_ADD_CFLAGS([-Werror])
486         AC_LANG_PUSH([C++])
487         XIPH_ADD_CXXFLAGS([-Werror])
488         AC_LANG_POP([C++])
489         fi
491 if test x$enable_stack_smash_protection = "xyes" ; then
492         XIPH_GCC_STACK_PROTECTOR
493         XIPH_GXX_STACK_PROTECTOR
494         fi
496 if test "x$sys_linux" = xtrue ; then
497        LIB_CLOCK_GETTIME=-lrt
498        fi
499 AC_SUBST(LIB_CLOCK_GETTIME)
501 AC_CONFIG_FILES([ \
502         Makefile \
503         src/Makefile \
504         src/libFLAC/Makefile \
505         src/libFLAC/flac.pc \
506         src/libFLAC/ia32/Makefile \
507         src/libFLAC/include/Makefile \
508         src/libFLAC/include/private/Makefile \
509         src/libFLAC/include/protected/Makefile \
510         src/libFLAC++/Makefile \
511         src/libFLAC++/flac++.pc \
512         src/flac/Makefile \
513         src/metaflac/Makefile \
514         src/plugin_common/Makefile \
515         src/plugin_xmms/Makefile \
516         src/share/Makefile \
517         src/test_grabbag/Makefile \
518         src/test_grabbag/cuesheet/Makefile \
519         src/test_grabbag/picture/Makefile \
520         src/test_libs_common/Makefile \
521         src/test_libFLAC/Makefile \
522         src/test_libFLAC++/Makefile \
523         src/test_seeking/Makefile \
524         src/test_streams/Makefile \
525         src/utils/Makefile \
526         src/utils/flacdiff/Makefile \
527         src/utils/flactimer/Makefile \
528         examples/Makefile \
529         examples/c/Makefile \
530         examples/c/decode/Makefile \
531         examples/c/decode/file/Makefile \
532         examples/c/encode/Makefile \
533         examples/c/encode/file/Makefile \
534         examples/cpp/Makefile \
535         examples/cpp/decode/Makefile \
536         examples/cpp/decode/file/Makefile \
537         examples/cpp/encode/Makefile \
538         examples/cpp/encode/file/Makefile \
539         include/Makefile \
540         include/FLAC/Makefile \
541         include/FLAC++/Makefile \
542         include/share/Makefile \
543         include/share/grabbag/Makefile \
544         include/test_libs_common/Makefile \
545         doc/Doxyfile \
546         doc/Makefile \
547         doc/html/Makefile \
548         doc/html/images/Makefile \
549         m4/Makefile \
550         man/Makefile \
551         test/common.sh \
552         test/Makefile \
553         test/cuesheets/Makefile \
554         test/flac-to-flac-metadata-test-files/Makefile \
555         test/metaflac-test-files/Makefile \
556         test/pictures/Makefile \
557         build/Makefile \
558         objs/Makefile \
559         objs/debug/Makefile \
560         objs/debug/bin/Makefile \
561         objs/debug/lib/Makefile \
562         objs/release/Makefile \
563         objs/release/bin/Makefile \
564         objs/release/lib/Makefile \
565         microbench/Makefile
567 AC_OUTPUT
569 AC_MSG_RESULT([
570 -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
572   Configuration summary :
574     FLAC version : ........................ ${VERSION}
576     Host CPU : ............................ ${host_cpu}
577     Host Vendor : ......................... ${host_vendor}
578     Host OS : ............................. ${host_os}
581         echo "    Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
582 if test x$ac_cv_c_compiler_gnu = xyes ; then
583         echo "    GCC version : ......................... ${GCC_VERSION}"
585         echo "    Compiler is Clang : ................... ${xiph_cv_c_compiler_clang}"
586         echo "    SSE optimizations : ................... ${sse_os}"
587         echo "    Asm optimizations : ................... ${asm_optimisation}"
588         echo "    Ogg/FLAC support : .................... ${have_ogg}"
589 echo