Blame configure.ac

Packit c32a2d
dnl configure.ac: source for the configure script
Packit c32a2d
Packit c32a2d
dnl copyright by the mpg123 project - free software under the terms of the LGPL 2.1
Packit c32a2d
dnl see COPYING and AUTHORS files in distribution or http://mpg123.org
Packit c32a2d
dnl initially written by Nicholas J. Humfrey
Packit c32a2d
Packit c32a2d
dnl Require autoconf version >= 2.57
Packit c32a2d
AC_PREREQ(2.57)
Packit c32a2d
Packit c32a2d
dnl ############# Initialisation
Packit c32a2d
AC_INIT([mpg123], [1.25.10], [maintainer@mpg123.org])
Packit c32a2d
dnl Increment API_VERSION when the API gets changes (new functions).
Packit c32a2d
Packit c32a2d
dnl libmpg123
Packit c32a2d
API_VERSION=44
Packit c32a2d
LIB_PATCHLEVEL=8
Packit c32a2d
Packit c32a2d
dnl libout123
Packit c32a2d
OUTAPI_VERSION=2
Packit c32a2d
OUTLIB_PATCHLEVEL=2
Packit c32a2d
Packit c32a2d
dnl Since we want to be backwards compatible, both sides get set to API_VERSION.
Packit c32a2d
LIBMPG123_VERSION=$API_VERSION:$LIB_PATCHLEVEL:$API_VERSION
Packit c32a2d
LIBOUT123_VERSION=$OUTAPI_VERSION:$OUTLIB_PATCHLEVEL:$OUTAPI_VERSION
Packit c32a2d
AC_SUBST(LIBMPG123_VERSION)
Packit c32a2d
AC_SUBST(API_VERSION)
Packit c32a2d
AC_SUBST(LIBOUT123_VERSION)
Packit c32a2d
AC_SUBST(OUTAPI_VERSION)
Packit c32a2d
Packit c32a2d
Packit c32a2d
AC_CONFIG_SRCDIR(src/mpg123.c)
Packit c32a2d
AC_CONFIG_AUX_DIR(build)
Packit c32a2d
AC_CONFIG_SRCDIR(doc)
Packit c32a2d
AC_CONFIG_MACRO_DIR([m4])
Packit c32a2d
AC_CANONICAL_HOST
Packit c32a2d
Packit c32a2d
dnl Version 1.7 of automake is recommended
Packit c32a2d
dnl Not sure what minimal version does not choke on sub directories.
Packit c32a2d
dnl Testing with 1.14.
Packit c32a2d
AM_INIT_AUTOMAKE([subdir-objects])
Packit c32a2d
AC_CONFIG_HEADERS([src/config.h])
Packit c32a2d
Packit c32a2d
Packit c32a2d
# You get strange symptoms like jack module build failing because the AC_C_CONST failed to detect the working const support.
Packit c32a2d
# In that case, the test failed because -Werror, not because no const there...
Packit c32a2d
# After looking again, there are possibly more tests being obscured by false failures.
Packit c32a2d
AC_MSG_CHECKING([for -Werror in CFLAGS (It breaks tests)])
Packit c32a2d
if echo "$CFLAGS" | grep Werror; then
Packit c32a2d
	AC_MSG_RESULT([yes])
Packit c32a2d
	AC_MSG_WARN([You have -Werror in CFLAGS. That may break some tests and make this configure bogus.
Packit c32a2d
If you want paranoid compilation, use --enable-nagging option, which adds -Werror for gcc.
Packit c32a2d
Also note that you shall not run make distcheck after configuring with --enable-nagging.
Packit c32a2d
distcheck uses the generated CFLAGS...
Packit c32a2d
Anyhow, continuing at your own risk.])
Packit c32a2d
else
Packit c32a2d
	AC_MSG_RESULT([no])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
buffer=enabled # try to build with buffer by default
Packit c32a2d
Packit c32a2d
dnl ############# Compiler and tools Checks
Packit c32a2d
Packit c32a2d
LT_LDFLAGS=-export-dynamic
Packit c32a2d
EXEC_LT_LDFLAGS=
Packit c32a2d
be_static=no
Packit c32a2d
all_static=no
Packit c32a2d
lib_static=no
Packit c32a2d
AC_MSG_CHECKING([if you are up to something totally static with LDFLAGS/CFLAGS])
Packit c32a2d
for f in $LDFLAGS $CFLAGS
Packit c32a2d
do
Packit c32a2d
	case "$f" in
Packit c32a2d
		-all-static)
Packit c32a2d
			be_static=yes
Packit c32a2d
			all_static=yes
Packit c32a2d
			lib_static=yes
Packit c32a2d
		;;
Packit c32a2d
		-static)
Packit c32a2d
			be_static=yes
Packit c32a2d
			lib_static=yes
Packit c32a2d
		;;
Packit c32a2d
		-static-libgcc)
Packit c32a2d
			lib_static=yes
Packit c32a2d
		;;
Packit c32a2d
	esac
Packit c32a2d
done
Packit c32a2d
if test "x$be_static" = xyes; then
Packit c32a2d
	AC_MSG_RESULT([yes])
Packit c32a2d
	LT_LDFLAGS=-all-static
Packit c32a2d
	EXEC_LT_LDFLAGS="$LT_LDFLAGS"
Packit c32a2d
else
Packit c32a2d
	AC_MSG_RESULT([no])
Packit c32a2d
fi
Packit c32a2d
if test "x$all_static" = xyes; then
Packit c32a2d
	AC_MSG_WARN( Use -static in LDFLAGS for all-static linking! Your compiler may blow up on that -all-static. )
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
AM_PROG_AS
Packit c32a2d
AC_PROG_CC
Packit c32a2d
AM_PROG_CC_C_O
Packit c32a2d
AC_PROG_CPP
Packit c32a2d
AC_PROG_INSTALL
Packit c32a2d
AC_CHECK_LIBM
Packit c32a2d
AC_SUBST(LIBM)
Packit c32a2d
dnl "Checking for egrep is broken after removal of libltdl stuff... checks use $EGREP, so searching it here."
Packit c32a2d
AC_PROG_EGREP
Packit c32a2d
AC_C_CONST
Packit c32a2d
AC_INLINE
Packit c32a2d
AC_C_BIGENDIAN
Packit c32a2d
Packit c32a2d
if test "x$lib_static" = xyes; then
Packit c32a2d
        CC="$CC -static-libgcc"
Packit c32a2d
        CCLD="$CC"
Packit c32a2d
	echo "Adding -static-libgcc"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl ############# Use Libtool for dynamic module loading
Packit c32a2d
Packit c32a2d
modules=auto
Packit c32a2d
OUTPUT_OBJ="module.\$(OBJEXT)"
Packit c32a2d
AC_ARG_ENABLE(modules,
Packit c32a2d
[  --enable-modules=[no/yes] dynamically loadable output modules],
Packit c32a2d
[
Packit c32a2d
	if test "x$enableval" = xyes
Packit c32a2d
	then
Packit c32a2d
		modules=enabled
Packit c32a2d
	else
Packit c32a2d
		modules=disabled
Packit c32a2d
	fi
Packit c32a2d
],
Packit c32a2d
[
Packit c32a2d
	if test "x$be_static" = "xyes"; then
Packit c32a2d
		modules=disabled
Packit c32a2d
	else
Packit c32a2d
		modules=auto
Packit c32a2d
	fi
Packit c32a2d
])
Packit c32a2d
Packit c32a2d
dnl We only want shared libraries by default
Packit c32a2d
AC_DISABLE_STATIC
Packit c32a2d
AC_ENABLE_SHARED
Packit c32a2d
Packit c32a2d
if test x"$enable_shared" = xno; then
Packit c32a2d
	modules=disabled
Packit c32a2d
	LT_LDFLAGS=
Packit c32a2d
else
Packit c32a2d
	AC_DEFINE(DYNAMIC_BUILD, 1, [ Define if building with dynamcally linked libmpg123])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl We need the windows header also for checking the module mechanism.
Packit c32a2d
AC_CHECK_HEADERS([windows.h])
Packit c32a2d
Packit c32a2d
if test x"$modules" = xdisabled
Packit c32a2d
then
Packit c32a2d
  echo "Modules disabled, not checking for dynamic loading."
Packit c32a2d
else
Packit c32a2d
  have_dl=no
Packit c32a2d
  # The dlopen() API is either in libc or in libdl.
Packit c32a2d
  if test x$ac_cv_header_windows_h = xyes; then
Packit c32a2d
    AC_MSG_CHECKING([if LoadLibrary should be used])
Packit c32a2d
    AC_LINK_IFELSE([AC_LANG_SOURCE([
Packit c32a2d
Packit c32a2d
#ifdef __CYGWIN__
Packit c32a2d
#error Cygwin should use dlopen
Packit c32a2d
#endif
Packit c32a2d
Packit c32a2d
#include <windows.h>
Packit c32a2d
Packit c32a2d
int main() {
Packit c32a2d
  LoadLibraryW(0);
Packit c32a2d
  GetProcAddress(0, 0);
Packit c32a2d
  FreeLibrary(0);
Packit c32a2d
}
Packit c32a2d
    ])], [
Packit c32a2d
    have_dl=yes
Packit c32a2d
    AC_MSG_RESULT([Using LoadLibrary])
Packit c32a2d
    ],
Packit c32a2d
  [AC_MSG_RESULT([no])])
Packit c32a2d
  else
Packit c32a2d
    AC_SEARCH_LIBS(dlopen, dl)
Packit c32a2d
    AC_CHECK_HEADER(dlfcn.h)
Packit c32a2d
    AC_CHECK_FUNCS(dlopen dlsym dlclose, [ have_dl=yes ])
Packit c32a2d
  fi
Packit c32a2d
  if test x"$modules" = xenabled -a x"$have_dl" = xno; then
Packit c32a2d
    AC_MSG_ERROR([Modules enabled but no runtime loader found! This will not work...])
Packit c32a2d
  fi
Packit c32a2d
  if test x"$modules" = xauto; then
Packit c32a2d
    if test x"$have_dl" = xyes; then
Packit c32a2d
      modules=enabled
Packit c32a2d
      echo "We found a runtime loader: Modules enabled."
Packit c32a2d
    else
Packit c32a2d
      echo "We did not find a runtime loader: Modules disabled."
Packit c32a2d
      modules=disabled
Packit c32a2d
    fi
Packit c32a2d
  fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl Configure libtool
Packit c32a2d
Packit c32a2d
AC_LIBTOOL_WIN32_DLL
Packit c32a2d
AM_PROG_LIBTOOL
Packit c32a2d
Packit c32a2d
if test x"$modules" = xdisabled
Packit c32a2d
then
Packit c32a2d
  echo "Modules disabled."
Packit c32a2d
else
Packit c32a2d
  # Enable module support in source code
Packit c32a2d
  AC_DEFINE( USE_MODULES, 1, [Define if modules are enabled] )
Packit c32a2d
  # Export the module file suffix as LT_MODULE_EXT
Packit c32a2d
  LT_SYS_MODULE_EXT
Packit c32a2d
fi
Packit c32a2d
AM_CONDITIONAL( [HAVE_MODULES], [test "x$modules" = xenabled] )
Packit c32a2d
Packit c32a2d
AC_SUBST(LT_LDFLAGS)
Packit c32a2d
AC_SUBST(EXEC_LT_LDFLAGS)
Packit c32a2d
Packit c32a2d
dnl ############## Configurable Options
Packit c32a2d
Packit c32a2d
AC_ARG_ENABLE(debug,
Packit c32a2d
              [  --enable-debug=[no/yes] turn on debugging],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xyes
Packit c32a2d
                then
Packit c32a2d
                  debugging="enabled"
Packit c32a2d
                else
Packit c32a2d
                  debugging="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ],
Packit c32a2d
              [ debugging="disabled" ]
Packit c32a2d
)
Packit c32a2d
Packit c32a2d
AC_ARG_ENABLE(nagging,
Packit c32a2d
              [  --enable-nagging=[no/yes] turn on GCC's pedantic nagging with error on warnings, does not include --enable-debug anymore ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xyes
Packit c32a2d
                then
Packit c32a2d
                  nagging="enabled"
Packit c32a2d
               else
Packit c32a2d
                  nagging="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ],
Packit c32a2d
              [ nagging="disabled" ]
Packit c32a2d
)
Packit c32a2d
Packit c32a2d
if test x"$debugging" = xenabled; then
Packit c32a2d
	AC_DEFINE(DEBUG, 1, [ Define if debugging is enabled. ])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
AC_ARG_ENABLE(gapless,
Packit c32a2d
              [  --enable-gapless=[no/yes] turn on gapless (enabled per default)],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xyes
Packit c32a2d
                then
Packit c32a2d
                  gapless="enabled"
Packit c32a2d
                  AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ])
Packit c32a2d
                else
Packit c32a2d
                  gapless="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ],
Packit c32a2d
              [
Packit c32a2d
                gapless="enabled"
Packit c32a2d
                AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ])
Packit c32a2d
              ]
