dnl configure.ac: source for the configure script dnl copyright by the mpg123 project - free software under the terms of the LGPL 2.1 dnl see COPYING and AUTHORS files in distribution or http://mpg123.org dnl initially written by Nicholas J. Humfrey dnl Autoconf 2.71 wants some changes, hope we kept it fine for dnl 2.69 at least. AC_PREREQ([2.69]) dnl ############# Initialisation dnl Set version numbers from header version.h and each library API header. dnl Do not forget the re-generate configure on version changes. This does dnl not happen automatically, as it would with m4_include() usage, wich dnl is too fragile with arbitrary header contents. m4_define([V_HEADER], m4_esyscmd(grep MPG123_ src/version.h)) m4_define([V_MAJOR], m4_bregexp(V_HEADER, [#define MPG123_MAJOR\s+\([0-9]+\)], [\1])) m4_define([V_MINOR], m4_bregexp(V_HEADER, [\#define MPG123_MINOR\s+\([0-9]+\)], [\1])) m4_define([V_PATCH], m4_bregexp(V_HEADER, [\#define MPG123_PATCH\s+\([0-9]+\)], [\1])) m4_define([V_SUFFIX], m4_bregexp(V_HEADER, [\#define MPG123_SUFFIX\s+"\(.+\)"], [\1])) m4_undefine([V_HEADER]) AC_INIT([mpg123], V_MAJOR.V_MINOR.V_PATCH[]V_SUFFIX, [maintainer@mpg123.org]) m4_define([V_HEADER], m4_esyscmd(grep -e _API_VERSION -e _PATCHLEVEL src/libmpg123/mpg123.h.in src/libout123/out123.h src/libsyn123/syn123.h)) dnl libmpg123 m4_define([API_VERSION], m4_bregexp(V_HEADER, [\#define MPG123_API_VERSION\s+\([0-9]+\)], [\1])) m4_define([LIB_PATCHLEVEL], m4_bregexp(V_HEADER, [\#define MPG123_PATCHLEVEL\s+\([0-9]+\)], [\1])) dnl libout123 m4_define([OUTAPI_VERSION], m4_bregexp(V_HEADER, [\#define OUT123_API_VERSION\s+\([0-9]+\)], [\1])) m4_define([OUTLIB_PATCHLEVEL], m4_bregexp(V_HEADER, [\#define OUT123_PATCHLEVEL\s+\([0-9]+\)], [\1])) dnl libsyn123 m4_define([SYNAPI_VERSION], m4_bregexp(V_HEADER, [\#define SYN123_API_VERSION\s+\([0-9]+\)], [\1])) m4_define([SYNLIB_PATCHLEVEL], m4_bregexp(V_HEADER, [\#define SYN123_PATCHLEVEL\s+\([0-9]+\)], [\1])) m4_undefine([V_HEADER]) dnl Since we want to be backwards compatible, both sides get set to API_VERSION. LIBMPG123_VERSION=API_VERSION:LIB_PATCHLEVEL:API_VERSION LIBOUT123_VERSION=OUTAPI_VERSION:OUTLIB_PATCHLEVEL:OUTAPI_VERSION LIBSYN123_VERSION=SYNAPI_VERSION:SYNLIB_PATCHLEVEL:SYNAPI_VERSION AC_SUBST([LIBMPG123_VERSION]) AC_SUBST([LIBOUT123_VERSION]) AC_SUBST([LIBSYN123_VERSION]) AC_CONFIG_SRCDIR(src/mpg123.c) AC_CONFIG_AUX_DIR(build) AC_CONFIG_SRCDIR(doc) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST dnl Version 1.7 of automake is recommended dnl Not sure what minimal version does not choke on sub directories. dnl Testing with 1.14. AM_INIT_AUTOMAKE([subdir-objects]) AC_CONFIG_HEADERS([src/config.h]) # You get strange symptoms like jack module build failing because the AC_C_CONST failed to detect the working const support. # In that case, the test failed because -Werror, not because no const there... # After looking again, there are possibly more tests being obscured by false failures. AC_MSG_CHECKING([for -Werror in CFLAGS (It breaks tests)]) if echo "$CFLAGS" | grep Werror; then AC_MSG_RESULT([yes]) AC_MSG_WARN([You have -Werror in CFLAGS. That may break some tests and make this configure bogus. If you want paranoid compilation, use --enable-nagging option, which adds -Werror for gcc. Also note that you shall not run make distcheck after configuring with --enable-nagging. distcheck uses the generated CFLAGS... Anyhow, continuing at your own risk.]) else AC_MSG_RESULT([no]) fi buffer=enabled # try to build with buffer by default dnl ############# Compiler and tools Checks LT_LDFLAGS=-export-dynamic EXEC_LT_LDFLAGS= be_static=no all_static=no lib_static=no AC_MSG_CHECKING([if you are up to something totally static with LDFLAGS/CFLAGS]) for f in $LDFLAGS $CFLAGS do case "$f" in -all-static) be_static=yes all_static=yes lib_static=yes ;; -static) be_static=yes lib_static=yes ;; -static-libgcc) lib_static=yes ;; esac done if test "x$be_static" = xyes; then AC_MSG_RESULT([yes]) LT_LDFLAGS=-all-static EXEC_LT_LDFLAGS="$LT_LDFLAGS" else AC_MSG_RESULT([no]) fi if test "x$all_static" = xyes; then AC_MSG_WARN( Use -static in LDFLAGS for all-static linking! Your compiler may blow up on that -all-static. ) fi AM_PROG_AS dnl For autocinf 2.69, the C99 macro still does something. AC_PROG_CC_C99 AM_PROG_CC_C_O AC_PROG_CPP AC_PROG_INSTALL # Just look, no touch. oldLIBS=$LIBS LT_LIB_M dnl Test if -lrt is required for clock_gettime() (old glibc). AC_SEARCH_LIBS([clock_gettime], [rt]) if echo " $LIBS" | grep -q -w -- -lrt; then LIBRT=-lrt fi LIBS=$oldLIBS AC_SUBST(LIBM) dnl "Checking for egrep is broken after removal of libltdl stuff... checks use $EGREP, so searching it here." AC_PROG_EGREP AC_C_CONST AC_C_INLINE AC_C_BIGENDIAN if test "x$lib_static" = xyes; then CC="$CC -static-libgcc" CCLD="$CC" echo "Adding -static-libgcc" fi dnl ############# Use Libtool for dynamic module loading modules=auto AC_ARG_ENABLE(modules, [ --enable-modules=[no/yes] dynamically loadable output modules], [ if test "x$enableval" = xyes then modules=enabled else modules=disabled fi ], [ if test "x$be_static" = "xyes"; then modules=disabled else modules=auto fi ]) if test x"$enable_shared" = xno; then modules=disabled LT_LDFLAGS= else AC_DEFINE(DYNAMIC_BUILD, 1, [ Define if building with dynamcally linked libmpg123]) fi dnl We need the windows header also for checking the module mechanism. AC_CHECK_HEADERS([windows.h]) android_build=no case "$host" in *-*-mingw*) win32=yes AC_MSG_CHECKING([if this is a UWP build]) AC_PREPROC_IFELSE([AC_LANG_PROGRAM( [[#include #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) # error Win32 Desktop build #endif ]],[[;]]) ],[ uwp_build=yes AC_MSG_RESULT([yes]) ],[ uwp_build=no AC_MSG_RESULT([no]) ]) if test x"$uwp_build" = xyes; then AC_DEFINE( [WINDOWS_UWP], 1, [Windows UWP build] ) fi ;; linux*) dnl Android is linux, but a bit different AC_MSG_CHECKING([for an Android system]) AC_PREPROC_IFELSE([AC_LANG_PROGRAM( [[#ifndef __ANDROID__ # error Not Android #endif ]],[[;]]) ],[ android_build=yes AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) ;; *) win32=no ;; esac LIBDL= if test x"$modules" = xdisabled then echo "Modules disabled, not checking for dynamic loading." else have_dl=no dl_missing=no # The dlopen() API is either in libc or in libdl. if test "x$ac_cv_header_windows_h" = xyes && test "x$win32" = xyes; then AC_MSG_CHECKING([if LoadLibrary should be used]) AC_LINK_IFELSE([AC_LANG_SOURCE([ #include int main() { LoadLibraryW(0); GetProcAddress(0, 0); FreeLibrary(0); } ])], [ have_dl=yes AC_MSG_RESULT([Using LoadLibrary]) ], [AC_MSG_RESULT([no])]) else # Check for libdl functions, but only apply them for libcompat_dl. # This looks too messy. Can I avoid messing with LIBS here? oldLIBS=$LIBS AC_SEARCH_LIBS(dlopen, dl) AC_SEARCH_LIBS(dlsym, dl) AC_SEARCH_LIBS(dlclose, dl) AC_CHECK_HEADER(dlfcn.h) AC_CHECK_FUNCS(dlopen dlsym dlclose, [ have_dl=yes ], [ dl_missing=yes] ) LIBS=$oldLIBS # A better way to check if the library was really needed? if test "x$ac_cv_search_dlopen" = x-ldl || test "x$ac_cv_search_dlsym" = x-ldl || test "x$ac_cv_search_dlclose" = x-ldl then LIBDL=-ldl fi fi if test x"$dl_missing" = xyes; then AC_MSG_WARN([Some dynamic loading functions missing.]) have_dl=no fi if test x"$modules" = xenabled -a x"$have_dl" = xno; then AC_MSG_ERROR([Modules enabled but no runtime loader found! This will not work...]) fi if test x"$modules" = xauto; then if test x"$have_dl" = xyes; then modules=enabled echo "We found a runtime loader: Modules enabled." else echo "We did not find a runtime loader: Modules disabled." modules=disabled fi fi fi AC_SUBST(LIBDL) dnl Configure libtool LT_INIT([win32-dll disable-static]) if test x"$modules" = xdisabled then echo "Modules disabled." else # Enable module support in source code AC_DEFINE( USE_MODULES, 1, [Define if modules are enabled] ) # Export the module file suffix as LT_MODULE_EXT LT_SYS_MODULE_EXT fi AM_CONDITIONAL( [HAVE_MODULES], [test "x$modules" = xenabled] ) # Ensure that a possibly hijacked libtool does not build any static libs. if test x"$enable_static" = xno; then LIB_CFLAGS=-shared else LIB_CFLAGS= fi AC_SUBST(LIB_CFLAGS) AC_SUBST(LT_LDFLAGS) AC_SUBST(EXEC_LT_LDFLAGS) dnl ############## Configurable Options AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging], [ if test "x$enableval" = xyes then debugging="enabled" else debugging="disabled" fi ], [ debugging="disabled" ] ) AC_ARG_ENABLE(xdebug, [ --enable-xdebug=[no/yes] turn on extreme debugging], [ if test "x$enableval" = xyes then xdebugging="enabled" else xdebugging="disabled" fi ], [ xdebugging="disabled" ] ) if test x"$xdebugging" = xenabled; then debugging=enabled AC_DEFINE(XDEBUG, 1, [ Define for extreme debugging. ]) fi AC_ARG_ENABLE(nagging, [ --enable-nagging=[no/yes] turn on GCC's pedantic nagging with error on warnings, does not include --enable-debug anymore ], [ if test "x$enableval" = xyes then nagging="enabled" else nagging="disabled" fi ], [ nagging="disabled" ] ) if test x"$debugging" = xenabled; then AC_DEFINE(DEBUG, 1, [ Define if debugging is enabled. ]) fi AC_ARG_ENABLE(gapless, [ --enable-gapless=[no/yes] turn on gapless (enabled per default)], [ if test "x$enableval" = xyes then gapless="enabled" AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ]) else gapless="disabled" fi ], [ gapless="enabled" AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ]) ] ) AC_ARG_ENABLE(fifo, [ --enable-fifo=[no/yes] FIFO support for control interface (auto-enabled on linux) ], [ if test "x$enableval" = xyes then fifo="enabled" else fifo="disabled" fi ], [ fifo="auto" ] ) dnl Optional objects list, depends on decoder choice and core feature selection. dnl Not just for specific decoders anymore... dnl Core features that can be disabled to reduce binary size. id3v2=enabled AC_ARG_ENABLE(id3v2, [ --disable-id3v2=[no/yes] no ID3v2 parsing ], [ if test "x$enableval" = xno; then id3v2="disabled" fi ], []) # id3v2 depends on strings... so check that in between. string=enabled AC_ARG_ENABLE(string, [ --disable-string=[no/yes] no string API (this will disable ID3v2; main mpg123 won't build anymore) ], [ if test "x$enableval" = xno; then string="disabled" fi ], []) if test "x$string" = "xdisabled"; then AC_DEFINE(NO_STRING, 1, [ Define to disable string functions. ]) id3v2=disabled AC_MSG_WARN([ID3v2 support disabled because of string API being disabled.]) fi AM_CONDITIONAL([HAVE_STRING], [test "x$string" = xenabled]) if test "x$id3v2" = "xdisabled"; then AC_DEFINE(NO_ID3V2, 1, [ Define to disable ID3v2 parsing. ]) fi icy=enabled AC_ARG_ENABLE(icy, [ --disable-icy=[no/yes] no ICY metainfo parsing/conversion (main mpg123 won't build!) ], [ if test "x$enableval" = xno; then icy="disabled" fi ], []) if test "x$icy" = "xdisabled"; then AC_DEFINE(NO_ICY, 1, [ Define to disable ICY handling. ]) fi AM_CONDITIONAL([HAVE_ICY], [test "x$icy" = xenabled]) ntom=enabled AC_ARG_ENABLE(ntom, [ --disable-ntom=[no/yes] no flexible resampling ], [ if test "x$enableval" = xno; then ntom="disabled" fi ], []) if test "x$ntom" = "xdisabled"; then AC_DEFINE(NO_NTOM, 1, [ Define to disable ntom resampling. ]) fi AM_CONDITIONAL([HAVE_NTOM], [test "x$ntom" = xenabled]) downsample=enabled AC_ARG_ENABLE(downsample, [ --disable-downsample=[no/yes] no downsampled decoding ], [ if test "x$enableval" = xno; then downsample="disabled" fi ], []) if test "x$downsample" = "xdisabled"; then AC_DEFINE(NO_DOWNSAMPLE, 1, [ Define to disable downsampled decoding. ]) fi feeder=enabled AC_ARG_ENABLE(feeder, [ --disable-feeder=[no/yes] no feeder decoding, no buffered readers ], [ if test "x$enableval" = xno; then feeder="disabled" fi ], []) if test "x$feeder" = "xdisabled"; then AC_DEFINE(NO_FEEDER, 1, [ Define to disable feeder and buffered readers. ]) fi moreinfo=enabled AC_ARG_ENABLE(moreinfo, [ --disable-moreinfo=[no/yes] no extra information for frame analyzers ], [ if test "x$enableval" = xno; then moreinfo="disabled" fi ], []) if test "x$moreinfo" = "xdisabled"; then AC_DEFINE(NO_MOREINFO, 1, [ Define to disable analyzer info. ]) fi messages=enabled AC_ARG_ENABLE(messages, [ --disable-messages=[no/yes] no error/warning messages on the console ], [ if test "x$enableval" = xno; then messages="disabled" fi ], []) if test "x$messages" = "xdisabled"; then AC_DEFINE(NO_WARNING, 1, [ Define to disable warning messages. ]) AC_DEFINE(NO_ERRORMSG, 1, [ Define to disable error messages. ]) AC_DEFINE(NO_ERETURN, 1, [ Define to disable error messages in combination with a return value (the return is left intact). ]) fi runtimetables=disabled AC_ARG_ENABLE(runtime-tables, [ --enable-runtime-tables=[yes/no] calculate tables at runtime saving size at the expense of additional computation at load time ], [ if test "x$enableval" = xyes; then runtimetables=enabled fi ] , []) if test "x$runtimetables" = "xenabled"; then AC_DEFINE(RUNTIME_TABLES, 1, [ Define for calculating tables at runtime. ]) fi AM_CONDITIONAL([HAVE_RUNTIME_TABLES], [test "x$runtimetables" = xenabled] ) newhuff=enabled AC_ARG_ENABLE(new-huffman, [ --enable-new-huffman=[yes/no] use new huffman decoding scheme by Taihei (faster on modern CPUs at least, so on by default) ], [ if test "x$enableval" = xno; then newhuff=disabled fi ] , []) if test "x$newhuff" = "xenabled"; then AC_DEFINE(USE_NEW_HUFFTABLE, 1, [ Define for new Huffman decoding scheme. ]) fi integers=quality AC_ARG_ENABLE(int-quality, [ --enable-int-quality=[yes/no] use rounding instead of fast truncation for integer output, where possible ], [ if test "x$enableval" = xno; then integers=fast fi ], []) if test $integers = quality; then AC_DEFINE(ACCURATE_ROUNDING, 1, [ Define to use proper rounding. ]) fi AM_CONDITIONAL([HAVE_ACCURATE], [ test x"$integers" = xquality ]) int16=enabled AC_ARG_ENABLE(16bit, [ --disable-16bit=[no/yes] no 16 bit integer output ], [ if test "x$enableval" = xno; then int16="disabled" fi ], []) int8=enabled AC_ARG_ENABLE(8bit, [ --disable-8bit=[no/yes] no 8 bit integer output ], [ if test "x$enableval" = xno; then int8="disabled" fi ], []) int32=enabled AC_ARG_ENABLE(32bit, [ --disable-32bit=[no/yes] no 32 bit integer output (also 24 bit) ], [ if test "x$enableval" = xno; then int32="disabled" fi ], []) real=enabled AC_ARG_ENABLE(real, [ --disable-real=[no/yes] no real (floating point) output ], [ if test "x$enableval" = xno; then real="disabled" fi ], []) equalizer=enabled AC_ARG_ENABLE(equalizer, [ --disable-equalizer=[no/yes] no equalizer support ], [ if test "x$enableval" = xno; then equalizer="disabled" fi ], []) AC_ARG_WITH([cpu], [ --with-cpu=generic[[_fpu]] Use generic processor code with floating point arithmetic --with-cpu=generic_float Plain alias to generic_fpu now... float output is a normal runtime option! --with-cpu=generic_nofpu Use generic processor code with fixed point arithmetic (p.ex. ARM) --with-cpu=generic_dither Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding. --with-cpu=i386[[_fpu]] Use code optimized for i386 processors with floating point arithmetic --with-cpu=i386_nofpu Use code optimized for i386 processors with fixed point arithmetic --with-cpu=i486 Use code optimized for i486 processors (only usable alone!) --with-cpu=i586 Use code optimized for i586 processors --with-cpu=i586_dither Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size --with-cpu=3dnow Use code optimized for 3DNow processors --with-cpu=3dnow_vintage Use code optimized for older 3DNow processors (K6 family) --with-cpu=3dnowext Use code optimized for 3DNowExt processors (K6-3+, Athlon) --with-cpu=3dnowext_alone Really only 3DNowExt decoder, without 3DNow fallback for flexible rate --with-cpu=3dnow_vintage Use code optimized for older extended 3DNow processors (like K6-III+) --with-cpu=mmx Use code optimized for MMX processors --with-cpu=mmx_alone Really only MMX decoder, without i586 fallback for flexible rate --with-cpu=sse Use code optimized for SSE processors --with-cpu=sse_vintage Use code optimized for older SSE processors (plain C DCT36) --with-cpu=sse_alone Really only SSE decoder, without i586 fallback for flexible rate --with-cpu=avx Use code optimized for x86-64 with AVX processors --with-cpu=x86 Pack all x86 opts into one binary (excluding i486, including dither) --with-cpu=x86-64 Use code optimized for x86-64 processors (AMD64 and Intel64, including AVX and dithered generic) --with-cpu=altivec Use code optimized for Altivec processors (PowerPC G4 and G5) --with-cpu=ppc_nofpu Use code optimized for PowerPC processors with fixed point arithmetic --with-cpu=neon Use code optimized for ARM NEON SIMD engine (Cortex-A series) --with-cpu=arm_fpu Pack neon and generic[[_dither]] decoders, for ARM processors with FPU and/or NEON --with-cpu=arm_nofpu Use code optimized for ARM processors with fixed point arithmetic --with-cpu=neon64 Use code optimized for AArch64 NEON SIMD engine --with-cpu=aarch64 Pack neon64 and generic[[_dither]] decoders, for 64bit ARM processors ]) use_yasm=auto AC_ARG_ENABLE(yasm, [ --enable-yasm=[no/yes] enforce yasm instad of default assembler for some optimizations (AVX, currently) ], [ if test "x$enableval" = xyes; then use_yasm="enabled" else use_yasm="disabled" fi ], []) if test x"$use_yasm" = xenabled; then AC_MSG_ERROR([Yasm for AVX is currently broken and might go away.]) fi AC_ARG_ENABLE(ieeefloat, [ --enable-ieeefloat=[yes/no] use special hackery relying on IEEE 754 floating point storage format (to accurately round to 16 bit integer at bit more efficiently in generic decoder, enabled by default, disable in case you have a very special computer) ], [ if test "x$enableval" = xyes; then ieee=enabled else ieee=disabled fi ], [ ieee=enabled ]) if test "x$ieee" = xenabled; then echo "We assume IEEE754 floating point format." AC_DEFINE(IEEE_FLOAT, 1, [ Define to indicate that float storage follows IEEE754. ]) fi AC_ARG_ENABLE(cases, [ --enable-cases=[yes/no] include special cases for likely parameter values (channel count, encoding sizes in libsyn123 routines) in the hope of better optimization at the expense of some code bloat (default enabled) ], [ if test "x$enableval" = xyes; then specialcases=enabled else specialcases=disabled fi ], [ specialcases=enabled ]) if test "x$specialcases" = xdisabled; then AC_DEFINE(SYN123_NO_CASES, 1, [ Define to not duplicate some code for likely cases in libsyn123. ]) fi sys_cppflags= newoldwritesample=disabled case $host in aarch64-*linux*|arm64-*linux*|aarch64-*bsd*|arm64-*bsd*|aarch64-apple-darwin*|arm64-apple-darwin*) cpu_type="aarch64" ;; arm*-*-linux*-*eabihf|armv7hl*-*-linux*) cpu_type="arm_fpu" ;; arm*-*-linux*) # check that... perhaps we are better off on arm with kernel math emulation cpu_type="arm_nofpu" ;; armv7*-apple-darwin*) cpu_type="arm_fpu" ;; i386-*-linux*|i386-*-kfreebsd*-gnu) cpu_type="i386_fpu" newoldwritesample=enabled ;; i486-*-linux*|i486-*-kfreebsd*-gnu) cpu_type="i486" newoldwritesample=enabled ;; i586-*-linux*|i586-*-kfreebsd*-gnu) cpu_type="x86" newoldwritesample=enabled ;; i686-*-linux*|i686-*-kfreebsd*-gnu) cpu_type="x86" newoldwritesample=enabled ;; x86_64-*-linux*|x86_64-*-kfreebsd*-gnu) cpu_type="x86-64" ;; *-*-linux*|*-*-kfreebsd*-gnu) cpu_type="generic_fpu" ;; i?86-apple-darwin10*) AC_MSG_CHECKING([if CPU type supports x86-64]) case `sysctl -n hw.optional.x86_64` in 1) AC_MSG_RESULT([yes]) cpu_type="x86-64" ;; *) AC_MSG_RESULT([no]) cpu_type="x86" newoldwritesample=enabled ;; esac ;; i?86-apple-darwin*) cpu_type="x86" newoldwritesample=enabled ;; x86_64-apple-darwin*) cpu_type="x86-64" ;; *-apple-darwin*) AC_MSG_CHECKING([if CPU type supports AltiVec]) case `machine` in ppc7400 | ppc7450 | ppc970) AC_MSG_RESULT([yes]) cpu_type="altivec" ;; *) AC_MSG_RESULT([no]) cpu_type="generic_fpu" ;; esac ;; i?86-*-dragonfly* | i?86-*-freebsd* | i?86-*-midnightbsd* | i?86-*-mirbsd* | i?86-*-netbsd* | i?86-*-openbsd* | i?86-*-haiku*) cpu_type="x86" newoldwritesample=enabled ;; x86_64-*-dragonfly* | x86_64-*-freebsd* | x86_64-*-midnightbsd* | x86_64-*-mirbsd* | x86_64-*-netbsd* | x86_64-*-openbsd* | x86_64-*-haiku*) cpu_type="x86-64" ;; *-*-dragonfly* | *-*-freebsd* | *-*-midnightbsd* | *-*-mirbsd* | *-*-netbsd* | *-*-openbsd*) cpu_type="generic_fpu" ;; i386-*-solaris*) cpu_type=x86 newoldwritesample=enabled ;; x86_64-*-solaris*) cpu_type=x86-64 ;; *-*-solaris*) cpu_type="generic_fpu" ;; # os2-emx = OS/2 with some Unix fun; so p.ex. buffer works. # Till we sorted out the assembler troubles, generic CPU is default. i386-pc-os2-emx) cpu_type=generic_fpu newoldwritesample=enabled ;; x86_64-pc-os2-emx) # We are optimistic hat the future knows OS/2 on x86-64;-) cpu_type=generic_fpu ;; *-pc-os2-emx) cpu_type="generic_fpu" ;; *-dec-osf*) cpu_type="generic_fpu" ;; x86_64-*-cygwin*) cpu_type="x86-64" ;; i686-*-cygwin*) cpu_type="x86" newoldwritesample=enabled ;; i586-*-cygwin*) cpu_type="x86" newoldwritesample=enabled ;; i486-*-cygwin*) cpu_type="i486" newoldwritesample=enabled ;; i386-*-cygwin*) cpu_type="i386" newoldwritesample=enabled ;; *-cygwin*) cpu_type="generic_fpu" ;; i@<:@3-7@:>@86-*-mingw32*) LIBS="$LIBS" buffer=disabled cpu_type="x86" newoldwritesample=enabled ;; x86_64-*-mingw32*) LIBS="$LIBS" buffer=disabled cpu_type="x86-64" ;; i386-*-nto-qnx*) cpu_type="x86" newoldwritesample=enabled ;; *-ibm-aix*) AC_MSG_WARN([AIX system detected. You might want to --disable-largefile when trouble about conflicting types for lseek64 and friends occurs.]) # Altivec instead? It is developed for MacOS ... cpu_type=generic_fpu # no struct winsize without _ALL_SOURCE sys_cppflags=-D_ALL_SOURCE ;; i386-*) AC_MSG_WARN([Unknown host operating system]) cpu_type="i386" buffer=disabled sys_cppflags=-DGENERIC newoldwritesample=enabled ;; i486-*) AC_MSG_WARN([Unknown host operating system]) cpu_type="i486" buffer=disabled sys_cppflags=-DGENERIC newoldwritesample=enabled ;; i586-*) AC_MSG_WARN([Unknown host operating system]) cpu_type="x86" buffer=disabled sys_cppflags=-DGENERIC newoldwritesample=enabled ;; i686-*) AC_MSG_WARN([Unknown host operating system]) cpu_type="x86" buffer=disabled sys_cppflags=-DGENERIC newoldwritesample=enabled ;; x86_64-*) AC_MSG_WARN([Unknown host operating system]) cpu_type="x86-64" buffer=disabled sys_cppflags=-DGENERIC ;; *) AC_MSG_WARN([Unknown host operating system]) cpu_type="generic_fpu" buffer=disabled sys_cppflags=-DGENERIC ;; esac AC_ARG_ENABLE(buffer, [ --enable-buffer=[yes/no] disable audio buffer code (default uses system whitelist... proper checks later) ], [ if test "x$enableval" = xyes then echo "Note: Enabling buffer per request... perhaps it will not build anyway." buffer="enabled" else echo "Note: Disabling buffer per request." buffer="disabled" fi ] ) AC_ARG_ENABLE(newoldwritesample, [ --enable-newoldwritesample=[no/yes] enable new/old WRITE_SAMPLE macro for non-accurate 16 bit output, faster on certain CPUs (default on on x86-32)], [ if test "x$enableval" = xyes then newoldwritesample=enabled else newoldwritesample=disabled fi ]) dnl Did user choose other CPU type ? if test "x$with_cpu" != "x"; then cpu_type=$with_cpu fi # Flag for 32 bit synth output or post-processing. case "$cpu_type" in *_nofpu) synth32=false AC_DEFINE(NO_SYNTH32, 1, [ Define for post-processed 32 bit formats. ]) ;; *) synth32=true ;; esac if test "x$int16" = "xdisabled"; then AC_DEFINE(NO_16BIT, 1, [ Define to disable 16 bit integer output. ]) fi AM_CONDITIONAL([HAVE_SYNTH16], [test "x$int16" = "xenabled"]) # 8bit works only through 16bit if test "x$int16" = "xdisabled"; then int8=disabled fi if test "x$int8" = "xdisabled"; then AC_DEFINE(NO_8BIT, 1, [ Define to disable 8 bit integer output. ]) fi AM_CONDITIONAL([HAVE_SYNTH8], [test "x$int8" = "xenabled"]) if test "x$int32" = "xdisabled"; then AC_DEFINE(NO_32BIT, 1, [ Define to disable 32 bit and 24 bit integer output. ]) fi AM_CONDITIONAL([HAVE_SYNTH32], [ $synth32 && test x"$int32" = xenabled ]) if test "x$real" = "xdisabled"; then AC_DEFINE(NO_REAL, 1, [ Define to disable real output. ]) fi AM_CONDITIONAL([HAVE_SYNTHREAL], [ $synth32 && test x"$real" = xenabled ] ) if test "x$equalizer" = "xdisabled"; then AC_DEFINE(NO_EQUALIZER, 1, [ Define to disable equalizer. ] ) fi AM_CONDITIONAL([HAVE_EQUALIZER], [ test x"$equalizer" = xenabled ] ) layer1=enabled AC_ARG_ENABLE(layer1, [ --disable-layer1=[no/yes] no layer I decoding ], [ if test "x$enableval" = xno; then layer1="disabled" AC_DEFINE(NO_LAYER1, 1, [ Define to disable layer I. ]) fi ], []) AM_CONDITIONAL([HAVE_LAYER1], [test "x$layer1" = xenabled] ) layer2=enabled AC_ARG_ENABLE(layer2, [ --disable-layer2=[no/yes] no layer II decoding ], [ if test "x$enableval" = xno; then layer2="disabled" AC_DEFINE(NO_LAYER2, 1, [ Define to disable layer II. ]) fi ], []) AM_CONDITIONAL([HAVE_LAYER2], [test "x$layer2" = xenabled] ) layer3=enabled AC_ARG_ENABLE(layer3, [ --disable-layer3=[no/yes] no layer III decoding ], [ if test "x$enableval" = xno; then layer3="disabled" AC_DEFINE(NO_LAYER3, 1, [ Define to disable layer III. ]) fi ], []) AM_CONDITIONAL([HAVE_LAYER3], [test "x$layer3" = xenabled] ) AC_ARG_WITH([audio], [ --with-audio= Select a list (or only one) of audio output modules (comma or space separated list). Choices are: aix Use AIX as default audio output sub-system alib Use Alib as default audio output sub-system (for HPUX) alsa Use ALSA as default audio output sub-system (libasound) tinyalsa Use ALSA as default audio output sub-system (tinyalsa) arts Use aRts as default audio output sub-system (KDE sound server) dummy Use dummy as default audio (when no sound card is available) esd Use ESoundD as default audio output sub-system hp Use HP as default audio output sub-system jack Use JACK as default low-latency audio server coreaudio Use Mac OS X as default audio output sub-system (CoreAudio) mint Use MinT as default audio output sub-system (Atari) nas Use NAS as default audio output (Network Audio System) os2 Use OS2 as default audio output sub-system oss Use OSS as default audio output sub-system (/dev/dsp) portaudio Use PortAudio as default audio output sub-system pulse Use Pulse audio server as default audio output sub-system qsa Use QSA as default audio output sub-system sdl Use SDL as default audio output sub-system (Simple DirectMedia Layer) sgi Use SGI as default audio output sub-system (IRIX) sndio Use OpenBSD's sndio as default audio output sub-system sun Use Sun as default audio output sub-system (/dev/audio) win32 Use Win32 audio as default audio output sub-system win32_wasapi Use Win32 wasapi audio as default audio output sub-system ]) AC_ARG_WITH([default-audio], [ --with-default-audio= Select a list of audio output modules to try at runtime, even if not built right now (comma or space separated). See --with-audio for options. ]) AC_ARG_WITH([optimization], [ --with-optimization=0 No Optimization --with-optimization=1 Limited Optimization (-O) (for gcc) --with-optimization=2 Default Optimization (-O2 ...) (for gcc) --with-optimization=3 More Optimize than default (-O3 ...) (for gcc) --with-optimization=4 Optimize yet more (-O4 ...) (for gcc) ]) AC_ARG_WITH([seektable], [ --with-seektable= choose size of seek index table (0 disables it), default 1000 ]) dnl ############## Assembler, compiler properties # based on posting from John Dalgliesh on ffmpeg (LGPL) mailing list # extended to use balign if present AC_MSG_CHECKING([if .balign is present]) echo '.balign 4' > conftest.s if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then AC_MSG_RESULT([yes]) AC_DEFINE(ASMALIGN_BALIGN, 1, [ Define if .balign is present. ]) else AC_MSG_RESULT([no]) # find if .align arg is power-of-two or not asmalign_exp="unknown" if test x"$asmalign_exp" = xunknown; then AC_MSG_CHECKING([if .align takes 2-exponent]) asmalign_exp="no" echo '.align 3' > conftest.s if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then asmalign_exp="yes" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi rm -f conftest.o conftest.s fi if test x"$asmalign_exp" = xyes; then AC_DEFINE(ASMALIGN_EXP, 1, [ Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. ]) else AC_DEFINE(ASMALIGN_BYTE, 1, [ Define if .align just takes byte count. ]) fi fi ccalign="unknown" if test x"$ccalign" = xunknown; then AC_MSG_CHECKING([__attribute__((aligned(16)))]) ccalign="no" echo '__attribute__((aligned(16))) float var;' > conftest.c if $CC -c -o conftest.o conftest.c >/dev/null 2>&1; then ccalign="yes" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi rm -f conftest.o conftest.c fi dnl We apply alignment hints only to cpus that need it. dnl See further below for the definition of CCALIGN avx_support="unknown" if test x"$avx_support" = xunknown; then AC_MSG_CHECKING([if assembler supports AVX instructions]) avx_support="no" echo '.text' > conftest.s echo 'vaddps %ymm0,%ymm0,%ymm0' >> conftest.s if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then avx_support="yes" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi rm -f conftest.o conftest.s fi check_yasm=no if test x"$avx_support" = xno || test x"$use_yasm" = xenabled; then check_yasm=yes fi if test x"$use_yasm" = xdisabled; then check_yasm=no fi if test x"$check_yasm" = xyes; then AC_CHECK_PROGS(YASM,[yasm],no) if test x"$YASM" != xno; then AC_MSG_CHECKING([if $YASM supports GAS syntax and AVX instructions]) echo '.text' > conftest.s echo 'vaddps %ymm0,%ymm0,%ymm0' >> conftest.s if $YASM -pgas -rcpp -o conftest.o conftest.s 1>/dev/null 2>&1; then avx_support="yes" YASMFLAGS="-pgas -rgas -mamd64" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi rm -f conftest.o conftest.s else if test x"$use_yasm" = xenabled; then AC_MSG_ERROR([Yasm enforced but not found!]) fi fi else YASM="no" fi if test "x$cpu_type" = "xavx"; then if test "x$avx_support" != "xyes"; then AC_MSG_ERROR([Assembler doesn't understand AVX instructions.]) fi fi AC_SUBST(YASM) AC_SUBST(YASMFLAGS) dnl ############## Really basic headers, needed for other checks. dnl Is it too paranoid to specifically check for stdint.h and limits.h? AC_CHECK_HEADERS([stdio.h stdlib.h string.h unistd.h sched.h sys/ioctl.h sys/types.h stdint.h limits.h inttypes.h sys/time.h sys/wait.h sys/resource.h sys/signal.h signal.h sys/select.h dirent.h sys/stat.h]) dnl ############## Types dnl Large file support stuff needs cleanup. There are superfluous variables. dnl Detect large file support, enable switches if needed. AC_SYS_LARGEFILE dnl If we do have a switch for large files, rename off_t-aware API calls. dnl Using the file_offset_bits variable here is fine for linux (possibly Solaris), dnl Others... we'll have to see. dnl Note: I started writing this with with multiline replacements. dnl Does not work. Automake insists on putting these into Makefiles where they break things. dnl It is also assumed that a system that does not set file offset bits is not dnl sensitive to largefile changes, i.e. FreeBSD always using 64 bit off_t. if test "x$ac_cv_sys_file_offset_bits" = x || echo "$ac_cv_sys_file_offset_bits" | $GREP '@<:@^0-9@:>@' > /dev/null; then dnl if it has non-numeric chars or is empty... ignore... largefile_sensitive=no BUILD_NO_LARGENAME=1 AC_DEFINE(BUILD_NO_LARGENAME, 1, [ No suffixed symbols for large file support (only alias for backwards compat.) ]) else largefile_sensitive=yes BUILD_NO_LARGENAME=0 fi # Add dual-mode wrapper code. AM_CONDITIONAL([HAVE_LFS_WRAP], [ test x"$largefile_sensitive" = xyes ] ) # Any non-sensitive platform does not bother with off_t-based function renaming. AC_SUBST(BUILD_NO_LARGENAME) # Using the lower level macros instead of AC_TYPE_* for compatibility with not freshest autoconf. AC_CHECK_TYPE(size_t, unsigned long) AC_CHECK_TYPE(uintptr_t, unsigned long) AC_CHECK_TYPE(ssize_t, long) AC_CHECK_TYPE(off_t, long int) AC_CHECK_TYPE(int32_t, int) AC_CHECK_TYPE(int64_t, long long) AC_CHECK_TYPE(uint32_t, unsigned int) AC_CHECK_TYPE(int16_t, short) AC_CHECK_TYPE(uint16_t, unsigned short) AC_CHECK_SIZEOF(size_t,4) AC_CHECK_SIZEOF(ssize_t,4) AC_CHECK_SIZEOF(off_t,4) AC_CHECK_SIZEOF(int32_t) AC_CHECK_SIZEOF(long,4) dnl The native type used for aliases is what off_t maps to without any largefile- dnl enabling switches. So, it's long int if the system is largefile-senstive, dnl but it is actual plain off_t if the system does not have such switches. if test "x$largefile_sensitive" = xyes; then lfs_alias_type=long lfs_alias_size=$ac_cv_sizeof_long elif test "x$android_build" = xyes; then lfs_alias_type=off64_t lfs_alias_size=$ac_cv_sizeof_off64_t else lfs_alias_type=off_t lfs_alias_size=$ac_cv_sizeof_off_t fi if test "x$lfs_alias_size" = "x"; then AC_MSG_ERROR([Cannot determine sizeof(lfs_alias_t)?]) else LFS_ALIAS_BITS=`expr "$lfs_alias_size" "*" "8"` AC_DEFINE_UNQUOTED([lfs_alias_t], $lfs_alias_type, [Define to the native offset type (long or actually off_t).]) AC_DEFINE_UNQUOTED([LFS_ALIAS_BITS], $LFS_ALIAS_BITS, [Define this to the size of native offset type in bits, used for LFS alias functions.]) fi AC_SUBST(LFS_ALIAS_BITS) lfs_alias=enabled AC_ARG_ENABLE(lfs-alias, [ --disable-lfs-alias disable alias wrappers for largefile bitness (mpg123_seek_32 or mpg123_seek_64 in addition to mpg123_seek, or the other way around; It is a mess, do not play with this!) ], [ if test "x$enableval" = xno; then lfs_alias="disabled" fi ], [ case $host in *-cygwin*) lfs_alias="disabled" AC_MSG_NOTICE([lfs-alias disabled for Cygwin, use --enable-lfs-alias explicitly to enable, only if you know what you are doing]) ;; esac ]) AC_MSG_CHECKING([if we want to enable alias wrappers for largefile]) if test "x$lfs_alias" = "xenabled"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi AM_CONDITIONAL([HAVE_LFS_ALIAS], [ test x"$lfs_alias" = xenabled ]) dnl ############## Function Checks AC_CHECK_FUNCS([mmap],[have_mmap=yes],[have_mmap=no]) if test "x$have_mmap" = "xno"; then AC_CHECK_HEADERS([sys/ipc.h sys/shm.h],[], [buffer=disabled]) AC_CHECK_FUNCS([shmget shmat shmdt shmctl],[], [buffer=disabled]) fi # Check if system supports termios AC_SYS_POSIX_TERMIOS AC_MSG_CHECKING([if we have wincon.h]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([ #include #include void *v = &ReadConsoleInput; ])],[ac_cv_header_wincon_h=yes],[ac_cv_header_wincon_h=no]) AC_MSG_RESULT([$ac_cv_header_wincon_h]) AS_IF([test "x$ac_cv_header_wincon_h" = "xyes"],[],[AC_DEFINE([HAVE_WINCON_H],[1],[Define to 1 if you have the header file.])]) term_type=none if test "x$ac_cv_sys_posix_termios" = "xyes"; then AC_DEFINE_UNQUOTED([HAVE_TERMIOS], 1, [Define this if you have the POSIX termios library]) term_type=posix elif test "x$ac_cv_header_windows_h" = "xyes" && test "x$ac_cv_header_wincon_h" = "xyes"; then term_type=win32 fi AC_CHECK_FUNCS( random setenv unsetenv ) # Check for sched_setscheduler AC_CHECK_FUNCS( sched_setscheduler setuid getuid) # Check for setpriority AC_CHECK_FUNCS( setpriority ) AC_CHECK_FUNCS( strerror ) AC_CHECK_FUNCS( setlocale nl_langinfo mbstowcs wcstombs wcswidth iswprint ) AC_CHECK_FUNCS( atoll ) AC_CHECK_FUNCS( mkfifo, [ have_mkfifo=yes ], [ have_mkfifo=no ] ) AC_CHECK_FUNCS( fork execvp, [ have_fork=yes ], [have_fork=no; break] ) AC_CHECK_FUNCS( ctermid ) dnl For Windows and OS/2. dnl Checking for both the functions as well as the flag symbols. dnl Taking care with _setmode() being preferred on Windows, and dnl OS/2 providing _setmode, but not the underscored flags. #AC_CHECK_FUNCS( _setmode setmode ) AC_LINK_IFELSE( [AC_LANG_SOURCE( #include #include #include int main() { _setmode(STDIN_FILENO, _O_BINARY); _setmode(STDOUT_FILENO, _O_TEXT); return 0; } )], [AC_DEFINE( HAVE__SETMODE, 1, [for Win/DOS system with _setmode()] )], [] ) AC_LINK_IFELSE( [AC_LANG_SOURCE( #include #include #include int main() { setmode(STDIN_FILENO, O_BINARY); setmode(STDOUT_FILENO, O_TEXT); return 0; } )], [AC_DEFINE( HAVE_SETMODE, 1, [for Win/DOS system with setmode()] )], [] ) dnl ############## Header and Library Checks # locale headers AC_CHECK_HEADERS([locale.h langinfo.h wchar.h wctype.h]) # Headers for network (http) stuff network_internal=unknown AC_CHECK_HEADERS([netdb.h sys/param.h sys/socket.h netinet/in.h arpa/inet.h]) if test "x$ac_cv_header_netdb_h" = "xyes" && test "x$ac_cv_header_sys_param_h" = "xyes" && test "x$ac_cv_header_sys_socket_h" = "xyes" && test "x$ac_cv_header_netinet_in_h" = "xyes" && test "x$ac_cv_header_arpa_inet_h" = "xyes"; then have_network=yes network_internal=posix else have_network=no fi dnl trying to get that socket lib settled in one line AC_SEARCH_LIBS(gethostbyname, nsl socket network) dnl OK, two lines... Solaris needs -lnsl -lsocket AC_SEARCH_LIBS(socket, socket) AC_CHECK_FUNCS( getaddrinfo, [ have_ipv6=yes ], [ have_ipv6=no ] ) # Substitutions for the installable mpg123.h header if test "x$ac_cv_header_stdio_h" = "xyes"; then INCLUDE_STDIO_H="#include " else INCLUDE_STDIO_H="/* #include is not available on this system */" fi AC_SUBST(INCLUDE_STDIO_H) if test "x$ac_cv_header_stdlib_h" = "xyes"; then INCLUDE_STDLIB_H="#include " else INCLUDE_STDLIB_H="/* #include is not available on this system */" fi AC_SUBST(INCLUDE_STDLIB_H) if test "x$ac_cv_header_sys_types_h" = "xyes"; then INCLUDE_SYS_TYPE_H="#include " else INCLUDE_SYS_TYPE_H="/* #include is not available on this system */" fi AC_SUBST(INCLUDE_SYS_TYPE_H) # Checks for maths libraries. AC_CHECK_LIB([m], [sqrt]) AC_CHECK_LIB([mx], [powf]) # attempt to make the signal stuff work... also with GENERIC - later #if test x"$ac_cv_header_sys_signal_h" = xyes; then # AC_CHECK_FUNCS( sigemptyset sigaddset sigprocmask sigaction ) # if test x"$ac_cv_func_sigemptyset" = xyes && # test x"$ac_cv_func_sigaddset" = xyes && # test x"$ac_cv_func_sigprocmask" = xyes && # test x"$ac_cv_func_sigaction" = xyes; then # AC_DEFINE( #fi # Optionally use platform macros for byte swapping. AC_CHECK_HEADERS([byteswap.h]) dnl ############## Choose compiler flags and CPU # do not assume gcc here, so no flags by default ADD_CFLAGS="" ADD_CPPFLAGS="$sys_cppflags" ADD_LDFLAGS="" LIBS="$LIBS" # Remove that if it is settled that tcsetattr on OS/2 is unsalvageable anyway. # The only user of os2.h is the output module. AC_CHECK_HEADERS([os2.h]) # If debugging is enabled, just enable debugging symbols. # All other stuff enters nagging territory. if test x"$debugging" = xenabled; then ADD_CFLAGS="-g" fi # gcc specific... if test x"$GCC" = xyes; then if test x"$nagging" = xenabled; then ADD_CFLAGS="$ADD_CFLAGS -Wall -Werror -std=c99 -pedantic" fi fi dnl Only try the attribute_align_arg mumbo-jumbo on x86, x86-64 warns/errors out on that attribute. dnl ...dunno even what about other architectures. case $host in i?86-*) AC_DEFINE(ABI_ALIGN_FUN, 1, [ Define if your architecture wants/needs/can use attribute_align_arg and alignment checks. It is for 32bit x86... ]) ;; esac dnl Choice of extra libmpg12 sources via lots of AM_CONDITIONALS. dnl Those are defined after this block of CPU selection. Make sure dnl that any new conditional gets added down there before using it dnl here in definitions. s_altivec="HAVE_ALTIVEC" s_i386="HAVE_I386" s_i486="$s_i386 HAVE_I486" s_i586="$s_i386 HAVE_I586" s_i586d="$s_i386 HAVE_I586_DITHER" s_3dnow="$s_i386 HAVE_3DNOW" s_3dnowext="$s_i386 HAVE_3DNOWEXT HAVE_MMXTAB" s_3dnow_vintage="$s_3dnow HAVE_3DNOW_VINTAGE" s_3dnowext_vintage="$s_3dnowext HAVE_3DNOWEXT_VINTAGE" s_mmx="$s_i386 HAVE_MMX HAVE_MMXTAB" s_sse_vintage="$s_i386 HAVE_MMXTAB HAVE_SSE_VINTAGE" s_sse="$s_sse_vintage HAVE_SSE" s_x86_64="HAVE_X86_64 HAVE_X86_64_MONO" s_x86_64_mono_synths="HAVE_X86_64_MONO" s_x86_64_avx="HAVE_AVX" s_x86multi="HAVE_GETCPUFLAGS" s_x86_64_multi="HAVE_GETCPUFLAGS_X86_64" s_dither="HAVE_DITHER" s_neon="HAVE_NEON" s_neon64="HAVE_NEON64" s_arm_multi="HAVE_GETCPUFLAGS_ARM" s_arm="HAVE_ARM" # SSE and newer invoke dct64 for float numbers when producing s32 or float output, # as well as accurate rounding. AM_CONDITIONAL([HAVE_FLOATDCT], [ test x"$integers" = xquality || test x"$int32" = xenabled || test x"$real" = xenabled ]) dnl CPU specific compiler flags and sources case $cpu_type in generic) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT" more_sources="" ccalign=no ;; generic_dither) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT" more_sources="$s_dither" ccalign=no ;; generic_fpu | generic_float) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT" more_sources="" ccalign=no ;; generic_nofpu) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FIXED" more_sources= ccalign=no ;; ppc_nofpu) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DOPT_PPC -DREAL_IS_FIXED" more_sources= ccalign=no ;; arm_nofpu) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_ARM -DREAL_IS_FIXED" more_sources="$s_arm" ccalign=no ;; altivec) ADD_CFLAGS="$ADD_CFLAGS -maltivec" ADD_CPPFLAGS="$ADD_CPPFLAGS -DREAL_IS_FLOAT -DOPT_ALTIVEC" more_sources="$s_altivec" AC_MSG_CHECKING([if $CC accepts -faltivec]) touch conftest.c if $CC -faltivec -c -o conftest.o conftest.c >/dev/null 2>&1; then ADD_CFLAGS="$ADD_CFLAGS -faltivec" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi rm -f conftest.o conftest.c ;; neon) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON -DREAL_IS_FLOAT" more_sources="$s_neon" ;; arm_fpu) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON -DREAL_IS_FLOAT" more_sources="$s_neon $s_dither $s_arm_multi" ;; neon64) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON64 -DREAL_IS_FLOAT" more_sources="$s_neon64" ;; aarch64) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON64 -DREAL_IS_FLOAT" more_sources="$s_neon64 $s_dither $s_arm_multi" ;; i386) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT" more_sources="$s_i386" ccalign=no ;; i386_fpu) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT" more_sources="$s_i386" ccalign=no ;; i386_nofpu) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FIXED" more_sources="$s_i386" have_cond ccalign=no ;; i486) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I486 -DREAL_IS_FLOAT" more_sources="$s_i486" ccalign=no ;; i586) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586 -DREAL_IS_FLOAT" more_sources="$s_i586" ;; i586_dither) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586_DITHER -DREAL_IS_FLOAT" more_sources="$s_i586d $s_dither" ;; 3dnow) # legacy 3dnow had the 3dnow paired with i586... ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW -DREAL_IS_FLOAT" more_sources="$s_i586 $s_3dnow $s_x86multi " ;; 3dnow_vintage) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW_VINTAGE -DREAL_IS_FLOAT" more_sources="$s_i586 $s_3dnow_vintage $s_x86multi " ;; 3dnow_alone) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOW -DREAL_IS_FLOAT" more_sources="$s_3dnow" ;; 3dnowext_alone) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOWEXT -DREAL_IS_FLOAT" more_sources="$s_3dnowext" ;; 3dnowext_vintage) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT_VINTAGE -DREAL_IS_FLOAT" more_sources="$s_3dnowext_vintage $s_3dnow $s_x86multi" ;; 3dnowext) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT -DREAL_IS_FLOAT" more_sources="$s_3dnowext $s_3dnow $s_x86multi" ;; mmx_alone|mmx) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MMX -DREAL_IS_FLOAT" more_sources="$s_mmx" ;; sse_alone|sse) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE -DREAL_IS_FLOAT" more_sources="$s_sse" ;; sse_vintage) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT" more_sources="$s_sse_vintage" ;; avx) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_AVX -DREAL_IS_FLOAT" more_sources="$s_x86_64_avx $s_x86_64_mono_synths" if test "x$YASM" != "xno"; then use_yasm_for_avx="yes" fi ;; x86|x86_dither) # plain C dct36 always there, for vintage/non-vintage # Selection of non-/vintage sources implies that # $s_3dnow_vintage contains $s_3dnow, # $s_sse contains $s_sse_vintage. ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_I386 -DOPT_I586 -DOPT_I586_DITHER -DOPT_MMX -DOPT_3DNOW -DOPT_3DNOW_VINTAGE -DOPT_3DNOWEXT -DOPT_3DNOWEXT_VINTAGE -DOPT_SSE -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT" more_sources="$s_i386 $s_i586 $s_i586d $s_mmx $s_3dnow_vintage $s_3dnowext_vintage $s_sse $s_x86multi $s_dither" ;; x86-64_alone) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_X86_64 -DREAL_IS_FLOAT" more_sources="$s_x86_64" ;; x86-64|x86-64_all|x86-64_dither) ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_X86_64 -DOPT_GENERIC -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT" more_sources="$s_x86_64 $s_dither $s_x86_64_multi" if test "x$avx_support" = "xyes"; then ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_AVX" more_sources="$more_sources $s_x86_64_avx" if test "x$YASM" != "xno"; then use_yasm_for_avx="yes" fi fi ;; *) AC_MSG_ERROR([Unknown CPU type '$cpu_type']) ;; esac # Use yasm instead of the default assembler for AVX sources if test "x$use_yasm_for_avx" = "xyes"; then case $host_os in *cygwin*|*mingw*) YASM_FORMAT="-f win64" ;; *darwin*) YASM_FORMAT="-f macho" ;; *) YASM_FORMAT="-f elf" ;; esac AC_DEFINE(USE_YASM_FOR_AVX, 1, [Define to use yasm for assemble AVX sources.]) fi AM_CONDITIONAL([USE_YASM_FOR_AVX], [test "x$use_yasm_for_avx" = xyes]) AC_SUBST(YASM_FORMAT) # Check if we want feature report function. AC_MSG_CHECKING([if we want feature report function]) feature_report=enabled AC_ARG_ENABLE(feature_report, [ --disable-feature_report Disable feature report function ], [ if test "x$enableval" = xno; then AC_MSG_RESULT([no]) feature_report=disabled else AC_MSG_RESULT([yes]) fi ], [AC_MSG_RESULT([yes])]) AM_CONDITIONAL([HAVE_FEATURE], [test "x$feature_report" = xenabled]) # Return 0 if first arg appears in list of following arguments. # Return 1 otherwise. word_in_list() { word=$1 shift # Avoid naming conflict with the outside! # Is local not POSIX sh? for given_word in "$@" do if test "x$word" = "x$given_word"; then return 0 fi done return 1 } dnl Really, having to write code again to generate configure.ac code dnl because I cannot generate macro invocations in a shell loop? dnl Autoconf is a bit ridiculous here. There's something to say about dnl a build system with one language that can express the stuff, not this dnl intermingling of m4 and shell on top of each other. dnl for c in HAVE_ALTIVEC HAVE_I386 HAVE_I486 HAVE_I586 HAVE_I586_DITHER \ dnl HAVE_3DNOW HAVE_3DNOWEXT HAVE_MMXTAB HAVE_3DNOW_VINTAGE HAVE_3DNOWEXT_VINTAGE \ dnl HAVE_MMX HAVE_SSE_VINTAGE HAVE_SSE HAVE_X86_64 HAVE_X86_64_MONO HAVE_AVX \ dnl HAVE_GETCPUFLAGS HAVE_GETCPUFLAGS_X86_64 HAVE_DITHER HAVE_NEON HAVE_NEON64 \ dnl HAVE_GETCPUFLAGS_ARM HAVE_ARM dnl do dnl echo "AM_CONDITIONAL([$c], [word_in_list $c \$more_sources])" dnl done AM_CONDITIONAL([HAVE_ALTIVEC], [word_in_list HAVE_ALTIVEC $more_sources]) AM_CONDITIONAL([HAVE_I386], [word_in_list HAVE_I386 $more_sources]) AM_CONDITIONAL([HAVE_I486], [word_in_list HAVE_I486 $more_sources]) AM_CONDITIONAL([HAVE_I586], [word_in_list HAVE_I586 $more_sources]) AM_CONDITIONAL([HAVE_I586_DITHER], [word_in_list HAVE_I586_DITHER $more_sources]) AM_CONDITIONAL([HAVE_3DNOW], [word_in_list HAVE_3DNOW $more_sources]) AM_CONDITIONAL([HAVE_3DNOWEXT], [word_in_list HAVE_3DNOWEXT $more_sources]) AM_CONDITIONAL([HAVE_MMXTAB], [word_in_list HAVE_MMXTAB $more_sources]) AM_CONDITIONAL([HAVE_3DNOW_VINTAGE], [word_in_list HAVE_3DNOW_VINTAGE $more_sources]) AM_CONDITIONAL([HAVE_3DNOWEXT_VINTAGE], [word_in_list HAVE_3DNOWEXT_VINTAGE $more_sources]) AM_CONDITIONAL([HAVE_MMX], [word_in_list HAVE_MMX $more_sources]) AM_CONDITIONAL([HAVE_SSE_VINTAGE], [word_in_list HAVE_SSE_VINTAGE $more_sources]) AM_CONDITIONAL([HAVE_SSE], [word_in_list HAVE_SSE $more_sources]) AM_CONDITIONAL([HAVE_X86_64], [word_in_list HAVE_X86_64 $more_sources]) AM_CONDITIONAL([HAVE_X86_64_MONO], [word_in_list HAVE_X86_64_MONO $more_sources]) AM_CONDITIONAL([HAVE_AVX], [word_in_list HAVE_AVX $more_sources]) AM_CONDITIONAL([HAVE_GETCPUFLAGS], [word_in_list HAVE_GETCPUFLAGS $more_sources]) AM_CONDITIONAL([HAVE_GETCPUFLAGS_X86_64], [word_in_list HAVE_GETCPUFLAGS_X86_64 $more_sources]) AM_CONDITIONAL([HAVE_DITHER], [word_in_list HAVE_DITHER $more_sources]) AM_CONDITIONAL([HAVE_NEON], [word_in_list HAVE_NEON $more_sources]) AM_CONDITIONAL([HAVE_NEON64], [word_in_list HAVE_NEON64 $more_sources]) AM_CONDITIONAL([HAVE_GETCPUFLAGS_ARM], [word_in_list HAVE_GETCPUFLAGS_ARM $more_sources]) AM_CONDITIONAL([HAVE_ARM], [word_in_list HAVE_ARM $more_sources]) dnl Finally insert the code switch for alignment, above cpu selection having possibly changed the setting. if test x"$ccalign" = xyes; then AC_DEFINE(CCALIGN, 1, [ Define if __attribute__((aligned(16))) shall be used ]) fi dnl ############## Output module choice # The full list of supported modules to check, first come, first serve. check_modules="pulse alsa tinyalsa oss coreaudio sndio sun win32 win32_wasapi os2 esd jack portaudio sdl nas arts openal dummy" # Only check qsa before all else on QNX. # It would mask ALSA otherwise. case $host in *-nto-qnx*) check_modules="qsa $check_modules" ;; esac # The final list. output_modules= check_forced=no check_failed=no if test "x$with_audio" != "x"; then check_modules=`echo $with_audio|tr , ' '` if ! echo "$check_modules" | grep -qw dummy; then check_modules="$check_modules dummy" fi echo "Limiting outputs to build according to your preference: $check_modules" check_forced=yes fi PKG_PROG_PKG_CONFIG([]) # Now go through the modules to check and do the chores. for m in $check_modules do case "$m" in dummy) AC_MSG_CHECKING([if you are too dumbing dumb for the dummy]) AC_MSG_RESULT([no]) output_modules="$output_modules dummy" HAVE_DUMMY=yes ;; oss) AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h]) if test "x${ac_cv_header_sys_soundcard_h}" = "xyes" \ -o "x${ac_cv_header_linux_soundcard_h}" = "xyes" \ -o "x${ac_cv_header_machine_soundcard_h}" = "xyes"; then output_modules="$output_modules oss" HAVE_OSS="yes" else check_failed=yes fi ;; tinyalsa) TINYALSA_LIBS="-ltinyalsa" # Check for ALSA AC_CHECK_LIB( [tinyalsa], [pcm_open], [ AC_CHECK_HEADER( [tinyalsa/asoundlib.h], [ output_modules="$output_modules tinyalsa" HAVE_TINYALSA="yes"], [ AC_MSG_WARN([Found TINYALSA library but NOT header files on your system]) ] ) ] ) if test "x$HAVE_TINYALSA" != xyes; then check_failed=yes fi ;; # QSA and ALSA are not distinguishable in these tests, need to block # each other and play with test order depending on platform. alsa) if test "x$HAVE_QSA" = xyes; then HAVE_ALSA=no else ALSA_LIBS="-lasound" # Check for ALSA AC_CHECK_LIB( [asound], [snd_pcm_open], [ AC_CHECK_HEADER( [alsa/asoundlib.h], [ output_modules="$output_modules alsa" HAVE_ALSA="yes"], [ AC_MSG_WARN([Found ALSA library but NOT header files on your system]) ] ) ] ) if test "x$HAVE_ALSA" != xyes; then check_failed=yes fi fi # HAVE_QSA ;; qsa) if test "x$HAVE_ALSA" = xyes; then HAVE_QSA=no else QSA_LIBS="-lasound" # Check for QSA AC_CHECK_LIB( [asound], [snd_pcm_open], [ AC_CHECK_HEADER( [sys/asoundlib.h], [ output_modules="$output_modules qsa" HAVE_QSA="yes"], [ AC_MSG_WARN([Found QSA library but NOT header files on your system]) ] ) ] ) if test "x$HAVE_QSA" != xyes; then check_failed=yes fi fi # HAVE_ALSA ;; jack) # JACK module uses semaphores, hence -lpthread. AC_CHECK_LIB( [pthread], [sem_post], [ PKG_CHECK_MODULES(JACK, jack, [ output_modules="$output_modules jack" HAVE_JACK="yes" JACK_LIBS="$JACK_LIBS -lpthread" ], [ HAVE_JACK="no" check_failed=yes ] ) ], [ HAVE_JACK=no check_failed=yes ] ) ;; pulse) PKG_CHECK_MODULES(PULSE, libpulse-simple, output_modules="$output_modules pulse" HAVE_PULSE="yes", HAVE_PULSE="no" check_failed=yes) ;; esd) PKG_CHECK_MODULES(ESD, esound, output_modules="$output_modules esd" HAVE_ESD="yes", HAVE_ESD="no" check_failed=yes) ;; portaudio) # Remember: This looks only insane because you chose an insane tab width! PORTAUDIO_LIBS="-lportaudio" PORTAUDIO_CFLAGS= case $host in *-*-mingw32) # We tested portaudio with MME if test "x$HAVE_PORTAUDIO" != "xyes"; then AC_CHECK_LIB( [portaudio], [Pa_Initialize], [ AC_CHECK_HEADER( [portaudio.h], [ output_modules="$output_modules portaudio" HAVE_PORTAUDIO_WINMM="yes" HAVE_PORTAUDIO="yes" ], [ AC_MSG_WARN([Found PortAudio library but NOT header files on your system]) ] ) PORTAUDIO_LIBS="$PORTAUDIO_LIBS -lwinmm" ], [ HAVE_PORTAUDIO="no"], [ -lwinmm ] ) fi ;; *) AC_CHECK_LIB( [portaudio], [Pa_Initialize], [ AC_CHECK_HEADER( [portaudio.h], [ output_modules="$output_modules portaudio" HAVE_PORTAUDIO="yes" ], [ AC_MSG_WARN([Found PortAudio library but NOT header files on your system]) ] ) ] ) ;; esac if test "x$HAVE_PORTAUDIO" != xyes; then check_failed=yes else # See if we have v19 or v18 AC_CHECK_LIB( [portaudio], [Pa_GetVersion], [:], [AC_DEFINE( [PORTAUDIO18], 1, [Define if portaudio v18 API is wanted.]) ], [$PORTAUDIO_LIBS] ) fi ;; sdl) PKG_CHECK_MODULES(SDL, sdl2, output_modules="$output_modules sdl" HAVE_SDL="yes", HAVE_SDL="no" check_failed=yes) if ! test "$HAVE_SDL" = "yes"; then check_failed=no PKG_CHECK_MODULES(SDL, sdl, output_modules="$output_modules sdl" HAVE_SDL="yes", HAVE_SDL="no" check_failed=yes) fi ;; nas) NAS_LIBS=-laudio AC_CHECK_LIB( [audio], [AuOpenServer], [ AC_CHECK_HEADER( [audio/audiolib.h], [ output_modules="$output_modules nas" HAVE_NAS="yes"], [ AC_MSG_WARN([Found NAS library but NOT header files on your system]) ] ) ] ) if test "x$HAVE_NAS" != xyes; then check_failed=yes fi ;; win32) # Check for windows ... and win32 audio # Does not work... instead just check for header # AC_CHECK_LIB( [winmm], [waveOutOpen] ) WIN32_LIBS=-lwinmm if test x$ac_cv_header_windows_h = xyes; then output_modules="$output_modules win32" HAVE_WIN32=yes else HAVE_WIN32=no check_failed=yes fi ;; win32_wasapi) # Check for windows ... and win32 wasapi audio # Does not work... instead just check for header # AC_CHECK_LIB( [avrt], [] ) AC_MSG_CHECKING([if we have wasapi headers]) OLD_LIBS=$LIBS LIBS="$LIBS -lole32 -lavrt" AC_LINK_IFELSE([AC_LANG_SOURCE([ #define COBJMACROS 1 #define _WIN32_WINNT 0x601 #include #include #include #include int main(){ /* UUID Checks */ GUID *IDs[] = { &CLSID_MMDeviceEnumerator, &IID_IMMDeviceEnumerator, &IID_IAudioClient, &IID_IAudioRenderClient }; return 0; } ])], [HAVE_WIN32_WASAPI=yes], [HAVE_WIN32_WASAPI=no]) LIBS=$OLD_LIBS WIN32_WASAPI_LIBS="-lole32 -lavrt" AC_MSG_RESULT([$HAVE_WIN32_WASAPI]) if test "x$HAVE_WIN32_WASAPI" = xyes; then output_modules="$output_modules win32_wasapi" else check_failed=yes fi ;; sndio) PKG_CHECK_MODULES(SNDIO, sndio, output_modules="$output_modules sndio" HAVE_SNDIO="yes", HAVE_SNDIO="no" check_failed=yes) ;; sun) AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h asm/audioio.h sys/audio.h]) if test "x${ac_cv_header_sun_audioio_h}" = "xyes" \ -o "x${ac_cv_header_sys_audioio_h}" = "xyes" \ -o "x${ac_cv_header_asm_audioio_h}" = "xyes"; then output_modules="$output_modules sun" HAVE_SUN="yes" else check_failed=yes fi ;; coreaudio) COREAUDIO_LIBS="-framework AudioToolbox" AC_CHECK_HEADERS([AudioUnit/AudioUnit.h AudioToolbox/AudioToolbox.h]) if test "x${ac_cv_header_AudioUnit_AudioUnit_h}" = "xyes" \ -a "x${ac_cv_header_AudioToolbox_AudioToolbox_h}" = "xyes"; then OLD_LIBS=$LIBS LIBS="$LIBS $COREAUDIO_LIBS" AC_MSG_CHECKING([if AudioUnit functions are available within AudioToolbox]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[AudioUnitInitialize(NULL);]])],[AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no]) COREAUDIO_LIBS="$COREAUDIO_LIBS -framework AudioUnit" ]) LIBS=$OLD_LIBS AC_CHECK_HEADERS([CoreServices/CoreServices.h], [COREAUDIO_LIBS="$COREAUDIO_LIBS -framework CoreServices"] ) if test x"$modules" = xdisabled; then AC_MSG_WARN([Disabling buffer because of directly linked CoreAudio! Use the module if you need the buffer.]) buffer=disabled fi output_modules="$output_modules coreaudio" HAVE_COREAUDIO="yes" else check_failed=yes fi ;; arts) AC_MSG_CHECKING([for artsc]) if artsc-config > /dev/null 2>&1; then AC_MSG_RESULT([yes]) output_modules="$output_modules arts" HAVE_ARTS=yes ARTS_LIBS=`artsc-config --libs` ARTS_CFLAGS=`artsc-config --cflags` else AC_MSG_RESULT([no]) check_failed=yes fi ;; openal) AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h AL/al.h AL/alc.h al.h alc.h]) if test "x${ac_cv_header_OpenAL_al_h}" = "xyes" \ -a "x${ac_cv_header_OpenAL_alc_h}" = "xyes"; then #Mac OS X output_modules="$output_modules openal" OPENAL_LIBS="-framework OpenAL" OPENAL_CFLAGS="-DOPENAL_SUBDIR_OPENAL" HAVE_OPENAL="yes" elif test "x${ac_cv_header_AL_al_h}" = "xyes" \ -a "x${ac_cv_header_AL_alc_h}" = "xyes"; then #Linux output_modules="$output_modules openal" OPENAL_LIBS="-lopenal" OPENAL_CFLAGS="-DOPENAL_SUBDIR_AL" HAVE_OPENAL="yes" elif test "x${ac_cv_header_al_h}" = "xyes" \ -a "x${ac_cv_header_alc_h}" = "xyes"; then #Windows? output_modules="$output_modules openal" OPENAL_LIBS="-lopenal" OPENAL_CFLAGS="" HAVE_OPENAL="yes" else check_failed=yes fi ;; os2) OS2_LIBS="-lcx -lmmpm2" OS2_CFLAGS="-idirafter /@unixroot/usr/include/os2tk45" oldcflags="$CFLAGS" CFLAGS="$CFLAGS $OS2_CFLAGS" AC_CHECK_HEADERS([os2.h]) # os2me.h depends on os2.h # Yes, that way of coding it is ugly. if test "x${ac_cv_header_os2_h}" = xyes then # We mimick exactly the way how the header will be used. # It seems to be picky... AC_CHECK_HEADERS([os2me.h], [], [], [#define INCL_OS2MM #undef VERSION #define INCL_DOS #define INCL_VIO #define INCL_KBD #include #]) fi if test "x${ac_cv_header_os2_h}" = xyes \ -a "x${ac_cv_header_os2me_h}" = xyes then output_modules="$output_modules os2" HAVE_OS2=yes else check_failed=yes fi CFLAGS="$oldcflags" ;; # from here on only forced tests, untested code hp) # What's the deal with that and alib? UNSUPPORTED_AUDIO=yes AC_CHECK_HEADER([sys/audio.h], [output_modules="$output_modules hp" HAVE_HP=yes], [check_failed=yes]) ;; alib) UNSUPPORTED_AUDIO=yes # ALIB_CFLAGS="-I/opt/audio/include" ALIB_LIBS=-lAlib # These headers may not be all about audio but they are used. AC_CHECK_HEADERS([ Alib.h CUlib.h netdb.h netinet/in.h netinet/tcp.h]) if test "x${ac_cv_header_Alib_h}" = xyes \ -a "x${ac_cv_header_CUlib_h}" = xyes \ -a "x${ac_cv_header_netdb_h}" = xyes \ -a "x${ac_cv_header_netinet_in_h}" = xyes \ -a "x${ac_cv_header_netinet_tcp_h}" = xyes then output_modules="$output_modules alib" HAVE_ALIB=yes else check_failed=yes fi ;; mint) UNSUPPORTED_AUDIO=yes AC_CHECK_HEADERS([audios.h], [output_modules="$output_modules mint" HAVE_MINT=yes], [check_failes=yes]) ;; aix) UNSUPPORTED_AUDIO=yes AC_CHECK_HEADERS([sys/audio.h], [output_modules="$output_modules aix" HAVE_AIX=yes], [check_failed=yes]) ;; sgi) UNSUPPORTED_AUDIO=yes SGI_LIBS=-laudio AC_CHECK_HEADER([dmedia/audio.h], [output_modules="$output_modules sgi" HAVE_SGI=yes], [check_failed=yes]) ;; *) AC_MSG_ERROR([Unsupported/-known output '$m' demanded!]) ;; esac done if test "x$check_forced" = xyes -a "x$UNSUPPORTED_AUDIO" = xyes; then AC_MSG_WARN([You requested bulding of an unsupported audio module. Be prepared for happy hacking and please tell us about your experience!]) fi if test "x$check_forced" = xyes -a "x$check_failed" = "xyes"; then AC_MSG_ERROR([One/some of your requested audio modules failed the test!]) fi # When you extend check_modules, you should extend this: #for i in alsa qsa oss coreaudio sndio sun win32 win32_wasapi esd jack portaudio pulse sdl nas aix alib arts hp os2 sgi mint openal dummy #do echo $i; done | #perl -ne 'chomp; $big = uc($_); print <