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