Packit c32a2d
)
Packit c32a2d
Packit c32a2d
AC_ARG_ENABLE(fifo,
Packit c32a2d
              [  --enable-fifo=[no/yes] FIFO support for control interface (auto-enabled on linux) ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xyes
Packit c32a2d
                then
Packit c32a2d
                  fifo="enabled"
Packit c32a2d
                else
Packit c32a2d
                  fifo="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ],
Packit c32a2d
              [
Packit c32a2d
                fifo="auto"
Packit c32a2d
              ]
Packit c32a2d
)
Packit c32a2d
Packit c32a2d
AC_ARG_ENABLE(ipv6,
Packit c32a2d
              [  --enable-ipv6=[no/yes] IPv6 support (actually any protocol your libc does with getaddrinfo) ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xyes
Packit c32a2d
                then
Packit c32a2d
                  ipv6="enabled"
Packit c32a2d
                else
Packit c32a2d
                  ipv6="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ],
Packit c32a2d
              [
Packit c32a2d
                ipv6="auto"
Packit c32a2d
              ]
Packit c32a2d
)
Packit c32a2d
Packit c32a2d
AC_ARG_ENABLE(network,
Packit c32a2d
              [  --enable-network=[no/yes] network support (http streams / webradio) ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xyes
Packit c32a2d
                then
Packit c32a2d
                  network="enabled"
Packit c32a2d
                else
Packit c32a2d
                  network="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ],
Packit c32a2d
              [
Packit c32a2d
                network="auto"
Packit c32a2d
              ]
Packit c32a2d
)
Packit c32a2d
Packit c32a2d
dnl Optional objects list, depends on decoder choice and core feature selection.
Packit c32a2d
dnl Not just for specific decoders anymore...
Packit c32a2d
s_fpu=
Packit c32a2d
DECODER_OBJ=
Packit c32a2d
DECODER_LOBJ=
Packit c32a2d
Packit c32a2d
dnl Core features that can be disabled to reduce binary size.
Packit c32a2d
Packit c32a2d
id3v2=enabled
Packit c32a2d
AC_ARG_ENABLE(id3v2,
Packit c32a2d
              [  --disable-id3v2=[no/yes] no ID3v2 parsing ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  id3v2="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
# id3v2 depends on strings... so check that in between.
Packit c32a2d
string=enabled
Packit c32a2d
AC_ARG_ENABLE(string,
Packit c32a2d
              [  --disable-string=[no/yes] no string API (this will disable ID3v2; main mpg123 won't build anymore) ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  string="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
if test "x$string" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_STRING, 1, [ Define to disable string functions. ])
Packit c32a2d
  id3v2=disabled
Packit c32a2d
 	AC_MSG_WARN([ID3v2 support disabled because of string API being disabled.])
Packit c32a2d
else
Packit c32a2d
  DECODER_OBJ="$DECODER_OBJ stringbuf.\$(OBJEXT)"
Packit c32a2d
  DECODER_LOBJ="$DECODER_LOBJ stringbuf.lo"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test "x$id3v2" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_ID3V2, 1, [ Define to disable ID3v2 parsing. ])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
icy=enabled
Packit c32a2d
AC_ARG_ENABLE(icy,
Packit c32a2d
              [  --disable-icy=[no/yes] no ICY metainfo parsing/conversion (main mpg123 won't build!) ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  icy="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
if test "x$icy" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_ICY, 1, [ Define to disable ICY handling. ])
Packit c32a2d
else
Packit c32a2d
  DECODER_OBJ="$DECODER_OBJ icy.\$(OBJEXT) icy2utf8.\$(OBJEXT)"
Packit c32a2d
  DECODER_LOBJ="$DECODER_LOBJ icy.lo icy2utf8.lo"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
ntom=enabled
Packit c32a2d
AC_ARG_ENABLE(ntom,
Packit c32a2d
              [  --disable-ntom=[no/yes] no flexible resampling ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  ntom="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
if test "x$ntom" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_NTOM, 1, [ Define to disable ntom resampling. ])
Packit c32a2d
else
Packit c32a2d
  DECODER_OBJ="$DECODER_OBJ ntom.\$(OBJEXT)"
Packit c32a2d
  DECODER_LOBJ="$DECODER_LOBJ ntom.lo"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
downsample=enabled
Packit c32a2d
AC_ARG_ENABLE(downsample,
Packit c32a2d
              [  --disable-downsample=[no/yes] no downsampled decoding ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  downsample="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
if test "x$downsample" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_DOWNSAMPLE, 1, [ Define to disable downsampled decoding. ])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
feeder=enabled
Packit c32a2d
AC_ARG_ENABLE(feeder,
Packit c32a2d
              [  --disable-feeder=[no/yes] no feeder decoding, no buffered readers ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  feeder="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
if test "x$feeder" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_FEEDER, 1, [ Define to disable feeder and buffered readers. ])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
messages=enabled
Packit c32a2d
AC_ARG_ENABLE(messages,
Packit c32a2d
              [  --disable-messages=[no/yes] no error/warning messages on the console ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  messages="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
if test "x$messages" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_WARNING, 1, [ Define to disable warning messages. ])
Packit c32a2d
  AC_DEFINE(NO_ERRORMSG,   1, [ Define to disable error messages. ])
Packit c32a2d
  AC_DEFINE(NO_ERETURN, 1, [ Define to disable error messages in combination with a return value (the return is left intact). ])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
newhuff=enabled
Packit c32a2d
AC_ARG_ENABLE(new-huffman,
Packit c32a2d
[  --enable-new-huffman=[yes/no] use new huffman decoding scheme by Taihei (faster on modern CPUs at least, so on by default) ],
Packit c32a2d
[
Packit c32a2d
  if test "x$enableval" = xno; then
Packit c32a2d
    newhuff=disabled
Packit c32a2d
  fi
Packit c32a2d
]
Packit c32a2d
, [])
Packit c32a2d
Packit c32a2d
if test "x$newhuff" = "xenabled"; then
Packit c32a2d
  AC_DEFINE(USE_NEW_HUFFTABLE, 1, [ Define for new Huffman decoding scheme. ])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
integers=fast
Packit c32a2d
AC_ARG_ENABLE(int-quality,
Packit c32a2d
[  --enable-int-quality=[yes/no] use rounding instead of fast truncation for integer output, where possible ],
Packit c32a2d
[
Packit c32a2d
  if test "x$enableval" = xyes; then
Packit c32a2d
    integers=quality
Packit c32a2d
    AC_DEFINE(ACCURATE_ROUNDING,   1, [ Define to use proper rounding. ])
Packit c32a2d
  fi
Packit c32a2d
], [])
Packit c32a2d
Packit c32a2d
int16=enabled
Packit c32a2d
AC_ARG_ENABLE(16bit,
Packit c32a2d
              [  --disable-16bit=[no/yes] no 16 bit integer output ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  int16="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
int8=enabled
Packit c32a2d
AC_ARG_ENABLE(8bit,
Packit c32a2d
              [  --disable-8bit=[no/yes] no 8 bit integer output ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  int8="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
int32=enabled
Packit c32a2d
AC_ARG_ENABLE(32bit,
Packit c32a2d
              [  --disable-32bit=[no/yes] no 32 bit integer output (also 24 bit) ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  int32="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
real=enabled
Packit c32a2d
AC_ARG_ENABLE(real,
Packit c32a2d
              [  --disable-real=[no/yes] no real (floating point) output ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  real="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
equalizer=enabled
Packit c32a2d
AC_ARG_ENABLE(equalizer,
Packit c32a2d
              [  --disable-equalizer=[no/yes] no equalizer support ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  equalizer="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
			  
Packit c32a2d
AC_ARG_WITH([cpu], [
Packit c32a2d
  --with-cpu=generic[[_fpu]]      Use generic processor code with floating point arithmetic
Packit c32a2d
  --with-cpu=generic_float      Plain alias to generic_fpu now... float output is a normal runtime option!
Packit c32a2d
  --with-cpu=generic_nofpu      Use generic processor code with fixed point arithmetic (p.ex. ARM)
Packit c32a2d
  --with-cpu=generic_dither     Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding.
Packit c32a2d
  --with-cpu=i386[[_fpu]]         Use code optimized for i386 processors with floating point arithmetic
Packit c32a2d
  --with-cpu=i386_nofpu         Use code optimized for i386 processors with fixed point arithmetic
Packit c32a2d
  --with-cpu=i486         Use code optimized for i486 processors (only usable alone!)
Packit c32a2d
  --with-cpu=i586         Use code optimized for i586 processors
Packit c32a2d
  --with-cpu=i586_dither  Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size
Packit c32a2d
  --with-cpu=3dnow         Use code optimized for 3DNow processors
Packit c32a2d
  --with-cpu=3dnow_vintage Use code optimized for older 3DNow processors (K6 family)
Packit c32a2d
  --with-cpu=3dnowext      Use code optimized for 3DNowExt processors (K6-3+, Athlon)
Packit c32a2d
  --with-cpu=3dnowext_alone     Really only 3DNowExt decoder, without 3DNow fallback for flexible rate
Packit c32a2d
  --with-cpu=3dnow_vintage       Use code optimized for older extended 3DNow processors (like K6-III+)
Packit c32a2d
  --with-cpu=mmx          Use code optimized for MMX processors
Packit c32a2d
  --with-cpu=mmx_alone          Really only MMX decoder, without i586 fallback for flexible rate
Packit c32a2d
  --with-cpu=sse          Use code optimized for SSE processors
Packit c32a2d
  --with-cpu=sse_vintage  Use code optimized for older SSE processors (plain C DCT36)
Packit c32a2d
  --with-cpu=sse_alone          Really only SSE decoder, without i586 fallback for flexible rate
Packit c32a2d
  --with-cpu=avx          Use code optimized for x86-64 with AVX processors
Packit c32a2d
  --with-cpu=x86          Pack all x86 opts into one binary (excluding i486, including dither)
Packit c32a2d
  --with-cpu=x86-64       Use code optimized for x86-64 processors (AMD64 and Intel64, including AVX and dithered generic)
Packit c32a2d
  --with-cpu=altivec      Use code optimized for Altivec processors (PowerPC G4 and G5)
Packit c32a2d
  --with-cpu=ppc_nofpu    Use code optimized for PowerPC processors with fixed point arithmetic
Packit c32a2d
  --with-cpu=neon         Use code optimized for ARM NEON SIMD engine (Cortex-A series)
Packit c32a2d
  --with-cpu=arm_fpu      Pack neon and generic[[_dither]] decoders, for ARM processors with FPU and/or NEON
Packit c32a2d
  --with-cpu=arm_nofpu    Use code optimized for ARM processors with fixed point arithmetic
Packit c32a2d
  --with-cpu=neon64       Use code optimized for AArch64 NEON SIMD engine
Packit c32a2d
  --with-cpu=aarch64      Pack neon64 and generic[[_dither]] decoders, for 64bit ARM processors
Packit c32a2d
])
Packit c32a2d
Packit c32a2d
use_yasm=auto
Packit c32a2d
AC_ARG_ENABLE(yasm,
Packit c32a2d
              [  --enable-yasm=[no/yes] enforce yasm instad of default assembler for some optimizations (AVX, currently) ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xyes; then
Packit c32a2d
                  use_yasm="enabled"
Packit c32a2d
                else
Packit c32a2d
                  use_yasm="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
AC_ARG_ENABLE(ieeefloat,
Packit c32a2d
  [  --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) ],
Packit c32a2d
  [
Packit c32a2d
    if test "x$enableval" = xyes; then
Packit c32a2d
      ieee=enabled
Packit c32a2d
    else
Packit c32a2d
      ieee=disabled
Packit c32a2d
    fi
Packit c32a2d
  ], [ ieee=enabled ])
Packit c32a2d
Packit c32a2d
if test "x$ieee" = xenabled; then
Packit c32a2d
  echo "We assume IEEE754 floating point format."
Packit c32a2d
  AC_DEFINE(IEEE_FLOAT,   1, [ Define to indicate that float storage follows IEEE754. ])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
sys_cppflags=
Packit c32a2d
newoldwritesample=disabled
Packit c32a2d
case $host in
Packit c32a2d
  aarch64-*linux*|arm64-*linux*|aarch64-*bsd*|arm64-*bsd*|aarch64-apple-darwin*|arm64-apple-darwin*)
Packit c32a2d
    cpu_type="aarch64"
Packit c32a2d
  ;;
Packit c32a2d
  arm*-*-linux*-*eabihf|armv7hl*-*-linux*)
Packit c32a2d
    cpu_type="arm_fpu"
Packit c32a2d
  ;;
Packit c32a2d
  arm*-*-linux*)
Packit c32a2d
    # check that... perhaps we are better off on arm with kernel math emulation
Packit c32a2d
    cpu_type="arm_nofpu"
Packit c32a2d
  ;;
Packit c32a2d
  armv7*-apple-darwin*)
Packit c32a2d
    cpu_type="arm_fpu"
Packit c32a2d
  ;;
Packit c32a2d
  i386-*-linux*|i386-*-kfreebsd*-gnu)
Packit c32a2d
    cpu_type="i386_fpu"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  i486-*-linux*|i486-*-kfreebsd*-gnu)
Packit c32a2d
    cpu_type="i486"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  i586-*-linux*|i586-*-kfreebsd*-gnu)
Packit c32a2d
    cpu_type="x86"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  i686-*-linux*|i686-*-kfreebsd*-gnu)
Packit c32a2d
    cpu_type="x86"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  x86_64-*-linux*|x86_64-*-kfreebsd*-gnu)
Packit c32a2d
    cpu_type="x86-64"
Packit c32a2d
  ;;
Packit c32a2d
  *-*-linux*|*-*-kfreebsd*-gnu)
Packit c32a2d
    cpu_type="generic_fpu"
Packit c32a2d
  ;;
Packit c32a2d
  i?86-apple-darwin10*)
Packit c32a2d
    AC_MSG_CHECKING([if CPU type supports x86-64])
Packit c32a2d
    case `sysctl -n hw.optional.x86_64` in
Packit c32a2d
      1)
Packit c32a2d
        AC_MSG_RESULT([yes])
Packit c32a2d
        cpu_type="x86-64"
Packit c32a2d
      ;;
Packit c32a2d
      *)
Packit c32a2d
        AC_MSG_RESULT([no])
Packit c32a2d
        cpu_type="x86"
Packit c32a2d
        newoldwritesample=enabled
Packit c32a2d
      ;;
Packit c32a2d
    esac
Packit c32a2d
  ;;
Packit c32a2d
  i?86-apple-darwin*)
Packit c32a2d
    cpu_type="x86"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  x86_64-apple-darwin*)
Packit c32a2d
    cpu_type="x86-64"
Packit c32a2d
  ;;
Packit c32a2d
  *-apple-darwin*)
Packit c32a2d
    AC_MSG_CHECKING([if CPU type supports AltiVec])
Packit c32a2d
    case `machine` in
Packit c32a2d
      ppc7400 | ppc7450 | ppc970)
Packit c32a2d
        AC_MSG_RESULT([yes])
Packit c32a2d
        cpu_type="altivec"
Packit c32a2d
      ;;
Packit c32a2d
      *)
Packit c32a2d
        AC_MSG_RESULT([no])
Packit c32a2d
        cpu_type="generic_fpu"
Packit c32a2d
      ;;
Packit c32a2d
    esac
Packit c32a2d
  ;;
Packit c32a2d
  i?86-*-dragonfly* | i?86-*-freebsd* | i?86-*-midnightbsd* | i?86-*-mirbsd* | i?86-*-netbsd* | i?86-*-openbsd* | i?86-*-haiku*)
Packit c32a2d
    cpu_type="x86"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  x86_64-*-dragonfly* | x86_64-*-freebsd* | x86_64-*-midnightbsd* | x86_64-*-mirbsd* | x86_64-*-netbsd* | x86_64-*-openbsd* | x86_64-*-haiku*)
Packit c32a2d
    cpu_type="x86-64"
Packit c32a2d
  ;;
Packit c32a2d
  *-*-dragonfly* | *-*-freebsd* | *-*-midnightbsd* | *-*-mirbsd* | *-*-netbsd* | *-*-openbsd*)
Packit c32a2d
    cpu_type="generic_fpu"
Packit c32a2d
  ;;
Packit c32a2d
  i386-*-solaris*)
Packit c32a2d
    cpu_type=x86
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  x86_64-*-solaris*)
Packit c32a2d
    cpu_type=x86-64
Packit c32a2d
  ;;
Packit c32a2d
  *-*-solaris*)
Packit c32a2d
    cpu_type="generic_fpu"
Packit c32a2d
  ;;
Packit c32a2d
  # os2-emx = OS/2 with some Unix fun; so p.ex. buffer works.
Packit c32a2d
  # Till we sorted out the assembler troubles, generic CPU is default.
Packit c32a2d
  i386-pc-os2-emx)
Packit c32a2d
    cpu_type=generic_fpu
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  x86_64-pc-os2-emx)
Packit c32a2d
    # We are optimistic hat the future knows OS/2 on x86-64;-)
Packit c32a2d
    cpu_type=generic_fpu
Packit c32a2d
  ;;
Packit c32a2d
  *-pc-os2-emx)
Packit c32a2d
    cpu_type="generic_fpu"
Packit c32a2d
  ;;
Packit c32a2d
  *-dec-osf*)
Packit c32a2d
    cpu_type="generic_fpu"
Packit c32a2d
  ;;
Packit c32a2d
  x86_64-*-cygwin*)
Packit c32a2d
    cpu_type="x86-64"
Packit c32a2d
  ;;
Packit c32a2d
  i686-*-cygwin*)
Packit c32a2d
    cpu_type="x86"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  i586-*-cygwin*)
Packit c32a2d
    cpu_type="x86"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  i486-*-cygwin*)
Packit c32a2d
    cpu_type="i486"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  i386-*-cygwin*)
Packit c32a2d
    cpu_type="i386"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  *-cygwin*)
Packit c32a2d
    cpu_type="generic_fpu"
Packit c32a2d
  ;;
Packit c32a2d
  i@<:@3-7@:>@86-*-mingw32*)
Packit c32a2d
    LIBS="$LIBS"
Packit c32a2d
    buffer=disabled
Packit c32a2d
    cpu_type="x86"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  x86_64-*-mingw32*)
Packit c32a2d
    LIBS="$LIBS"
Packit c32a2d
    buffer=disabled
Packit c32a2d
    cpu_type="x86-64"
Packit c32a2d
  ;;
Packit c32a2d
  i386-*-nto-qnx*)
Packit c32a2d
    cpu_type="x86"
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
  ;;
Packit c32a2d
  *-ibm-aix*)
Packit c32a2d
    AC_MSG_WARN([AIX system detected. You might want to --disable-largefile when trouble about conflicting types for lseek64 and friends occurs.])
Packit c32a2d
    # Altivec instead? It is developed for MacOS ...
Packit c32a2d
    cpu_type=generic_fpu
Packit c32a2d
    # no struct winsize without _ALL_SOURCE
Packit c32a2d
    sys_cppflags=-D_ALL_SOURCE
Packit c32a2d
  ;;
Packit c32a2d
	i386-*)
Packit c32a2d
		AC_MSG_WARN([Unknown host operating system])
Packit c32a2d
		cpu_type="i386"
Packit c32a2d
		buffer=disabled
Packit c32a2d
		sys_cppflags=-DGENERIC
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
	;;
Packit c32a2d
	i486-*)
Packit c32a2d
		AC_MSG_WARN([Unknown host operating system])
Packit c32a2d
		cpu_type="i486"
Packit c32a2d
		buffer=disabled
Packit c32a2d
		sys_cppflags=-DGENERIC
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
	;;
Packit c32a2d
	i586-*)
Packit c32a2d
		AC_MSG_WARN([Unknown host operating system])
Packit c32a2d
		cpu_type="x86"
Packit c32a2d
		buffer=disabled
