1 dnl Process this file with autoconf to produce a configure script.
4 AC_CONFIG_SRCDIR([src/a52dec.c])
5 AC_CONFIG_AUX_DIR(autotools)
6 AC_CONFIG_FILES([Makefile autotools/Makefile include/Makefile test/Makefile
7 doc/Makefile src/Makefile liba52/Makefile libao/Makefile vc++/Makefile])
8 AM_INIT_AUTOMAKE([a52dec],[0.7.3])
9 AM_CONFIG_HEADER(include/config.h)
12 if test x"$host_alias" = x""; then host_alias="$host"; fi
14 dnl Checks for compiler
16 AC_PROG_GCC_TRADITIONAL
18 dnl GCC-specific flags - try to optimize them sometime
19 if test x"$GCC" = x"yes"; then
21 dnl -Wall -Werror moved to the end to not disturb the configure script
25 OPT_CFLAGS=`echo "$CFLAGS"|sed "s/-O[0-9]*//g;"`
27 OPT_CFLAGS="$OPT_CFLAGS -O3"
28 AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS])
30 dnl -fomit-frame-pointer
31 OPT_CFLAGS="$CFLAGS -fomit-frame-pointer"
32 AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS])
34 dnl arch-specific flags
38 i386-*) OPT_CFLAGS="$CFLAGS -mcpu=i386";;
39 i486-*) OPT_CFLAGS="$CFLAGS -mcpu=i486";;
40 i586-*) OPT_CFLAGS="$CFLAGS -mcpu=pentium";;
41 i686-*) OPT_CFLAGS="$CFLAGS -mcpu=pentiumpro";;
42 k6-*) OPT_CFLAGS="$CFLAGS -mcpu=k6";;
44 AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
46 OPT_CFLAGS="$CFLAGS -mtune=ultrasparc"
47 AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
48 mips-sgi-irix6.*) dnl do we need to be that specific ?
49 OPT_CFLAGS="$CFLAGS -mabi=64"
50 AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
52 elif test x"$CC" = x"tcc" -a x"`$CC -version 2>&1 | grep TenDRA`" != x""; then
53 dnl TenDRA portability checking compiler
55 CFLAGS="-Xp -Yansi -f`pwd`/include/tendra.h -DELIDE_CODE"
58 enable_solaris_audio=no
59 elif test x"$CC" = x"icc" -a x"`$CC -V 2>&1 | grep Intel`" != x""; then
60 dnl Intel C++ compiler
61 CFLAGS="-g -O3 -unroll -ip"
63 dnl non-gcc flags - we probably need exact configuration triplets here.
66 OPT_CFLAGS="$CFLAGS -64"
67 AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
69 OPT_CFLAGS="$CFLAGS -xCC -fast -xO5"
70 AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
74 dnl Checks for libtool - this must be done after we set cflags
79 dnl Checks for libraries.
81 dnl Checks for header files.
82 INCLUDES='-I$(top_srcdir)/include -I$(top_builddir)/include'
84 AC_CHECK_HEADERS([sys/time.h io.h])
85 AC_CHECK_GENERATE_INTTYPES([include])
87 dnl Checks for typedefs, structures, and compiler characteristics.
93 dnl Checks for library functions.
94 AC_CHECK_FUNCS([memalign])
97 builtin([include],[liba52/configure.incl])
98 builtin([include],[libao/configure.incl])
99 builtin([include],[src/configure.incl])
101 AC_ARG_ENABLE([warnings],
102 [ --disable-warnings do not treat warnings as errors])
103 if test x"$enable_warnings" != x"no" -a x"$GCC" = x"yes"; then
104 dnl compiler warnings
105 OPT_CFLAGS="$CFLAGS -Wall -Werror"
106 AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS])
107 elif test x"$TENDRA" = x"yes"; then
108 dnl TenDRA portability checking compiler
109 CFLAGS="$CFLAGS -DTenDRA_check"
112 AC_C_ATTRIBUTE_ALIGNED