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