Packit c32a2d
		sys_cppflags=-DGENERIC
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
	;;
Packit c32a2d
	i686-*)
Packit c32a2d
		AC_MSG_WARN([Unknown host operating system])
Packit c32a2d
		cpu_type="x86"
Packit c32a2d
		buffer=disabled
Packit c32a2d
		sys_cppflags=-DGENERIC
Packit c32a2d
    newoldwritesample=enabled
Packit c32a2d
	;;
Packit c32a2d
	x86_64-*)
Packit c32a2d
		AC_MSG_WARN([Unknown host operating system])
Packit c32a2d
		cpu_type="x86-64"
Packit c32a2d
		buffer=disabled
Packit c32a2d
		sys_cppflags=-DGENERIC
Packit c32a2d
	;;
Packit c32a2d
  *)
Packit c32a2d
  	AC_MSG_WARN([Unknown host operating system])
Packit c32a2d
    cpu_type="generic_fpu"
Packit c32a2d
    buffer=disabled
Packit c32a2d
    sys_cppflags=-DGENERIC
Packit c32a2d
  ;;
Packit c32a2d
esac
Packit c32a2d
Packit c32a2d
AC_ARG_ENABLE(buffer,
Packit c32a2d
  [  --enable-buffer=[yes/no] disable audio buffer code (default uses system whitelist... proper checks later) ],
Packit c32a2d
  [
Packit c32a2d
    if test "x$enableval" = xyes
Packit c32a2d
    then
Packit c32a2d
      echo "Note: Enabling buffer per request... perhaps it will not build anyway."
Packit c32a2d
      buffer="enabled"
Packit c32a2d
    else
Packit c32a2d
      echo "Note: Disabling buffer per request."
Packit c32a2d
      buffer="disabled"
Packit c32a2d
    fi
Packit c32a2d
  ]
Packit c32a2d
)
Packit c32a2d
Packit c32a2d
AC_ARG_ENABLE(newoldwritesample,
Packit c32a2d
[  --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)],
Packit c32a2d
[
Packit c32a2d
	if test "x$enableval" = xyes
Packit c32a2d
	then
Packit c32a2d
		newoldwritesample=enabled
Packit c32a2d
	else
Packit c32a2d
		newoldwritesample=disabled
Packit c32a2d
	fi
Packit c32a2d
])
Packit c32a2d
Packit c32a2d
dnl Did user choose other CPU type ?
Packit c32a2d
if test "x$with_cpu" != "x"; then
Packit c32a2d
	cpu_type=$with_cpu
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
# Flag for 32 bit synth output or post-processing.
Packit c32a2d
case "$cpu_type" in
Packit c32a2d
*_nofpu)
Packit c32a2d
  synth32=false
Packit c32a2d
  AC_DEFINE(NO_SYNTH32, 1, [ Define for post-processed 32 bit formats. ])
Packit c32a2d
;;
Packit c32a2d
*)
Packit c32a2d
  synth32=true
Packit c32a2d
;;
Packit c32a2d
esac
Packit c32a2d
Packit c32a2d
if test "x$int16" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_16BIT, 1, [ Define to disable 16 bit integer output. ])
Packit c32a2d
else
Packit c32a2d
  DECODER_OBJ="$DECODER_OBJ synth.\$(OBJEXT)"
Packit c32a2d
  DECODER_LOBJ="$DECODER_LOBJ synth.lo"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
# 8bit works only through 16bit
Packit c32a2d
if test "x$int16" = "xdisabled"; then
Packit c32a2d
  int8=disabled
Packit c32a2d
fi
Packit c32a2d
if test "x$int8" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_8BIT, 1, [ Define to disable 8 bit integer output. ])
Packit c32a2d
else
Packit c32a2d
  DECODER_OBJ="$DECODER_OBJ synth_8bit.\$(OBJEXT)"
Packit c32a2d
  DECODER_LOBJ="$DECODER_LOBJ synth_8bit.lo"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test "x$int32" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_32BIT, 1, [ Define to disable 32 bit and 24 bit integer output. ])
Packit c32a2d
else
Packit c32a2d
  if $synth32; then
Packit c32a2d
    s_fpu="$s_fpu synth_s32"
Packit c32a2d
  fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test "x$real" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_REAL, 1, [ Define to disable real output. ])
Packit c32a2d
else
Packit c32a2d
  if $synth32; then
Packit c32a2d
    s_fpu="$s_fpu synth_real"
Packit c32a2d
  fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test "x$equalizer" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_EQUALIZER, 1, [ Define to disable equalizer. ])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
