blob: bef1b8e2e17f1dff5273011d82a6f62eb1566a96 [file] [log] [blame]
Josh Coalson0e3576e2001-05-25 00:07:51 +00001# NOTE that for many of the AM_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 Coalson76863772001-05-29 18:45:05 +00005AM_INIT_AUTOMAKE(flac, 0.10)
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 Coalson0e3576e2001-05-25 00:07:51 +000018 i*86) cpu_ia32=true ; AC_DEFINE(FLAC__CPU_IA32) ;;
19 powerpc) cpu_ppc=true ; AC_DEFINE(FLAC__CPU_PPC) ;;
20 sparc) cpu_sparc=true ; AC_DEFINE(FLAC__CPU_SPARC) ;;
Josh Coalsoncf030c82001-05-23 20:59:48 +000021esac
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
Josh Coalson0e3576e2001-05-25 00:07:51 +000026if test x$cpu_ia32 = xtrue ; then
27AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
28fi
Josh Coalsoncf030c82001-05-23 20:59:48 +000029
30AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
31AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
Josh Coalson0e3576e2001-05-25 00:07:51 +000032if test x$asm_opt = xno ; then
33AC_DEFINE(FLAC__NO_ASM)
34fi
Josh Coalsoncf030c82001-05-23 20:59:48 +000035
Josh Coalson9f429ba2001-01-19 22:39:39 +000036AC_ARG_ENABLE(debug,
Josh Coalsoncf030c82001-05-23 20:59:48 +000037 [ --enable-debug Turn on debugging],
38 [case "${enableval}" in
39 yes) debug=true ;;
40 no) debug=false ;;
41 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
42 esac],[debug=false])
Josh Coalson9f429ba2001-01-19 22:39:39 +000043AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
44
45AM_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 +000046AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
47
48AC_CHECK_PROGS(NASM, nasm)
49AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
Josh Coalson0e3576e2001-05-25 00:07:51 +000050if test -n "$NASM" ; then
51AC_DEFINE(FLAC__HAS_NASM)
52fi
Josh Coalson9f429ba2001-01-19 22:39:39 +000053
54CFLAGS='-I./include -I $(top_srcdir)/include -Wall -W'
55if test x$debug = xtrue; then
Josh Coalson06f76902001-06-05 22:36:45 +000056 CFLAGS="$CFLAGS -g -O0 -DDEBUG"
Josh Coalson9f429ba2001-01-19 22:39:39 +000057else
Josh Coalson06f76902001-06-05 22:36:45 +000058 CFLAGS="$CFLAGS -O3 -DNDEBUG"
59 if test x$GCC = xyes; then
60 CFLAGS="$CFLAGS -fomit-frame-pointer -funroll-loops -ffast-math -finline-functions"
61 fi
Josh Coalson9f429ba2001-01-19 22:39:39 +000062fi
63
64AC_OUTPUT( Makefile \
65 src/Makefile \
66 src/libFLAC/Makefile \
Josh Coalson0e3576e2001-05-25 00:07:51 +000067 src/libFLAC/i386/Makefile \
Josh Coalson9f429ba2001-01-19 22:39:39 +000068 src/flac/Makefile \
Josh Coalsonb72c5502001-03-08 20:31:05 +000069 src/metaflac/Makefile \
Josh Coalson9f429ba2001-01-19 22:39:39 +000070 src/plugin_xmms/Makefile \
71 src/test_streams/Makefile \
72 src/test_unit/Makefile \
73 test/Makefile \
Josh Coalsoncf030c82001-05-23 20:59:48 +000074 )