rename i386 to ia32 everywhere
[platform/upstream/flac.git] / configure.in
1 #  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
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
21 AC_INIT(src/flac/main.c)
22 AM_INIT_AUTOMAKE(flac, 0.10)
23
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.
27 AM_PROG_LIBTOOL
28 sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
29 chmod +x libtool-disable-static
30
31 AC_PROG_MAKE_SET
32
33 AC_CANONICAL_HOST
34 case $host_cpu in
35         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) ;;
38 esac
39 AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue)
40 AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue)
41 AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue)
42
43 if test x$cpu_ia32 = xtrue ; then
44 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
45 fi
46
47 AC_ARG_ENABLE(asm-optimizations, [  --disable-asm-optimizations    Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
48 AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
49 if test x$asm_opt = xno ; then
50 AC_DEFINE(FLAC__NO_ASM)
51 fi
52
53 AC_ARG_ENABLE(debug,
54         [  --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])
60 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
61
62 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built]))
63 AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
64
65 AC_CHECK_PROGS(NASM, nasm)
66 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
67 if test -n "$NASM" ; then
68 AC_DEFINE(FLAC__HAS_NASM)
69 fi
70
71 CFLAGS='-I./include -I $(top_srcdir)/include -Wall -W'
72 if test x$debug = xtrue; then
73         CFLAGS="$CFLAGS -g -O0 -DDEBUG"
74 else
75         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
79 fi
80
81 AC_OUTPUT(      Makefile        \
82                 src/Makefile    \
83                 src/libFLAC/Makefile    \
84                 src/libFLAC/ia32/Makefile       \
85                 src/flac/Makefile       \
86                 src/metaflac/Makefile   \
87                 src/plugin_xmms/Makefile        \
88                 src/test_streams/Makefile       \
89                 src/test_unit/Makefile  \
90                 test/Makefile   \
91                 )