layer1=enabled
Packit c32a2d
AC_ARG_ENABLE(layer1,
Packit c32a2d
              [  --disable-layer1=[no/yes] no layer I decoding ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  layer1="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
if test "x$layer1" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_LAYER1, 1, [ Define to disable layer I. ])
Packit c32a2d
else
Packit c32a2d
  # layer1 needs code in layer2
Packit c32a2d
  DECODER_OBJ="$DECODER_OBJ layer1.\$(OBJEXT) layer2.\$(OBJEXT)"
Packit c32a2d
  DECODER_LOBJ="$DECODER_LOBJ layer1.lo layer2.lo"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
layer2=enabled
Packit c32a2d
AC_ARG_ENABLE(layer2,
Packit c32a2d
              [  --disable-layer2=[no/yes] no layer II decoding ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  layer2="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
if test "x$layer2" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_LAYER2, 1, [ Define to disable layer II. ])
Packit c32a2d
else
Packit c32a2d
  # layer1 may have added the objects already
Packit c32a2d
  if test "x$layer1" = "xdisabled"; then
Packit c32a2d
    DECODER_OBJ="$DECODER_OBJ layer2.\$(OBJEXT)"
Packit c32a2d
    DECODER_LOBJ="$DECODER_LOBJ layer2.lo"
Packit c32a2d
  fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
layer3=enabled
Packit c32a2d
AC_ARG_ENABLE(layer3,
Packit c32a2d
              [  --disable-layer3=[no/yes] no layer III decoding ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  layer3="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ], [])
Packit c32a2d
Packit c32a2d
if test "x$layer3" = "xdisabled"; then
Packit c32a2d
  AC_DEFINE(NO_LAYER3, 1, [ Define to disable layer III. ])
Packit c32a2d
else
Packit c32a2d
  DECODER_OBJ="$DECODER_OBJ layer3.\$(OBJEXT)"
Packit c32a2d
  DECODER_LOBJ="$DECODER_LOBJ layer3.lo"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
AC_ARG_WITH([audio], [
Packit c32a2d
  --with-audio=<list of modules>  Select a list (or only one) of audio output modules (comma or space separated list).
Packit c32a2d
])
Packit c32a2d
AC_ARG_WITH([default-audio], [
Packit c32a2d
  --with-default-audio=aix            Use AIX as default audio output sub-system
Packit c32a2d
  --with-default-audio=alib           Use Alib as default audio output sub-system (for HPUX)
Packit c32a2d
  --with-default-audio=alsa           Use ALSA as default audio output sub-system (libasound)
Packit c32a2d
  --with-default-audio=tinyalsa       Use ALSA as default audio output sub-system (tinyalsa)
Packit c32a2d
  --with-default-audio=arts           Use aRts as default audio output sub-system (KDE sound server)
Packit c32a2d
  --with-default-audio=dummy          Use dummy as default audio (when no sound card is available)
Packit c32a2d
  --with-default-audio=esd            Use ESoundD as default audio output sub-system
Packit c32a2d
  --with-default-audio=hp             Use HP as default audio output sub-system
Packit c32a2d
  --with-default-audio=jack           Use JACK as default low-latency audio server
Packit c32a2d
  --with-default-audio=coreaudio      Use Mac OS X as default audio output sub-system (CoreAudio)
Packit c32a2d
  --with-default-audio=mint           Use MinT as default audio output sub-system (Atari)
Packit c32a2d
  --with-default-audio=nas            Use NAS as default audio output (Network Audio System)
Packit c32a2d
  --with-default-audio=os2            Use OS2 as default audio output sub-system
Packit c32a2d
  --with-default-audio=oss            Use OSS as default audio output sub-system (/dev/dsp)
Packit c32a2d
  --with-default-audio=portaudio      Use PortAudio as default audio output sub-system
Packit c32a2d
  --with-default-audio=pulse          Use Pulse audio server as default audio output sub-system
Packit c32a2d
  --with-default-audio=qsa            Use QSA as default audio output sub-system
Packit c32a2d
  --with-default-audio=sdl            Use SDL as default audio output sub-system (Simple DirectMedia Layer)
Packit c32a2d
  --with-default-audio=sgi            Use SGI as default audio output sub-system (IRIX)
Packit c32a2d
  --with-default-audio=sndio          Use OpenBSD's sndio as default audio output sub-system
Packit c32a2d
  --with-default-audio=sun            Use Sun as default audio output sub-system (/dev/audio)
Packit c32a2d
  --with-default-audio=win32          Use Win32 audio as default audio output sub-system
Packit c32a2d
  --with-default-audio=win32_wasapi   Use Win32 wasapi audio as default audio output sub-system
Packit c32a2d
])
Packit c32a2d
Packit c32a2d
AC_ARG_WITH([optimization], [
Packit c32a2d
  --with-optimization=0   No Optimization
Packit c32a2d
  --with-optimization=1   Limited Optimization (-O) (for gcc)
Packit c32a2d
  --with-optimization=2   Default Optimization (-O2 ...) (for gcc)
Packit c32a2d
  --with-optimization=3   More Optimize than default (-O3 ...) (for gcc)
Packit c32a2d
  --with-optimization=4   Optimize yet more (-O4 ...) (for gcc)
Packit c32a2d
])
Packit c32a2d
Packit c32a2d
AC_ARG_WITH([seektable], [
Packit c32a2d
  --with-seektable=<size> choose size of seek index table (0 disables it), default 1000
Packit c32a2d
])
Packit c32a2d
Packit c32a2d
Packit c32a2d
dnl ############## Modules
Packit c32a2d
Packit c32a2d
# Dummy audio output module is always supported
Packit c32a2d
output_modules="dummy"
Packit c32a2d
Packit c32a2d
dnl ############## Assembler, compiler properties
Packit c32a2d
Packit c32a2d
# based on posting from John Dalgliesh <johnd@defyne.org> on ffmpeg (LGPL) mailing list
Packit c32a2d
# extended to use balign if present
Packit c32a2d
AC_MSG_CHECKING([if .balign is present])
Packit c32a2d
echo '.balign 4' > conftest.s
Packit c32a2d
if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then
Packit c32a2d
Packit c32a2d
  AC_MSG_RESULT([yes])
Packit c32a2d
  AC_DEFINE(ASMALIGN_BALIGN, 1, [ Define if .balign is present. ])
Packit c32a2d
Packit c32a2d
else
Packit c32a2d
Packit c32a2d
AC_MSG_RESULT([no])
Packit c32a2d
Packit c32a2d
# find if .align arg is power-of-two or not
Packit c32a2d
asmalign_exp="unknown"
Packit c32a2d
if test x"$asmalign_exp" = xunknown; then
Packit c32a2d
	AC_MSG_CHECKING([if .align takes 2-exponent])
Packit c32a2d
	asmalign_exp="no"
Packit c32a2d
	echo '.align 3' > conftest.s
Packit c32a2d
	if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then
Packit c32a2d
		asmalign_exp="yes"
Packit c32a2d
		AC_MSG_RESULT([yes])
Packit c32a2d
	else
Packit c32a2d
		AC_MSG_RESULT([no])
Packit c32a2d
	fi
Packit c32a2d
	rm -f conftest.o conftest.s
Packit c32a2d
fi
Packit c32a2d
if test x"$asmalign_exp" = xyes; then
Packit c32a2d
	AC_DEFINE(ASMALIGN_EXP, 1, [ Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. ])
Packit c32a2d
else
Packit c32a2d
	AC_DEFINE(ASMALIGN_BYTE, 1, [ Define if .align just takes byte count. ])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
ccalign="unknown"
Packit c32a2d
if test x"$ccalign" = xunknown; then
Packit c32a2d
	AC_MSG_CHECKING([__attribute__((aligned(16)))])
Packit c32a2d
	ccalign="no"
Packit c32a2d
	echo '__attribute__((aligned(16))) float var;' > conftest.c
Packit c32a2d
	if $CC -c -o conftest.o conftest.c >/dev/null 2>&1; then
Packit c32a2d
		ccalign="yes"
Packit c32a2d
		AC_MSG_RESULT([yes])
Packit c32a2d
	else
Packit c32a2d
		AC_MSG_RESULT([no])
Packit c32a2d
	fi
Packit c32a2d
	rm -f conftest.o conftest.c
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl We apply alignment hints only to cpus that need it.
Packit c32a2d
dnl See further below for the definition of CCALIGN
Packit c32a2d
Packit c32a2d
avx_support="unknown"
Packit c32a2d
if test x"$avx_support" = xunknown; then
Packit c32a2d
	AC_MSG_CHECKING([if assembler supports AVX instructions])
Packit c32a2d
	avx_support="no"
Packit c32a2d
	echo '.text' > conftest.s
Packit c32a2d
	echo 'vaddps %ymm0,%ymm0,%ymm0' >> conftest.s
Packit c32a2d
	if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then
Packit c32a2d
		avx_support="yes"
Packit c32a2d
		AC_MSG_RESULT([yes])
Packit c32a2d
	else
Packit c32a2d
		AC_MSG_RESULT([no])
Packit c32a2d
	fi
Packit c32a2d
	rm -f conftest.o conftest.s
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
check_yasm=no
Packit c32a2d
if test x"$avx_support" = xno || test x"$use_yasm" = xenabled; then
Packit c32a2d
  check_yasm=yes
Packit c32a2d
fi
Packit c32a2d
if test x"$use_yasm" = xdisabled; then
Packit c32a2d
  check_yasm=no
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test x"$check_yasm" = xyes; then
Packit c32a2d
	AC_CHECK_PROGS(YASM,[yasm],no)
Packit c32a2d
	if test x"$YASM" != xno; then
Packit c32a2d
		AC_MSG_CHECKING([if $YASM supports GAS syntax and AVX instructions])
Packit c32a2d
		echo '.text' > conftest.s
Packit c32a2d
		echo 'vaddps %ymm0,%ymm0,%ymm0' >> conftest.s
Packit c32a2d
		if $YASM -pgas -rcpp -o conftest.o conftest.s 1>/dev/null 2>&1; then
Packit c32a2d
			avx_support="yes"
Packit c32a2d
			YASMFLAGS="-pgas -rgas -mamd64"
Packit c32a2d
			AC_MSG_RESULT([yes])
Packit c32a2d
		else
Packit c32a2d
			AC_MSG_RESULT([no])
Packit c32a2d
		fi
Packit c32a2d
		rm -f conftest.o conftest.s
Packit c32a2d
	else
Packit c32a2d
		if test x"$use_yasm" = xenabled; then
Packit c32a2d
			AC_MSG_ERROR([Yasm enforced but not found!])
Packit c32a2d
		fi
Packit c32a2d
	fi
Packit c32a2d
else
Packit c32a2d
	YASM="no"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test "x$cpu_type" = "xavx"; then
Packit c32a2d
	if test "x$avx_support" != "xyes"; then
Packit c32a2d
		AC_MSG_ERROR([Assembler doesn't understand AVX instructions.])
Packit c32a2d
	fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
AC_SUBST(YASM)
Packit c32a2d
AC_SUBST(YASMFLAGS)
Packit c32a2d
Packit c32a2d
dnl ############## Really basic headers, needed for other checks.
Packit c32a2d
Packit c32a2d
AC_HEADER_STDC
Packit c32a2d
dnl Is it too paranoid to specifically check for stdint.h and limits.h?
Packit c32a2d
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])
Packit c32a2d
Packit c32a2d
dnl ############## Types
Packit c32a2d
Packit c32a2d
dnl Large file support stuff needs cleanup. There are superfluous variables.
Packit c32a2d
Packit c32a2d
dnl Detect large file support, enable switches if needed.
Packit c32a2d
AC_SYS_LARGEFILE
Packit c32a2d
dnl If we do have a switch for large files, rename off_t-aware API calls.
Packit c32a2d
dnl Using the file_offset_bits variable here is fine for linux (possibly Solaris),
Packit c32a2d
dnl Others... we'll have to see.
Packit c32a2d
dnl Note: I started writing this with with multiline replacements.
Packit c32a2d
dnl Does not work. Automake insists on putting these into Makefiles where they break things.
Packit c32a2d
dnl It is also assumed that a system that does not set file offset bits is not
Packit c32a2d
dnl sensitive to largefile changes, i.e. FreeBSD always using 64 bit off_t.
Packit c32a2d
if test "x$ac_cv_sys_file_offset_bits" = x || echo "$ac_cv_sys_file_offset_bits" | $GREP  '@<:@^0-9@:>@' > /dev/null; then
Packit c32a2d
	dnl if it has non-numeric chars or is empty... ignore...
Packit c32a2d
	LFS_LOBJ=
Packit c32a2d
	largefile_sensitive=no
Packit c32a2d
else
Packit c32a2d
	# Add dual-mode wrapper code.
Packit c32a2d
	LFS_LOBJ=lfs_wrap.lo
Packit c32a2d
	largefile_sensitive=yes
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
# Using the lower level macros instead of AC_TYPE_* for compatibility with not freshest autoconf.
Packit c32a2d
AC_CHECK_TYPE(size_t, unsigned long)
Packit c32a2d
AC_CHECK_TYPE(uintptr_t, unsigned long)
Packit c32a2d
AC_CHECK_TYPE(ssize_t, long)
Packit c32a2d
AC_CHECK_TYPE(off_t,  long int)
Packit c32a2d
AC_CHECK_TYPE(int32_t, int)
Packit c32a2d
AC_CHECK_TYPE(int64_t, long long)
Packit c32a2d
AC_CHECK_TYPE(uint32_t, unsigned int)
Packit c32a2d
AC_CHECK_TYPE(int16_t, short)
Packit c32a2d
AC_CHECK_TYPE(uint16_t, unsigned short)
Packit c32a2d
AC_CHECK_SIZEOF(size_t,4)
Packit c32a2d
AC_CHECK_SIZEOF(ssize_t,4)
Packit c32a2d
AC_CHECK_SIZEOF(off_t,4)
Packit c32a2d
AC_CHECK_SIZEOF(int32_t)
Packit c32a2d
AC_CHECK_SIZEOF(long,4)
Packit c32a2d
Packit c32a2d
dnl The native type used for aliases is what off_t maps to without any largefile-
Packit c32a2d
dnl enabling switches. So, it's long int if the system is largefile-senstive,
Packit c32a2d
dnl but it is actual plain off_t if the system does not have such switches.
Packit c32a2d
if test "x$largefile_sensitive" = xyes; then
Packit c32a2d
  lfs_alias_type=long
Packit c32a2d
  lfs_alias_size=$ac_cv_sizeof_long
Packit c32a2d
else
Packit c32a2d
  lfs_alias_type=off_t
Packit c32a2d
  lfs_alias_size=$ac_cv_sizeof_off_t
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test "x$lfs_alias_size" = "x"; then 
Packit c32a2d
  AC_MSG_ERROR([Cannot determine sizeof(lfs_alias_t)?])
Packit c32a2d
else
Packit c32a2d
  LFS_ALIAS_BITS=`expr "$lfs_alias_size" "*" "8"`
Packit c32a2d
  AC_DEFINE_UNQUOTED([lfs_alias_t], $lfs_alias_type,
Packit c32a2d
    [Define to the native offset type (long or actually off_t).])
Packit c32a2d
  AC_DEFINE_UNQUOTED([LFS_ALIAS_BITS], $LFS_ALIAS_BITS,
Packit c32a2d
    [Define this to the size of native offset type in bits, used for LFS alias functions.])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
lfs_alias=enabled
Packit c32a2d
AC_ARG_ENABLE(lfs-alias,
Packit c32a2d
              [  --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!) ],
Packit c32a2d
              [
Packit c32a2d
                if test "x$enableval" = xno; then
Packit c32a2d
                  lfs_alias="disabled"
Packit c32a2d
                fi
Packit c32a2d
              ],
Packit c32a2d
              [
Packit c32a2d
                case $host in
Packit c32a2d
                *-cygwin*)
Packit c32a2d
                  lfs_alias="disabled"
Packit c32a2d
                  AC_MSG_NOTICE([lfs-alias disabled for Cygwin, use --enable-lfs-alias explicitly to enable, only if you know what you are doing])
Packit c32a2d
                ;;
Packit c32a2d
                esac
Packit c32a2d
Packit c32a2d
              ])
Packit c32a2d
Packit c32a2d
AC_MSG_CHECKING([if we want to enable alias wrappers for largefile])
Packit c32a2d
if test "x$lfs_alias" = "xenabled"; then
Packit c32a2d
  AC_MSG_RESULT([yes])
Packit c32a2d
  LFS_LOBJ="$LFS_LOBJ lfs_alias.lo"
Packit c32a2d
else
Packit c32a2d
  AC_MSG_RESULT([no])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
# Again, prepend path for non-recursive make.
Packit c32a2d
LFS_LOBJ=`for i in $LFS_LOBJ; do printf ' src/libmpg123/%s' $i; done`
Packit c32a2d
AC_SUBST(LFS_LOBJ)
Packit c32a2d
Packit c32a2d
Packit c32a2d
dnl ############## Function Checks
Packit c32a2d
Packit c32a2d
AC_FUNC_MMAP
Packit c32a2d
Packit c32a2d
# Check if system supports termios
Packit c32a2d
AC_SYS_POSIX_TERMIOS
Packit c32a2d
if test "x$ac_cv_sys_posix_termios" = "xyes"; then
Packit c32a2d
  AC_DEFINE_UNQUOTED([HAVE_TERMIOS], 1, 
Packit c32a2d
  [Define this if you have the POSIX termios library])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
AC_CHECK_FUNCS( random )
Packit c32a2d
Packit c32a2d
# Check for sched_setscheduler
Packit c32a2d
AC_CHECK_FUNCS( sched_setscheduler setuid getuid)
Packit c32a2d
Packit c32a2d
# Check for setpriority
Packit c32a2d
AC_CHECK_FUNCS( setpriority )
Packit c32a2d
Packit c32a2d
AC_CHECK_FUNCS( strerror )
Packit c32a2d
Packit c32a2d
AC_CHECK_FUNCS( setlocale nl_langinfo )
Packit c32a2d
Packit c32a2d
AC_CHECK_FUNCS( atoll )
Packit c32a2d
Packit c32a2d
AC_CHECK_FUNCS( mkfifo, [ have_mkfifo=yes ], [ have_mkfifo=no ] )
Packit c32a2d
Packit c32a2d
dnl ############## Header and Library Checks
Packit c32a2d
Packit c32a2d
# locale headers
Packit c32a2d
AC_CHECK_HEADERS([locale.h langinfo.h])
Packit c32a2d
# Headers for network (http) stuff
Packit c32a2d
network_type=Unknown
Packit c32a2d
AC_CHECK_HEADERS([netdb.h sys/param.h sys/socket.h netinet/in.h arpa/inet.h])
Packit c32a2d
if test "x$ac_cv_header_netdb_h" = "xyes"      &&
Packit c32a2d
   test "x$ac_cv_header_sys_param_h" = "xyes"  &&
Packit c32a2d
   test "x$ac_cv_header_sys_socket_h" = "xyes" &&
Packit c32a2d
   test "x$ac_cv_header_netinet_in_h" = "xyes" &&
Packit c32a2d
   test "x$ac_cv_header_arpa_inet_h"  = "xyes"; then
Packit c32a2d
  have_network=yes
Packit c32a2d
  network_type=Posix
Packit c32a2d
else
Packit c32a2d
  have_network=no
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl trying to get that socket lib settled in one line
Packit c32a2d
AC_SEARCH_LIBS(gethostbyname, nsl socket network) 
Packit c32a2d
dnl OK, two lines... Solaris needs -lnsl -lsocket
Packit c32a2d
AC_SEARCH_LIBS(socket, socket) 
Packit c32a2d
Packit c32a2d
AC_CHECK_FUNCS( getaddrinfo, [ have_ipv6=yes ], [ have_ipv6=no ] )
Packit c32a2d
Packit c32a2d
APR_CHECK_GETADDRINFO_ADDRCONFIG()
Packit c32a2d
Packit c32a2d
# Substitutions for the installable mpg123.h header
Packit c32a2d
if test "x$ac_cv_header_stdio_h" = "xyes"; then
Packit c32a2d
	INCLUDE_STDIO_H="#include <stdio.h>"
Packit c32a2d
else
Packit c32a2d
	INCLUDE_STDIO_H="/* #include <stdio.h> is not available on this system */"
Packit c32a2d
fi
Packit c32a2d
AC_SUBST(INCLUDE_STDIO_H)
Packit c32a2d
Packit c32a2d
if test "x$ac_cv_header_stdlib_h" = "xyes"; then
Packit c32a2d
	INCLUDE_STDLIB_H="#include <stdlib.h>"
Packit c32a2d
else
Packit c32a2d
	INCLUDE_STDLIB_H="/* #include <stdlib.h> is not available on this system */"
Packit c32a2d
fi
Packit c32a2d
AC_SUBST(INCLUDE_STDLIB_H)
Packit c32a2d
Packit c32a2d
if test "x$ac_cv_header_sys_types_h" = "xyes"; then
Packit c32a2d
	INCLUDE_SYS_TYPE_H="#include <sys/types.h>"
Packit c32a2d
else
Packit c32a2d
	INCLUDE_SYS_TYPE_H="/* #include <sys/types.h> is not available on this system */"
Packit c32a2d
fi
Packit c32a2d
AC_SUBST(INCLUDE_SYS_TYPE_H)
Packit c32a2d
Packit c32a2d
Packit c32a2d
# Checks for maths libraries.
Packit c32a2d
AC_CHECK_LIB([m], [sqrt])
Packit c32a2d
AC_CHECK_LIB([mx], [powf])
Packit c32a2d
Packit c32a2d
# attempt to make the signal stuff work... also with GENERIC - later
Packit c32a2d
#if test x"$ac_cv_header_sys_signal_h" = xyes; then
Packit c32a2d
#	AC_CHECK_FUNCS( sigemptyset sigaddset sigprocmask sigaction )
Packit c32a2d
#	if test x"$ac_cv_func_sigemptyset" = xyes &&
Packit c32a2d
#	   test x"$ac_cv_func_sigaddset" = xyes &&
Packit c32a2d
#	   test x"$ac_cv_func_sigprocmask" = xyes &&
Packit c32a2d
#	   test x"$ac_cv_func_sigaction" = xyes; then
Packit c32a2d
#	AC_DEFINE( 
Packit c32a2d
#fi
Packit c32a2d
Packit c32a2d
dnl ############## Choose compiler flags and CPU
Packit c32a2d
Packit c32a2d
# do not assume gcc here, so no flags by default
Packit c32a2d
ADD_CFLAGS=""
Packit c32a2d
ADD_CPPFLAGS="$sys_cppflags"
Packit c32a2d
ADD_LDFLAGS=""
Packit c32a2d
LIBS="$LIBS"
Packit c32a2d
Packit c32a2d
# Consider moving that stuff.
Packit c32a2d
AC_CHECK_HEADER([os2.h], [ADD_CPPFLAGS="$ADD_CPPFLAGS -DOS2"])
Packit c32a2d
# On OS/2, we need to link to os2term to make terminal control actually work.
Packit c32a2d
AC_CHECK_LIB([os2term], [tcsetattr], [ADD_LDFLAGS="$ADD_LDFLAGS -los2term"])
Packit c32a2d
Packit c32a2d
# If debugging is enabled, just enable debugging symbols.
Packit c32a2d
# All other stuff enters nagging territory.
Packit c32a2d
if test x"$debugging" = xenabled; then
Packit c32a2d
	ADD_CFLAGS="-g"
Packit c32a2d
fi
Packit c32a2d
# gcc specific...
Packit c32a2d
if test x"$GCC" = xyes; then
Packit c32a2d
	if test x"$nagging" = xenabled; then
Packit c32a2d
		ADD_CFLAGS="$ADD_CFLAGS -Wall -Werror -std=c89 -pedantic -DPLAIN_C89"
Packit c32a2d
	fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl Only try the attribute_align_arg mumbo-jumbo on x86, x86-64 warns/errors out on that attribute.
Packit c32a2d
dnl ...dunno even what about other architectures.
Packit c32a2d
case $host in
Packit c32a2d
  i?86-*)
Packit c32a2d
    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... ])
Packit c32a2d
 ;;
Packit c32a2d
esac
Packit c32a2d
Packit c32a2d
s_altivec="synth_altivec dct64_altivec"
Packit c32a2d
s_i386="dct64_i386"
Packit c32a2d
s_i486="$s_i386 synth_i486 dct64_i486"
Packit c32a2d
s_i586="$s_i386 synth_i586"
Packit c32a2d
s_i586d="$s_i386 synth_i586_dither"
Packit c32a2d
s_3dnow="$s_i386 synth_3dnow dct64_3dnow equalizer_3dnow"
Packit c32a2d
s_3dnowext="$s_i386 dct64_3dnowext tabinit_mmx synth_3dnowext"
Packit c32a2d
s_3dnow_vintage=$s_3dnow
Packit c32a2d
s_3dnowext_vintage=$s_3dnowext
Packit c32a2d
if test "x$layer3" = "xenabled"; then
Packit c32a2d
  s_3dnow_vintage="$s_3dnow_vintage dct36_3dnow"
Packit c32a2d
  s_3dnowext_vintage="$s_3dnowext_vintage dct36_3dnowext"
Packit c32a2d
fi
Packit c32a2d
s_mmx="$s_i386 dct64_mmx tabinit_mmx synth_mmx"
Packit c32a2d
s_sse_vintage="$s_i386 tabinit_mmx dct64_sse_float synth_sse_float synth_stereo_sse_float synth_sse_s32 synth_stereo_sse_s32 "
Packit c32a2d
s_sse="$s_sse_vintage dct36_sse"
Packit c32a2d
s_x86_64="dct36_x86_64 dct64_x86_64_float synth_x86_64_float synth_x86_64_s32 synth_stereo_x86_64_float synth_stereo_x86_64_s32"
Packit c32a2d
s_x86_64_mono_synths="synth_x86_64_float synth_x86_64_s32"
Packit c32a2d
s_x86_64_avx="dct36_avx dct64_avx_float synth_stereo_avx_float synth_stereo_avx_s32"
Packit c32a2d
s_x86multi="getcpuflags"
Packit c32a2d
s_x86_64_multi="getcpuflags_x86_64"
Packit c32a2d
s_dither="dither"
Packit c32a2d
s_neon="dct36_neon dct64_neon_float synth_neon_float synth_neon_s32 synth_stereo_neon_float synth_stereo_neon_s32"
Packit c32a2d
s_neon64="dct36_neon64 dct64_neon64_float synth_neon64_float synth_neon64_s32 synth_stereo_neon64_float synth_stereo_neon64_s32"
Packit c32a2d
s_arm_multi="getcpuflags_arm check_neon"
Packit c32a2d
Packit c32a2d
# choose optimized 16bit decoder for SSE, quality or fast
Packit c32a2d
# note: supporting deactivation of output formats for these decoders would need more logic here
Packit c32a2d
if test "x$integers" = "xquality"; then
Packit c32a2d
  s_sse="$s_sse synth_sse_accurate synth_stereo_sse_accurate"
Packit c32a2d
  s_sse_vintage="$s_sse_vintage synth_sse_accurate synth_stereo_sse_accurate"
Packit c32a2d
  s_x86_64="$s_x86_64 synth_x86_64_accurate synth_stereo_x86_64_accurate"
Packit c32a2d
  s_x86_64_mono_synths="$s_x86_64_mono_synths synth_x86_64_accurate"
Packit c32a2d
  s_x86_64_avx="$s_x86_64_avx synth_stereo_avx_accurate"
Packit c32a2d
  s_arm="synth_arm_accurate"
Packit c32a2d
  s_neon="$s_neon synth_neon_accurate synth_stereo_neon_accurate"
Packit c32a2d
  s_neon64="$s_neon64 synth_neon64_accurate synth_stereo_neon64_accurate"
Packit c32a2d
else
Packit c32a2d
  s_sse="$s_sse dct64_sse synth_sse" # no stereo
Packit c32a2d
  s_sse_vintage="$s_sse_vintage dct64_sse synth_sse" # no stereo
Packit c32a2d
  s_x86_64="$s_x86_64 synth_x86_64 dct64_x86_64 synth_stereo_x86_64"
Packit c32a2d
  s_x86_64_mono_synths="$s_x86_64_mono_synths synth_x86_64"
