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