Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 1 | # 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 Klauer | cd4ddab | 2013-05-26 22:53:43 +0200 | [diff] [blame] | 5 | # components distributed under different licenses. The codec libraries |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 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íguez | 9b7cb22 | 2012-04-07 19:24:21 -0300 | [diff] [blame] | 21 | AC_PREREQ(2.60) |
Erik de Castro Lopo | 0e11f73 | 2014-11-27 14:04:48 +1100 | [diff] [blame] | 22 | AC_INIT([flac], [1.3.1], [flac-dev@xiph.org], [flac], [https://www.xiph.org/flac/]) |
Max Horn | 0b47ede | 2012-12-12 21:33:55 +0100 | [diff] [blame] | 23 | AC_CONFIG_HEADERS([config.h]) |
Cristian Rodríguez | 9b7cb22 | 2012-04-07 19:24:21 -0300 | [diff] [blame] | 24 | AC_CONFIG_SRCDIR([src/flac/main.c]) |
| 25 | AC_CONFIG_MACRO_DIR([m4]) |
Erik de Castro Lopo | 723cfa3 | 2014-12-01 05:28:02 +1100 | [diff] [blame] | 26 | AM_INIT_AUTOMAKE([foreign 1.10 -Wall tar-pax no-dist-gzip dist-xz subdir-objects]) |
Erik de Castro Lopo | 886b960 | 2012-02-03 05:52:01 +1100 | [diff] [blame] | 27 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 28 | |
Miroslav Lichvar | 18e0154 | 2012-12-03 21:04:56 +0100 | [diff] [blame] | 29 | user_cflags=$CFLAGS |
| 30 | |
Cristian Rodríguez | f029625 | 2012-04-05 19:39:37 -0300 | [diff] [blame] | 31 | #Prefer whatever the current ISO standard is. |
| 32 | AC_PROG_CC_STDC |
| 33 | AC_USE_SYSTEM_EXTENSIONS |
Cristian Rodríguez | 63c874f | 2012-06-02 17:00:56 -0400 | [diff] [blame] | 34 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
Cristian Rodríguez | 9b7cb22 | 2012-04-07 19:24:21 -0300 | [diff] [blame] | 35 | LT_INIT([win32-dll disable-static pic-only]) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 36 | AM_PROG_AS |
| 37 | AC_PROG_CXX |
Erik de Castro Lopo | a6a4b6f | 2013-11-22 18:13:36 +1100 | [diff] [blame] | 38 | XIPH_C_COMPILER_IS_CLANG |
| 39 | XIPH_GCC_REALLY_IS_GCC |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 40 | AC_PROG_MAKE_SET |
Erik de Castro Lopo | 95bc23a | 2014-03-21 18:27:37 +1100 | [diff] [blame] | 41 | AC_PROG_MKDIR_P |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 42 | |
| 43 | AC_SYS_LARGEFILE |
| 44 | AC_FUNC_FSEEKO |
| 45 | |
Erik de Castro Lopo | 6497ce1 | 2013-03-13 21:54:15 +1100 | [diff] [blame] | 46 | AC_CHECK_SIZEOF(off_t,1) # Fake default value. |
Max Horn | 0b47ede | 2012-12-12 21:33:55 +0100 | [diff] [blame] | 47 | AC_CHECK_SIZEOF([void*]) |
Cristian Rodríguez | 9b7cb22 | 2012-04-07 19:24:21 -0300 | [diff] [blame] | 48 | AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)]) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 49 | |
Max Horn | 0b47ede | 2012-12-12 21:33:55 +0100 | [diff] [blame] | 50 | AC_LANG_PUSH([C++]) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 51 | # c++ flavor first |
| 52 | AC_C_VARARRAYS |
| 53 | if test $ac_cv_c_vararrays = yes; then |
| 54 | AC_DEFINE([HAVE_CXX_VARARRAYS], 1, [Define to 1 if C++ supports variable-length arrays.]) |
| 55 | fi |
Max Horn | 0b47ede | 2012-12-12 21:33:55 +0100 | [diff] [blame] | 56 | AC_LANG_POP([C++]) |
Erik de Castro Lopo | 3abb6c9 | 2012-02-05 18:58:11 +1100 | [diff] [blame] | 57 | |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 58 | # c flavor |
| 59 | AC_HEADER_STDC |
Erik de Castro Lopo | afedee1 | 2012-04-04 20:08:52 +1000 | [diff] [blame] | 60 | AM_PROG_CC_C_O |
Erik de Castro Lopo | 3abb6c9 | 2012-02-05 18:58:11 +1100 | [diff] [blame] | 61 | AC_C_INLINE |
| 62 | AC_C_VARARRAYS |
Cristian Rodríguez | f029625 | 2012-04-05 19:39:37 -0300 | [diff] [blame] | 63 | AC_C_TYPEOF |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 64 | |
Erik de Castro Lopo | d7e6d91 | 2014-03-21 17:45:18 +1100 | [diff] [blame] | 65 | AC_CHECK_HEADERS([stdint.h inttypes.h byteswap.h sys/param.h termios.h x86intrin.h cpuid.h]) |
Dagobert Michelsen | 5999d81 | 2013-05-26 23:32:01 +0200 | [diff] [blame] | 66 | |
| 67 | AC_HEADER_TIOCGWINSZ |
Cristian Rodríguez | f029625 | 2012-04-05 19:39:37 -0300 | [diff] [blame] | 68 | |
Erik de Castro Lopo | d7bfc77 | 2012-02-06 07:15:48 +1100 | [diff] [blame] | 69 | XIPH_C_BSWAP32 |
Ralph Giles | 7a671e7 | 2014-11-04 11:58:45 -0800 | [diff] [blame] | 70 | XIPH_C_BSWAP16 |
Erik de Castro Lopo | d7bfc77 | 2012-02-06 07:15:48 +1100 | [diff] [blame] | 71 | |
Max Horn | f20164e | 2012-12-12 21:33:51 +0100 | [diff] [blame] | 72 | ac_cv_c_big_endian=0 |
| 73 | ac_cv_c_little_endian=0 |
| 74 | AC_C_BIGENDIAN([ac_cv_c_big_endian=1], [ac_cv_c_little_endian=1], [ |
| 75 | AC_MSG_WARN([[*****************************************************************]]) |
| 76 | AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]]) |
| 77 | AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]]) |
| 78 | AC_MSG_WARN([[*** config.h may need to be hand editied. ]]) |
| 79 | AC_MSG_WARN([[*****************************************************************]]) |
| 80 | ]) |
Erik de Castro Lopo | 3abb6c9 | 2012-02-05 18:58:11 +1100 | [diff] [blame] | 81 | AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian}, |
| 82 | [Target processor is big endian.]) |
| 83 | AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian}, |
| 84 | [Target processor is little endian.]) |
| 85 | AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian}, |
| 86 | [Target processor is big endian.]) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 87 | |
Erik de Castro Lopo | 1ec41a9 | 2013-08-11 21:46:18 +1000 | [diff] [blame] | 88 | AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes) |
| 89 | dnl ' Terminate the damn single quote |
| 90 | AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno) |
| 91 | if test "x$asm_opt" = xno ; then |
| 92 | AC_DEFINE(FLAC__NO_ASM) |
| 93 | AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code]) |
| 94 | fi |
| 95 | |
Erik de Castro Lopo | 3abb6c9 | 2012-02-05 18:58:11 +1100 | [diff] [blame] | 96 | # For the XMMS plugin. |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 97 | AC_CHECK_TYPES(socklen_t, [], []) |
| 98 | |
| 99 | dnl check for getopt in standard library |
| 100 | dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) |
| 101 | AC_CHECK_FUNCS(getopt_long, [], []) |
| 102 | |
Erik de Castro Lopo | 1ec41a9 | 2013-08-11 21:46:18 +1000 | [diff] [blame] | 103 | AC_CHECK_SIZEOF(void*,1) |
| 104 | |
| 105 | asm_optimisation=no |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 106 | case "$host_cpu" in |
Christian Weisgerber | b5a10e7 | 2015-01-09 22:37:37 +0000 | [diff] [blame] | 107 | amd64|x86_64) |
Erik de Castro Lopo | 1ec41a9 | 2013-08-11 21:46:18 +1000 | [diff] [blame] | 108 | if test $ac_cv_sizeof_voidp = 4 ; then |
Erik de Castro Lopo | b72540b | 2013-09-15 09:42:29 +1000 | [diff] [blame] | 109 | # This must be a 32 bit user space running on 64 bit kernel so treat |
| 110 | # this as ia32. |
Erik de Castro Lopo | 1ec41a9 | 2013-08-11 21:46:18 +1000 | [diff] [blame] | 111 | cpu_ia32=true |
| 112 | AC_DEFINE(FLAC__CPU_IA32) |
| 113 | AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386]) |
Erik de Castro Lopo | b72540b | 2013-09-15 09:42:29 +1000 | [diff] [blame] | 114 | else |
| 115 | # x86_64 user space and kernel. |
| 116 | cpu_x86_64=true |
Erik de Castro Lopo | b8d58e3 | 2014-06-15 20:29:34 +1000 | [diff] [blame] | 117 | AC_DEFINE(FLAC__CPU_X86_64) |
| 118 | AH_TEMPLATE(FLAC__CPU_X86_64, [define if building for x86_64]) |
Erik de Castro Lopo | 1ec41a9 | 2013-08-11 21:46:18 +1000 | [diff] [blame] | 119 | fi |
Erik de Castro Lopo | b72540b | 2013-09-15 09:42:29 +1000 | [diff] [blame] | 120 | asm_optimisation=$asm_opt |
Erik de Castro Lopo | 1ec41a9 | 2013-08-11 21:46:18 +1000 | [diff] [blame] | 121 | ;; |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 122 | i*86) |
| 123 | cpu_ia32=true |
| 124 | AC_DEFINE(FLAC__CPU_IA32) |
| 125 | AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386]) |
Erik de Castro Lopo | 1ec41a9 | 2013-08-11 21:46:18 +1000 | [diff] [blame] | 126 | asm_optimisation=$asm_opt |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 127 | ;; |
Erik de Castro Lopo | 592021e | 2012-12-28 09:49:50 +1100 | [diff] [blame] | 128 | powerpc|powerpc64) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 129 | cpu_ppc=true |
| 130 | AC_DEFINE(FLAC__CPU_PPC) |
| 131 | AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC]) |
Erik de Castro Lopo | 1ec41a9 | 2013-08-11 21:46:18 +1000 | [diff] [blame] | 132 | asm_optimisation=$asm_opt |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 133 | ;; |
| 134 | sparc) |
| 135 | cpu_sparc=true |
| 136 | AC_DEFINE(FLAC__CPU_SPARC) |
| 137 | AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC]) |
Erik de Castro Lopo | 1ec41a9 | 2013-08-11 21:46:18 +1000 | [diff] [blame] | 138 | asm_optimisation=$asm_opt |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 139 | ;; |
| 140 | esac |
Erik de Castro Lopo | b8d58e3 | 2014-06-15 20:29:34 +1000 | [diff] [blame] | 141 | AM_CONDITIONAL(FLAC__CPU_X86_64, test "x$cpu_x86_64" = xtrue) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 142 | AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue) |
| 143 | AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue) |
| 144 | AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue) |
| 145 | |
Erik de Castro Lopo | 336f6a5 | 2015-02-25 06:40:53 +1100 | [diff] [blame^] | 146 | if test "x$ac_cv_header_x86intrin_h" = xyes; then |
| 147 | AC_DEFINE([FLAC__HAS_X86INTRIN], 1, [Set to 1 if <x86intrin.h> is available.]) |
| 148 | fi |
Erik de Castro Lopo | b72540b | 2013-09-15 09:42:29 +1000 | [diff] [blame] | 149 | |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 150 | case "$host" in |
| 151 | i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;; |
| 152 | *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;; |
| 153 | *-*-darwin*) OBJ_FORMAT=macho ;; |
Erik de Castro Lopo | 0fe9767 | 2012-02-05 16:29:43 +1100 | [diff] [blame] | 154 | *emx*) OBJ_FORMAT=aout ;; |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 155 | *) OBJ_FORMAT=elf ;; |
| 156 | esac |
| 157 | AC_SUBST(OBJ_FORMAT) |
Erik de Castro Lopo | b6e64af | 2012-02-13 19:46:32 +1100 | [diff] [blame] | 158 | case "$host" in |
| 159 | *-gnuspe) |
| 160 | abi_spe=true |
| 161 | AC_DEFINE(FLAC__CPU_PPC_SPE) |
| 162 | AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI]) |
| 163 | ;; |
| 164 | esac |
| 165 | AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 166 | |
Erik de Castro Lopo | 2199d08 | 2013-04-01 19:57:13 +1100 | [diff] [blame] | 167 | os_is_windows=no |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 168 | case "$host" in |
Erik de Castro Lopo | c1ebd2c | 2013-04-29 21:32:48 +1000 | [diff] [blame] | 169 | *-*-cygwin|*mingw*) |
Erik de Castro Lopo | f44c353 | 2013-04-02 06:27:07 +1100 | [diff] [blame] | 170 | CPPFLAGS="-D__MSVCRT_VERSION__=0x0601 $CPPFLAGS" |
Erik de Castro Lopo | 2199d08 | 2013-04-01 19:57:13 +1100 | [diff] [blame] | 171 | os_is_windows=yes |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 172 | ;; |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 173 | esac |
Cristian Rodríguez | 355f4aa | 2013-07-21 01:28:51 -0400 | [diff] [blame] | 174 | |
Erik de Castro Lopo | 2199d08 | 2013-04-01 19:57:13 +1100 | [diff] [blame] | 175 | AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 176 | |
| 177 | case "$host" in |
| 178 | *-pc-linux-gnu) |
| 179 | sys_linux=true |
| 180 | AC_DEFINE(FLAC__SYS_LINUX) |
| 181 | AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux]) |
| 182 | ;; |
| 183 | *-*-darwin*) |
| 184 | sys_darwin=true |
| 185 | AC_DEFINE(FLAC__SYS_DARWIN) |
| 186 | AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X]) |
| 187 | ;; |
| 188 | esac |
| 189 | AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue) |
| 190 | AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue) |
| 191 | |
Erik de Castro Lopo | 899599e | 2013-09-25 23:26:49 +1000 | [diff] [blame] | 192 | if test "x$cpu_ia32" = xtrue || test "x$cpu_x86_64" = xtrue ; then |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 193 | AC_DEFINE(FLAC__ALIGN_MALLOC_DATA) |
| 194 | AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries]) |
| 195 | fi |
| 196 | |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 197 | AC_ARG_ENABLE(debug, |
| 198 | AC_HELP_STRING([--enable-debug], [Turn on debugging]), |
| 199 | [case "${enableval}" in |
| 200 | yes) debug=true ;; |
| 201 | no) debug=false ;; |
| 202 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; |
| 203 | esac],[debug=false]) |
| 204 | AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue) |
| 205 | |
| 206 | AC_ARG_ENABLE(sse, |
Erik de Castro Lopo | 9863998 | 2014-03-15 16:47:49 +1100 | [diff] [blame] | 207 | AC_HELP_STRING([--disable-sse], [Disable SSE if the OS does not support SSE instructions]), |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 208 | [case "${enableval}" in |
Erik de Castro Lopo | 9863998 | 2014-03-15 16:47:49 +1100 | [diff] [blame] | 209 | yes) sse_os=yes ;; |
| 210 | no) sse_os=no ;; |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 211 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;; |
Erik de Castro Lopo | 9863998 | 2014-03-15 16:47:49 +1100 | [diff] [blame] | 212 | esac],[sse_os=yes]) |
Erik de Castro Lopo | 336f6a5 | 2015-02-25 06:40:53 +1100 | [diff] [blame^] | 213 | AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xyes) |
Erik de Castro Lopo | 9863998 | 2014-03-15 16:47:49 +1100 | [diff] [blame] | 214 | if test "x$sse_os" = xyes ; then |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 215 | AC_DEFINE(FLAC__SSE_OS) |
| 216 | AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions]) |
| 217 | fi |
| 218 | |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 219 | AC_ARG_ENABLE(altivec, |
| 220 | AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]), |
| 221 | [case "${enableval}" in |
| 222 | yes) use_altivec=true ;; |
| 223 | no) use_altivec=false ;; |
| 224 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;; |
| 225 | esac],[use_altivec=true]) |
| 226 | AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue) |
| 227 | if test "x$use_altivec" = xtrue ; then |
| 228 | AC_DEFINE(FLAC__USE_ALTIVEC) |
| 229 | AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions]) |
| 230 | fi |
| 231 | |
| 232 | AC_ARG_ENABLE(thorough-tests, |
| 233 | AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]), |
| 234 | [case "${enableval}" in |
| 235 | yes) thorough_tests=true ;; |
| 236 | no) thorough_tests=false ;; |
| 237 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;; |
| 238 | esac],[thorough_tests=true]) |
| 239 | AC_ARG_ENABLE(exhaustive-tests, |
| 240 | AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]), |
| 241 | [case "${enableval}" in |
| 242 | yes) exhaustive_tests=true ;; |
| 243 | no) exhaustive_tests=false ;; |
| 244 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;; |
| 245 | esac],[exhaustive_tests=false]) |
| 246 | if test "x$thorough_tests" = xfalse ; then |
| 247 | FLAC__TEST_LEVEL=0 |
| 248 | elif test "x$exhaustive_tests" = xfalse ; then |
| 249 | FLAC__TEST_LEVEL=1 |
| 250 | else |
| 251 | FLAC__TEST_LEVEL=2 |
| 252 | fi |
| 253 | AC_SUBST(FLAC__TEST_LEVEL) |
| 254 | |
Erik de Castro Lopo | 2c45537 | 2014-04-08 20:48:13 +1000 | [diff] [blame] | 255 | AC_ARG_ENABLE(werror, |
| 256 | AC_HELP_STRING([--enable-werror], [Enable -Werror in all Makefiles])) |
Erik de Castro Lopo | 195470f | 2013-03-13 18:58:16 +1100 | [diff] [blame] | 257 | |
| 258 | AC_ARG_ENABLE(stack-smash-protection, |
| 259 | AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection])) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 260 | |
| 261 | AC_ARG_ENABLE(valgrind-testing, |
| 262 | AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]), |
| 263 | [case "${enableval}" in |
| 264 | yes) FLAC__TEST_WITH_VALGRIND=yes ;; |
| 265 | no) FLAC__TEST_WITH_VALGRIND=no ;; |
| 266 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;; |
| 267 | esac],[FLAC__TEST_WITH_VALGRIND=no]) |
| 268 | AC_SUBST(FLAC__TEST_WITH_VALGRIND) |
| 269 | |
| 270 | AC_ARG_ENABLE(doxygen-docs, |
| 271 | AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]), |
| 272 | [case "${enableval}" in |
| 273 | yes) enable_doxygen_docs=true ;; |
| 274 | no) enable_doxygen_docs=false ;; |
| 275 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;; |
| 276 | esac],[enable_doxygen_docs=true]) |
| 277 | if test "x$enable_doxygen_docs" != xfalse ; then |
| 278 | AC_CHECK_PROGS(DOXYGEN, doxygen) |
| 279 | fi |
| 280 | AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN") |
| 281 | |
| 282 | AC_ARG_ENABLE(local-xmms-plugin, |
| 283 | AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]), |
| 284 | [case "${enableval}" in |
| 285 | yes) install_xmms_plugin_locally=true ;; |
| 286 | no) install_xmms_plugin_locally=false ;; |
| 287 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;; |
| 288 | esac],[install_xmms_plugin_locally=false]) |
| 289 | AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue) |
| 290 | |
| 291 | AC_ARG_ENABLE(xmms-plugin, |
| 292 | AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]), |
| 293 | [case "${enableval}" in |
| 294 | yes) enable_xmms_plugin=true ;; |
| 295 | no) enable_xmms_plugin=false ;; |
| 296 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;; |
| 297 | esac],[enable_xmms_plugin=true]) |
| 298 | if test "x$enable_xmms_plugin" != xfalse ; then |
| 299 | AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built])) |
| 300 | fi |
| 301 | AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR") |
| 302 | |
| 303 | dnl build FLAC++ or not |
| 304 | AC_ARG_ENABLE([cpplibs], |
| 305 | AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]), |
| 306 | [case "${enableval}" in |
| 307 | yes) disable_cpplibs=false ;; |
| 308 | no) disable_cpplibs=true ;; |
| 309 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;; |
| 310 | esac], [disable_cpplibs=false]) |
| 311 | AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue]) |
| 312 | |
| 313 | dnl check for ogg library |
| 314 | AC_ARG_ENABLE([ogg], |
| 315 | AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]), |
| 316 | [ want_ogg=$enableval ], [ want_ogg=yes ] ) |
| 317 | |
| 318 | if test "x$want_ogg" != "xno"; then |
| 319 | XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built])) |
| 320 | fi |
| 321 | |
| 322 | AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes]) |
| 323 | if test "x$have_ogg" = xyes ; then |
Erik de Castro Lopo | 3e2cd27 | 2012-07-04 19:53:31 +1000 | [diff] [blame] | 324 | AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],1,[define if you have the ogg library]) |
Ulrich Klauer | 5da8663 | 2013-04-06 20:41:12 +0200 | [diff] [blame] | 325 | OGG_PACKAGE="ogg" |
Erik de Castro Lopo | 3e2cd27 | 2012-07-04 19:53:31 +1000 | [diff] [blame] | 326 | else |
| 327 | AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],0) |
Erik de Castro Lopo | e21237a | 2013-09-15 19:58:05 +1000 | [diff] [blame] | 328 | have_ogg=no |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 329 | fi |
Ulrich Klauer | 5da8663 | 2013-04-06 20:41:12 +0200 | [diff] [blame] | 330 | AC_SUBST(OGG_PACKAGE) |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 331 | |
| 332 | dnl check for i18n(internationalization); these are from libiconv/gettext |
| 333 | AM_ICONV |
| 334 | AM_LANGINFO_CODESET |
| 335 | |
| 336 | AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man) |
| 337 | AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN") |
| 338 | if test -n "$DOCBOOK_TO_MAN" ; then |
| 339 | AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN) |
| 340 | AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man]) |
| 341 | fi |
| 342 | |
| 343 | # only matters for x86 |
| 344 | AC_CHECK_PROGS(NASM, nasm) |
| 345 | AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM") |
| 346 | if test -n "$NASM" ; then |
| 347 | AC_DEFINE(FLAC__HAS_NASM) |
| 348 | AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler]) |
| 349 | fi |
| 350 | |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 351 | if test "x$debug" = xtrue; then |
Cristian Rodríguez | 9b7cb22 | 2012-04-07 19:24:21 -0300 | [diff] [blame] | 352 | CPPFLAGS="-DDEBUG $CPPFLAGS" |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 353 | CFLAGS="-g $CFLAGS" |
| 354 | else |
| 355 | CPPFLAGS="-DNDEBUG $CPPFLAGS" |
Erik de Castro Lopo | 1e4ffab | 2014-11-30 11:56:47 +1100 | [diff] [blame] | 356 | CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//') |
Erik de Castro Lopo | f73c82a | 2014-07-27 10:08:44 +1000 | [diff] [blame] | 357 | CFLAGS="-O3 -funroll-loops $CFLAGS" |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 358 | fi |
| 359 | |
Erik de Castro Lopo | caef93e | 2012-02-26 22:41:44 +1100 | [diff] [blame] | 360 | XIPH_GCC_VERSION |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 361 | |
| 362 | if test x$ac_cv_c_compiler_gnu = xyes ; then |
Erik de Castro Lopo | f73c82a | 2014-07-27 10:08:44 +1000 | [diff] [blame] | 363 | CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Wunreachable-code -Winline " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Wconversion |
Erik de Castro Lopo | bc2b8c6 | 2014-03-21 18:52:24 +1100 | [diff] [blame] | 364 | CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef -Wunreachable-code " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Woverloaded-virtual -Wmissing-declarations |
Erik de Castro Lopo | 06f3812 | 2013-03-10 22:34:18 +1100 | [diff] [blame] | 365 | |
Erik de Castro Lopo | 24a6447 | 2013-09-15 18:09:48 +1000 | [diff] [blame] | 366 | XIPH_ADD_CFLAGS([-Wdeclaration-after-statement]) |
| 367 | XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2]) |
| 368 | |
| 369 | AC_LANG_PUSH([C++]) |
| 370 | XIPH_ADD_CXXFLAGS([-Weffc++]) |
| 371 | AC_LANG_POP([C++]) |
| 372 | |
Miroslav Lichvar | 19c78e5 | 2012-12-03 21:04:57 +0100 | [diff] [blame] | 373 | if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = elf; then |
| 374 | CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR" |
| 375 | CFLAGS="$CFLAGS -fvisibility=hidden" |
| 376 | CXXFLAGS="$CXXFLAGS -fvisibility=hidden" |
Erik de Castro Lopo | 2860f17 | 2013-03-09 19:42:26 +1100 | [diff] [blame] | 377 | fi |
| 378 | |
Erik de Castro Lopo | be0a894 | 2014-05-25 19:42:53 +1000 | [diff] [blame] | 379 | if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = macho; then |
| 380 | CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR" |
| 381 | CFLAGS="$CFLAGS -fvisibility=hidden" |
| 382 | CXXFLAGS="$CXXFLAGS -fvisibility=hidden" |
| 383 | fi |
| 384 | |
Erik de Castro Lopo | 2860f17 | 2013-03-09 19:42:26 +1100 | [diff] [blame] | 385 | if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then |
| 386 | XIPH_ADD_CFLAGS([-fgnu89-inline]) |
| 387 | fi |
Erik de Castro Lopo | 24a6447 | 2013-09-15 18:09:48 +1000 | [diff] [blame] | 388 | |
Erik de Castro Lopo | 1930ae1 | 2014-07-27 21:18:08 +1000 | [diff] [blame] | 389 | if test "x$asm_optimisation$sse_os" = "xyesyes" ; then |
Erik de Castro Lopo | ae4d720 | 2013-09-15 20:34:40 +1000 | [diff] [blame] | 390 | XIPH_ADD_CFLAGS([-msse2]) |
| 391 | fi |
| 392 | |
Miroslav Lichvar | 19c78e5 | 2012-12-03 21:04:57 +0100 | [diff] [blame] | 393 | fi |
Miroslav Lichvar | 19c78e5 | 2012-12-03 21:04:57 +0100 | [diff] [blame] | 394 | |
Erik de Castro Lopo | d5b03bc | 2013-03-09 08:55:37 +1100 | [diff] [blame] | 395 | XIPH_ADD_CFLAGS([-Wextra]) |
Erik de Castro Lopo | d5b03bc | 2013-03-09 08:55:37 +1100 | [diff] [blame] | 396 | |
Erik de Castro Lopo | 2c45537 | 2014-04-08 20:48:13 +1000 | [diff] [blame] | 397 | if test x$enable_werror = "xyes" ; then |
| 398 | XIPH_ADD_CFLAGS([-Werror]) |
| 399 | AC_LANG_PUSH([C++]) |
| 400 | XIPH_ADD_CXXFLAGS([-Werror]) |
| 401 | AC_LANG_POP([C++]) |
| 402 | fi |
| 403 | |
Erik de Castro Lopo | 195470f | 2013-03-13 18:58:16 +1100 | [diff] [blame] | 404 | if test x$enable_stack_smash_protection = "xyes" ; then |
| 405 | XIPH_GCC_STACK_PROTECTOR |
| 406 | XIPH_GXX_STACK_PROTECTOR |
| 407 | fi |
Erik de Castro Lopo | d5b03bc | 2013-03-09 08:55:37 +1100 | [diff] [blame] | 408 | |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 409 | AC_CONFIG_FILES([ \ |
| 410 | Makefile \ |
| 411 | src/Makefile \ |
| 412 | src/libFLAC/Makefile \ |
| 413 | src/libFLAC/flac.pc \ |
| 414 | src/libFLAC/ia32/Makefile \ |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 415 | src/libFLAC/include/Makefile \ |
| 416 | src/libFLAC/include/private/Makefile \ |
| 417 | src/libFLAC/include/protected/Makefile \ |
| 418 | src/libFLAC++/Makefile \ |
| 419 | src/libFLAC++/flac++.pc \ |
| 420 | src/flac/Makefile \ |
| 421 | src/metaflac/Makefile \ |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 422 | src/plugin_common/Makefile \ |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 423 | src/plugin_xmms/Makefile \ |
| 424 | src/share/Makefile \ |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 425 | src/test_grabbag/Makefile \ |
| 426 | src/test_grabbag/cuesheet/Makefile \ |
| 427 | src/test_grabbag/picture/Makefile \ |
| 428 | src/test_libs_common/Makefile \ |
| 429 | src/test_libFLAC/Makefile \ |
| 430 | src/test_libFLAC++/Makefile \ |
| 431 | src/test_seeking/Makefile \ |
| 432 | src/test_streams/Makefile \ |
| 433 | src/utils/Makefile \ |
| 434 | src/utils/flacdiff/Makefile \ |
| 435 | src/utils/flactimer/Makefile \ |
| 436 | examples/Makefile \ |
| 437 | examples/c/Makefile \ |
| 438 | examples/c/decode/Makefile \ |
| 439 | examples/c/decode/file/Makefile \ |
| 440 | examples/c/encode/Makefile \ |
| 441 | examples/c/encode/file/Makefile \ |
| 442 | examples/cpp/Makefile \ |
| 443 | examples/cpp/decode/Makefile \ |
| 444 | examples/cpp/decode/file/Makefile \ |
| 445 | examples/cpp/encode/Makefile \ |
| 446 | examples/cpp/encode/file/Makefile \ |
| 447 | include/Makefile \ |
| 448 | include/FLAC/Makefile \ |
| 449 | include/FLAC++/Makefile \ |
| 450 | include/share/Makefile \ |
| 451 | include/share/grabbag/Makefile \ |
| 452 | include/test_libs_common/Makefile \ |
Olivier Blin | f699788 | 2012-12-28 19:58:46 +0100 | [diff] [blame] | 453 | doc/Doxyfile \ |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 454 | doc/Makefile \ |
| 455 | doc/html/Makefile \ |
| 456 | doc/html/images/Makefile \ |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 457 | m4/Makefile \ |
| 458 | man/Makefile \ |
Erik de Castro Lopo | a9712a2 | 2013-09-16 19:55:11 +1000 | [diff] [blame] | 459 | test/common.sh \ |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 460 | test/Makefile \ |
| 461 | test/cuesheets/Makefile \ |
| 462 | test/flac-to-flac-metadata-test-files/Makefile \ |
| 463 | test/metaflac-test-files/Makefile \ |
| 464 | test/pictures/Makefile \ |
| 465 | build/Makefile \ |
Erik de Castro Lopo | 55788ea | 2012-12-28 11:06:38 +1100 | [diff] [blame] | 466 | objs/Makefile \ |
| 467 | objs/debug/Makefile \ |
| 468 | objs/debug/bin/Makefile \ |
| 469 | objs/debug/lib/Makefile \ |
| 470 | objs/release/Makefile \ |
| 471 | objs/release/bin/Makefile \ |
| 472 | objs/release/lib/Makefile \ |
Erik de Castro Lopo | 06ed05e | 2012-02-01 17:55:50 +1100 | [diff] [blame] | 473 | ]) |
| 474 | AC_OUTPUT |
Erik de Castro Lopo | caef93e | 2012-02-26 22:41:44 +1100 | [diff] [blame] | 475 | |
| 476 | AC_MSG_RESULT([ |
| 477 | -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=- |
| 478 | |
| 479 | Configuration summary : |
| 480 | |
| 481 | FLAC version : ........................ ${VERSION} |
| 482 | |
| 483 | Host CPU : ............................ ${host_cpu} |
| 484 | Host Vendor : ......................... ${host_vendor} |
| 485 | Host OS : ............................. ${host_os} |
| 486 | ]) |
| 487 | |
Erik de Castro Lopo | caef93e | 2012-02-26 22:41:44 +1100 | [diff] [blame] | 488 | echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}" |
Max Horn | cdcb88b | 2012-12-12 21:33:53 +0100 | [diff] [blame] | 489 | if test x$ac_cv_c_compiler_gnu = xyes ; then |
Erik de Castro Lopo | caef93e | 2012-02-26 22:41:44 +1100 | [diff] [blame] | 490 | echo " GCC version : ......................... ${GCC_VERSION}" |
Max Horn | cdcb88b | 2012-12-12 21:33:53 +0100 | [diff] [blame] | 491 | fi |
Erik de Castro Lopo | a6a4b6f | 2013-11-22 18:13:36 +1100 | [diff] [blame] | 492 | echo " Compiler is Clang : ................... ${xiph_cv_c_compiler_clang}" |
Erik de Castro Lopo | 9863998 | 2014-03-15 16:47:49 +1100 | [diff] [blame] | 493 | echo " SSE optimizations : ................... ${sse_os}" |
Erik de Castro Lopo | 899599e | 2013-09-25 23:26:49 +1000 | [diff] [blame] | 494 | echo " Asm optimizations : ................... ${asm_optimisation}" |
Erik de Castro Lopo | e21237a | 2013-09-15 19:58:05 +1000 | [diff] [blame] | 495 | echo " Ogg/FLAC support : .................... ${have_ogg}" |
Erik de Castro Lopo | 592021e | 2012-12-28 09:49:50 +1100 | [diff] [blame] | 496 | echo |