Josh Coalson | 6b05bc5 | 2001-06-08 00:13:21 +0000 | [diff] [blame] | 1 | # FLAC - Free Lossless Audio Codec |
Josh Coalson | 1152f9f | 2002-01-26 18:05:12 +0000 | [diff] [blame] | 2 | # Copyright (C) 2001,2002 Josh Coalson |
Josh Coalson | 6b05bc5 | 2001-06-08 00:13:21 +0000 | [diff] [blame] | 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 | 7fd3737 | 2002-06-01 05:23:37 +0000 | [diff] [blame] | 22 | AM_INIT_AUTOMAKE(flac, 1.0.3) |
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 | |
Josh Coalson | 57ba6f4 | 2002-06-07 05:27:37 +0000 | [diff] [blame^] | 31 | AC_PROG_CXX |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 32 | AC_PROG_MAKE_SET |
| 33 | |
Josh Coalson | 5a804ca | 2002-05-17 06:08:13 +0000 | [diff] [blame] | 34 | dnl check for getopt in standard library |
| 35 | dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) |
| 36 | AC_CHECK_FUNCS(getopt_long, [], []) |
| 37 | |
Josh Coalson | def8eb8 | 2001-05-23 22:08:27 +0000 | [diff] [blame] | 38 | AC_CANONICAL_HOST |
Josh Coalson | 5a804ca | 2002-05-17 06:08:13 +0000 | [diff] [blame] | 39 | case "$host_cpu" in |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 40 | i*86) cpu_ia32=true ; AC_DEFINE(FLAC__CPU_IA32) ;; |
| 41 | powerpc) cpu_ppc=true ; AC_DEFINE(FLAC__CPU_PPC) ;; |
| 42 | sparc) cpu_sparc=true ; AC_DEFINE(FLAC__CPU_SPARC) ;; |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 43 | esac |
| 44 | AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue) |
| 45 | AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue) |
| 46 | AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue) |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 47 | case "$host" in |
Josh Coalson | 4ca5ec9 | 2001-08-13 21:58:49 +0000 | [diff] [blame] | 48 | i[[3-6]]86-*-openbsd*) OBJ_FORMAT=aoutb ;; |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 49 | *) OBJ_FORMAT=elf ;; |
| 50 | esac |
| 51 | AC_SUBST(OBJ_FORMAT) |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 52 | |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 53 | if test x$cpu_ia32 = xtrue ; then |
| 54 | AC_DEFINE(FLAC__ALIGN_MALLOC_DATA) |
| 55 | fi |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 56 | |
| 57 | AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes) |
| 58 | AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno) |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 59 | if test x$asm_opt = xno ; then |
| 60 | AC_DEFINE(FLAC__NO_ASM) |
| 61 | fi |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 62 | |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 63 | AC_ARG_ENABLE(debug, |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 64 | [ --enable-debug Turn on debugging], |
| 65 | [case "${enableval}" in |
| 66 | yes) debug=true ;; |
| 67 | no) debug=false ;; |
| 68 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; |
| 69 | esac],[debug=false]) |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 70 | AM_CONDITIONAL(DEBUG, test x$debug = xtrue) |
| 71 | |
Josh Coalson | bb14ae8 | 2001-12-04 06:46:35 +0000 | [diff] [blame] | 72 | AC_ARG_ENABLE(sse, |
| 73 | [ --enable-sse Enable SSE support by asserting that the OS supports SSE instructions], |
Josh Coalson | d01b13a | 2001-07-18 00:27:06 +0000 | [diff] [blame] | 74 | [case "${enableval}" in |
| 75 | yes) sse_os=true ;; |
| 76 | no) sse_os=false ;; |
Josh Coalson | bb14ae8 | 2001-12-04 06:46:35 +0000 | [diff] [blame] | 77 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;; |
Josh Coalson | d01b13a | 2001-07-18 00:27:06 +0000 | [diff] [blame] | 78 | esac],[sse_os=false]) |
| 79 | AM_CONDITIONAL(FLaC__SSE_OS, test x$sse_os = xtrue) |
| 80 | if test x$sse_os = xtrue ; then |
| 81 | AC_DEFINE(FLAC__SSE_OS) |
| 82 | fi |
| 83 | |
Josh Coalson | bb14ae8 | 2001-12-04 06:46:35 +0000 | [diff] [blame] | 84 | AC_ARG_ENABLE(3dnow, |
| 85 | [ --enable-3dnow Enable 3DNOW! support], |
Josh Coalson | c69f878 | 2001-11-13 23:08:22 +0000 | [diff] [blame] | 86 | [case "${enableval}" in |
| 87 | yes) use_3dnow=true ;; |
| 88 | no) use_3dnow=false ;; |
Josh Coalson | bb14ae8 | 2001-12-04 06:46:35 +0000 | [diff] [blame] | 89 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;; |
Josh Coalson | c69f878 | 2001-11-13 23:08:22 +0000 | [diff] [blame] | 90 | esac],[use_3dnow=false]) |
| 91 | AM_CONDITIONAL(FLaC__USE_3DNOW, test x$use_3dnow = xtrue) |
| 92 | if test x$use_3dnow = xtrue ; then |
| 93 | AC_DEFINE(FLAC__USE_3DNOW) |
| 94 | fi |
| 95 | |
Matt Zimmerman | 548175c | 2001-11-01 11:23:32 +0000 | [diff] [blame] | 96 | AC_CHECK_LIB(ogg, ogg_stream_init, |
| 97 | [LIBS="$LIBS -logg"; have_ogg=yes], |
| 98 | [AC_MSG_WARN([*** Ogg development enviroment not installed - ogg support will not be built])]) |
Josh Coalson | c8a7d35 | 2001-11-11 03:59:46 +0000 | [diff] [blame] | 99 | AM_CONDITIONAL(FLaC__HAS_OGG, [test x$have_ogg = xyes]) |
| 100 | if test x$have_ogg = xyes ; then |
| 101 | AC_DEFINE(FLAC__HAS_OGG) |
| 102 | fi |
Josh Coalson | f7fc5c8 | 2001-10-31 18:31:36 +0000 | [diff] [blame] | 103 | |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 104 | 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] | 105 | AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x) |
| 106 | |
Josh Coalson | 5a804ca | 2002-05-17 06:08:13 +0000 | [diff] [blame] | 107 | SHARE_LIBS='$(top_builddir)/src/share/libutf8.a $(top_builddir)/src/share/libgetopt.a' |
| 108 | |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 109 | AC_CHECK_PROGS(NASM, nasm) |
| 110 | AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM") |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 111 | if test -n "$NASM" ; then |
| 112 | AC_DEFINE(FLAC__HAS_NASM) |
| 113 | fi |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 114 | |
Josh Coalson | 6ca4b1b | 2001-06-29 02:54:59 +0000 | [diff] [blame] | 115 | dnl Check for type sizes |
| 116 | |
| 117 | AC_CHECK_SIZEOF(short) |
| 118 | AC_CHECK_SIZEOF(int) |
| 119 | AC_CHECK_SIZEOF(long) |
| 120 | AC_CHECK_SIZEOF(long long) |
| 121 | |
| 122 | case 2 in |
| 123 | $ac_cv_sizeof_short) FLaC__SIZE16="short" ; FLaC__USIZE16="unsigned short";; |
| 124 | $ac_cv_sizeof_int) FLaC__SIZE16="int" ; FLaC__USIZE16="unsigned int";; |
| 125 | esac |
| 126 | |
| 127 | case 4 in |
| 128 | $ac_cv_sizeof_short) FLaC__SIZE32="short" ; FLaC__USIZE32="unsigned short";; |
| 129 | $ac_cv_sizeof_int) FLaC__SIZE32="int" ; FLaC__USIZE32="unsigned int";; |
| 130 | $ac_cv_sizeof_long) FLaC__SIZE32="long" ; FLaC__USIZE32="unsigned long";; |
| 131 | esac |
| 132 | |
| 133 | case 8 in |
| 134 | $ac_cv_sizeof_int) FLaC__SIZE64="int" ; FLaC__USIZE64="unsigned int";; |
| 135 | $ac_cv_sizeof_long) FLaC__SIZE64="long" ; FLaC__USIZE64="unsigned long";; |
| 136 | $ac_cv_sizeof_long_long) FLaC__SIZE64="long long" ; FLaC__USIZE64="unsigned long long";; |
| 137 | esac |
| 138 | |
| 139 | if test -z "$FLaC__SIZE16"; then |
| 140 | AC_MSG_ERROR(No 16 bit type found on this platform!) |
| 141 | fi |
| 142 | if test -z "$FLaC__USIZE16"; then |
| 143 | AC_MSG_ERROR(No unsigned 16 bit type found on this platform!) |
| 144 | fi |
| 145 | if test -z "$FLaC__SIZE32"; then |
| 146 | AC_MSG_ERROR(No 32 bit type found on this platform!) |
| 147 | fi |
| 148 | if test -z "$FLaC__USIZE32"; then |
| 149 | AC_MSG_ERROR(No unsigned 32 bit type found on this platform!) |
| 150 | fi |
| 151 | if test -z "$FLaC__SIZE64"; then |
| 152 | AC_MSG_WARN(No 64 bit type found on this platform!) |
| 153 | fi |
| 154 | if test -z "$FLaC__USIZE64"; then |
| 155 | AC_MSG_ERROR(No unsigned 64 bit type found on this platform!) |
| 156 | fi |
| 157 | |
| 158 | AC_SUBST(FLaC__SIZE16) |
| 159 | AC_SUBST(FLaC__USIZE16) |
| 160 | AC_SUBST(FLaC__SIZE32) |
| 161 | AC_SUBST(FLaC__USIZE32) |
| 162 | AC_SUBST(FLaC__SIZE64) |
| 163 | AC_SUBST(FLaC__USIZE64) |
| 164 | |
Josh Coalson | 5a804ca | 2002-05-17 06:08:13 +0000 | [diff] [blame] | 165 | AC_SUBST(SHARE_LIBS) |
| 166 | |
Josh Coalson | 57ba6f4 | 2002-06-07 05:27:37 +0000 | [diff] [blame^] | 167 | OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include' |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 168 | if test x$debug = xtrue; then |
Josh Coalson | 57ba6f4 | 2002-06-07 05:27:37 +0000 | [diff] [blame^] | 169 | OUR_CFLAGS_TAIL="-g -O0 -DDEBUG" |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 170 | else |
Josh Coalson | 57ba6f4 | 2002-06-07 05:27:37 +0000 | [diff] [blame^] | 171 | OUR_CFLAGS_TAIL="-O3 -DNDEBUG" |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 172 | if test x$GCC = xyes; then |
Josh Coalson | 57ba6f4 | 2002-06-07 05:27:37 +0000 | [diff] [blame^] | 173 | OUR_CFLAGS_TAIL="$OUR_CFLAGS_TAIL -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__" |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 174 | fi |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 175 | fi |
Josh Coalson | 57ba6f4 | 2002-06-07 05:27:37 +0000 | [diff] [blame^] | 176 | CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS $OUR_CFLAGS_TAIL" |
| 177 | CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS $OUR_CFLAGS_TAIL" |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 178 | |
| 179 | AC_OUTPUT( Makefile \ |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 180 | src/Makefile \ |
| 181 | src/libFLAC/Makefile \ |
| 182 | src/libFLAC/ia32/Makefile \ |
Josh Coalson | 4c8f73a | 2001-07-22 07:27:45 +0000 | [diff] [blame] | 183 | src/libFLAC/include/Makefile \ |
| 184 | src/libFLAC/include/private/Makefile \ |
| 185 | src/libFLAC/include/protected/Makefile \ |
Josh Coalson | 57ba6f4 | 2002-06-07 05:27:37 +0000 | [diff] [blame^] | 186 | src/libFLAC++/Makefile \ |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 187 | src/flac/Makefile \ |
| 188 | src/metaflac/Makefile \ |
| 189 | src/plugin_xmms/Makefile \ |
Josh Coalson | 5a804ca | 2002-05-17 06:08:13 +0000 | [diff] [blame] | 190 | src/share/Makefile \ |
Josh Coalson | 57ba6f4 | 2002-06-07 05:27:37 +0000 | [diff] [blame^] | 191 | src/test_libFLAC/Makefile \ |
| 192 | src/test_libFLAC++/Makefile \ |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 193 | src/test_streams/Makefile \ |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 194 | include/Makefile \ |
| 195 | include/FLAC/Makefile \ |
Josh Coalson | 6ca4b1b | 2001-06-29 02:54:59 +0000 | [diff] [blame] | 196 | include/FLAC/ordinals.h \ |
Josh Coalson | 5a804ca | 2002-05-17 06:08:13 +0000 | [diff] [blame] | 197 | include/FLAC++/Makefile \ |
| 198 | include/share/Makefile \ |
Josh Coalson | 4c8f73a | 2001-07-22 07:27:45 +0000 | [diff] [blame] | 199 | doc/Makefile \ |
| 200 | doc/images/Makefile \ |
| 201 | doc/ru/Makefile \ |
| 202 | man/Makefile \ |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 203 | test/Makefile \ |
| 204 | ) |