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