Packit c32a2d
  s_x86_64_avx="$s_x86_64_avx dct64_avx synth_stereo_avx"
Packit c32a2d
  s_arm="synth_arm"
Packit c32a2d
  s_neon="$s_neon dct64_neon synth_neon synth_stereo_neon"
Packit c32a2d
  s_neon64="$s_neon64 dct64_neon64 synth_neon64 synth_stereo_neon64"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl CPU specific compiler flags and sources
Packit c32a2d
case $cpu_type in
Packit c32a2d
  generic)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu"
Packit c32a2d
    ccalign=no
Packit c32a2d
  ;;
Packit c32a2d
  generic_dither)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_dither"
Packit c32a2d
    ccalign=no
Packit c32a2d
  ;;
Packit c32a2d
dnl Not disabling buffer for float mode... check that this is OK now!
Packit c32a2d
  generic_fpu | generic_float)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu"
Packit c32a2d
    ccalign=no
Packit c32a2d
  ;;
Packit c32a2d
  generic_nofpu)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FIXED"
Packit c32a2d
    more_sources=
Packit c32a2d
    ccalign=no
Packit c32a2d
  ;;
Packit c32a2d
  ppc_nofpu)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DOPT_PPC -DREAL_IS_FIXED"
Packit c32a2d
    more_sources=
Packit c32a2d
    ccalign=no
Packit c32a2d
  ;;
Packit c32a2d
  arm_nofpu)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_ARM -DREAL_IS_FIXED"
Packit c32a2d
    more_sources="$s_arm"
Packit c32a2d
    ccalign=no
Packit c32a2d
  ;;
Packit c32a2d
  altivec)
Packit c32a2d
    ADD_CFLAGS="$ADD_CFLAGS -maltivec"
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DREAL_IS_FLOAT -DOPT_ALTIVEC"
Packit c32a2d
    more_sources="$s_altivec $s_fpu"
Packit c32a2d
    AC_MSG_CHECKING([if $CC accepts -faltivec])
Packit c32a2d
    touch conftest.c
Packit c32a2d
    if $CC -faltivec -c -o conftest.o conftest.c >/dev/null 2>&1; then
Packit c32a2d
        ADD_CFLAGS="$ADD_CFLAGS -faltivec"
Packit c32a2d
        AC_MSG_RESULT([yes])
Packit c32a2d
    else
Packit c32a2d
        AC_MSG_RESULT([no])
Packit c32a2d
    fi
Packit c32a2d
    rm -f conftest.o conftest.c
Packit c32a2d
  ;;
Packit c32a2d
  neon)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_neon $s_fpu"
Packit c32a2d
  ;;
Packit c32a2d
  arm_fpu)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_neon $s_fpu $s_dither $s_arm_multi"
Packit c32a2d
  ;;
Packit c32a2d
  neon64)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON64 -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_neon64 $s_fpu"
Packit c32a2d
  ;;
Packit c32a2d
  aarch64)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON64 -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_neon64 $s_fpu $s_dither $s_arm_multi"
Packit c32a2d
  ;;
Packit c32a2d
  i386) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_i386"
Packit c32a2d
    ccalign=no
Packit c32a2d
  ;;
Packit c32a2d
  i386_fpu) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_i386"
Packit c32a2d
    ccalign=no
Packit c32a2d
  ;;
Packit c32a2d
  i386_nofpu) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FIXED"
Packit c32a2d
    more_sources="$s_i386"
Packit c32a2d
    ccalign=no
Packit c32a2d
  ;;
Packit c32a2d
  i486) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I486 -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_i486"
Packit c32a2d
    ccalign=no
Packit c32a2d
  ;;
Packit c32a2d
  i586) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586 -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_i586"
Packit c32a2d
  ;;
Packit c32a2d
  i586_dither) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586_DITHER -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_i586d $s_dither"
Packit c32a2d
  ;;
Packit c32a2d
  3dnow)
Packit c32a2d
    # legacy 3dnow had the 3dnow paired with i586...
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_i586 $s_3dnow $s_x86multi "
Packit c32a2d
  ;;
Packit c32a2d
  3dnow_vintage)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW_VINTAGE -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_i586 $s_3dnow_vintage $s_x86multi "
Packit c32a2d
  ;;
Packit c32a2d
  3dnow_alone)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOW -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_3dnow"
Packit c32a2d
  ;;
Packit c32a2d
  3dnowext_alone) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOWEXT -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_3dnowext"
Packit c32a2d
  ;;
Packit c32a2d
  3dnowext_vintage) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT_VINTAGE -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_3dnowext_vintage $s_3dnow $s_x86multi"
Packit c32a2d
  ;;
Packit c32a2d
  3dnowext) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_3dnowext $s_3dnow $s_x86multi"
Packit c32a2d
  ;;
Packit c32a2d
  mmx_alone|mmx) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MMX -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_mmx"
Packit c32a2d
  ;;
Packit c32a2d
  sse_alone|sse) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_sse"
Packit c32a2d
  ;;
Packit c32a2d
  sse_vintage) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_sse_vintage"
Packit c32a2d
  ;;
Packit c32a2d
  avx) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_AVX -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_x86_64_avx $s_x86_64_mono_synths"
Packit c32a2d
	if test "x$YASM" != "xno"; then
Packit c32a2d
		use_yasm_for_avx="yes"
Packit c32a2d
	fi
Packit c32a2d
  ;;
Packit c32a2d
  x86|x86_dither)
Packit c32a2d
    # plain C dct36 always there, for vintage/non-vintage
Packit c32a2d
    # Selection of non-/vintage sources implies that
Packit c32a2d
    # $s_3dnow_vintage contains $s_3dnow,
Packit c32a2d
    # $s_sse contains $s_sse_vintage.
Packit c32a2d
    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"
Packit c32a2d
    more_sources="$s_fpu $s_i386 $s_i586 $s_i586d $s_mmx $s_3dnow_vintage $s_3dnowext_vintage $s_sse $s_x86multi $s_dither"
Packit c32a2d
  ;;
Packit c32a2d
  x86-64_alone) 
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_X86_64 -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_x86_64"
Packit c32a2d
  ;;
Packit c32a2d
  x86-64|x86-64_all|x86-64_dither)
Packit c32a2d
    ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_X86_64 -DOPT_GENERIC -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT"
Packit c32a2d
    more_sources="$s_fpu $s_x86_64 $s_dither $s_x86_64_multi"
Packit c32a2d
	if test "x$avx_support" = "xyes"; then
Packit c32a2d
		ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_AVX"
Packit c32a2d
		more_sources="$more_sources $s_x86_64_avx"
Packit c32a2d
		if test "x$YASM" != "xno"; then
Packit c32a2d
			use_yasm_for_avx="yes"
Packit c32a2d
		fi
Packit c32a2d
	fi
Packit c32a2d
  ;;
Packit c32a2d
  *)
Packit c32a2d
  	AC_MSG_ERROR([Unknown CPU type '$cpu_type'])
Packit c32a2d
  ;;
Packit c32a2d
esac
Packit c32a2d
Packit c32a2d
# Use yasm instead of the default assembler for AVX sources
Packit c32a2d
if test "x$use_yasm_for_avx" = "xyes"; then
Packit c32a2d
	case $host_os in
Packit c32a2d
		*cygwin*|*mingw*)
Packit c32a2d
			YASM_FORMAT="-f win64"
Packit c32a2d
		;;
Packit c32a2d
		*darwin*)
Packit c32a2d
			YASM_FORMAT="-f macho"
Packit c32a2d
		;;
Packit c32a2d
		*)
Packit 89a6ad
			YASM_FORMAT="-f elf -g dwarf2"
Packit c32a2d
		;;
Packit c32a2d
	esac
Packit c32a2d
	AC_DEFINE(USE_YASM_FOR_AVX, 1, [Define to use yasm for assemble AVX sources.])
Packit c32a2d
fi
Packit c32a2d
AM_CONDITIONAL( [USE_YASM_FOR_AVX], [test "x$use_yasm_for_avx" = xyes] )
Packit c32a2d
AC_SUBST(YASM_FORMAT)
Packit c32a2d
Packit c32a2d
# Check if we want feature report function.
Packit c32a2d
AC_MSG_CHECKING([if we want feature report function])
Packit c32a2d
feature_report=enabled
Packit c32a2d
AC_ARG_ENABLE(feature_report,
Packit c32a2d
	[  --disable-feature_report Disable feature report function ],
Packit c32a2d
	[
Packit c32a2d
		if test "x$enableval" = xno; then
Packit c32a2d
		AC_MSG_RESULT([no])
Packit c32a2d
		feature_report=disabled
Packit c32a2d
		else
Packit c32a2d
		AC_MSG_RESULT([yes])
Packit c32a2d
		fi
Packit c32a2d
	],
Packit c32a2d
	[AC_MSG_RESULT([yes])])
Packit c32a2d
Packit c32a2d
if test "x$feature_report" = xenabled; then
Packit c32a2d
	more_sources="$more_sources feature"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
# Return 0 if first arg appears in list of following arguments.
Packit c32a2d
# Return 1 otherwise.
Packit c32a2d
word_in_list() {
Packit c32a2d
  word=$1
Packit c32a2d
  shift
Packit c32a2d
  # Avoid naming conflict with the outside!
Packit c32a2d
  # Is local not POSIX sh?
Packit c32a2d
  for given_word in "$@"
Packit c32a2d
  do
Packit c32a2d
    if test "x$word" = "x$given_word"; then
Packit c32a2d
      return 0
Packit c32a2d
    fi
Packit c32a2d
  done
Packit c32a2d
  return 1
Packit c32a2d
}
Packit c32a2d
Packit c32a2d
for i in $more_sources
Packit c32a2d
do
Packit c32a2d
  # Make sure every file is only once in the list.
Packit c32a2d
  word_in_list "$i.\$(OBJEXT)" $DECODER_OBJ || DECODER_OBJ="$DECODER_OBJ $i.\$(OBJEXT)"
Packit c32a2d
  word_in_list "$i.lo" $DECODER_LOBJ || DECODER_LOBJ="$DECODER_LOBJ $i.lo"
Packit c32a2d
done
Packit c32a2d
Packit c32a2d
# Another preprocessing step: Append prefix for non-recursive make.
Packit c32a2d
# Just because $(addprefix ...) is a GNU extension.
Packit c32a2d
Packit c32a2d
DECODER_OBJ=`for i in $DECODER_OBJ; do printf ' src/libmpg123/%s' $i; done`
Packit c32a2d
DECODER_LOBJ=`for i in $DECODER_LOBJ; do printf ' src/libmpg123/%s' $i; done`
Packit c32a2d
Packit c32a2d
AC_SUBST(DECODER_OBJ)
Packit c32a2d
AC_SUBST(DECODER_LOBJ)
Packit c32a2d
Packit c32a2d
dnl Finally insert the code switch for alignment, above cpu selection having possibly changed the setting.
Packit c32a2d
if test x"$ccalign" = xyes; then
Packit c32a2d
	AC_DEFINE(CCALIGN, 1, [ Define if __attribute__((aligned(16))) shall be used ])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
Packit c32a2d
dnl ############## Output module choice
Packit c32a2d
Packit c32a2d
# The full list of supported modules to check, first come, first serve.
Packit c32a2d
check_modules="alsa tinyalsa oss coreaudio sndio sun win32 win32_wasapi os2 esd jack portaudio pulse sdl nas arts openal dummy"
Packit c32a2d
# Only check qsa before all else on QNX.
Packit c32a2d
# It would mask ALSA otherwise.
Packit c32a2d
case $host in
Packit c32a2d
  *-nto-qnx*)
Packit c32a2d
    check_modules="qsa $check_modules"
Packit c32a2d
  ;;
Packit c32a2d
esac
Packit c32a2d
Packit c32a2d
# The final list.
Packit c32a2d
output_modules=
Packit c32a2d
Packit c32a2d
check_forced=no
Packit c32a2d
check_failed=no
Packit c32a2d
if test "x$with_audio" != "x"; then
Packit c32a2d
	check_modules="`echo $with_audio|tr , ' '` dummy"
Packit c32a2d
	echo "Limiting outputs to build according to your preference: $check_modules"
Packit c32a2d
	check_forced=yes
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
PKG_PROG_PKG_CONFIG([])
Packit c32a2d
Packit c32a2d
# Now go through the modules to check and do the chores.
Packit c32a2d
for m in $check_modules
Packit c32a2d
do
Packit c32a2d
	case "$m" in
Packit c32a2d
		dummy)
Packit c32a2d
			AC_MSG_CHECKING([if you are too dumbing dumb for the dummy])
Packit c32a2d
			AC_MSG_RESULT([no])
Packit c32a2d
			output_modules="$output_modules dummy"
Packit c32a2d
			HAVE_DUMMY=yes
Packit c32a2d
		;;
Packit c32a2d
		oss)
Packit c32a2d
			AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h])
Packit c32a2d
			if test "x${ac_cv_header_sys_soundcard_h}" = "xyes" \
Packit c32a2d
				 -o "x${ac_cv_header_linux_soundcard_h}" = "xyes" \
Packit c32a2d
				 -o "x${ac_cv_header_machine_soundcard_h}" = "xyes";
Packit c32a2d
			then
Packit c32a2d
				output_modules="$output_modules oss"
Packit c32a2d
				HAVE_OSS="yes"
Packit c32a2d
			else
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		tinyalsa)
Packit c32a2d
			TINYALSA_LIBS="-ltinyalsa"
Packit c32a2d
			# Check for ALSA
Packit c32a2d
			AC_CHECK_LIB( [tinyalsa], [pcm_open],
Packit c32a2d
				[ AC_CHECK_HEADER( [tinyalsa/asoundlib.h],
Packit c32a2d
					[ output_modules="$output_modules tinyalsa" HAVE_TINYALSA="yes"],
Packit c32a2d
					[ AC_MSG_WARN([Found TINYALSA library but NOT header files on your system]) ] )
Packit c32a2d
				]
Packit c32a2d
			)
Packit c32a2d
			if test "x$HAVE_TINYALSA" != xyes; then
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		# QSA and ALSA are not distinguishable in these tests, need to block
Packit c32a2d
		# each other and play with test order depending on platform.
Packit c32a2d
		alsa)
Packit c32a2d
			if test "x$HAVE_QSA" = xyes; then
Packit c32a2d
				HAVE_ALSA=no
Packit c32a2d
			else
Packit c32a2d
Packit c32a2d
			ALSA_LIBS="-lasound"
Packit c32a2d
			# Check for ALSA
Packit c32a2d
			AC_CHECK_LIB( [asound], [snd_pcm_open],
Packit c32a2d
				[ AC_CHECK_HEADER( [alsa/asoundlib.h],
Packit c32a2d
					[ output_modules="$output_modules alsa" HAVE_ALSA="yes"],
Packit c32a2d
					[ AC_MSG_WARN([Found ALSA library but NOT header files on your system]) ] )
Packit c32a2d
				]
Packit c32a2d
			)
Packit c32a2d
			if test "x$HAVE_ALSA" != xyes; then
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
Packit c32a2d
			fi # HAVE_QSA
Packit c32a2d
		;;
Packit c32a2d
		qsa)
Packit c32a2d
			if test "x$HAVE_ALSA" = xyes; then
Packit c32a2d
				HAVE_QSA=no
Packit c32a2d
			else
Packit c32a2d
Packit c32a2d
			QSA_LIBS="-lasound"
Packit c32a2d
			# Check for QSA
Packit c32a2d
			AC_CHECK_LIB( [asound], [snd_pcm_open],
Packit c32a2d
				[ AC_CHECK_HEADER( [sys/asoundlib.h],
Packit c32a2d
					[ output_modules="$output_modules qsa" HAVE_QSA="yes"],
Packit c32a2d
					[ AC_MSG_WARN([Found QSA library but NOT header files on your system]) ] )
Packit c32a2d
				]
Packit c32a2d
			)
Packit c32a2d
			if test "x$HAVE_QSA" != xyes; then
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
Packit c32a2d
			fi # HAVE_ALSA
Packit c32a2d
		;;
Packit c32a2d
		jack)
Packit c32a2d
			# JACK module uses semaphores, hence -lpthread.
