Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 1 | # NOTE that for many of the AM_CONDITIONALs we use the prefix FLaC__ |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 2 | # instead of FLAC__ since autoconf triggers off 'AC_' in strings |
| 3 | |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 4 | AC_INIT(src/flac/main.c) |
Josh Coalson | 7686377 | 2001-05-29 18:45:05 +0000 | [diff] [blame] | 5 | AM_INIT_AUTOMAKE(flac, 0.10) |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 6 | |
| 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. |
| 10 | AM_PROG_LIBTOOL |
| 11 | sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static |
| 12 | chmod +x libtool-disable-static |
| 13 | |
| 14 | AC_PROG_MAKE_SET |
| 15 | |
Josh Coalson | def8eb8 | 2001-05-23 22:08:27 +0000 | [diff] [blame] | 16 | AC_CANONICAL_HOST |
| 17 | case $host_cpu in |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 18 | 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 Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 21 | esac |
| 22 | AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue) |
| 23 | AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue) |
| 24 | AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue) |
| 25 | |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 26 | if test x$cpu_ia32 = xtrue ; then |
| 27 | AC_DEFINE(FLAC__ALIGN_MALLOC_DATA) |
| 28 | fi |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 29 | |
| 30 | AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes) |
| 31 | AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno) |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 32 | if test x$asm_opt = xno ; then |
| 33 | AC_DEFINE(FLAC__NO_ASM) |
| 34 | fi |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 35 | |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 36 | AC_ARG_ENABLE(debug, |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 37 | [ --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 Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 43 | AM_CONDITIONAL(DEBUG, test x$debug = xtrue) |
| 44 | |
| 45 | AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built])) |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 46 | AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x) |
| 47 | |
| 48 | AC_CHECK_PROGS(NASM, nasm) |
| 49 | AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM") |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 50 | if test -n "$NASM" ; then |
| 51 | AC_DEFINE(FLAC__HAS_NASM) |
| 52 | fi |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 53 | |
| 54 | CFLAGS='-I./include -I $(top_srcdir)/include -Wall -W' |
| 55 | if test x$debug = xtrue; then |
Josh Coalson | 06f7690 | 2001-06-05 22:36:45 +0000 | [diff] [blame^] | 56 | CFLAGS="$CFLAGS -g -O0 -DDEBUG" |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 57 | else |
Josh Coalson | 06f7690 | 2001-06-05 22:36:45 +0000 | [diff] [blame^] | 58 | 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 Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 62 | fi |
| 63 | |
| 64 | AC_OUTPUT( Makefile \ |
| 65 | src/Makefile \ |
| 66 | src/libFLAC/Makefile \ |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 67 | src/libFLAC/i386/Makefile \ |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 68 | src/flac/Makefile \ |
Josh Coalson | b72c550 | 2001-03-08 20:31:05 +0000 | [diff] [blame] | 69 | src/metaflac/Makefile \ |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 70 | src/plugin_xmms/Makefile \ |
| 71 | src/test_streams/Makefile \ |
| 72 | src/test_unit/Makefile \ |
| 73 | test/Makefile \ |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 74 | ) |