Josh Coalson | 6b05bc5 | 2001-06-08 00:13:21 +0000 | [diff] [blame] | 1 | # FLAC - Free Lossless Audio Codec |
Josh Coalson | afae69f | 2003-01-02 07:03:16 +0000 | [diff] [blame] | 2 | # Copyright (C) 2001,2002,2003 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 | 53496dd | 2003-01-25 06:04:55 +0000 | [diff] [blame] | 22 | AM_INIT_AUTOMAKE(flac, 1.1.0) |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 23 | |
Matt Zimmerman | 057b532 | 2002-10-05 14:41:19 +0000 | [diff] [blame] | 24 | # Don't automagically regenerate autoconf/automake generated files unless |
| 25 | # explicitly requested. Eases autobuilding -mdz |
| 26 | AM_MAINTAINER_MODE |
| 27 | |
Josh Coalson | e2fece2 | 2002-09-09 21:54:28 +0000 | [diff] [blame] | 28 | # Function to configure paths for id3lib; search for 'meat' to get to the end. |
| 29 | # adapted from ogg.m4 |
| 30 | # This is here until id3lib comes with an equivalent. |
| 31 | # It is inline with configure.in instead of a separate file as a courtesy to users unaware of the -I flag to aclocal |
| 32 | dnl LOCAL__PATH_ID3LIB([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) |
| 33 | dnl Test for libid3, and define ID3LIB_CFLAGS and ID3LIB_LIBS |
| 34 | dnl |
| 35 | AC_DEFUN(LOCAL__PATH_ID3LIB, |
| 36 | [dnl |
| 37 | dnl Get the cflags and libraries |
| 38 | dnl |
| 39 | AC_ARG_WITH(id3lib,[ --with-id3lib=PFX Prefix where libid3 is installed (optional)], id3lib_prefix="$withval", id3lib_prefix="") |
| 40 | AC_ARG_WITH(id3lib-libraries,[ --with-id3lib-libraries=DIR Directory where libid3 library is installed (optional)], id3lib_libraries="$withval", id3lib_libraries="") |
| 41 | AC_ARG_WITH(id3lib-includes,[ --with-id3lib-includes=DIR Directory where libid3 header files are installed (optional)], id3lib_includes="$withval", id3lib_includes="") |
| 42 | AC_ARG_ENABLE(id3libtest, [ --disable-id3libtest Do not try to compile and run a test id3lib program],, enable_id3libtest=yes) |
| 43 | |
| 44 | if test "x$id3lib_libraries" != "x" ; then |
| 45 | ID3LIB_LIBS="-L$id3lib_libraries" |
| 46 | elif test "x$id3lib_prefix" != "x" ; then |
| 47 | ID3LIB_LIBS="-L$id3lib_prefix/lib" |
| 48 | elif test "x$prefix" != "xNONE" ; then |
| 49 | ID3LIB_LIBS="-L$prefix/lib" |
| 50 | fi |
| 51 | |
| 52 | ID3LIB_LIBS="$ID3LIB_LIBS -lid3" |
| 53 | |
| 54 | if test "x$id3lib_includes" != "x" ; then |
| 55 | ID3LIB_CFLAGS="-I$id3lib_includes" |
| 56 | elif test "x$id3lib_prefix" != "x" ; then |
| 57 | ID3LIB_CFLAGS="-I$id3lib_prefix/include" |
| 58 | elif test "$prefix" != "xNONE"; then |
| 59 | ID3LIB_CFLAGS="-I$prefix/include" |
| 60 | fi |
| 61 | |
| 62 | AC_MSG_CHECKING(for id3lib) |
| 63 | |
| 64 | |
| 65 | if test "x$enable_id3libtest" = "xyes" ; then |
| 66 | id3lib_found="" |
| 67 | else |
| 68 | id3lib_found="yes" |
| 69 | fi |
| 70 | dnl There is some confusion over what libraries libid3 needs |
| 71 | dnl so we must be pessimistic and try all permutations: |
| 72 | dnl "-lid3" "-lid3 -lstdc++" "-lid3 -lz" "-lid3 -lz -lstdc++" |
| 73 | for xtra_stdcpp in "" " -lstdc++" ; do |
| 74 | for xtra_z in "" " -lz" ; do |
| 75 | if test "x$id3lib_found" = "x" ; then |
| 76 | ac_save_CFLAGS="$CFLAGS" |
| 77 | ac_save_LIBS="$LIBS" |
| 78 | CFLAGS="$CFLAGS $ID3LIB_CFLAGS" |
| 79 | LIBS="$LIBS $ID3LIB_LIBS$xtra_stdcpp$xtra_z" |
| 80 | rm -f conf.id3libtest |
| 81 | AC_TRY_RUN([ |
| 82 | #include <stdio.h> |
| 83 | #include <stdlib.h> |
| 84 | #include <string.h> |
| 85 | #include <id3.h> |
| 86 | int main () { system("touch conf.id3libtest"); return 0; } |
| 87 | ], id3lib_found=yes,,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
| 88 | CFLAGS="$ac_save_CFLAGS" |
| 89 | LIBS="$ac_save_LIBS" |
| 90 | fi |
| 91 | if test "x$id3lib_found" = "xyes" ; then |
| 92 | ID3LIB_LIBS="$ID3LIB_LIBS$xtra_stdcpp$xtra_z" |
| 93 | fi |
| 94 | done |
| 95 | done |
| 96 | |
| 97 | if test "x$id3lib_found" = "xyes" ; then |
| 98 | AC_MSG_RESULT(yes) |
| 99 | ifelse([$1], , :, [$1]) |
| 100 | else |
| 101 | AC_MSG_RESULT(no) |
| 102 | if test -f conf.id3libtest ; then |
| 103 | : |
| 104 | else |
| 105 | echo "*** Could not run id3lib test program, checking why..." |
| 106 | CFLAGS="$CFLAGS $ID3LIB_CFLAGS" |
| 107 | LIBS="$LIBS $ID3LIB_LIBS" |
| 108 | AC_TRY_LINK([ |
| 109 | #include <stdio.h> |
| 110 | #include <id3.h> |
| 111 | ], [ return 0; ], |
| 112 | [ echo "*** The test program compiled, but did not run. This usually means" |
| 113 | echo "*** that the run-time linker is not finding id3lib or finding the wrong" |
| 114 | echo "*** version of id3lib. If it is not finding id3lib, you'll need to set your" |
| 115 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
| 116 | echo "*** to the installed location Also, make sure you have run ldconfig if that" |
| 117 | echo "*** is required on your system" |
| 118 | echo "***" |
| 119 | echo "*** If you have an old version installed, it is best to remove it, although" |
| 120 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], |
| 121 | [ echo "*** The test program failed to compile or link. See the file config.log for the" |
| 122 | echo "*** exact error that occured. This usually means id3lib was incorrectly installed" |
| 123 | echo "*** or that you have moved id3lib since it was installed." ]) |
| 124 | CFLAGS="$ac_save_CFLAGS" |
| 125 | LIBS="$ac_save_LIBS" |
| 126 | fi |
| 127 | ID3LIB_CFLAGS="" |
| 128 | ID3LIB_LIBS="" |
| 129 | ifelse([$2], , :, [$2]) |
| 130 | fi |
| 131 | AC_SUBST(ID3LIB_CFLAGS) |
| 132 | AC_SUBST(ID3LIB_LIBS) |
| 133 | rm -f conf.id3libtest |
| 134 | ]) |
| 135 | |
| 136 | |
| 137 | dnl Now the meat of configure.in: |
| 138 | |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 139 | # We need two libtools, one that builds both shared and static, and |
| 140 | # one that builds only static. This is because the resulting libtool |
| 141 | # does not allow us to choose which to build at runtime. |
| 142 | AM_PROG_LIBTOOL |
| 143 | sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool > libtool-disable-static |
| 144 | chmod +x libtool-disable-static |
| 145 | |
Josh Coalson | 57ba6f4 | 2002-06-07 05:27:37 +0000 | [diff] [blame] | 146 | AC_PROG_CXX |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 147 | AC_PROG_MAKE_SET |
| 148 | |
Josh Coalson | 5a804ca | 2002-05-17 06:08:13 +0000 | [diff] [blame] | 149 | dnl check for getopt in standard library |
| 150 | dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) |
| 151 | AC_CHECK_FUNCS(getopt_long, [], []) |
| 152 | |
Josh Coalson | def8eb8 | 2001-05-23 22:08:27 +0000 | [diff] [blame] | 153 | AC_CANONICAL_HOST |
Josh Coalson | 5a804ca | 2002-05-17 06:08:13 +0000 | [diff] [blame] | 154 | case "$host_cpu" in |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 155 | i*86) cpu_ia32=true ; AC_DEFINE(FLAC__CPU_IA32) ;; |
| 156 | powerpc) cpu_ppc=true ; AC_DEFINE(FLAC__CPU_PPC) ;; |
| 157 | sparc) cpu_sparc=true ; AC_DEFINE(FLAC__CPU_SPARC) ;; |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 158 | esac |
| 159 | AM_CONDITIONAL(FLaC__CPU_IA32, test x$cpu_ia32 = xtrue) |
| 160 | AM_CONDITIONAL(FLaC__CPU_PPC, test x$cpu_ppc = xtrue) |
| 161 | AM_CONDITIONAL(FLaC__CPU_SPARC, test x$cpu_sparc = xtrue) |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 162 | case "$host" in |
Josh Coalson | 4ca5ec9 | 2001-08-13 21:58:49 +0000 | [diff] [blame] | 163 | i[[3-6]]86-*-openbsd*) OBJ_FORMAT=aoutb ;; |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 164 | *) OBJ_FORMAT=elf ;; |
| 165 | esac |
| 166 | AC_SUBST(OBJ_FORMAT) |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 167 | |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 168 | if test x$cpu_ia32 = xtrue ; then |
| 169 | AC_DEFINE(FLAC__ALIGN_MALLOC_DATA) |
| 170 | fi |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 171 | |
| 172 | AC_ARG_ENABLE(asm-optimizations, [ --disable-asm-optimizations Don't use any assembly optimization routines], asm_opt=no, asm_opt=yes) |
| 173 | AM_CONDITIONAL(FLaC__NO_ASM, test x$asm_opt = xno) |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 174 | if test x$asm_opt = xno ; then |
| 175 | AC_DEFINE(FLAC__NO_ASM) |
| 176 | fi |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 177 | |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 178 | AC_ARG_ENABLE(debug, |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 179 | [ --enable-debug Turn on debugging], |
| 180 | [case "${enableval}" in |
| 181 | yes) debug=true ;; |
| 182 | no) debug=false ;; |
| 183 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; |
| 184 | esac],[debug=false]) |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 185 | AM_CONDITIONAL(DEBUG, test x$debug = xtrue) |
| 186 | |
Josh Coalson | bb14ae8 | 2001-12-04 06:46:35 +0000 | [diff] [blame] | 187 | AC_ARG_ENABLE(sse, |
| 188 | [ --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] | 189 | [case "${enableval}" in |
| 190 | yes) sse_os=true ;; |
| 191 | no) sse_os=false ;; |
Josh Coalson | bb14ae8 | 2001-12-04 06:46:35 +0000 | [diff] [blame] | 192 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;; |
Josh Coalson | d01b13a | 2001-07-18 00:27:06 +0000 | [diff] [blame] | 193 | esac],[sse_os=false]) |
| 194 | AM_CONDITIONAL(FLaC__SSE_OS, test x$sse_os = xtrue) |
| 195 | if test x$sse_os = xtrue ; then |
| 196 | AC_DEFINE(FLAC__SSE_OS) |
| 197 | fi |
| 198 | |
Josh Coalson | 28311cf | 2002-12-26 19:35:19 +0000 | [diff] [blame] | 199 | AC_ARG_ENABLE(3dnow, |
| 200 | [ --disable-3dnow Disable 3DNOW! optimizations], |
| 201 | [case "${enableval}" in |
| 202 | yes) use_3dnow=true ;; |
| 203 | no) use_3dnow=false ;; |
| 204 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;; |
| 205 | esac],[use_3dnow=true]) |
| 206 | AM_CONDITIONAL(FLaC__USE_3DNOW, test x$use_3dnow = xtrue) |
| 207 | if test x$use_3dnow = xtrue ; then |
Josh Coalson | c69f878 | 2001-11-13 23:08:22 +0000 | [diff] [blame] | 208 | AC_DEFINE(FLAC__USE_3DNOW) |
| 209 | fi |
| 210 | |
Josh Coalson | 3d73072 | 2003-01-14 06:59:50 +0000 | [diff] [blame] | 211 | AC_ARG_ENABLE(local-xmms-plugin, |
| 212 | [ --enable-local-xmms-plugin Install XMMS plugin to ~/.xmms/Plugins instead of system location], |
| 213 | [case "${enableval}" in |
| 214 | yes) install_xmms_plugin_locally=true ;; |
| 215 | no) install_xmms_plugin_locally=false ;; |
| 216 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-local-xmms-plugin) ;; |
| 217 | esac],[install_xmms_plugin_locally=false]) |
| 218 | AM_CONDITIONAL(FLaC__INSTALL_XMMS_PLUGIN_LOCALLY, test x$install_xmms_plugin_locally = xtrue) |
| 219 | |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 220 | AC_ARG_ENABLE(exhaustive-tests, |
Josh Coalson | b776793 | 2002-09-17 05:36:39 +0000 | [diff] [blame] | 221 | [ --enable-exhaustive-tests Enable exhaustive testing], |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 222 | [case "${enableval}" in |
| 223 | yes) exhaustive_tests=true ;; |
| 224 | no) exhaustive_tests=false ;; |
| 225 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-exhaustive-tests) ;; |
| 226 | esac],[exhaustive_tests=false]) |
| 227 | AM_CONDITIONAL(FLaC__EXHAUSTIVE_TESTS, test x$exhaustive_tests = xtrue) |
Josh Coalson | 962bb3b | 2002-12-28 07:08:31 +0000 | [diff] [blame] | 228 | if test x$exhaustive_tests = xtrue ; then |
| 229 | AC_DEFINE(FLAC__EXHAUSTIVE_TESTS) |
| 230 | fi |
Josh Coalson | d192362 | 2002-12-05 06:36:12 +0000 | [diff] [blame] | 231 | |
| 232 | AC_ARG_ENABLE(valgrind-testing, |
| 233 | [ --enable-valgrind-testing Run all tests inside Valgrind], |
| 234 | [case "${enableval}" in |
| 235 | yes) valgrind_testing=true ;; |
| 236 | no) valgrind_testing=false ;; |
| 237 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind-testing) ;; |
| 238 | esac],[valgrind_testing=false]) |
| 239 | AM_CONDITIONAL(FLaC__VALGRIND_TESTING, test x$valgrind_testing = xtrue) |
Josh Coalson | 962bb3b | 2002-12-28 07:08:31 +0000 | [diff] [blame] | 240 | if test x$valgrind_testing = xtrue ; then |
| 241 | AC_DEFINE(FLAC__VALGRIND_TESTING) |
| 242 | fi |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 243 | |
Josh Coalson | e2fece2 | 2002-09-09 21:54:28 +0000 | [diff] [blame] | 244 | dnl check for ogg library |
Josh Coalson | 3f6c998 | 2002-09-05 05:40:58 +0000 | [diff] [blame] | 245 | XIPH_PATH_OGG(have_ogg=yes, 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] | 246 | AM_CONDITIONAL(FLaC__HAS_OGG, [test x$have_ogg = xyes]) |
| 247 | if test x$have_ogg = xyes ; then |
| 248 | AC_DEFINE(FLAC__HAS_OGG) |
| 249 | fi |
Josh Coalson | f7fc5c8 | 2001-10-31 18:31:36 +0000 | [diff] [blame] | 250 | |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 251 | 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] | 252 | AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x) |
| 253 | |
Josh Coalson | 130cbb5 | 2002-07-16 16:12:27 +0000 | [diff] [blame] | 254 | dnl check for i18n(internationalization); these are from libiconv/gettext |
Josh Coalson | 412fa3b | 2002-07-11 06:15:30 +0000 | [diff] [blame] | 255 | AM_ICONV |
| 256 | AM_LANGINFO_CODESET |
| 257 | |
Josh Coalson | e2fece2 | 2002-09-09 21:54:28 +0000 | [diff] [blame] | 258 | dnl check for id3lib library |
| 259 | dnl LOCAL__PATH_ID3LIB is defined by us, and will be until such time as id3lib supplies one |
| 260 | LOCAL__PATH_ID3LIB(have_id3lib=yes, AC_MSG_WARN([*** id3lib not found - id3v2 support will not be built])) |
Josh Coalson | 412fa3b | 2002-07-11 06:15:30 +0000 | [diff] [blame] | 261 | AM_CONDITIONAL(FLaC__HAS_ID3LIB, [test x$have_id3lib = xyes]) |
| 262 | if test x$have_id3lib = xyes ; then |
| 263 | AC_DEFINE(FLAC__HAS_ID3LIB) |
Josh Coalson | 412fa3b | 2002-07-11 06:15:30 +0000 | [diff] [blame] | 264 | |
Josh Coalson | e2fece2 | 2002-09-09 21:54:28 +0000 | [diff] [blame] | 265 | dnl expected id3lib version for cross compiling |
Josh Coalson | 412fa3b | 2002-07-11 06:15:30 +0000 | [diff] [blame] | 266 | ID3LIB_MAJOR=3 |
| 267 | ID3LIB_MINOR=8 |
| 268 | ID3LIB_PATCH=0 |
| 269 | |
Josh Coalson | e2fece2 | 2002-09-09 21:54:28 +0000 | [diff] [blame] | 270 | CFLAGS_save_blah_blah_blah=$CFLAGS |
| 271 | CFLAGS="$ID3LIB_CFLAGS $CFLAGS" |
| 272 | LIBS_save_blah_blah_blah=$LIBS |
| 273 | LIBS="$ID3LIB_LIBS $LIBS" |
Josh Coalson | 412fa3b | 2002-07-11 06:15:30 +0000 | [diff] [blame] | 274 | AC_MSG_CHECKING(for id3lib version) |
| 275 | AC_TRY_RUN([ |
| 276 | #include <id3.h> |
| 277 | #include <stdio.h> |
Josh Coalson | 3d8a96e | 2002-08-27 05:51:19 +0000 | [diff] [blame] | 278 | int |
Josh Coalson | 412fa3b | 2002-07-11 06:15:30 +0000 | [diff] [blame] | 279 | main () |
| 280 | { |
Josh Coalson | 3d8a96e | 2002-08-27 05:51:19 +0000 | [diff] [blame] | 281 | FILE *output; |
| 282 | output=fopen("conftest.id3","w"); |
| 283 | fprintf(output,"ID3LIB_MAJOR=%d\nID3LIB_MINOR=%d\nID3LIB_PATCH=%d\n",ID3LIB_MAJOR_VERSION,ID3LIB_MINOR_VERSION,ID3LIB_PATCH_VERSION); |
| 284 | fclose(output); |
| 285 | exit(0); |
Josh Coalson | 412fa3b | 2002-07-11 06:15:30 +0000 | [diff] [blame] | 286 | } |
Josh Coalson | 1ce20b6 | 2002-10-23 22:18:37 +0000 | [diff] [blame] | 287 | ], . ./conftest.id3; echo "${ID3LIB_MAJOR}.${ID3LIB_MINOR}.${ID3LIB_PATCH}", AC_MSG_WARN(could not determine id3lib version),[echo $ac_n "cross compiling; assuming ${ID3LIB_MAJOR}.${ID3LIB_MINOR}.${ID3LIB_PATCH} $ac_c"]) |
Josh Coalson | 412fa3b | 2002-07-11 06:15:30 +0000 | [diff] [blame] | 288 | AC_DEFINE_UNQUOTED(ID3LIB_MAJOR, $ID3LIB_MAJOR) |
| 289 | AC_DEFINE_UNQUOTED(ID3LIB_MINOR, $ID3LIB_MINOR) |
| 290 | AC_DEFINE_UNQUOTED(ID3LIB_PATCH, $ID3LIB_PATCH) |
Josh Coalson | e2fece2 | 2002-09-09 21:54:28 +0000 | [diff] [blame] | 291 | CFLAGS=$CFLAGS_save_blah_blah_blah |
Josh Coalson | 412fa3b | 2002-07-11 06:15:30 +0000 | [diff] [blame] | 292 | LIBS=$LIBS_save_blah_blah_blah |
Josh Coalson | e2fece2 | 2002-09-09 21:54:28 +0000 | [diff] [blame] | 293 | fi |
Josh Coalson | 412fa3b | 2002-07-11 06:15:30 +0000 | [diff] [blame] | 294 | |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 295 | AC_CHECK_PROGS(DOXYGEN, doxygen) |
| 296 | AM_CONDITIONAL(FLaC__HAS_DOXYGEN, test -n "$DOXYGEN") |
| 297 | if test -n "$DOXYGEN" ; then |
| 298 | AC_DEFINE(FLAC__HAS_DOXYGEN) |
| 299 | fi |
| 300 | |
Josh Coalson | cf030c8 | 2001-05-23 20:59:48 +0000 | [diff] [blame] | 301 | AC_CHECK_PROGS(NASM, nasm) |
| 302 | AM_CONDITIONAL(FLaC__HAS_NASM, test -n "$NASM") |
Josh Coalson | 0e3576e | 2001-05-25 00:07:51 +0000 | [diff] [blame] | 303 | if test -n "$NASM" ; then |
| 304 | AC_DEFINE(FLAC__HAS_NASM) |
| 305 | fi |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 306 | |
Josh Coalson | 6ca4b1b | 2001-06-29 02:54:59 +0000 | [diff] [blame] | 307 | dnl Check for type sizes |
| 308 | |
| 309 | AC_CHECK_SIZEOF(short) |
| 310 | AC_CHECK_SIZEOF(int) |
| 311 | AC_CHECK_SIZEOF(long) |
| 312 | AC_CHECK_SIZEOF(long long) |
| 313 | |
| 314 | case 2 in |
| 315 | $ac_cv_sizeof_short) FLaC__SIZE16="short" ; FLaC__USIZE16="unsigned short";; |
| 316 | $ac_cv_sizeof_int) FLaC__SIZE16="int" ; FLaC__USIZE16="unsigned int";; |
| 317 | esac |
| 318 | |
| 319 | case 4 in |
| 320 | $ac_cv_sizeof_short) FLaC__SIZE32="short" ; FLaC__USIZE32="unsigned short";; |
| 321 | $ac_cv_sizeof_int) FLaC__SIZE32="int" ; FLaC__USIZE32="unsigned int";; |
| 322 | $ac_cv_sizeof_long) FLaC__SIZE32="long" ; FLaC__USIZE32="unsigned long";; |
| 323 | esac |
| 324 | |
| 325 | case 8 in |
| 326 | $ac_cv_sizeof_int) FLaC__SIZE64="int" ; FLaC__USIZE64="unsigned int";; |
| 327 | $ac_cv_sizeof_long) FLaC__SIZE64="long" ; FLaC__USIZE64="unsigned long";; |
| 328 | $ac_cv_sizeof_long_long) FLaC__SIZE64="long long" ; FLaC__USIZE64="unsigned long long";; |
| 329 | esac |
| 330 | |
| 331 | if test -z "$FLaC__SIZE16"; then |
| 332 | AC_MSG_ERROR(No 16 bit type found on this platform!) |
| 333 | fi |
| 334 | if test -z "$FLaC__USIZE16"; then |
| 335 | AC_MSG_ERROR(No unsigned 16 bit type found on this platform!) |
| 336 | fi |
| 337 | if test -z "$FLaC__SIZE32"; then |
| 338 | AC_MSG_ERROR(No 32 bit type found on this platform!) |
| 339 | fi |
| 340 | if test -z "$FLaC__USIZE32"; then |
| 341 | AC_MSG_ERROR(No unsigned 32 bit type found on this platform!) |
| 342 | fi |
| 343 | if test -z "$FLaC__SIZE64"; then |
| 344 | AC_MSG_WARN(No 64 bit type found on this platform!) |
| 345 | fi |
| 346 | if test -z "$FLaC__USIZE64"; then |
| 347 | AC_MSG_ERROR(No unsigned 64 bit type found on this platform!) |
| 348 | fi |
| 349 | |
| 350 | AC_SUBST(FLaC__SIZE16) |
| 351 | AC_SUBST(FLaC__USIZE16) |
| 352 | AC_SUBST(FLaC__SIZE32) |
| 353 | AC_SUBST(FLaC__USIZE32) |
| 354 | AC_SUBST(FLaC__SIZE64) |
| 355 | AC_SUBST(FLaC__USIZE64) |
| 356 | |
Josh Coalson | 57ba6f4 | 2002-06-07 05:27:37 +0000 | [diff] [blame] | 357 | 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] | 358 | if test x$debug = xtrue; then |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 359 | OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG" |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 360 | else |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 361 | OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -O3 -DNDEBUG" |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 362 | if test x$GCC = xyes; then |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 363 | OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -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] | 364 | fi |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 365 | fi |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 366 | CFLAGS="$OUR_CFLAGS_HEAD $CFLAGS" |
| 367 | CXXFLAGS="$OUR_CFLAGS_HEAD $CXXFLAGS" |
Josh Coalson | 9f429ba | 2001-01-19 22:39:39 +0000 | [diff] [blame] | 368 | |
Matt Zimmerman | e525917 | 2002-10-10 16:51:06 +0000 | [diff] [blame] | 369 | AM_CONFIG_HEADER(config.h) |
Josh Coalson | f0a8c4f | 2003-01-15 03:17:51 +0000 | [diff] [blame] | 370 | AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries]) |
Matt Zimmerman | e525917 | 2002-10-10 16:51:06 +0000 | [diff] [blame] | 371 | AH_TEMPLATE(FLAC__CPU_IA32, [define if building for ia32/i386]) |
| 372 | AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC]) |
| 373 | AH_TEMPLATE(FLAC__CPU_SPARC, [define if building for SPARC]) |
Josh Coalson | 3238673 | 2003-01-02 07:29:58 +0000 | [diff] [blame] | 374 | AH_TEMPLATE(FLAC__EXHAUSTIVE_TESTS, [define to run even more tests]) |
| 375 | AH_TEMPLATE(FLAC__VALGRIND_TESTING, [define to enable use of Valgrind in testers]) |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 376 | AH_TEMPLATE(FLAC__HAS_DOXYGEN, [define if you have Doxygen]) |
Matt Zimmerman | e525917 | 2002-10-10 16:51:06 +0000 | [diff] [blame] | 377 | AH_TEMPLATE(FLAC__HAS_ID3LIB, [define if you have the id3lib library]) |
| 378 | AH_TEMPLATE(FLAC__HAS_NASM, [define if you have the NASM assembler]) |
| 379 | AH_TEMPLATE(FLAC__HAS_OGG, [define if you have the ogg library]) |
| 380 | AH_TEMPLATE(FLAC__NO_ASM, [define to disable use of assembly code]) |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 381 | AH_TEMPLATE(FLAC__SSE_OS, [define if your operating system supports SSE instructions]) |
Matt Zimmerman | e525917 | 2002-10-10 16:51:06 +0000 | [diff] [blame] | 382 | AH_TEMPLATE(FLAC__USE_3DNOW, [define to enable use of 3Dnow! instructions]) |
| 383 | AH_TEMPLATE(ID3LIB_MAJOR, [define to major version number of id3lib]) |
| 384 | AH_TEMPLATE(ID3LIB_MINOR, [define to minor version number of id3lib]) |
| 385 | AH_TEMPLATE(ID3LIB_PATCH, [define to patch level of id3lib]) |
| 386 | |
uid38180 | b4bc14b | 2002-09-09 20:53:08 +0000 | [diff] [blame] | 387 | AC_OUTPUT( \ |
Josh Coalson | 1d96b7e | 2002-07-24 06:13:33 +0000 | [diff] [blame] | 388 | Makefile \ |
| 389 | src/Makefile \ |
| 390 | src/libFLAC/Makefile \ |
| 391 | src/libFLAC/ia32/Makefile \ |
| 392 | src/libFLAC/include/Makefile \ |
| 393 | src/libFLAC/include/private/Makefile \ |
| 394 | src/libFLAC/include/protected/Makefile \ |
| 395 | src/libFLAC++/Makefile \ |
Josh Coalson | c49380d | 2002-08-07 17:38:08 +0000 | [diff] [blame] | 396 | src/libOggFLAC/Makefile \ |
| 397 | src/libOggFLAC/include/Makefile \ |
| 398 | src/libOggFLAC/include/protected/Makefile \ |
| 399 | src/libOggFLAC++/Makefile \ |
Josh Coalson | 1d96b7e | 2002-07-24 06:13:33 +0000 | [diff] [blame] | 400 | src/flac/Makefile \ |
| 401 | src/metaflac/Makefile \ |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 402 | src/monkeys_audio_utilities/Makefile \ |
Josh Coalson | 1f99eac | 2002-08-23 06:45:23 +0000 | [diff] [blame] | 403 | src/monkeys_audio_utilities/flac_mac/Makefile \ |
| 404 | src/monkeys_audio_utilities/flac_ren/Makefile \ |
Josh Coalson | 1f99eac | 2002-08-23 06:45:23 +0000 | [diff] [blame] | 405 | src/plugin_common/Makefile \ |
Josh Coalson | 1d16a52 | 2002-11-01 04:26:14 +0000 | [diff] [blame] | 406 | src/plugin_common/include/Makefile \ |
| 407 | src/plugin_common/include/private/Makefile \ |
Josh Coalson | 1f99eac | 2002-08-23 06:45:23 +0000 | [diff] [blame] | 408 | src/plugin_winamp2/Makefile \ |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 409 | src/plugin_winamp2/include/Makefile \ |
| 410 | src/plugin_winamp2/include/winamp2/Makefile \ |
Josh Coalson | 1f99eac | 2002-08-23 06:45:23 +0000 | [diff] [blame] | 411 | src/plugin_winamp3/Makefile \ |
Josh Coalson | 1d96b7e | 2002-07-24 06:13:33 +0000 | [diff] [blame] | 412 | src/plugin_xmms/Makefile \ |
| 413 | src/share/Makefile \ |
Josh Coalson | 3c043fd | 2002-10-25 04:57:05 +0000 | [diff] [blame] | 414 | src/share/gain_analysis/Makefile \ |
| 415 | src/share/getopt/Makefile \ |
Josh Coalson | b8f8a07 | 2002-11-07 05:07:30 +0000 | [diff] [blame] | 416 | src/share/grabbag/Makefile \ |
Josh Coalson | 3c043fd | 2002-10-25 04:57:05 +0000 | [diff] [blame] | 417 | src/share/utf8/Makefile \ |
Josh Coalson | 1dca1c2 | 2002-12-03 06:30:14 +0000 | [diff] [blame] | 418 | src/test_grabbag/Makefile \ |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 419 | src/test_grabbag/cuesheet/Makefile \ |
Josh Coalson | 1d96b7e | 2002-07-24 06:13:33 +0000 | [diff] [blame] | 420 | src/test_libFLAC/Makefile \ |
| 421 | src/test_libFLAC++/Makefile \ |
Josh Coalson | 1f99eac | 2002-08-23 06:45:23 +0000 | [diff] [blame] | 422 | src/test_libOggFLAC/Makefile \ |
| 423 | src/test_libOggFLAC++/Makefile \ |
Josh Coalson | 1d96b7e | 2002-07-24 06:13:33 +0000 | [diff] [blame] | 424 | src/test_streams/Makefile \ |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 425 | include/Makefile \ |
| 426 | include/FLAC/Makefile \ |
Josh Coalson | 6ca4b1b | 2001-06-29 02:54:59 +0000 | [diff] [blame] | 427 | include/FLAC/ordinals.h \ |
Josh Coalson | 5a804ca | 2002-05-17 06:08:13 +0000 | [diff] [blame] | 428 | include/FLAC++/Makefile \ |
Josh Coalson | 1f99eac | 2002-08-23 06:45:23 +0000 | [diff] [blame] | 429 | include/OggFLAC/Makefile \ |
| 430 | include/OggFLAC++/Makefile \ |
Josh Coalson | 5a804ca | 2002-05-17 06:08:13 +0000 | [diff] [blame] | 431 | include/share/Makefile \ |
Josh Coalson | b8f8a07 | 2002-11-07 05:07:30 +0000 | [diff] [blame] | 432 | include/share/grabbag/Makefile \ |
Josh Coalson | 4c8f73a | 2001-07-22 07:27:45 +0000 | [diff] [blame] | 433 | doc/Makefile \ |
Josh Coalson | 130cbb5 | 2002-07-16 16:12:27 +0000 | [diff] [blame] | 434 | doc/html/Makefile \ |
| 435 | doc/html/images/Makefile \ |
| 436 | doc/html/ru/Makefile \ |
Josh Coalson | 4c8f73a | 2001-07-22 07:27:45 +0000 | [diff] [blame] | 437 | man/Makefile \ |
Josh Coalson | 1d96b7e | 2002-07-24 06:13:33 +0000 | [diff] [blame] | 438 | test/Makefile \ |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 439 | test/cuesheets/Makefile \ |
Josh Coalson | 1f99eac | 2002-08-23 06:45:23 +0000 | [diff] [blame] | 440 | build/Makefile \ |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 441 | obj/Makefile \ |
| 442 | obj/debug/Makefile \ |
Josh Coalson | b74fc98 | 2002-11-20 06:40:08 +0000 | [diff] [blame] | 443 | obj/debug/bin/Makefile \ |
| 444 | obj/debug/lib/Makefile \ |
Josh Coalson | 2080974 | 2003-01-10 04:39:20 +0000 | [diff] [blame] | 445 | obj/release/Makefile \ |
Josh Coalson | b74fc98 | 2002-11-20 06:40:08 +0000 | [diff] [blame] | 446 | obj/release/bin/Makefile \ |
| 447 | obj/release/lib/Makefile \ |
Josh Coalson | 1f99eac | 2002-08-23 06:45:23 +0000 | [diff] [blame] | 448 | flac.pbproj/Makefile \ |
Josh Coalson | da0adb2 | 2001-06-18 23:07:19 +0000 | [diff] [blame] | 449 | ) |