Packit c32a2d
			AC_CHECK_LIB( [pthread], [sem_post],
Packit c32a2d
				[ PKG_CHECK_MODULES(JACK, jack,
Packit c32a2d
					[
Packit c32a2d
						output_modules="$output_modules jack"
Packit c32a2d
						HAVE_JACK="yes"
Packit c32a2d
						JACK_LIBS="$JACK_LIBS -lpthread"
Packit c32a2d
					], [ HAVE_JACK="no" check_failed=yes ] )
Packit c32a2d
				],
Packit c32a2d
				[ HAVE_JACK=no check_failed=yes ]
Packit c32a2d
			)
Packit c32a2d
		;;
Packit c32a2d
		pulse)
Packit c32a2d
			PKG_CHECK_MODULES(PULSE, libpulse-simple, output_modules="$output_modules pulse" HAVE_PULSE="yes", HAVE_PULSE="no" check_failed=yes)
Packit c32a2d
		;;
Packit c32a2d
		esd)
Packit c32a2d
			PKG_CHECK_MODULES(ESD, esound, output_modules="$output_modules esd" HAVE_ESD="yes", HAVE_ESD="no" check_failed=yes)
Packit c32a2d
		;;
Packit c32a2d
		portaudio)
Packit c32a2d
			# Remember: This looks only insane because you chose an insane tab width!
Packit c32a2d
			PORTAUDIO_LIBS="-lportaudio"
Packit c32a2d
			PORTAUDIO_CFLAGS=
Packit c32a2d
			case $host in
Packit c32a2d
				*-*-mingw32)
Packit c32a2d
					# We tested portaudio with MME
Packit c32a2d
					if test "x$HAVE_PORTAUDIO" != "xyes"; then
Packit c32a2d
						AC_CHECK_LIB( [portaudio], [Pa_Initialize],
Packit c32a2d
							[ AC_CHECK_HEADER( [portaudio.h],
Packit c32a2d
								[ output_modules="$output_modules portaudio" HAVE_PORTAUDIO_WINMM="yes" HAVE_PORTAUDIO="yes" ],
Packit c32a2d
								[ AC_MSG_WARN([Found PortAudio library but NOT header files on your system]) ] )
Packit c32a2d
								PORTAUDIO_LIBS="$PORTAUDIO_LIBS -lwinmm"
Packit c32a2d
							],
Packit c32a2d
							[ HAVE_PORTAUDIO="no"],
Packit c32a2d
							[ -lwinmm ]
Packit c32a2d
						)
Packit c32a2d
					fi
Packit c32a2d
				;;
Packit c32a2d
				*)
Packit c32a2d
					AC_CHECK_LIB( [portaudio], [Pa_Initialize],
Packit c32a2d
						[ AC_CHECK_HEADER( [portaudio.h],
Packit c32a2d
							[ output_modules="$output_modules portaudio" HAVE_PORTAUDIO="yes" ],
Packit c32a2d
							[ AC_MSG_WARN([Found PortAudio library but NOT header files on your system]) ] )
Packit c32a2d
						]
Packit c32a2d
					)
Packit c32a2d
				;;
Packit c32a2d
			esac
Packit c32a2d
			if test "x$HAVE_PORTAUDIO" != xyes; then
Packit c32a2d
				check_failed=yes
Packit c32a2d
			else
Packit c32a2d
				# See if we have v19 or v18
Packit c32a2d
				AC_CHECK_LIB( [portaudio], [Pa_GetVersion], [:], [AC_DEFINE( [PORTAUDIO18], 1, [Define if portaudio v18 API is wanted.]) ], [$PORTAUDIO_LIBS] )
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		sdl)
Packit c32a2d
			PKG_CHECK_MODULES(SDL, sdl, output_modules="$output_modules sdl" HAVE_SDL="yes", HAVE_SDL="no" check_failed=yes)
Packit c32a2d
		;;
Packit c32a2d
		nas)
Packit c32a2d
			NAS_LIBS=-laudio
Packit c32a2d
			AC_CHECK_LIB( [audio], [AuOpenServer],
Packit c32a2d
				[ AC_CHECK_HEADER( [audio/audiolib.h],
Packit c32a2d
					[ output_modules="$output_modules nas" HAVE_NAS="yes"],
Packit c32a2d
					[ AC_MSG_WARN([Found NAS library but NOT header files on your system]) ] )
Packit c32a2d
				]
Packit c32a2d
			)
Packit c32a2d
			if test "x$HAVE_NAS" != xyes; then
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		win32)
Packit c32a2d
			# Check for windows ... and win32 audio
Packit c32a2d
			# Does not work... instead just check for header
Packit c32a2d
			# AC_CHECK_LIB( [winmm], [waveOutOpen] )
Packit c32a2d
			WIN32_LIBS=-lwinmm
Packit c32a2d
			if test x$ac_cv_header_windows_h = xyes; then
Packit c32a2d
				output_modules="$output_modules win32"
Packit c32a2d
				HAVE_WIN32=yes
Packit c32a2d
			else
Packit c32a2d
				HAVE_WIN32=no
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		win32_wasapi)
Packit c32a2d
			# Check for windows ... and win32 wasapi audio
Packit c32a2d
			# Does not work... instead just check for header
Packit c32a2d
			# AC_CHECK_LIB( [avrt], [] )
Packit c32a2d
            AC_MSG_CHECKING([if we have wasapi headers])
Packit c32a2d
            OLD_LIBS=$LIBS
Packit c32a2d
            LIBS="$LIBS -lole32 -lavrt"
Packit c32a2d
            AC_LINK_IFELSE([AC_LANG_SOURCE([
Packit c32a2d
#define COBJMACROS 1
Packit c32a2d
#define _WIN32_WINNT 0x601
Packit c32a2d
#include <initguid.h>
Packit c32a2d
#include <audioclient.h>
Packit c32a2d
#include <mmdeviceapi.h>
Packit c32a2d
#include <avrt.h>
Packit c32a2d
int main(){
Packit c32a2d
  /* UUID Checks */
Packit c32a2d
  GUID *IDs[] = {
Packit c32a2d
    &CLSID_MMDeviceEnumerator,
Packit c32a2d
    &IID_IMMDeviceEnumerator,
Packit c32a2d
    &IID_IAudioClient,
Packit c32a2d
    &IID_IAudioRenderClient
Packit c32a2d
  };
Packit c32a2d
  return 0;
Packit c32a2d
}
Packit c32a2d
    ])], [HAVE_WIN32_WASAPI=yes], [HAVE_WIN32_WASAPI=no])
Packit c32a2d
			LIBS=$OLD_LIBS
Packit c32a2d
			WIN32_WASAPI_LIBS="-lole32 -lavrt"
Packit c32a2d
			AC_MSG_RESULT([$HAVE_WIN32_WASAPI])
Packit c32a2d
			if test "x$HAVE_WIN32_WASAPI" = xyes; then
Packit c32a2d
				output_modules="$output_modules win32_wasapi"
Packit c32a2d
			else
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		sndio)
Packit c32a2d
			SNDIO_LIBS=-lsndio
Packit c32a2d
			AC_CHECK_LIB([sndio], [sio_open],
Packit c32a2d
				[AC_CHECK_HEADERS([sndio.h],
Packit c32a2d
					[output_modules="$output_modules sndio" HAVE_SNDIO="yes"])
Packit c32a2d
				]
Packit c32a2d
			)
Packit c32a2d
			if test "x$HAVE_SNDIO" != xyes; then
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		sun)
Packit c32a2d
			AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h asm/audioio.h sys/audio.h])
Packit c32a2d
			if test "x${ac_cv_header_sun_audioio_h}" = "xyes" \
Packit c32a2d
				 -o "x${ac_cv_header_sys_audioio_h}" = "xyes" \
Packit c32a2d
				 -o "x${ac_cv_header_asm_audioio_h}" = "xyes";
Packit c32a2d
			then
Packit c32a2d
				output_modules="$output_modules sun"
Packit c32a2d
				HAVE_SUN="yes"
Packit c32a2d
			else
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		coreaudio)
Packit c32a2d
			COREAUDIO_LIBS="-framework AudioToolbox"
Packit c32a2d
			AC_CHECK_HEADERS([AudioUnit/AudioUnit.h AudioToolbox/AudioToolbox.h])
Packit c32a2d
			if test "x${ac_cv_header_AudioUnit_AudioUnit_h}" = "xyes" \
Packit c32a2d
				 -a "x${ac_cv_header_AudioToolbox_AudioToolbox_h}" = "xyes";
Packit c32a2d
			then
Packit c32a2d
				OLD_LIBS=$LIBS
Packit c32a2d
				LIBS="$LIBS $COREAUDIO_LIBS"
Packit c32a2d
    			AC_MSG_CHECKING([if AudioUnit functions are available within AudioToolbox])
Packit c32a2d
				AC_TRY_LINK(
Packit c32a2d
					[#include <AudioUnit/AudioUnit.h>],
Packit c32a2d
					[AudioUnitInitialize(NULL);],
Packit c32a2d
					[AC_MSG_RESULT([yes])],
Packit c32a2d
					[AC_MSG_RESULT([no])
Packit c32a2d
					 COREAUDIO_LIBS="$COREAUDIO_LIBS -framework AudioUnit"]
Packit c32a2d
				)
Packit c32a2d
				LIBS=$OLD_LIBS
Packit c32a2d
				AC_CHECK_HEADERS([CoreServices/CoreServices.h],
Packit c32a2d
					[COREAUDIO_LIBS="$COREAUDIO_LIBS -framework CoreServices"]
Packit c32a2d
				)
Packit c32a2d
				if test x"$modules" = xdisabled; then
Packit c32a2d
					AC_MSG_WARN([Disabling buffer because of directly linked CoreAudio! Use the module if you need the buffer.])
Packit c32a2d
					buffer=disabled
Packit c32a2d
				fi
Packit c32a2d
				output_modules="$output_modules coreaudio"
Packit c32a2d
				HAVE_COREAUDIO="yes"
Packit c32a2d
			else
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		arts)
Packit c32a2d
			AC_MSG_CHECKING([for artsc])
Packit c32a2d
			if artsc-config > /dev/null 2>&1; then
Packit c32a2d
				AC_MSG_RESULT([yes])
Packit c32a2d
				output_modules="$output_modules arts"
Packit c32a2d
				HAVE_ARTS=yes
Packit c32a2d
				ARTS_LIBS=`artsc-config --libs`
Packit c32a2d
				ARTS_CFLAGS=`artsc-config --cflags`
Packit c32a2d
			else
Packit c32a2d
				AC_MSG_RESULT([no])
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		openal)
Packit c32a2d
			AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h AL/al.h AL/alc.h al.h alc.h])
Packit c32a2d
			if test "x${ac_cv_header_OpenAL_al_h}" = "xyes" \
Packit c32a2d
				 -a "x${ac_cv_header_OpenAL_alc_h}" = "xyes";
Packit c32a2d
			then #Mac OS X
Packit c32a2d
				output_modules="$output_modules openal"
Packit c32a2d
				OPENAL_LIBS="-framework OpenAL"
Packit c32a2d
				OPENAL_CFLAGS="-DOPENAL_SUBDIR_OPENAL"
Packit c32a2d
				HAVE_OPENAL="yes"
Packit c32a2d
			elif test "x${ac_cv_header_AL_al_h}" = "xyes" \
Packit c32a2d
				 -a "x${ac_cv_header_AL_alc_h}" = "xyes";
Packit c32a2d
			then #Linux
Packit c32a2d
				output_modules="$output_modules openal"
Packit c32a2d
				OPENAL_LIBS="-lopenal"
Packit c32a2d
				OPENAL_CFLAGS="-DOPENAL_SUBDIR_AL"
Packit c32a2d
				HAVE_OPENAL="yes"
Packit c32a2d
			elif test "x${ac_cv_header_al_h}" = "xyes" \
Packit c32a2d
				 -a "x${ac_cv_header_alc_h}" = "xyes";
Packit c32a2d
			then #Windows?
Packit c32a2d
				output_modules="$output_modules openal"
Packit c32a2d
				OPENAL_LIBS="-lopenal"
Packit c32a2d
				OPENAL_CFLAGS=""
Packit c32a2d
				HAVE_OPENAL="yes"
Packit c32a2d
			else
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		os2)
Packit c32a2d
			OS2_LIBS="-los2me -lmmpm2 -lsocket"
Packit c32a2d
			AC_CHECK_HEADERS([os2.h])
Packit c32a2d
			# os2me.h depends on os2.h
Packit c32a2d
			# Yes, that way of coding it is ugly.
Packit c32a2d
			if test "x${ac_cv_header_os2_h}" = xyes
Packit c32a2d
			then
Packit c32a2d
				# We mimick exactly the way how the header will be used.
Packit c32a2d
				# It seems to be picky...
Packit c32a2d
				AC_CHECK_HEADERS([os2me.h], [], [], [#define INCL_OS2MM
Packit c32a2d
#define INCL_DOS
Packit c32a2d
#define INCL_VIO
Packit c32a2d
#define INCL_KBD
Packit c32a2d
#include <os2.h>
Packit c32a2d
#])
Packit c32a2d
			fi
Packit c32a2d
			if test "x${ac_cv_header_os2_h}" = xyes \
Packit c32a2d
			   -a   "x${ac_cv_header_os2me_h}" = xyes
Packit c32a2d
			then
Packit c32a2d
				output_modules="$output_modules os2"
Packit c32a2d
				HAVE_OS2=yes
Packit c32a2d
			else
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
# from here on only forced tests, untested code
Packit c32a2d
		hp)
Packit c32a2d
			# What's the deal with that and alib?
Packit c32a2d
			UNSUPPORTED_AUDIO=yes
Packit c32a2d
			AC_CHECK_HEADER([sys/audio.h], [output_modules="$output_modules hp" HAVE_HP=yes], [check_failed=yes])
Packit c32a2d
		;;
Packit c32a2d
		alib)
Packit c32a2d
			UNSUPPORTED_AUDIO=yes
Packit c32a2d
			# ALIB_CFLAGS="-I/opt/audio/include"
Packit c32a2d
			ALIB_LIBS=-lAlib
Packit c32a2d
			# These headers may not be all about audio but they are used.
Packit c32a2d
			AC_CHECK_HEADERS([ Alib.h CUlib.h netdb.h netinet/in.h netinet/tcp.h])
Packit c32a2d
			if test "x${ac_cv_header_Alib_h}" = xyes \
Packit c32a2d
			   -a   "x${ac_cv_header_CUlib_h}" = xyes \
Packit c32a2d
			   -a   "x${ac_cv_header_netdb_h}" = xyes \
Packit c32a2d
			   -a   "x${ac_cv_header_netinet_in_h}" = xyes \
Packit c32a2d
			   -a   "x${ac_cv_header_netinet_tcp_h}" = xyes
Packit c32a2d
			then
Packit c32a2d
				output_modules="$output_modules alib"
Packit c32a2d
				HAVE_ALIB=yes
Packit c32a2d
			else
Packit c32a2d
				check_failed=yes
Packit c32a2d
			fi
Packit c32a2d
		;;
Packit c32a2d
		mint)
Packit c32a2d
			UNSUPPORTED_AUDIO=yes
Packit c32a2d
			AC_CHECK_HEADERS([audios.h], [output_modules="$output_modules mint" HAVE_MINT=yes], [check_failes=yes])
Packit c32a2d
		;;
Packit c32a2d
		aix)
Packit c32a2d
			UNSUPPORTED_AUDIO=yes
Packit c32a2d
			AC_CHECK_HEADERS([sys/audio.h], [output_modules="$output_modules aix" HAVE_AIX=yes], [check_failed=yes])
Packit c32a2d
		;;
Packit c32a2d
		sgi)
Packit c32a2d
			UNSUPPORTED_AUDIO=yes
Packit c32a2d
			SGI_LIBS=-laudio
Packit c32a2d
			AC_CHECK_HEADER([dmedia/audio.h], [output_modules="$output_modules sgi" HAVE_SGI=yes], [check_failed=yes])
Packit c32a2d
		;;
Packit c32a2d
		*)
Packit c32a2d
			AC_MSG_ERROR([Unsupported/-known output '$m' demanded!])
Packit c32a2d
		;;
Packit c32a2d
	esac
Packit c32a2d
done
Packit c32a2d
Packit c32a2d
if test "x$check_forced" = xyes -a "x$UNSUPPORTED_AUDIO" = xyes; then
Packit c32a2d
	AC_MSG_WARN([You requested bulding of an unsupported audio module. Be prepared for happy hacking and please tell us about your experience!])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test "x$check_forced" = xyes -a "x$check_failed" = "xyes"; then
