1# FLAC - Free Lossless Audio Codec 2# Copyright (C) 2001-2009 Josh Coalson 3# Copyright (C) 2011-2023 Xiph.Org Foundation 4# 5# This file is part the FLAC project. FLAC is comprised of several 6# components distributed under different licenses. The codec libraries 7# are distributed under Xiph.Org's BSD-like license (see the file 8# COPYING.Xiph in this distribution). All other programs, libraries, and 9# plugins are distributed under the GPL (see COPYING.GPL). The documentation 10# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the 11# FLAC distribution contains at the top the terms under which it may be 12# distributed. 13# 14# Since this particular file is relevant to all components of FLAC, 15# it may be distributed under the Xiph.Org license, which is the least 16# restrictive of those mentioned above. See the file COPYING.Xiph in this 17# distribution. 18 19# NOTE that for many of the AM_CONDITIONALs we use the prefix FLaC__ 20# instead of FLAC__ since autoconf triggers off 'AC_' in strings 21 22AC_PREREQ(2.60) 23AC_INIT([flac],[1.4.3],[[email protected]],[flac],[https://www.xiph.org/flac/]) 24AC_CONFIG_HEADERS([config.h]) 25AC_CONFIG_SRCDIR([src/flac/main.c]) 26AC_CONFIG_MACRO_DIR([m4]) 27AM_INIT_AUTOMAKE([foreign 1.10 -Wall tar-pax no-dist-gzip dist-xz subdir-objects]) 28m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 29 30AX_CHECK_ENABLE_DEBUG 31user_cflags=$CFLAGS 32 33#Prefer whatever the current ISO standard is. 34AC_PROG_CC 35AC_USE_SYSTEM_EXTENSIONS 36m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) 37LT_INIT([win32-dll disable-static pic-only]) 38AM_PROG_AS 39AC_PROG_CXX 40XIPH_C_COMPILER_IS_CLANG 41XIPH_GCC_REALLY_IS_GCC 42AC_PROG_MAKE_SET 43AC_PROG_MKDIR_P 44 45AC_SYS_LARGEFILE 46AC_FUNC_FSEEKO 47 48AC_CHECK_SIZEOF(off_t,1) # Fake default value. 49AC_CHECK_SIZEOF([void*]) 50AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)]) 51 52AM_PROG_CC_C_O 53AC_C_INLINE 54AC_C_TYPEOF 55 56AC_CHECK_HEADERS([stdint.h stdbool.h inttypes.h byteswap.h sys/auxv.h sys/param.h sys/ioctl.h termios.h x86intrin.h cpuid.h arm_neon.h]) 57 58if test "x$ac_cv_header_stdint_h" != xyes -o "x$ac_cv_header_stdbool_h" != xyes; then 59AC_MSG_ERROR("Header stdint.h and/or stdbool.h not found") 60fi 61 62 63XIPH_C_BSWAP32 64XIPH_C_BSWAP16 65 66ac_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]) 75AC_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.]) 81 82AC_ARG_ENABLE(asm-optimizations, AS_HELP_STRING([--disable-asm-optimizations],[Do not use any CPU specific optimization routines]), asm_opt=no, asm_opt=yes) 83AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno) 84if test "x$asm_opt" = xno ; then 85AC_DEFINE(FLAC__NO_ASM) 86AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code]) 87fi 88 89dnl check for getauxval in standard library 90AC_CHECK_FUNCS(getauxval) 91 92dnl check for getopt in standard library 93dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) 94AC_CHECK_FUNCS(getopt_long, [], []) 95 96AC_CHECK_SIZEOF(void*,1) 97 98asm_optimisation=no 99case "$host_cpu" in 100 amd64|x86_64) 101 case "$host" in 102 *gnux32) 103 # x32 user space and 64 bit kernel. 104 cpu_x86_64=true 105 AC_DEFINE(FLAC__CPU_X86_64) 106 AH_TEMPLATE(FLAC__CPU_X86_64, [define if building for x86_64]) 107 ;; 108 *) 109 if test $ac_cv_sizeof_voidp = 4 ; then 110 # This must be a 32 bit user space running on 64 bit kernel so treat 111 # this as ia32. 112 cpu_ia32=true 113 AC_DEFINE(FLAC__CPU_IA32) 114 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386]) 115 else 116 # x86_64 user space and kernel. 117 cpu_x86_64=true 118 AC_DEFINE(FLAC__CPU_X86_64) 119 AH_TEMPLATE(FLAC__CPU_X86_64, [define if building for x86_64]) 120 fi 121 ;; 122 esac 123 ;; 124 i*86) 125 cpu_ia32=true 126 AC_DEFINE(FLAC__CPU_IA32) 127 AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386]) 128 ;; 129 arm64|aarch64) 130 cpu_arm64=true 131 AC_DEFINE(FLAC__CPU_ARM64) 132 AH_TEMPLATE(FLAC__CPU_ARM64, [define if building for ARM]) 133 ;; 134esac 135AM_CONDITIONAL(FLAC__CPU_X86_64, test "x$cpu_x86_64" = xtrue) 136AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue) 137AM_CONDITIONAL(FLAC__CPU_ARM64, test "x$cpu_arm64" = xtrue) 138 139if test "x$ac_cv_header_x86intrin_h" = xyes -a "x$asm_opt" = xyes; then 140 AC_DEFINE([FLAC__HAS_X86INTRIN], 1, [Set to 1 if <x86intrin.h> is available.]) 141 asm_optimisation=yes 142else 143 AC_DEFINE([FLAC__HAS_X86INTRIN], 0) 144fi 145 146if test "x$ac_cv_header_arm_neon_h" = xyes -a "x$asm_opt" = xyes; then 147 AC_DEFINE([FLAC__HAS_NEONINTRIN], 1, [Set to 1 if <arm_neon.h> is available.]) 148 AC_MSG_CHECKING([whether arm_neon.h has A64 functions]) 149 AC_COMPILE_IFELSE( 150 [AC_LANG_PROGRAM([[#include <arm_neon.h>]], 151 [[float64x2_t sum5; sum5 = vdupq_n_f64(0.0f);]])], 152 [AC_MSG_RESULT([yes]) 153 has_a64neon=yes], 154 [AC_MSG_RESULT([no])]) 155 if test "x$has_a64neon" = xyes; then 156 AC_DEFINE([FLAC__HAS_A64NEONINTRIN], 1, [Set to 1 if <arm_neon.h> has A64 instructions.]) 157 asm_optimisation=yes 158 else 159 AC_DEFINE([FLAC__HAS_A64NEONINTRIN], 0) 160 fi 161else 162 AC_DEFINE([FLAC__HAS_NEONINTRIN], 0) 163fi 164 165case "$host" in 166 i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;; 167 *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;; 168 *-*-darwin*) OBJ_FORMAT=macho ;; 169 *emx*) OBJ_FORMAT=aout ;; 170 *djgpp) OBJ_FORMAT=coff ;; 171 *) OBJ_FORMAT=elf ;; 172esac 173AC_SUBST(OBJ_FORMAT) 174 175os_is_windows=no 176case "$host" in 177 *mingw*) 178 os_is_windows=yes 179 AC_CHECK_TOOL(RC,[windres],[:]) 180 ;; 181esac 182 183AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes) 184AM_CONDITIONAL(HAVE_WINDRES, test "x$RC" != "x:") 185 186case "$host" in 187 *-linux-*) 188 sys_linux=true 189 AC_DEFINE(FLAC__SYS_LINUX) 190 AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux]) 191 ;; 192 *-*-darwin*) 193 sys_darwin=true 194 AC_DEFINE(FLAC__SYS_DARWIN) 195 AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X]) 196 ;; 197esac 198AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue) 199AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue) 200 201if test "x$cpu_ia32" = xtrue || test "x$cpu_x86_64" = xtrue ; then 202AC_DEFINE(FLAC__ALIGN_MALLOC_DATA) 203AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries]) 204fi 205 206AM_CONDITIONAL([DEBUG], [test "x${ax_enable_debug}" = "xyes" || test "x${ax_enable_debug}" = "xinfo"]) 207 208AC_ARG_ENABLE(avx, 209AS_HELP_STRING([--disable-avx],[Disable AVX, AVX2 optimizations. There is runtime detection of CPU features, so disabling is only necessary when a compiler does not know about them]), 210[case "${enableval}" in 211 yes) use_avx=true ;; 212 no) use_avx=false ;; 213 *) AC_MSG_ERROR(bad value ${enableval} for --enable-avx) ;; 214esac],[use_avx=true]) 215AM_CONDITIONAL(FLaC__USE_AVX, test "x$use_avx" = xtrue) 216if test "x$use_avx" = xtrue ; then 217AC_DEFINE(FLAC__USE_AVX) 218AH_TEMPLATE(FLAC__USE_AVX, [define to enable use of AVX instructions]) 219fi 220 221AC_ARG_ENABLE(thorough-tests, 222AS_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, 229AS_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(werror, 245 AS_HELP_STRING([--enable-werror],[Enable -Werror in all Makefiles])) 246 247AC_ARG_ENABLE([stack-smash-protection], 248 [AS_HELP_STRING([--disable-stack-smash-protection],[Disable GNU GCC stack smash protection])],, 249 [AS_IF([test "$ac_cv_c_compiler_gnu" = "yes"], 250 [enable_stack_smash_protection=yes],[enable_stack_smash_protection=no])]) 251 252AC_ARG_ENABLE([fortify-source], 253 [AS_HELP_STRING([--disable-fortify-source],[Disable _FORTIFY_SOURCE buffer overflow protection])],, 254 [AS_IF([test "$ac_cv_c_compiler_gnu" = "yes"], 255 [enable_fortify_source=yes],[enable_fortify_source=no])]) 256 257case "$host" in 258 *mingw*) 259 if test "$enable_fortify_source" = "yes"; then 260 AC_SEARCH_LIBS(__memset_chk, ssp, , mingw_has_memset_chk=no) 261 fi 262 if test "$enable_stack_smash_protection" = "yes"; then 263 AC_SEARCH_LIBS(__stack_chk_fail, ssp, , mingw_has_stack_chk_fail=no) 264 fi 265 ;; 266esac 267 268 269AC_ARG_ENABLE(64-bit-words, 270 AS_HELP_STRING([--disable-64-bit-words],[Set FLAC__BYTES_PER_WORD to 4 (8 is the default)])) 271if test "x$enable_64_bit_words" = xno ; then 272 AC_DEFINE_UNQUOTED([ENABLE_64_BIT_WORDS],0,[Set FLAC__BYTES_PER_WORD to 8 (this is the default)]) 273else 274 AC_DEFINE_UNQUOTED([ENABLE_64_BIT_WORDS],1) 275fi 276AC_SUBST(ENABLE_64_BIT_WORDS) 277 278AC_ARG_ENABLE(valgrind-testing, 279AS_HELP_STRING([--enable-valgrind-testing],[Run all tests inside Valgrind]), 280[case "${enableval}" in 281 yes) FLAC__TEST_WITH_VALGRIND=yes ;; 282 no) FLAC__TEST_WITH_VALGRIND=no ;; 283 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;; 284esac],[FLAC__TEST_WITH_VALGRIND=no]) 285AC_SUBST(FLAC__TEST_WITH_VALGRIND) 286 287AC_ARG_ENABLE(doxygen-docs, 288AS_HELP_STRING([--disable-doxygen-docs],[Disable API documentation building via Doxygen]), 289[case "${enableval}" in 290 yes) enable_doxygen_docs=true ;; 291 no) enable_doxygen_docs=false ;; 292 *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;; 293esac],[enable_doxygen_docs=true]) 294if test "x$enable_doxygen_docs" != xfalse ; then 295 AC_CHECK_PROGS(DOXYGEN, doxygen) 296fi 297AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN") 298 299if test ! -n "$DOXYGEN" && test -f "$srcdir/doc/FLAC.tag" && test -f "$srcdir/doc/api/modules.html" ; then 300 HAS_PREBUILT_DOXYGEN=yes 301fi 302AM_CONDITIONAL(FLaC__HAS_PREBUILT_DOXYGEN, test "x$HAS_PREBUILT_DOXYGEN" = xyes) 303 304dnl build FLAC++ or not 305AC_ARG_ENABLE([cpplibs], 306AS_HELP_STRING([--disable-cpplibs],[Do not build libFLAC++]), 307[case "${enableval}" in 308 yes) disable_cpplibs=false ;; 309 no) disable_cpplibs=true ;; 310 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;; 311esac], [disable_cpplibs=false]) 312AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue]) 313 314AC_ARG_ENABLE([oss-fuzzers], 315 [AS_HELP_STRING([--enable-oss-fuzzers], 316 [Whether to generate the fuzzers for OSS-Fuzz (Clang only)])], 317 [have_oss_fuzzers=yes], [have_oss_fuzzers=no]) 318 319if test "x$have_oss_fuzzers" = "xyes"; then 320 if test "x$xiph_cv_c_compiler_clang" = "xyes" ; then 321 AM_CONDITIONAL([USE_OSSFUZZERS], [test "x$have_oss_fuzzers" = "xyes"]) 322 if test "x$LIB_FUZZING_ENGINE" = "x" ; then 323 # Only set this if it is empty. 324 LIB_FUZZING_ENGINE=-fsanitize=fuzzer 325 fi 326 else 327 AM_CONDITIONAL([USE_OSSFUZZERS], [test "false" = "true"]) 328 # Disable fuzzer if the compiler is not Clang. 329 AC_MSG_WARN([*** Ozz-Fuzz is disabled because that requires the Clang compiler.]) 330 have_oss_fuzzers="no (compiler is not Clang)" 331 fi 332else 333 AM_CONDITIONAL([USE_OSSFUZZERS], [test "false" = "true"]) 334fi 335 336AC_SUBST([LIB_FUZZING_ENGINE]) 337 338dnl check for ogg library 339AC_ARG_ENABLE([ogg], 340 AS_HELP_STRING([--disable-ogg],[Disable ogg support (default: test for libogg)]), 341 [ want_ogg=$enableval ], [ want_ogg=yes ] ) 342 343if test "x$want_ogg" != "xno"; then 344 XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development environment not installed - Ogg support will not be built])) 345fi 346 347FLAC__HAS_OGG=0 348AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes]) 349if test "x$have_ogg" = xyes ; then 350 FLAC__HAS_OGG=1 351 OGG_PACKAGE="ogg" 352else 353 have_ogg=no 354fi 355AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],$FLAC__HAS_OGG,[define if you have the ogg library]) 356AC_SUBST(FLAC__HAS_OGG) 357AC_SUBST(OGG_PACKAGE) 358 359dnl Build programs? 360AC_ARG_ENABLE([programs], 361 AS_HELP_STRING([--disable-programs], [Do not build and install flac and metaflac])) 362AM_CONDITIONAL(FLaC__WITH_PROGRAMS, [test "x$enable_programs" != "xno"]) 363 364dnl Build examples? 365AC_ARG_ENABLE([examples], 366 AS_HELP_STRING([--disable-examples], [Do not build and install examples])) 367AM_CONDITIONAL([EXAMPLES], [test "x$enable_examples" != "xno"]) 368 369dnl Ask git which version FLAC is 370AC_ARG_ENABLE([version-from-git], 371 AS_HELP_STRING([--disable-version-from-git], [Do not use git tag, commit hash and commit date for version number]), 372 [ enable_version_from_git=$enableval ], [ enable_version_from_git=yes ]) 373 374 375dnl check for i18n(internationalization); these are from libiconv/gettext 376AM_ICONV 377AM_LANGINFO_CODESET 378 379AC_CHECK_PROGS(PANDOC, pandoc) 380AM_CONDITIONAL(FLaC__HAS_PANDOC, test -n "$PANDOC") 381if test -n "$PANDOC" ; then 382 AC_DEFINE(FLAC__HAS_PANDOC) 383 AH_TEMPLATE(FLAC__HAS_PANDOC, [define if you have pandoc]) 384else 385if test -f "$srcdir/man/flac.1" && test -f "$srcdir/man/metaflac.1" ; then 386 HAS_PREBUILT_MANPAGES=yes 387fi 388fi 389AM_CONDITIONAL(FLaC__HAS_PREBUILT_MANPAGES, test "x$HAS_PREBUILT_MANPAGES" = "xyes") 390 391AC_CHECK_LIB(rt, clock_gettime, 392 LIB_CLOCK_GETTIME=-lrt 393 AC_DEFINE(HAVE_CLOCK_GETTIME) 394 AH_TEMPLATE(HAVE_CLOCK_GETTIME, [define if you have clock_gettime])) 395AC_SUBST(LIB_CLOCK_GETTIME) 396 397XIPH_GCC_VERSION dnl Sets a non-zero GCC_XXX_VERSION for gcc, not clang. checks below rely on that.. 398 399if test x$ac_cv_c_compiler_gnu = xyes -o x$xiph_cv_c_compiler_clang = xyes ; then 400 dnl Prepend defaults to CFLAGS for GCC and Clang 401 AS_IF([test "x${ax_enable_debug}" = "xno"], [ 402 CFLAGS="-O3 -funroll-loops $CFLAGS" 403 CXXFLAGS="-O3 $CXXFLAGS" 404 ]) 405 406 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 407 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 408 409 XIPH_ADD_CFLAGS([-Wdeclaration-after-statement]) 410 411 dnl some distributions (such as Gentoo) have _FORTIFY_SOURCE always 412 dnl enabled. We test for this situation in order to prevent polluting 413 dnl the console with messages of macro redefinitions. 414 415 if test "$enable_fortify_source" = "yes" && test "x$mingw_has_memset_chk" != "xno" 416 then 417 AX_ADD_FORTIFY_SOURCE 418 fi 419 420 AC_LANG_PUSH([C++]) 421 XIPH_ADD_CXXFLAGS([-Weffc++]) 422 AC_LANG_POP([C++]) 423 424 if test x$xiph_cv_c_compiler_clang = xyes -a "$OBJ_FORMAT" = elf; then 425 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR" 426 CFLAGS="$CFLAGS -fvisibility=hidden" 427 CXXFLAGS="$CXXFLAGS -fvisibility=hidden" 428 elif test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elf; then 429 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR" 430 CFLAGS="$CFLAGS -fvisibility=hidden" 431 CXXFLAGS="$CXXFLAGS -fvisibility=hidden" 432 fi 433 434 435 if test x$xiph_cv_c_compiler_clang = xyes -a "$OBJ_FORMAT" = macho; then 436 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR" 437 CFLAGS="$CFLAGS -fvisibility=hidden" 438 CXXFLAGS="$CXXFLAGS -fvisibility=hidden" 439 elif test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = macho; then 440 CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR" 441 CFLAGS="$CFLAGS -fvisibility=hidden" 442 CXXFLAGS="$CXXFLAGS -fvisibility=hidden" 443 fi 444 445 if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then 446 XIPH_ADD_CFLAGS([-fgnu89-inline]) 447 fi 448 449 if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x47" ; then 450 XIPH_ADD_CFLAGS([-fno-inline-small-functions]) 451 fi 452 453 fi 454 455case "$host_os" in 456 "mingw32"|"os2") 457 if test "$host_cpu" = "i686"; then 458 XIPH_ADD_CFLAGS([-mstackrealign]) 459 fi 460 esac 461 462if test x$enable_werror = "xyes" ; then 463 XIPH_ADD_CFLAGS([-Werror]) 464 AC_LANG_PUSH([C++]) 465 XIPH_ADD_CXXFLAGS([-Werror]) 466 AC_LANG_POP([C++]) 467 fi 468 469if test x$enable_stack_smash_protection = "xyes" && test "x$mingw_has_stack_chk_fail" != "xno" ; then 470 XIPH_GCC_STACK_PROTECTOR 471 XIPH_GXX_STACK_PROTECTOR 472else 473 enable_stack_smash_protection=no 474fi 475 476AH_VERBATIM([FLAC_API_EXPORTS], 477[/* libtool defines DLL_EXPORT for windows dll builds, 478 but flac code relies on FLAC_API_EXPORTS instead. */ 479#ifdef DLL_EXPORT 480#ifdef __cplusplus 481# define FLACPP_API_EXPORTS 482#else 483# define FLAC_API_EXPORTS 484#endif 485#endif]) 486 487if test x$enable_static = "xyes" ; then 488dnl for correct FLAC_API 489 CPPFLAGS="-DFLAC__NO_DLL $CPPFLAGS" 490 fi 491 492AC_CHECK_PROG(GIT_FOUND,git,yes) 493 494if test x$GIT_FOUND$enable_version_from_git = "xyesyes"; then 495 GIT_COMMIT_TAG=`git -C $srcdir --git-dir=.git describe --tags --exact-match 2>/dev/null` 496 GIT_COMMIT_HASH=`git -C $srcdir --git-dir=.git log -1 --pretty=format:%h 2>/dev/null` 497 GIT_COMMIT_DATE=`git -C $srcdir --git-dir=.git log -1 --pretty=format:%cd --date=format:%Y%m%d 2>/dev/null` 498 if test ${#GIT_COMMIT_HASH} = 8 && test ${#GIT_COMMIT_DATE} = 8; then 499 GIT_COMMIT_VERSION_AVAIL=yes 500 if test ${#GIT_COMMIT_TAG} != 0 ; then 501 GIT_COMMIT_TAG_AVAIL=yes 502 AC_DEFINE_UNQUOTED(GIT_COMMIT_TAG, "${GIT_COMMIT_TAG}", "Define to the tag of the current git HEAD") 503 else 504 GIT_COMMIT_VERSION_HASH=yes 505 fi 506 AC_DEFINE_UNQUOTED(GIT_COMMIT_HASH, "${GIT_COMMIT_HASH}", "Define to the short hash of the current git HEAD") 507 AC_DEFINE_UNQUOTED(GIT_COMMIT_DATE, "${GIT_COMMIT_DATE}", "Define to the commit date of the current git HEAD") 508 fi 509fi 510 511AC_SUBST(GIT_COMMIT_VERSION_HASH) 512 513AX_CHECK_COMPILE_FLAG([-fassociative-math -fno-signed-zeros -fno-trapping-math -freciprocal-math],HAVE_ASSOC_MATH=yes) 514AM_CONDITIONAL(ASSOC_MATH_AVAILABLE, test "x$HAVE_ASSOC_MATH" = "xyes") 515 516 517AC_CONFIG_FILES([ \ 518 Makefile \ 519 src/Makefile \ 520 src/libFLAC/Makefile \ 521 src/libFLAC/flac.pc \ 522 src/libFLAC/include/Makefile \ 523 src/libFLAC/include/private/Makefile \ 524 src/libFLAC/include/protected/Makefile \ 525 src/libFLAC++/Makefile \ 526 src/libFLAC++/flac++.pc \ 527 src/flac/Makefile \ 528 src/metaflac/Makefile \ 529 src/share/Makefile \ 530 src/test_grabbag/Makefile \ 531 src/test_grabbag/cuesheet/Makefile \ 532 src/test_grabbag/picture/Makefile \ 533 src/test_libs_common/Makefile \ 534 src/test_libFLAC/Makefile \ 535 src/test_libFLAC++/Makefile \ 536 src/test_seeking/Makefile \ 537 src/test_streams/Makefile \ 538 src/utils/Makefile \ 539 src/utils/flacdiff/Makefile \ 540 src/utils/flactimer/Makefile \ 541 examples/Makefile \ 542 examples/c/Makefile \ 543 examples/c/decode/Makefile \ 544 examples/c/decode/file/Makefile \ 545 examples/c/encode/Makefile \ 546 examples/c/encode/file/Makefile \ 547 examples/cpp/Makefile \ 548 examples/cpp/decode/Makefile \ 549 examples/cpp/decode/file/Makefile \ 550 examples/cpp/encode/Makefile \ 551 examples/cpp/encode/file/Makefile \ 552 include/Makefile \ 553 include/FLAC/Makefile \ 554 include/FLAC++/Makefile \ 555 include/share/Makefile \ 556 include/share/grabbag/Makefile \ 557 include/test_libs_common/Makefile \ 558 doc/Doxyfile \ 559 doc/Makefile \ 560 doc/images/Makefile \ 561 m4/Makefile \ 562 man/Makefile \ 563 test/common.sh \ 564 test/Makefile \ 565 test/cuesheets/Makefile \ 566 test/foreign-metadata-test-files/Makefile \ 567 test/flac-to-flac-metadata-test-files/Makefile \ 568 test/metaflac-test-files/Makefile \ 569 test/pictures/Makefile \ 570 microbench/Makefile \ 571 oss-fuzz/Makefile 572]) 573AC_OUTPUT 574 575AC_MSG_RESULT([ 576-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=- 577 578 Configuration summary : 579 580 FLAC version : ............................ ${VERSION} 581 582 Host CPU : ................................ ${host_cpu} 583 Host Vendor : ............................. ${host_vendor} 584 Host OS : ................................. ${host_os} 585]) 586 587if test x$GIT_COMMIT_TAG_AVAIL = xyes ; then 588 echo " Version string : reference libFLAC ${GIT_COMMIT_TAG} ${GIT_COMMIT_DATE}" 589elif test x$GIT_COMMIT_VERSION_AVAIL = xyes ; then 590 echo " Version string : reference libFLAC git-${GIT_COMMIT_HASH} ${GIT_COMMIT_DATE}" 591fi 592 echo "" 593 echo " Compiler is GCC : ......................... ${ac_cv_c_compiler_gnu}" 594if test x$ac_cv_c_compiler_gnu = xyes ; then 595 echo " GCC version : ............................. ${GCC_VERSION}" 596fi 597 echo " Compiler is Clang : ....................... ${xiph_cv_c_compiler_clang}" 598 echo " Asm optimizations : ....................... ${asm_optimisation}" 599 echo " Ogg/FLAC support : ........................ ${have_ogg}" 600 echo " Stack protector : ........................ ${enable_stack_smash_protection}" 601 echo " Fuzzing support (Clang only) : ............ ${have_oss_fuzzers}" 602echo 603