blob: 065a40ae66b846d93894c99d1f7caff45187770e [file] [log] [blame]
Josh Coalsondef8eb82001-05-23 22:08:27 +00001# NOTE that for many of the conditionals we use the prefix FLaC__
Josh Coalsoncf030c82001-05-23 20:59:48 +00002# instead of FLAC__ since autoconf triggers off 'AC_' in strings
3
Josh Coalson9f429ba2001-01-19 22:39:39 +00004AC_INIT(src/flac/main.c)
Josh Coalson2bfc33d2001-03-21 23:18:04 +00005AM_INIT_AUTOMAKE(flac, 0.9)
Josh Coalson9f429ba2001-01-19 22:39:39 +00006
7# We need two libtools, one that builds both shared and static, and
8# one that builds only static. This is because the resulting libtool
9# does not allow us to choose which to build at runtime.
10AM_PROG_LIBTOOL
11sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
12chmod +x libtool-disable-static
13
14AC_PROG_MAKE_SET
15
Josh Coalsondef8eb82001-05-23 22:08:27 +000016AC_CANONICAL_HOST
17case $host_cpu in
Josh Coalsoncf030c82001-05-23 20:59:48 +000018 i*86) cpu_ia32=true ;;
19 powerpc) cpu_ppc=true ;;
20 sparc) cpu_sparc=true ;;
21esac
22AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue)
23AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue)
24AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue)
25
26AM_CONDITIONAL(FLaC__ALIGN_MALLOC_DATA, test x$cpu_ia32 = xtrue)
27
28AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
29AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
30
Josh Coalson9f429ba2001-01-19 22:39:39 +000031AC_ARG_ENABLE(debug,
Josh Coalsoncf030c82001-05-23 20:59:48 +000032 [ --enable-debug Turn on debugging],
33 [case "${enableval}" in
34 yes) debug=true ;;
35 no) debug=false ;;
36 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
37 esac],[debug=false])
Josh Coalson9f429ba2001-01-19 22:39:39 +000038AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
39
40AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built]))
Josh Coalsoncf030c82001-05-23 20:59:48 +000041AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
42
43AC_CHECK_PROGS(NASM, nasm)
44AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
Josh Coalson9f429ba2001-01-19 22:39:39 +000045
46CFLAGS='-I./include -I $(top_srcdir)/include -Wall -W'
47if test x$debug = xtrue; then
48 CFLAGS="$CFLAGS -g -O0 -DDEBUG"
49else
Josh Coalson230e0f52001-02-05 23:19:09 +000050 CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -funroll-loops -ffast-math -finline-functions -DNDEBUG"
Josh Coalson9f429ba2001-01-19 22:39:39 +000051fi
52
53AC_OUTPUT( Makefile \
54 src/Makefile \
55 src/libFLAC/Makefile \
56 src/flac/Makefile \
Josh Coalsonb72c5502001-03-08 20:31:05 +000057 src/metaflac/Makefile \
Josh Coalson9f429ba2001-01-19 22:39:39 +000058 src/plugin_xmms/Makefile \
59 src/test_streams/Makefile \
60 src/test_unit/Makefile \
61 test/Makefile \
Josh Coalsoncf030c82001-05-23 20:59:48 +000062 )