Packit c32a2d
	AC_MSG_ERROR([One/some of your requested audio modules failed the test!])
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
# When you extend check_modules, you should extend this:
Packit c32a2d
#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
Packit c32a2d
#do echo $i; done |
Packit c32a2d
#perl -ne 'chomp; $big = uc($_); print <
Packit c32a2d
#AC_SUBST(${big}_LIBS)
Packit c32a2d
#AC_SUBST(${big}_LDFLAGS)
Packit c32a2d
#AC_SUBST(${big}_CFLAGS)
Packit c32a2d
#AM_CONDITIONAL( [HAVE_$big], [test "x\$HAVE_$big" = xyes] )
Packit c32a2d
#EOT
Packit c32a2d
#'
Packit c32a2d
AC_SUBST(TINYALSA_LIBS)
Packit c32a2d
AC_SUBST(TINYALSA_LDFLAGS)
Packit c32a2d
AC_SUBST(TINYALSA_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_TINYALSA], [test "x$HAVE_TINYALSA" = xyes] )
Packit c32a2d
AC_SUBST(ALSA_LIBS)
Packit c32a2d
AC_SUBST(ALSA_LDFLAGS)
Packit c32a2d
AC_SUBST(ALSA_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_ALSA], [test "x$HAVE_ALSA" = xyes] )
Packit c32a2d
AC_SUBST(QSA_LIBS)
Packit c32a2d
AC_SUBST(QSA_LDFLAGS)
Packit c32a2d
AC_SUBST(QSA_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_QSA], [test "x$HAVE_QSA" = xyes] )
Packit c32a2d
AC_SUBST(OSS_LIBS)
Packit c32a2d
AC_SUBST(OSS_LDFLAGS)
Packit c32a2d
AC_SUBST(OSS_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_OSS], [test "x$HAVE_OSS" = xyes] )
Packit c32a2d
AC_SUBST(COREAUDIO_LIBS)
Packit c32a2d
AC_SUBST(COREAUDIO_LDFLAGS)
Packit c32a2d
AC_SUBST(COREAUDIO_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_COREAUDIO], [test "x$HAVE_COREAUDIO" = xyes] )
Packit c32a2d
AC_SUBST(SNDIO_LIBS)
Packit c32a2d
AC_SUBST(SNDIO_LDFLAGS)
Packit c32a2d
AC_SUBST(SNDIO_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_SNDIO], [test "x$HAVE_SNDIO" = xyes] )
Packit c32a2d
AC_SUBST(SUN_LIBS)
Packit c32a2d
AC_SUBST(SUN_LDFLAGS)
Packit c32a2d
AC_SUBST(SUN_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_SUN], [test "x$HAVE_SUN" = xyes] )
Packit c32a2d
AC_SUBST(WIN32_LIBS)
Packit c32a2d
AC_SUBST(WIN32_LDFLAGS)
Packit c32a2d
AC_SUBST(WIN32_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_WIN32], [test "x$HAVE_WIN32" = xyes] )
Packit c32a2d
AC_SUBST(WIN32_WASAPI_LIBS)
Packit c32a2d
AC_SUBST(WIN32_WASAPI_LDFLAGS)
Packit c32a2d
AC_SUBST(WIN32_WASAPI_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_WIN32_WASAPI], [test "x$HAVE_WIN32_WASAPI" = xyes] )
Packit c32a2d
AC_SUBST(ESD_LIBS)
Packit c32a2d
AC_SUBST(ESD_LDFLAGS)
Packit c32a2d
AC_SUBST(ESD_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_ESD], [test "x$HAVE_ESD" = xyes] )
Packit c32a2d
AC_SUBST(JACK_LIBS)
Packit c32a2d
AC_SUBST(JACK_LDFLAGS)
Packit c32a2d
AC_SUBST(JACK_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_JACK], [test "x$HAVE_JACK" = xyes] )
Packit c32a2d
AC_SUBST(PORTAUDIO_LIBS)
Packit c32a2d
AC_SUBST(PORTAUDIO_LDFLAGS)
Packit c32a2d
AC_SUBST(PORTAUDIO_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_PORTAUDIO], [test "x$HAVE_PORTAUDIO" = xyes] )
Packit c32a2d
AC_SUBST(PULSE_LIBS)
Packit c32a2d
AC_SUBST(PULSE_LDFLAGS)
Packit c32a2d
AC_SUBST(PULSE_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_PULSE], [test "x$HAVE_PULSE" = xyes] )
Packit c32a2d
AC_SUBST(SDL_LIBS)
Packit c32a2d
AC_SUBST(SDL_LDFLAGS)
Packit c32a2d
AC_SUBST(SDL_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_SDL], [test "x$HAVE_SDL" = xyes] )
Packit c32a2d
AC_SUBST(NAS_LIBS)
Packit c32a2d
AC_SUBST(NAS_LDFLAGS)
Packit c32a2d
AC_SUBST(NAS_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_NAS], [test "x$HAVE_NAS" = xyes] )
Packit c32a2d
AC_SUBST(AIX_LIBS)
Packit c32a2d
AC_SUBST(AIX_LDFLAGS)
Packit c32a2d
AC_SUBST(AIX_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_AIX], [test "x$HAVE_AIX" = xyes] )
Packit c32a2d
AC_SUBST(ALIB_LIBS)
Packit c32a2d
AC_SUBST(ALIB_LDFLAGS)
Packit c32a2d
AC_SUBST(ALIB_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_ALIB], [test "x$HAVE_ALIB" = xyes] )
Packit c32a2d
AC_SUBST(ARTS_LIBS)
Packit c32a2d
AC_SUBST(ARTS_LDFLAGS)
Packit c32a2d
AC_SUBST(ARTS_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_ARTS], [test "x$HAVE_ARTS" = xyes] )
Packit c32a2d
AC_SUBST(HP_LIBS)
Packit c32a2d
AC_SUBST(HP_LDFLAGS)
Packit c32a2d
AC_SUBST(HP_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_HP], [test "x$HAVE_HP" = xyes] )
Packit c32a2d
AC_SUBST(OS2_LIBS)
Packit c32a2d
AC_SUBST(OS2_LDFLAGS)
Packit c32a2d
AC_SUBST(OS2_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_OS2], [test "x$HAVE_OS2" = xyes] )
Packit c32a2d
AC_SUBST(SGI_LIBS)
Packit c32a2d
AC_SUBST(SGI_LDFLAGS)
Packit c32a2d
AC_SUBST(SGI_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_SGI], [test "x$HAVE_SGI" = xyes] )
Packit c32a2d
AC_SUBST(MINT_LIBS)
Packit c32a2d
AC_SUBST(MINT_LDFLAGS)
Packit c32a2d
AC_SUBST(MINT_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_MINT], [test "x$HAVE_MINT" = xyes] )
Packit c32a2d
AC_SUBST(OPENAL_LIBS)
Packit c32a2d
AC_SUBST(OPENAL_LDFLAGS)
Packit c32a2d
AC_SUBST(OPENAL_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_OPENAL], [test "x$HAVE_OPENAL" = xyes] )
Packit c32a2d
AC_SUBST(DUMMY_LIBS)
Packit c32a2d
AC_SUBST(DUMMY_LDFLAGS)
Packit c32a2d
AC_SUBST(DUMMY_CFLAGS)
Packit c32a2d
AM_CONDITIONAL( [HAVE_DUMMY], [test "x$HAVE_DUMMY" = xyes] )
Packit c32a2d
# Hackery to get rid of module .la files.
Packit c32a2d
AC_SUBST(output_modules)
Packit c32a2d
for f in $output_modules
Packit c32a2d
do
Packit c32a2d
  output_modules_la="$output_modules_la output_$f.la"
Packit c32a2d
done
Packit c32a2d
AC_SUBST(output_modules_la)
Packit c32a2d
Packit c32a2d
# Did user choose default audio subsystem ?
Packit c32a2d
if test "x$with_default_audio" != "x"; then
Packit c32a2d
	default_output_module=$with_default_audio
Packit c32a2d
else
Packit c32a2d
	default_output_module=`echo "$output_modules" | $AWK '{ print $1 }'`
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
# That's (beginning of) the list for mpg123's internal default.
Packit c32a2d
default_output_modules=$default_output_module
Packit c32a2d
Packit c32a2d
# Setup the static build.
Packit c32a2d
# The conditionals always need to be defined by configure, even if
Packit c32a2d
# HAVE_MODULES is FALSE!
Packit c32a2d
# Here's a script for that tedious list, perhaps to be outsourced together with the one in #src/output/Makefile.am
Packit c32a2d
#for i in dummy tinyalsa alsa qsa coreaudio esd jack nas oss portaudio pulse sdl sndio sun win32 win32_wasapi aix alib arts hp os2 sgi mint openal
Packit c32a2d
#do echo $i; done |
Packit c32a2d
#perl -ne 'chomp; $big = uc($_); print <
Packit c32a2d
#AM_CONDITIONAL([BUILD_${big}], [ test "$_" = \$default_output_module ])
Packit c32a2d
#EOT
Packit c32a2d
#'
Packit c32a2d
Packit c32a2d
AM_CONDITIONAL([BUILD_DUMMY], [ test "dummy" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_TINYALSA], [ test "tinyalsa" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_ALSA], [ test "alsa" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_QSA], [ test "qsa" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_COREAUDIO], [ test "coreaudio" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_ESD], [ test "esd" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_JACK], [ test "jack" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_NAS], [ test "nas" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_OSS], [ test "oss" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_PORTAUDIO], [ test "portaudio" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_PULSE], [ test "pulse" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_SDL], [ test "sdl" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_SNDIO], [ test "sndio" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_SUN], [ test "sun" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_WIN32], [ test "win32" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_WIN32_WASAPI], [ test "win32_wasapi" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_AIX], [ test "aix" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_ALIB], [ test "alib" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_ARTS], [ test "arts" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_HP], [ test "hp" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_OS2], [ test "os2" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_SGI], [ test "sgi" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_MINT], [ test "mint" = $default_output_module ])
Packit c32a2d
AM_CONDITIONAL([BUILD_OPENAL], [ test "openal" = $default_output_module ])
Packit c32a2d
Packit c32a2d
if test "x$modules" = xenabled
Packit c32a2d
then
Packit c32a2d
Packit c32a2d
  # Now make a comma-separated list again... eliminating the possible duplicate and dummy.
Packit c32a2d
  for i in $output_modules
Packit c32a2d
  do
Packit c32a2d
    if test $i != $default_output_module && test $i != dummy; then
Packit c32a2d
      default_output_modules=$default_output_modules,$i
Packit c32a2d
    fi
Packit c32a2d
  done
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
AC_DEFINE_UNQUOTED( DEFAULT_OUTPUT_MODULE, "$default_output_modules", [The default audio output module(s) to use] )
Packit c32a2d
Packit c32a2d
dnl ############## Compiler Optimizations
Packit c32a2d
Packit c32a2d
CFLAGS="$ADD_CFLAGS $CFLAGS"
Packit c32a2d
AM_CONDITIONAL([BUILD_BUFFER], [ test x"$buffer" = xenabled ])
Packit c32a2d
if test x"$buffer" = xdisabled; then
Packit c32a2d
	ADD_CPPFLAGS="$ADD_CPPFLAGS -DNOXFERMEM"
Packit c32a2d
fi
Packit c32a2d
if test x"$newoldwritesample" = xenabled; then
Packit c32a2d
	ADD_CPPFLAGS="$ADD_CPPFLAGS -DNEWOLD_WRITE_SAMPLE"
Packit c32a2d
fi
Packit c32a2d
CPPFLAGS="$ADD_CPPFLAGS $CPPFLAGS"
Packit c32a2d
LDFLAGS="$ADD_LDFLAGS $LDFLAGS"
Packit c32a2d
Packit c32a2d
# None chosen?
Packit c32a2d
if test "x$with_optimization" = "x"; then
Packit c32a2d
	if test x"$debugging" = xenabled; then
Packit c32a2d
		with_optimization="0"
Packit c32a2d
	else
Packit c32a2d
		# enable (gcc specific) default opts only with gcc
Packit c32a2d
		if test "x$GCC" = xyes; then
Packit c32a2d
			with_optimization="2"
Packit c32a2d
		else
Packit c32a2d
			with_optimization="0"
Packit c32a2d
		fi
Packit c32a2d
	fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
case $with_optimization in
Packit c32a2d
  0)
Packit c32a2d
    # No Optimizations
Packit c32a2d
    CFLAGS="$CFLAGS"
Packit c32a2d
  ;;
Packit c32a2d
  1)
Packit c32a2d
    CFLAGS="-O $CFLAGS"
Packit c32a2d
  ;;
Packit c32a2d
  2)
Packit c32a2d
    CFLAGS="-O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS"
Packit c32a2d
  ;;
Packit c32a2d
  3)
Packit c32a2d
    CFLAGS="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS"
Packit c32a2d
  ;;
Packit c32a2d
  4)
Packit c32a2d
    CFLAGS="-O4 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS"
Packit c32a2d
  ;;
Packit c32a2d
  *)
Packit c32a2d
  	AC_MSG_ERROR([Unknown optimizations level '$with_optimization'])
Packit c32a2d
  ;;
Packit c32a2d
esac
Packit c32a2d
Packit c32a2d
dnl If using gcc, prevent a bad alignment option from breaking things.
Packit c32a2d
dnl Let's default to safe 16-byte alignment for any special x86 or altivec stuff.
Packit c32a2d
if test "x$GCC" = xyes && echo "$CFLAGS" | $GREP 'mpreferred-stack-boundary=' > /dev/null; then
Packit c32a2d
	case $cpu_type in
Packit c32a2d
		x86 | i586* | mmx | sse | 3dnow* | altivec)
Packit c32a2d
			AC_MSG_WARN( [ You are trying to mess with stack alignment. I know better. ] )
Packit c32a2d
			CFLAGS="$CFLAGS -mpreferred-stack-boundary=4"
Packit c32a2d
		;;
Packit c32a2d
	esac
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl ############## Seektable size
Packit c32a2d
Packit c32a2d
if test "x$with_seektable" = "x"; then
Packit c32a2d
	seektable=1000
Packit c32a2d
else
Packit c32a2d
	seektable=$with_seektable
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test "$seektable" -gt 0; then
Packit c32a2d
	AC_DEFINE(FRAME_INDEX, 1, [ Define if frame index should be used. ])
Packit c32a2d
fi
Packit c32a2d
# Define that always... also without frame index enabled.
Packit c32a2d
AC_DEFINE_UNQUOTED(INDEX_SIZE, $seektable, [size of the frame index seek table])
Packit c32a2d
Packit c32a2d
dnl ############## Win32 function checks
Packit c32a2d
# Check if we want Unicode for Win32. Cygwin does not need _wopen
Packit c32a2d
if test x$ac_cv_header_windows_h = xyes && test "x$host_os" != "xcygwin"; then
Packit c32a2d
  win32_specific_codes=enabled
Packit c32a2d
else
Packit c32a2d
  win32_specific_codes=disabled
Packit c32a2d
fi
Packit c32a2d
win32_unicode=unneeded
Packit c32a2d
win32_sockets=disabled
Packit c32a2d
win32_sockets_working=no
Packit c32a2d
win32_wide_working=no
Packit c32a2d
win32_winver_bump=no
Packit c32a2d
Packit c32a2d
dnl We do not support non-unicode Windows.
Packit c32a2d
if test "x$win32_specific_codes" = xenabled; then
Packit c32a2d
#### Check for Wide functions
Packit c32a2d
  AC_CHECK_FUNC([_wopen], [win32_unicode=enabled],[win32_unicode=disabled])
Packit c32a2d
  AC_MSG_CHECKING([if we want Unicode File Open for Win32])
Packit c32a2d
  if test "x$win32_unicode" = xenabled; then
Packit c32a2d
    dnl We need to include the header for PathCombineW checking as
Packit c32a2d
    dnl the actual symbol has a very funny name.
Packit c32a2d
    oldlibs=$LIBS
Packit c32a2d
    LIBS="$LIBS -lshlwapi"
Packit c32a2d
    AC_MSG_RESULT([yes])
Packit c32a2d
    AC_MSG_CHECKING([if Unicode functions working])
