1 # FLAC - Free Lossless Audio Codec
2 # Copyright (C) 2001 Josh Coalson
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.
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.
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.
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
21 AC_INIT(src/flac/main.c)
22 AM_INIT_AUTOMAKE(flac, 1.0.1)
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.
28 sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static
29 chmod +x libtool-disable-static
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) ;;
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)
43 i[[3-6]]86-*-openbsd*) OBJ_FORMAT=aoutb ;;
48 if test x$cpu_ia32 = xtrue ; then
49 AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
52 AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes)
53 AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno)
54 if test x$asm_opt = xno ; then
55 AC_DEFINE(FLAC__NO_ASM)
59 [ --enable-debug Turn on debugging],
60 [case "${enableval}" in
63 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
65 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
68 [ --sse-os Enable SSE support by asserting that the OS supports SSE instructions],
69 [case "${enableval}" in
72 *) AC_MSG_ERROR(bad value ${enableval} for --sse-os) ;;
74 AM_CONDITIONAL(FLaC__SSE_OS, test x$sse_os = xtrue)
75 if test x$sse_os = xtrue ; then
76 AC_DEFINE(FLAC__SSE_OS)
79 AC_CHECK_LIB(ogg, ogg_stream_init,
80 [LIBS="$LIBS -logg"; have_ogg=yes],
81 [AC_MSG_WARN([*** Ogg development enviroment not installed - ogg support will not be built])])
82 AM_CONDITIONAL(FLaC__HAS_OGG, [test x$have_ogg = xyes])
83 if test x$have_ogg = xyes ; then
84 AC_DEFINE(FLAC__HAS_OGG)
87 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built]))
88 AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
90 AC_CHECK_PROGS(NASM, nasm)
91 AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM")
92 if test -n "$NASM" ; then
93 AC_DEFINE(FLAC__HAS_NASM)
96 dnl Check for type sizes
98 AC_CHECK_SIZEOF(short)
100 AC_CHECK_SIZEOF(long)
101 AC_CHECK_SIZEOF(long long)
104 $ac_cv_sizeof_short) FLaC__SIZE16="short" ; FLaC__USIZE16="unsigned short";;
105 $ac_cv_sizeof_int) FLaC__SIZE16="int" ; FLaC__USIZE16="unsigned int";;
109 $ac_cv_sizeof_short) FLaC__SIZE32="short" ; FLaC__USIZE32="unsigned short";;
110 $ac_cv_sizeof_int) FLaC__SIZE32="int" ; FLaC__USIZE32="unsigned int";;
111 $ac_cv_sizeof_long) FLaC__SIZE32="long" ; FLaC__USIZE32="unsigned long";;
115 $ac_cv_sizeof_int) FLaC__SIZE64="int" ; FLaC__USIZE64="unsigned int";;
116 $ac_cv_sizeof_long) FLaC__SIZE64="long" ; FLaC__USIZE64="unsigned long";;
117 $ac_cv_sizeof_long_long) FLaC__SIZE64="long long" ; FLaC__USIZE64="unsigned long long";;
120 if test -z "$FLaC__SIZE16"; then
121 AC_MSG_ERROR(No 16 bit type found on this platform!)
123 if test -z "$FLaC__USIZE16"; then
124 AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
126 if test -z "$FLaC__SIZE32"; then
127 AC_MSG_ERROR(No 32 bit type found on this platform!)
129 if test -z "$FLaC__USIZE32"; then
130 AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
132 if test -z "$FLaC__SIZE64"; then
133 AC_MSG_WARN(No 64 bit type found on this platform!)
135 if test -z "$FLaC__USIZE64"; then
136 AC_MSG_ERROR(No unsigned 64 bit type found on this platform!)
139 AC_SUBST(FLaC__SIZE16)
140 AC_SUBST(FLaC__USIZE16)
141 AC_SUBST(FLaC__SIZE32)
142 AC_SUBST(FLaC__USIZE32)
143 AC_SUBST(FLaC__SIZE64)
144 AC_SUBST(FLaC__USIZE64)
146 SAVE_CFLAGS="$CFLAGS"
147 CFLAGS='-I$(top_builddir) -I$(srcdir)/include -I $(top_srcdir)/include -Wall -W'
148 if test x$debug = xtrue; then
149 CFLAGS="$CFLAGS -g -O0 -DDEBUG"
151 CFLAGS="$CFLAGS -O3 -DNDEBUG"
152 if test x$GCC = xyes; then
153 CFLAGS="$CFLAGS -fomit-frame-pointer -funroll-loops -finline-functions -Winline -DFLaC__INLINE=__inline__"
156 CFLAGS="$CFLAGS $SAVE_CFLAGS"
158 AC_OUTPUT( Makefile \
160 src/libFLAC/Makefile \
161 src/libFLAC/ia32/Makefile \
162 src/libFLAC/include/Makefile \
163 src/libFLAC/include/private/Makefile \
164 src/libFLAC/include/protected/Makefile \
166 src/metaflac/Makefile \
167 src/plugin_xmms/Makefile \
168 src/test_streams/Makefile \
169 src/test_unit/Makefile \
171 include/FLAC/Makefile \
172 include/FLAC/ordinals.h \
174 doc/images/Makefile \