Josh Coalson | 6b05bc5 | 2001-06-08 00:13:21 +0000 | [diff] [blame] | 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 | |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 18 | # 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] | 19 | # instead of FLAC__ since autoconf triggers off 'AC_' in strings |
| 20 | |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 21 | AC_INIT(src/flac/main.c) |
Josh Coalson | 4ac9823 | 2001-06-23 03:04:32 +0000 | [diff] [blame] | 22 | AM_INIT_AUTOMAKE(flac, 1.0) |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 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 | |
Josh Coalson | def8eb8 | 2001-05-23 22:08:27 +0000 | [diff] [blame] | 33 | AC_CANONICAL_HOST |
| 34 | case $host_cpu in |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 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) ;; |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 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) |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 42 | case "$host" in |
Josh Coalson | be00e30 | 2001-06-21 06:34:15 +0000 | [diff] [blame] | 43 | i[3-6]86-*-openbsd*) OBJ_FORMAT=aoutb ;; |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 44 | *) OBJ_FORMAT=elf ;; |
| 45 | esac |
| 46 | AC_SUBST(OBJ_FORMAT) |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 47 | |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 48 | if test x$cpu_ia32 = xtrue ; then |
| 49 | AC_DEFINE(FLAC__ALIGN_MALLOC_DATA) |
| 50 | fi |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 51 | |
| 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) |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 54 | if test x$asm_opt = xno ; then |
| 55 | AC_DEFINE(FLAC__NO_ASM) |
| 56 | fi |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 57 | |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 58 | AC_ARG_ENABLE(debug, |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 59 | [ --enable-debug Turn on debugging], |
| 60 | [case "${enableval}" in |
| 61 | yes) debug=true ;; |
| 62 | no) debug=false ;; |
| 63 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; |
| 64 | esac],[debug=false]) |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 65 | AM_CONDITIONAL(DEBUG, test x$debug = xtrue) |
| 66 | |
Josh Coalson | d01b13a | 2001-07-18 00:27:06 +0000 | [diff] [blame] | 67 | AC_ARG_ENABLE(sse_os, |
| 68 | [ --sse-os Enable SSE support by asserting that the OS supports SSE instructions], |
| 69 | [case "${enableval}" in |
| 70 | yes) sse_os=true ;; |
| 71 | no) sse_os=false ;; |
| 72 | *) AC_MSG_ERROR(bad value ${enableval} for --sse-os) ;; |
| 73 | esac],[sse_os=false]) |
| 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) |
| 77 | fi |
| 78 | |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 79 | 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] | 80 | AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x) |
| 81 | |
| 82 | AC_CHECK_PROGS(NASM, nasm) |
| 83 | AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM") |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 84 | if test -n "$NASM" ; then |
| 85 | AC_DEFINE(FLAC__HAS_NASM) |
| 86 | fi |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 87 | |
Josh Coalson | 6ca4b1b | 2001-06-29 02:54:59 +0000 | [diff] [blame] | 88 | dnl Check for type sizes |
| 89 | |
| 90 | AC_CHECK_SIZEOF(short) |
| 91 | AC_CHECK_SIZEOF(int) |
| 92 | AC_CHECK_SIZEOF(long) |
| 93 | AC_CHECK_SIZEOF(long long) |
| 94 | |
| 95 | case 2 in |
| 96 | $ac_cv_sizeof_short) FLaC__SIZE16="short" ; FLaC__USIZE16="unsigned short";; |
| 97 | $ac_cv_sizeof_int) FLaC__SIZE16="int" ; FLaC__USIZE16="unsigned int";; |
| 98 | esac |
| 99 | |
| 100 | case 4 in |
| 101 | $ac_cv_sizeof_short) FLaC__SIZE32="short" ; FLaC__USIZE32="unsigned short";; |
| 102 | $ac_cv_sizeof_int) FLaC__SIZE32="int" ; FLaC__USIZE32="unsigned int";; |
| 103 | $ac_cv_sizeof_long) FLaC__SIZE32="long" ; FLaC__USIZE32="unsigned long";; |
| 104 | esac |
| 105 | |
| 106 | case 8 in |
| 107 | $ac_cv_sizeof_int) FLaC__SIZE64="int" ; FLaC__USIZE64="unsigned int";; |
| 108 | $ac_cv_sizeof_long) FLaC__SIZE64="long" ; FLaC__USIZE64="unsigned long";; |
| 109 | $ac_cv_sizeof_long_long) FLaC__SIZE64="long long" ; FLaC__USIZE64="unsigned long long";; |
| 110 | esac |
| 111 | |
| 112 | if test -z "$FLaC__SIZE16"; then |
| 113 | AC_MSG_ERROR(No 16 bit type found on this platform!) |
| 114 | fi |
| 115 | if test -z "$FLaC__USIZE16"; then |
| 116 | AC_MSG_ERROR(No unsigned 16 bit type found on this platform!) |
| 117 | fi |
| 118 | if test -z "$FLaC__SIZE32"; then |
| 119 | AC_MSG_ERROR(No 32 bit type found on this platform!) |
| 120 | fi |
| 121 | if test -z "$FLaC__USIZE32"; then |
| 122 | AC_MSG_ERROR(No unsigned 32 bit type found on this platform!) |
| 123 | fi |
| 124 | if test -z "$FLaC__SIZE64"; then |
| 125 | AC_MSG_WARN(No 64 bit type found on this platform!) |
| 126 | fi |
| 127 | if test -z "$FLaC__USIZE64"; then |
| 128 | AC_MSG_ERROR(No unsigned 64 bit type found on this platform!) |
| 129 | fi |
| 130 | |
| 131 | AC_SUBST(FLaC__SIZE16) |
| 132 | AC_SUBST(FLaC__USIZE16) |
| 133 | AC_SUBST(FLaC__SIZE32) |
| 134 | AC_SUBST(FLaC__USIZE32) |
| 135 | AC_SUBST(FLaC__SIZE64) |
| 136 | AC_SUBST(FLaC__USIZE64) |
| 137 | |
Josh Coalson | 9ea7e2c | 2001-07-19 00:19:25 +0000 | [diff] [blame] | 138 | SAVE_CFLAGS="$CFLAGS" |
Josh Coalson | 4c8f73a | 2001-07-22 07:27:45 +0000 | [diff] [blame^] | 139 | CFLAGS='-I$(srcdir)/include -I $(top_srcdir)/include -Wall -W' |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 140 | if test x$debug = xtrue; then |
Josh Coalson | 51f2bbf | 2001-07-19 00:22:47 +0000 | [diff] [blame] | 141 | CFLAGS="$CFLAGS -g -O0 -DDEBUG" |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 142 | else |
Josh Coalson | 51f2bbf | 2001-07-19 00:22:47 +0000 | [diff] [blame] | 143 | CFLAGS="$CFLAGS -O3 -DNDEBUG" |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 144 | if test x$GCC = xyes; then |
Josh Coalson | 9bab041 | 2001-07-20 23:44:35 +0000 | [diff] [blame] | 145 | CFLAGS="$CFLAGS -fomit-frame-pointer -funroll-loops -finline-functions -Winline -DFLaC__INLINE=__inline__" |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 146 | fi |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 147 | fi |
Josh Coalson | 9ea7e2c | 2001-07-19 00:19:25 +0000 | [diff] [blame] | 148 | CFLAGS="$CFLAGS $SAVE_CFLAGS" |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 149 | |
| 150 | AC_OUTPUT( Makefile \ |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 151 | src/Makefile \ |
| 152 | src/libFLAC/Makefile \ |
| 153 | src/libFLAC/ia32/Makefile \ |
Josh Coalson | 4c8f73a | 2001-07-22 07:27:45 +0000 | [diff] [blame^] | 154 | src/libFLAC/include/Makefile \ |
| 155 | src/libFLAC/include/private/Makefile \ |
| 156 | src/libFLAC/include/protected/Makefile \ |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 157 | src/flac/Makefile \ |
| 158 | src/metaflac/Makefile \ |
| 159 | src/plugin_xmms/Makefile \ |
| 160 | src/test_streams/Makefile \ |
| 161 | src/test_unit/Makefile \ |
| 162 | include/Makefile \ |
| 163 | include/FLAC/Makefile \ |
Josh Coalson | 6ca4b1b | 2001-06-29 02:54:59 +0000 | [diff] [blame] | 164 | include/FLAC/ordinals.h \ |
Josh Coalson | 4c8f73a | 2001-07-22 07:27:45 +0000 | [diff] [blame^] | 165 | doc/Makefile \ |
| 166 | doc/images/Makefile \ |
| 167 | doc/ru/Makefile \ |
| 168 | man/Makefile \ |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 169 | test/Makefile \ |
| 170 | ) |