Packit c32a2d
    AC_LINK_IFELSE([AC_LANG_SOURCE([
Packit c32a2d
      #include <windows.h>
Packit c32a2d
      #include <shlwapi.h>
Packit c32a2d
      #include <stdlib.h>
Packit c32a2d
      int main()
Packit c32a2d
      {
Packit c32a2d
        MultiByteToWideChar (0, 0, NULL, 0, NULL, 0);
Packit c32a2d
        WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL);
Packit c32a2d
        PathCombineW(0,0,0);
Packit c32a2d
        return 0;
Packit c32a2d
      }
Packit c32a2d
    ])], [win32_wide_working=yes], [win32_winver_bump=yes])
Packit c32a2d
    if test "x$win32_wide_working" = xno; then
Packit c32a2d
      AC_LINK_IFELSE([AC_LANG_SOURCE([
Packit c32a2d
        #define WINVER 0x501
Packit c32a2d
        #define _WIN32_WINNT 0x501
Packit c32a2d
        #include <windows.h>
Packit c32a2d
        #include <shlwapi.h>
Packit c32a2d
        #include <stdlib.h>
Packit c32a2d
        int main()
Packit c32a2d
        {
Packit c32a2d
          MultiByteToWideChar (0, 0, NULL, 0, NULL, 0);
Packit c32a2d
          WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL);
Packit c32a2d
          PathCombineW(0,0,0);
Packit c32a2d
          return 0;
Packit c32a2d
        }
Packit c32a2d
      ])], [win32_wide_working=yes], [AC_MSG_RESULT([no])])
Packit c32a2d
    fi
Packit c32a2d
    if test "x$win32_wide_working" = xyes; then
Packit c32a2d
      AC_MSG_RESULT([yes])
Packit c32a2d
      AC_DEFINE([WANT_WIN32_UNICODE], [1], [ Define to use Unicode for Windows ])
Packit c32a2d
    else
Packit c32a2d
      LIBS=$oldlibs
Packit c32a2d
      AC_MSG_ERROR([Unicode support for Win32 not working])
Packit c32a2d
    fi
Packit c32a2d
  else
Packit c32a2d
    AC_MSG_ERROR([Unicode File Open for Win32 not available])
Packit c32a2d
  fi
Packit c32a2d
Packit c32a2d
#### Check for Network functions
Packit c32a2d
  AC_CHECK_HEADERS([ws2tcpip.h], [win32_sockets=enabled], [AC_MSG_WARN([Please update your headers to support winsock 2.2.])])
Packit c32a2d
  AC_MSG_CHECKING([if we want Win32 sockets])
Packit c32a2d
  if test "x$win32_sockets" = "xenabled" && test "x$network" != "xdisabled"; then
Packit c32a2d
  AC_MSG_RESULT([yes])
Packit c32a2d
  AC_MSG_CHECKING([if winsock2 API is available])
Packit c32a2d
    wsoldlibs="$LIBS"
Packit c32a2d
    LIBS="$LIBS -lws2_32"
Packit c32a2d
    AC_LINK_IFELSE([AC_LANG_SOURCE([
Packit c32a2d
      #include <winsock2.h>
Packit c32a2d
      #include <ws2tcpip.h>
Packit c32a2d
      #include <stdlib.h>
Packit c32a2d
      int main()
Packit c32a2d
      {
Packit c32a2d
        getaddrinfo(NULL, NULL, NULL, NULL);
Packit c32a2d
        freeaddrinfo(NULL);
Packit c32a2d
        return 0;
Packit c32a2d
      }
Packit c32a2d
    ])], [win32_sockets_working=yes], [win32_winver_bump=yes])
Packit c32a2d
    if test "x$win32_sockets_working" = "xno"; then
Packit c32a2d
      AC_MSG_CHECKING([deeper if winsock2 API is available])
Packit c32a2d
      AC_LINK_IFELSE([AC_LANG_SOURCE([
Packit c32a2d
        #define WINVER 0x501
Packit c32a2d
        #define _WIN32_WINNT 0x501
Packit c32a2d
        #include <winsock2.h>
Packit c32a2d
        #include <ws2tcpip.h>
Packit c32a2d
        #include <stdlib.h>
Packit c32a2d
        int main()
Packit c32a2d
        {
Packit c32a2d
          getaddrinfo(NULL, NULL, NULL, NULL);
Packit c32a2d
          freeaddrinfo(NULL);
Packit c32a2d
          return 0;
Packit c32a2d
        }
Packit c32a2d
      ])], [win32_sockets_working=yes], [AC_MSG_RESULT([no])])
Packit c32a2d
    fi
Packit c32a2d
    if test "x$win32_sockets_working" = "xyes"; then
Packit c32a2d
      AC_MSG_RESULT([yes])
Packit c32a2d
      AC_DEFINE([WANT_WIN32_SOCKETS], [1], [ Define to use Win32 sockets ])
Packit c32a2d
      network_type=Winsock2
Packit c32a2d
      have_network=yes
Packit c32a2d
      have_ipv6=yes
Packit c32a2d
    else
Packit c32a2d
      LIBS="$wsoldlibs"
Packit c32a2d
      AC_MSG_WARN([Please update your headers to support winsock 2.2.])
Packit c32a2d
    fi
Packit c32a2d
  else
Packit c32a2d
    AC_MSG_RESULT([no])
Packit c32a2d
  fi
Packit c32a2d
Packit c32a2d
#### Check for Win32 Named Pipe functions
Packit c32a2d
win32_fifo_working=no
Packit c32a2d
if test x$win32_specific_codes = xenabled; then
Packit c32a2d
  AC_MSG_CHECKING([if we have Named Pipes])
Packit c32a2d
  if test "x$fifo" != "xdisabled"; then
Packit c32a2d
    AC_LINK_IFELSE([AC_LANG_SOURCE([
Packit c32a2d
    #include <windows.h>
Packit c32a2d
      int main(){
Packit c32a2d
        CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
Packit c32a2d
        CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
Packit c32a2d
        return 0;
Packit c32a2d
      }])],[win32_fifo_working=yes],[win32_winver_bump=yes])
Packit c32a2d
    if test "x$win32_fifo_working" != "xyes"; then
Packit c32a2d
    AC_LINK_IFELSE([AC_LANG_SOURCE([
Packit c32a2d
    #define WINVER 0x501
Packit c32a2d
    #define _WIN32_WINNT 0x501
Packit c32a2d
    #include <windows.h>
Packit c32a2d
      int main(){
Packit c32a2d
        CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
Packit c32a2d
        CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
Packit c32a2d
        return 0;
Packit c32a2d
      }])],[win32_fifo_working=yes],[win32_fifo_working=no])
Packit c32a2d
    fi
Packit c32a2d
  fi
Packit c32a2d
  have_mkfifo=$win32_fifo_working
Packit c32a2d
  if test "x$win32_fifo_working" = "xyes"; then
Packit c32a2d
    AC_MSG_RESULT([yes])
Packit c32a2d
    AC_DEFINE([WANT_WIN32_FIFO], [1], [ Define to use Win32 named pipes ])
Packit c32a2d
  else
Packit c32a2d
    AC_MSG_RESULT([no])
Packit c32a2d
  fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
#### WINVER Bump
Packit c32a2d
if test x$win32_specific_codes = xenabled; then
Packit c32a2d
  AC_MSG_CHECKING([if WINVER and _WIN32_WINNT needs version bumps])
Packit c32a2d
  if test "x$win32_winver_bump" = "xyes"; then
Packit c32a2d
    AC_MSG_RESULT([yes])
Packit c32a2d
    AC_DEFINE([WINVER], [0x0501], [ WinXP and above for ipv6 ])
Packit c32a2d
    AC_DEFINE([_WIN32_WINNT], [0x0501], [ WinXP and above for ipv6 ])
Packit c32a2d
    # getaddrinfo and freeaddrinfo are available for Win2K and above
Packit c32a2d
    # Bug: MinGW.org w32api ws2tcpip.h incorrectly wants (_WIN32_WINNT >= 0x0501) for getaddrinfo and freeaddrinfo
Packit c32a2d
    # MultiByteToWideChar and WideCharToMultiByte are available for Win2K and above
Packit c32a2d
  else
Packit c32a2d
    AC_MSG_RESULT([no])
Packit c32a2d
  fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
fi #END OF WIN32 CHECKS
Packit c32a2d
Packit c32a2d
#### Check mingw.org for EOVERFLOW
Packit c32a2d
AC_MSG_CHECKING([if we have EOVERFLOW macro])
Packit c32a2d
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
Packit c32a2d
#include <errno.h>
Packit c32a2d
int i = (EOVERFLOW) + 0;
Packit c32a2d
])],[eoverflow_present=yes],[eoverflow_present=no])
Packit c32a2d
AC_MSG_RESULT([$eoverflow_present])
Packit c32a2d
AS_IF([test "x$eoverflow_present" = "xyes"],[],[AC_DEFINE([EOVERFLOW],[EFBIG],[Use EFBIG as substitude for EOVERFLOW, mingw.org may lack the latter])])
Packit c32a2d
Packit c32a2d
#### Use Win32 support codes
Packit c32a2d
AM_CONDITIONAL([WIN32_CODES], [ test "x$win32_specific_codes" = xenabled ])
Packit c32a2d
Packit c32a2d
if test x"$network" = xauto; then
Packit c32a2d
	if test x"$have_network" = xyes; then
Packit c32a2d
		network=enabled
Packit c32a2d
	else
Packit c32a2d
		network=disabled
Packit c32a2d
	fi
Packit c32a2d
fi
Packit c32a2d
if test x"$ipv6" = xauto; then
Packit c32a2d
	if test x"$have_ipv6" = xyes; then
Packit c32a2d
		ipv6=enabled
Packit c32a2d
	else
Packit c32a2d
		ipv6=disabled
Packit c32a2d
	fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl ############## FIFO enable
Packit c32a2d
Packit c32a2d
if test x"$fifo" = xauto; then
Packit c32a2d
	if test x"$have_mkfifo" = xyes; then
Packit c32a2d
		fifo=enabled
Packit c32a2d
	else
Packit c32a2d
		fifo=disabled
Packit c32a2d
	fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test x"$fifo" = xenabled; then
Packit c32a2d
	AC_DEFINE(FIFO, 1, [ Define if FIFO support is enabled. ])
Packit c32a2d
	if test x"$have_mkfifo" = xno; then
Packit c32a2d
		AC_MSG_WARN( [ You forced FIFO code while I think there is no mkfifo() available! ] )
Packit c32a2d
	fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl ############## Network enable
Packit c32a2d
if test x"$network" = xenabled; then
Packit c32a2d
	AC_DEFINE(NETWORK, 1, [ Define if network support is enabled. ])
Packit c32a2d
	if test x"$have_network" = xno; then
Packit c32a2d
		AC_MSG_WARN( [ You forced network code while I think there is support missing! ] )
Packit c32a2d
	fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test x"$ipv6" = xenabled; then
Packit c32a2d
	AC_DEFINE(IPV6, 1, [ Define if IPV6 support is enabled. ])
Packit c32a2d
	if test x"$have_ipv6" = xno; then
Packit c32a2d
		AC_MSG_WARN( [ You forced IPv6 code while I think there is no getaddrinfo() available! ] )
Packit c32a2d
	fi
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
dnl ############## Final Output
Packit c32a2d
Packit c32a2d
AC_CONFIG_FILES([
Packit c32a2d
	Makefile
Packit c32a2d
	libmpg123.pc
Packit c32a2d
	libout123.pc
Packit c32a2d
	mpg123.spec
Packit c32a2d
	src/libmpg123/mpg123.h
Packit c32a2d
	src/libout123/out123.h
Packit c32a2d
])
Packit c32a2d
Packit c32a2d
AC_OUTPUT
Packit c32a2d
Packit c32a2d
Packit c32a2d
Packit c32a2d
dnl ############## Display Message
Packit c32a2d
Packit c32a2d
echo "
Packit c32a2d
  $PACKAGE_NAME $PACKAGE_VERSION
Packit c32a2d
Packit c32a2d
  Install path ............ $prefix
Packit c32a2d
  CPU Optimization ........ $cpu_type
Packit c32a2d
  Compiler Optimization ... $with_optimization
Packit c32a2d
  Gapless Support ......... $gapless
Packit c32a2d
  Debugging ............... $debugging
Packit c32a2d
  Seek table size ......... $seektable
Packit c32a2d
  FIFO support ............ $fifo
Packit c32a2d
  Buffer .................. $buffer
Packit c32a2d
  Network (http streams) .. $network
Packit c32a2d
  Network Sockets ......... $network_type
Packit c32a2d
  IPv6 (getaddrinfo) ...... $ipv6"
Packit c32a2d
if test x"$LARGEFILE_BITS" = x; then
Packit c32a2d
  echo "  File offsets ............ default"
Packit c32a2d
else
Packit c32a2d
  echo "  File offsets ............ $LARGEFILE_BITS"
Packit c32a2d
  echo "    The lib will (try to) support default offset size, too."
Packit c32a2d
fi
Packit c32a2d
echo "  LFS alias symbols ....... $lfs_alias ($LFS_ALIAS_BITS)"
Packit c32a2d
echo "  LFS alias type .......... $lfs_alias_type"
Packit c32a2d
if test x"$use_yasm_for_avx" = xyes; then
Packit c32a2d
  echo "  Use yasm (for AVX only) . enabled"
Packit c32a2d
else
Packit c32a2d
  echo "  Use yasm (for AVX only) . disabled"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
echo "
Packit c32a2d
  Core libmpg123 features:
Packit c32a2d
  Layer I ................. $layer1
Packit c32a2d
  Layer II ................ $layer2
Packit c32a2d
  Layer III ............... $layer3
Packit c32a2d
  NtoM resampling ......... $ntom
Packit c32a2d
  downsampled decoding .... $downsample
Packit c32a2d
  Feeder/buffered input ... $feeder
Packit c32a2d
  ID3v2 parsing ........... $id3v2
Packit c32a2d
  String API .............. $string
Packit c32a2d
  ICY parsing/conversion .. $icy
Packit c32a2d
  Error/warning messages .. $messages
Packit c32a2d
  Win32 Unicode File Open.. $win32_unicode
Packit c32a2d
  Feature Report Function.. $feature_report
Packit c32a2d
  Output formats (nofpu will disable all but 16 or 8 bit!):
Packit c32a2d
  8 bit integer ........... $int8
Packit c32a2d
  16 bit integer .......... $int16
Packit c32a2d
  32/24 bit integer ....... $int32
Packit c32a2d
  real (32 bit float) ..... $real
Packit c32a2d
  Equalizer ............... $equalizer
Packit c32a2d
  Optimization detail:
Packit c32a2d
  Integer conversion ...... $integers
Packit c32a2d
  IEEE 754 hackery ........ $ieee
Packit c32a2d
  New/old WRITE_SAMPLE .... $newoldwritesample
Packit c32a2d
  new Huffman scheme ...... $newhuff
Packit c32a2d
Packit c32a2d
Note: Disabling core features is not commonly done and some combinations might not build/work. If you encounter such a case, help yourself (and provide a patch) or just poke the maintainers."
Packit c32a2d
# just an empty line
Packit c32a2d
echo
Packit c32a2d
Packit c32a2d
echo "  Modules ................. $modules"
Packit c32a2d
echo "  Checked audio modules ... $check_modules
Packit c32a2d
  Detected audio support ..$output_modules
Packit c32a2d
  Default output module ... $default_output_module
Packit c32a2d
"
Packit c32a2d
if test x"$modules" = xdisabled; then
Packit c32a2d
echo "The _single_ active output module is being statically linked in.
Packit c32a2d
"
Packit c32a2d
fi
Packit c32a2d
if test x"$with_optimization" = x0; then
Packit c32a2d
	echo "No optimization flags chosen, make sure you have something basic in your CFLAGS at least...
Packit c32a2d
"
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
if test x"$cpu_type" = xi486; then
Packit c32a2d
  echo "WARNING: You selected the i486 decoder. This is not recommened for regular use."
Packit c32a2d
  echo "It was designed for actual i486 CPUs a long time ago. Generic C code is likely"
Packit c32a2d
  echo "to perform better nowadays. Also, the decoder misses features like volume"
Packit c32a2d
  echo "scaling and has clipping issues. Continue if you are into software archeology"
Packit c32a2d
  echo "only."
Packit c32a2d
fi
Packit c32a2d
Packit c32a2d
echo
Packit c32a2d
echo "  CPPFLAGS='$CPPFLAGS'"
Packit c32a2d
echo "  CFLAGS='$CFLAGS'"
Packit c32a2d
echo "  LIBS='$LIBS'"
Packit c32a2d
echo
Packit c32a2d
echo "Next type 'make' and then 'make install'."