Chris@1: # FLAC - Free Lossless Audio Codec Chris@1: # Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson Chris@1: # Chris@1: # This file is part the FLAC project. FLAC is comprised of several Chris@1: # components distributed under difference licenses. The codec libraries Chris@1: # are distributed under Xiph.Org's BSD-like license (see the file Chris@1: # COPYING.Xiph in this distribution). All other programs, libraries, and Chris@1: # plugins are distributed under the GPL (see COPYING.GPL). The documentation Chris@1: # is distributed under the Gnu FDL (see COPYING.FDL). Each file in the Chris@1: # FLAC distribution contains at the top the terms under which it may be Chris@1: # distributed. Chris@1: # Chris@1: # Since this particular file is relevant to all components of FLAC, Chris@1: # it may be distributed under the Xiph.Org license, which is the least Chris@1: # restrictive of those mentioned above. See the file COPYING.Xiph in this Chris@1: # distribution. Chris@1: Chris@1: # NOTE that for many of the AM_CONDITIONALs we use the prefix FLaC__ Chris@1: # instead of FLAC__ since autoconf triggers off 'AC_' in strings Chris@1: Chris@1: AC_INIT(src/flac/main.c) Chris@1: AM_INIT_AUTOMAKE(flac, 1.2.1) Chris@1: Chris@1: # Don't automagically regenerate autoconf/automake generated files unless Chris@1: # explicitly requested. Eases autobuilding -mdz Chris@1: AM_MAINTAINER_MODE Chris@1: Chris@1: # We need two libtools, one that builds both shared and static, and Chris@1: # one that builds only static. This is because the resulting libtool Chris@1: # does not allow us to choose which to build at runtime. Chris@1: AM_PROG_LIBTOOL Chris@1: sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static Chris@1: chmod +x libtool-disable-static Chris@1: Chris@1: AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") Chris@1: Chris@1: AM_PROG_AS Chris@1: AC_PROG_CXX Chris@1: AC_PROG_MAKE_SET Chris@1: Chris@1: AC_SYS_LARGEFILE Chris@1: AC_FUNC_FSEEKO Chris@1: Chris@1: AC_CHECK_SIZEOF(void*,0) Chris@1: Chris@1: #@@@ new name is AC_CONFIG_HEADERS Chris@1: AM_CONFIG_HEADER(config.h) Chris@1: Chris@1: AC_C_BIGENDIAN Chris@1: Chris@1: AC_CHECK_TYPES(socklen_t, [], []) Chris@1: Chris@1: dnl check for getopt in standard library Chris@1: dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) Chris@1: AC_CHECK_FUNCS(getopt_long, [], []) Chris@1: Chris@1: case "$host_cpu" in Chris@1: i*86) Chris@1: cpu_ia32=true Chris@1: AC_DEFINE(FLAC__CPU_IA32) Chris@1: AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386]) Chris@1: ;; Chris@1: powerpc) Chris@1: cpu_ppc=true Chris@1: AC_DEFINE(FLAC__CPU_PPC) Chris@1: AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC]) Chris@1: ;; Chris@1: sparc) Chris@1: cpu_sparc=true Chris@1: AC_DEFINE(FLAC__CPU_SPARC) Chris@1: AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC]) Chris@1: ;; Chris@1: esac Chris@1: AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue) Chris@1: AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue) Chris@1: AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue) Chris@1: Chris@1: case "$host" in Chris@1: i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;; Chris@1: *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;; Chris@1: *-*-darwin*) OBJ_FORMAT=macho ;; Chris@1: *) OBJ_FORMAT=elf ;; Chris@1: esac Chris@1: AC_SUBST(OBJ_FORMAT) Chris@1: Chris@1: # only needed because of ntohl() usage, can get rid of after that's gone: Chris@1: case "$host" in Chris@1: *-*-cygwin|*mingw*) MINGW_WINSOCK_LIBS=-lwsock32 ;; Chris@1: *) MINGW_WINSOCK_LIBS= ;; Chris@1: esac Chris@1: AC_SUBST(MINGW_WINSOCK_LIBS) Chris@1: Chris@1: case "$host" in Chris@1: *-pc-linux-gnu) Chris@1: sys_linux=true Chris@1: AC_DEFINE(FLAC__SYS_LINUX) Chris@1: AH_TEMPLATE(FLAC__SYS_LINUX, [define if building for Linux]) Chris@1: ;; Chris@1: *-*-darwin*) Chris@1: sys_darwin=true Chris@1: AC_DEFINE(FLAC__SYS_DARWIN) Chris@1: AH_TEMPLATE(FLAC__SYS_DARWIN, [define if building for Darwin / MacOS X]) Chris@1: ;; Chris@1: esac Chris@1: AM_CONDITIONAL(FLaC__SYS_DARWIN, test "x$sys_darwin" = xtrue) Chris@1: AM_CONDITIONAL(FLaC__SYS_LINUX, test "x$sys_linux" = xtrue) Chris@1: Chris@1: if test "x$cpu_ia32" = xtrue ; then Chris@1: AC_DEFINE(FLAC__ALIGN_MALLOC_DATA) Chris@1: AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries]) Chris@1: fi Chris@1: Chris@1: AC_ARG_ENABLE(asm-optimizations, AC_HELP_STRING([--disable-asm-optimizations], [Don't use any assembly optimization routines]), asm_opt=no, asm_opt=yes) Chris@1: AM_CONDITIONAL(FLaC__NO_ASM, test "x$asm_opt" = xno) Chris@1: if test "x$asm_opt" = xno ; then Chris@1: AC_DEFINE(FLAC__NO_ASM) Chris@1: AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code]) Chris@1: fi Chris@1: Chris@1: AC_ARG_ENABLE(debug, Chris@1: AC_HELP_STRING([--enable-debug], [Turn on debugging]), Chris@1: [case "${enableval}" in Chris@1: yes) debug=true ;; Chris@1: no) debug=false ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; Chris@1: esac],[debug=false]) Chris@1: AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue) Chris@1: Chris@1: AC_ARG_ENABLE(sse, Chris@1: AC_HELP_STRING([--enable-sse], [Enable SSE support by asserting that the OS supports SSE instructions]), Chris@1: [case "${enableval}" in Chris@1: yes) sse_os=true ;; Chris@1: no) sse_os=false ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;; Chris@1: esac],[sse_os=false]) Chris@1: AM_CONDITIONAL(FLaC__SSE_OS, test "x$sse_os" = xtrue) Chris@1: if test "x$sse_os" = xtrue ; then Chris@1: AC_DEFINE(FLAC__SSE_OS) Chris@1: AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions]) Chris@1: fi Chris@1: Chris@1: AC_ARG_ENABLE(3dnow, Chris@1: AC_HELP_STRING([--disable-3dnow], [Disable 3DNOW! optimizations]), Chris@1: [case "${enableval}" in Chris@1: yes) use_3dnow=true ;; Chris@1: no) use_3dnow=false ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;; Chris@1: esac],[use_3dnow=true]) Chris@1: AM_CONDITIONAL(FLaC__USE_3DNOW, test "x$use_3dnow" = xtrue) Chris@1: if test "x$use_3dnow" = xtrue ; then Chris@1: AC_DEFINE(FLAC__USE_3DNOW) Chris@1: AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions]) Chris@1: fi Chris@1: Chris@1: AC_ARG_ENABLE(altivec, Chris@1: AC_HELP_STRING([--disable-altivec], [Disable Altivec optimizations]), Chris@1: [case "${enableval}" in Chris@1: yes) use_altivec=true ;; Chris@1: no) use_altivec=false ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;; Chris@1: esac],[use_altivec=true]) Chris@1: AM_CONDITIONAL(FLaC__USE_ALTIVEC, test "x$use_altivec" = xtrue) Chris@1: if test "x$use_altivec" = xtrue ; then Chris@1: AC_DEFINE(FLAC__USE_ALTIVEC) Chris@1: AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions]) Chris@1: fi Chris@1: Chris@1: AC_ARG_ENABLE(thorough-tests, Chris@1: AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]), Chris@1: [case "${enableval}" in Chris@1: yes) thorough_tests=true ;; Chris@1: no) thorough_tests=false ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-thorough-tests) ;; Chris@1: esac],[thorough_tests=true]) Chris@1: AC_ARG_ENABLE(exhaustive-tests, Chris@1: AC_HELP_STRING([--enable-exhaustive-tests], [Enable exhaustive testing (VERY long)]), Chris@1: [case "${enableval}" in Chris@1: yes) exhaustive_tests=true ;; Chris@1: no) exhaustive_tests=false ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;; Chris@1: esac],[exhaustive_tests=false]) Chris@1: if test "x$thorough_tests" = xfalse ; then Chris@1: FLAC__TEST_LEVEL=0 Chris@1: elif test "x$exhaustive_tests" = xfalse ; then Chris@1: FLAC__TEST_LEVEL=1 Chris@1: else Chris@1: FLAC__TEST_LEVEL=2 Chris@1: fi Chris@1: AC_SUBST(FLAC__TEST_LEVEL) Chris@1: Chris@1: AC_ARG_ENABLE(valgrind-testing, Chris@1: AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]), Chris@1: [case "${enableval}" in Chris@1: yes) FLAC__TEST_WITH_VALGRIND=yes ;; Chris@1: no) FLAC__TEST_WITH_VALGRIND=no ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;; Chris@1: esac],[FLAC__TEST_WITH_VALGRIND=no]) Chris@1: AC_SUBST(FLAC__TEST_WITH_VALGRIND) Chris@1: Chris@1: AC_ARG_ENABLE(doxygen-docs, Chris@1: AC_HELP_STRING([--disable-doxygen-docs], [Disable API documentation building via Doxygen]), Chris@1: [case "${enableval}" in Chris@1: yes) enable_doxygen_docs=true ;; Chris@1: no) enable_doxygen_docs=false ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-doxygen-docs) ;; Chris@1: esac],[enable_doxygen_docs=true]) Chris@1: if test "x$enable_doxygen_docs" != xfalse ; then Chris@1: AC_CHECK_PROGS(DOXYGEN, doxygen) Chris@1: fi Chris@1: AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN") Chris@1: Chris@1: AC_ARG_ENABLE(local-xmms-plugin, Chris@1: AC_HELP_STRING([--enable-local-xmms-plugin], [Install XMMS plugin to ~/.xmms/Plugins instead of system location]), Chris@1: [case "${enableval}" in Chris@1: yes) install_xmms_plugin_locally=true ;; Chris@1: no) install_xmms_plugin_locally=false ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;; Chris@1: esac],[install_xmms_plugin_locally=false]) Chris@1: AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test "x$install_xmms_plugin_locally" = xtrue) Chris@1: Chris@1: AC_ARG_ENABLE(xmms-plugin, Chris@1: AC_HELP_STRING([--disable-xmms-plugin], [Do not build XMMS plugin]), Chris@1: [case "${enableval}" in Chris@1: yes) enable_xmms_plugin=true ;; Chris@1: no) enable_xmms_plugin=false ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmms-plugin) ;; Chris@1: esac],[enable_xmms_plugin=true]) Chris@1: if test "x$enable_xmms_plugin" != xfalse ; then Chris@1: AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - XMMS support will not be built])) Chris@1: fi Chris@1: AM_CONDITIONAL(FLaC__HAS_XMMS, test -n "$XMMS_INPUT_PLUGIN_DIR") Chris@1: Chris@1: dnl build FLAC++ or not Chris@1: AC_ARG_ENABLE([cpplibs], Chris@1: AC_HELP_STRING([--disable-cpplibs], [Do not build libFLAC++]), Chris@1: [case "${enableval}" in Chris@1: yes) disable_cpplibs=false ;; Chris@1: no) disable_cpplibs=true ;; Chris@1: *) AC_MSG_ERROR(bad value ${enableval} for --enable-cpplibs) ;; Chris@1: esac], [disable_cpplibs=false]) Chris@1: AM_CONDITIONAL(FLaC__WITH_CPPLIBS, [test "x$disable_cpplibs" != xtrue]) Chris@1: Chris@1: dnl check for ogg library Chris@1: AC_ARG_ENABLE([ogg], Chris@1: AC_HELP_STRING([--disable-ogg], [Disable ogg support (default: test for libogg)]), Chris@1: [ want_ogg=$enableval ], [ want_ogg=yes ] ) Chris@1: Chris@1: if test "x$want_ogg" != "xno"; then Chris@1: XIPH_PATH_OGG(have_ogg=yes, AC_MSG_WARN([*** Ogg development enviroment not installed - Ogg support will not be built])) Chris@1: fi Chris@1: Chris@1: AM_CONDITIONAL(FLaC__HAS_OGG, [test "x$have_ogg" = xyes]) Chris@1: if test "x$have_ogg" = xyes ; then Chris@1: AC_DEFINE(FLAC__HAS_OGG) Chris@1: AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library]) Chris@1: fi Chris@1: Chris@1: dnl check for i18n(internationalization); these are from libiconv/gettext Chris@1: AM_ICONV Chris@1: AM_LANGINFO_CODESET Chris@1: Chris@1: AC_CHECK_PROGS(DOCBOOK_TO_MAN, docbook-to-man docbook2man) Chris@1: AM_CONDITIONAL(FLaC__HAS_DOCBOOK_TO_MAN, test -n "$DOCBOOK_TO_MAN") Chris@1: if test -n "$DOCBOOK_TO_MAN" ; then Chris@1: AC_DEFINE(FLAC__HAS_DOCBOOK_TO_MAN) Chris@1: AH_TEMPLATE(FLAC__HAS_DOCBOOK_TO_MAN, [define if you have docbook-to-man or docbook2man]) Chris@1: fi Chris@1: Chris@1: # only matters for x86 Chris@1: AC_CHECK_PROGS(NASM, nasm) Chris@1: AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM") Chris@1: if test -n "$NASM" ; then Chris@1: AC_DEFINE(FLAC__HAS_NASM) Chris@1: AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler]) Chris@1: fi Chris@1: Chris@1: # only matters for PowerPC Chris@1: AC_CHECK_PROGS(AS, as, as) Chris@1: AC_CHECK_PROGS(GAS, gas, gas) Chris@1: Chris@1: # try -v (apple as) and --version (gas) at the same time Chris@1: test "$AS" = "as" && as --version -v < /dev/null 2>&1 | grep Apple >/dev/null || AS=gas Chris@1: Chris@1: AM_CONDITIONAL(FLaC__HAS_AS, test "$AS" = "as") Chris@1: AM_CONDITIONAL(FLaC__HAS_GAS, test "$AS" = "gas") Chris@1: if test "$AS" = "as" ; then Chris@1: AC_DEFINE(FLAC__HAS_AS) Chris@1: AH_TEMPLATE(FLAC__HAS_AS, [define if you are compiling for PowerPC and have the 'as' assembler]) Chris@1: fi Chris@1: if test "$AS" = "gas" ; then Chris@1: # funniest. macro. ever. Chris@1: AC_DEFINE(FLAC__HAS_GAS) Chris@1: AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have the 'gas' assembler]) Chris@1: fi Chris@1: Chris@1: CPPFLAGS='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'" $CPPFLAGS" Chris@1: if test "x$debug" = xtrue; then Chris@1: CPPFLAGS="-DDEBUG $CPPFLAGS" Chris@1: CFLAGS="-g $CFLAGS" Chris@1: else Chris@1: CPPFLAGS="-DNDEBUG $CPPFLAGS" Chris@1: if test "x$GCC" = xyes; then Chris@1: CPPFLAGS="-DFLaC__INLINE=__inline__ $CPPFLAGS" Chris@1: CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS" Chris@1: fi Chris@1: fi Chris@1: Chris@1: #@@@ Chris@1: AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no") Chris@1: AM_CONDITIONAL(FLaC__HAS_GAS__TEMPORARILY_DISABLED, test "yes" = "no") Chris@1: Chris@1: AC_CONFIG_FILES([ \ Chris@1: Makefile \ Chris@1: src/Makefile \ Chris@1: src/libFLAC/Makefile \ Chris@1: src/libFLAC/flac.pc \ Chris@1: src/libFLAC/ia32/Makefile \ Chris@1: src/libFLAC/ppc/Makefile \ Chris@1: src/libFLAC/ppc/as/Makefile \ Chris@1: src/libFLAC/ppc/gas/Makefile \ Chris@1: src/libFLAC/include/Makefile \ Chris@1: src/libFLAC/include/private/Makefile \ Chris@1: src/libFLAC/include/protected/Makefile \ Chris@1: src/libFLAC++/Makefile \ Chris@1: src/libFLAC++/flac++.pc \ Chris@1: src/flac/Makefile \ Chris@1: src/metaflac/Makefile \ Chris@1: src/monkeys_audio_utilities/Makefile \ Chris@1: src/monkeys_audio_utilities/flac_mac/Makefile \ Chris@1: src/monkeys_audio_utilities/flac_ren/Makefile \ Chris@1: src/plugin_common/Makefile \ Chris@1: src/plugin_winamp2/Makefile \ Chris@1: src/plugin_winamp2/include/Makefile \ Chris@1: src/plugin_winamp2/include/winamp2/Makefile \ Chris@1: src/plugin_xmms/Makefile \ Chris@1: src/share/Makefile \ Chris@1: src/share/getopt/Makefile \ Chris@1: src/share/grabbag/Makefile \ Chris@1: src/share/replaygain_analysis/Makefile \ Chris@1: src/share/replaygain_synthesis/Makefile \ Chris@1: src/share/replaygain_synthesis/include/Makefile \ Chris@1: src/share/replaygain_synthesis/include/private/Makefile \ Chris@1: src/share/utf8/Makefile \ Chris@1: src/test_grabbag/Makefile \ Chris@1: src/test_grabbag/cuesheet/Makefile \ Chris@1: src/test_grabbag/picture/Makefile \ Chris@1: src/test_libs_common/Makefile \ Chris@1: src/test_libFLAC/Makefile \ Chris@1: src/test_libFLAC++/Makefile \ Chris@1: src/test_seeking/Makefile \ Chris@1: src/test_streams/Makefile \ Chris@1: examples/Makefile \ Chris@1: examples/c/Makefile \ Chris@1: examples/c/decode/Makefile \ Chris@1: examples/c/decode/file/Makefile \ Chris@1: examples/c/encode/Makefile \ Chris@1: examples/c/encode/file/Makefile \ Chris@1: examples/cpp/Makefile \ Chris@1: examples/cpp/decode/Makefile \ Chris@1: examples/cpp/decode/file/Makefile \ Chris@1: examples/cpp/encode/Makefile \ Chris@1: examples/cpp/encode/file/Makefile \ Chris@1: include/Makefile \ Chris@1: include/FLAC/Makefile \ Chris@1: include/FLAC++/Makefile \ Chris@1: include/share/Makefile \ Chris@1: include/share/grabbag/Makefile \ Chris@1: include/test_libs_common/Makefile \ Chris@1: doc/Makefile \ Chris@1: doc/html/Makefile \ Chris@1: doc/html/images/Makefile \ Chris@1: doc/html/images/hw/Makefile \ Chris@1: doc/html/ru/Makefile \ Chris@1: m4/Makefile \ Chris@1: man/Makefile \ Chris@1: test/Makefile \ Chris@1: test/cuesheets/Makefile \ Chris@1: test/flac-to-flac-metadata-test-files/Makefile \ Chris@1: test/metaflac-test-files/Makefile \ Chris@1: test/pictures/Makefile \ Chris@1: build/Makefile \ Chris@1: obj/Makefile \ Chris@1: obj/debug/Makefile \ Chris@1: obj/debug/bin/Makefile \ Chris@1: obj/debug/lib/Makefile \ Chris@1: obj/release/Makefile \ Chris@1: obj/release/bin/Makefile \ Chris@1: obj/release/lib/Makefile \ Chris@1: ]) Chris@1: AC_OUTPUT