blob: eb8d0b9a0620a501f1b9ea1b380b5c6df11444e9 [file] [log] [blame]
Josh Coalson6b05bc52001-06-08 00:13:21 +00001# FLAC - Free Lossless Audio Codec
2# Copyright (C) 2001 Josh Coalson
3#
4# This program is part of FLAC; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License
6# as published by the Free Software Foundation; either version 2
7# of the License, or (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
Josh Coalson0e3576e2001-05-25 00:07:51 +000018# NOTE that for many of the AM_CONDITIONALs we use the prefix FLaC__
Josh Coalsoncf030c82001-05-23 20:59:48 +000019# instead of FLAC__ since autoconf triggers off 'AC_' in strings
20
Josh Coalson9f429ba2001-01-19 22:39:39 +000021AC_INIT(src/flac/main.c)
Josh Coalson76863772001-05-29 18:45:05 +000022AM_INIT_AUTOMAKE(flac, 0.10)
Josh Coalson9f429ba2001-01-19 22:39:39 +000023
24# We need two libtools, one that builds both shared and static, and
25# one that builds only static. This is because the resulting libtool
26# does not allow us to choose which to build at runtime.
27AM_PROG_LIBTOOL
28sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
29chmod +x libtool-disable-static
30
31AC_PROG_MAKE_SET
32
Josh Coalsondef8eb82001-05-23 22:08:27 +000033AC_CANONICAL_HOST
34case $host_cpu in
Josh Coalson0e3576e2001-05-25 00:07:51 +000035 i*86) cpu_ia32=true ; AC_DEFINE(FLAC__CPU_IA32) ;;
36 powerpc) cpu_ppc=true ; AC_DEFINE(FLAC__CPU_PPC) ;;
37 sparc) cpu_sparc=true ; AC_DEFINE(FLAC__CPU_SPARC) ;;
Josh Coalsoncf030c82001-05-23 20:59:48 +000038esac
39AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue)
40AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue)
41AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue)
42
Josh Coalson0e3576e2001-05-25 00:07:51 +000043if test x$cpu_ia32 = xtrue ; then
44AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
45fi
Josh Coalsoncf030c82001-05-23 20:59:48 +000046
47AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
48AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
Josh Coalson0e3576e2001-05-25 00:07:51 +000049if test x$asm_opt = xno ; then
50AC_DEFINE(FLAC__NO_ASM)
51fi
Josh Coalsoncf030c82001-05-23 20:59:48 +000052
Josh Coalson9f429ba2001-01-19 22:39:39 +000053AC_ARG_ENABLE(debug,
Josh Coalsoncf030c82001-05-23 20:59:48 +000054 [ --enable-debug Turn on debugging],
55 [case "${enableval}" in
56 yes) debug=true ;;
57 no) debug=false ;;
58 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
59 esac],[debug=false])
Josh Coalson9f429ba2001-01-19 22:39:39 +000060AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
61
62AM_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 +000063AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
64
65AC_CHECK_PROGS(NASM, nasm)
66AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
Josh Coalson0e3576e2001-05-25 00:07:51 +000067if test -n "$NASM" ; then
68AC_DEFINE(FLAC__HAS_NASM)
69fi
Josh Coalson9f429ba2001-01-19 22:39:39 +000070
71CFLAGS='-I./include -I $(top_srcdir)/include -Wall -W'
72if test x$debug = xtrue; then
Josh Coalson06f76902001-06-05 22:36:45 +000073 CFLAGS="$CFLAGS -g -O0 -DDEBUG"
Josh Coalson9f429ba2001-01-19 22:39:39 +000074else
Josh Coalson06f76902001-06-05 22:36:45 +000075 CFLAGS="$CFLAGS -O3 -DNDEBUG"
76 if test x$GCC = xyes; then
77 CFLAGS="$CFLAGS -fomit-frame-pointer -funroll-loops -ffast-math -finline-functions"
78 fi
Josh Coalson9f429ba2001-01-19 22:39:39 +000079fi
80
81AC_OUTPUT( Makefile \
82 src/Makefile \
83 src/libFLAC/Makefile \
Josh Coalsone6499bd2001-06-13 18:11:25 +000084 src/libFLAC/ia32/Makefile \
Josh Coalson9f429ba2001-01-19 22:39:39 +000085 src/flac/Makefile \
Josh Coalsonb72c5502001-03-08 20:31:05 +000086 src/metaflac/Makefile \
Josh Coalson9f429ba2001-01-19 22:39:39 +000087 src/plugin_xmms/Makefile \
88 src/test_streams/Makefile \
89 src/test_unit/Makefile \
Josh Coalson03ac1452001-06-15 02:16:35 +000090 include/Makefile \
91 include/FLAC/Makefile \
Josh Coalson9f429ba2001-01-19 22:39:39 +000092 test/Makefile \
Josh Coalsoncf030c82001-05-23 20:59:48 +000093 )