mpg123-1.32.0

This commit is contained in:
Ozkan Sezer
2023-09-24 08:51:02 +03:00
parent 89d671ef14
commit 2279cffc0f
241 changed files with 18940 additions and 16360 deletions

View File

@@ -9,32 +9,64 @@ dnl 2.69 at least.
AC_PREREQ([2.69])
dnl ############# Initialisation
AC_INIT([mpg123], [1.31.3], [maintainer@mpg123.org])
dnl Increment API_VERSION when the API gets changes (new functions).
dnl Set version numbers from header version.h and each library API header.
dnl Do not forget the re-generate configure on version changes. This does
dnl not happen automatically, as it would with m4_include() usage, wich
dnl is too fragile with arbitrary header contents.
m4_define([V_HEADER], m4_esyscmd(grep MPG123_ src/version.h))
m4_define([V_MAJOR], m4_bregexp(V_HEADER,
[#define MPG123_MAJOR\s+\([0-9]+\)],
[\1]))
m4_define([V_MINOR], m4_bregexp(V_HEADER,
[\#define MPG123_MINOR\s+\([0-9]+\)],
[\1]))
m4_define([V_PATCH], m4_bregexp(V_HEADER,
[\#define MPG123_PATCH\s+\([0-9]+\)],
[\1]))
m4_define([V_SUFFIX], m4_bregexp(V_HEADER,
[\#define MPG123_SUFFIX\s+"\(.+\)"],
[\1]))
m4_undefine([V_HEADER])
AC_INIT([mpg123], V_MAJOR.V_MINOR.V_PATCH[]V_SUFFIX, [maintainer@mpg123.org])
m4_define([V_HEADER], m4_esyscmd(grep -e _API_VERSION -e _PATCHLEVEL src/libmpg123/mpg123.h src/libout123/out123.h src/libsyn123/syn123.h))
dnl libmpg123
API_VERSION=47
LIB_PATCHLEVEL=0
m4_define([API_VERSION], m4_bregexp(V_HEADER,
[\#define MPG123_API_VERSION\s+\([0-9]+\)],
[\1]))
m4_define([LIB_PATCHLEVEL], m4_bregexp(V_HEADER,
[\#define MPG123_PATCHLEVEL\s+\([0-9]+\)],
[\1]))
dnl libout123
OUTAPI_VERSION=4
OUTLIB_PATCHLEVEL=7
m4_define([OUTAPI_VERSION], m4_bregexp(V_HEADER,
[\#define OUT123_API_VERSION\s+\([0-9]+\)],
[\1]))
m4_define([OUTLIB_PATCHLEVEL], m4_bregexp(V_HEADER,
[\#define OUT123_PATCHLEVEL\s+\([0-9]+\)],
[\1]))
dnl libsyn123
SYNAPI_VERSION=1
SYNLIB_PATCHLEVEL=5
m4_define([SYNAPI_VERSION], m4_bregexp(V_HEADER,
[\#define SYN123_API_VERSION\s+\([0-9]+\)],
[\1]))
m4_define([SYNLIB_PATCHLEVEL], m4_bregexp(V_HEADER,
[\#define SYN123_PATCHLEVEL\s+\([0-9]+\)],
[\1]))
m4_undefine([V_HEADER])
dnl Since we want to be backwards compatible, both sides get set to API_VERSION.
LIBMPG123_VERSION=$API_VERSION:$LIB_PATCHLEVEL:$API_VERSION
LIBOUT123_VERSION=$OUTAPI_VERSION:$OUTLIB_PATCHLEVEL:$OUTAPI_VERSION
LIBSYN123_VERSION=$SYNAPI_VERSION:$SYNLIB_PATCHLEVEL:$SYNAPI_VERSION
AC_SUBST(LIBMPG123_VERSION)
AC_SUBST(API_VERSION)
AC_SUBST(LIBOUT123_VERSION)
AC_SUBST(OUTAPI_VERSION)
AC_SUBST(LIBSYN123_VERSION)
AC_SUBST(SYNAPI_VERSION)
LIBMPG123_VERSION=API_VERSION:LIB_PATCHLEVEL:API_VERSION
LIBOUT123_VERSION=OUTAPI_VERSION:OUTLIB_PATCHLEVEL:OUTAPI_VERSION
LIBSYN123_VERSION=SYNAPI_VERSION:SYNLIB_PATCHLEVEL:SYNAPI_VERSION
AC_SUBST([LIBMPG123_VERSION])
AC_SUBST([LIBOUT123_VERSION])
AC_SUBST([LIBSYN123_VERSION])
AC_CONFIG_SRCDIR(src/mpg123.c)
AC_CONFIG_AUX_DIR(build)
@@ -103,14 +135,19 @@ if test "x$all_static" = xyes; then
fi
AM_PROG_AS
dnl For autocinf 2.69, the C99 macro still does something.
AC_PROG_CC_C99
AM_PROG_CC_C_O
m4_version_prereq(2.70, [AC_PROG_CC], [AC_PROG_CC_C99])
AC_PROG_CPP
AC_PROG_INSTALL
# Just look, no touch.
oldLIBS=$LIBS
LT_LIB_M
dnl Test if -lrt is required for clock_gettime() (old glibc).
AC_SEARCH_LIBS([clock_gettime], [rt])
if echo " $LIBS" | grep -q -w -- -lrt; then
LIBRT=-lrt
fi
# Could actually be missing.
AC_CHECK_FUNCS([clock_gettime])
LIBS=$oldLIBS
AC_SUBST(LIBM)
dnl "Checking for egrep is broken after removal of libltdl stuff... checks use $EGREP, so searching it here."
@@ -129,7 +166,7 @@ dnl ############# Use Libtool for dynamic module loading
modules=auto
AC_ARG_ENABLE(modules,
[ --enable-modules=[no/yes] dynamically loadable output modules],
[AS_HELP_STRING([--disable-modules], [dynamically loadable output module support (default enabled in shared library builds)])],
[
if test "x$enableval" = xyes
then
@@ -155,6 +192,10 @@ fi
dnl We need the windows header also for checking the module mechanism.
AC_CHECK_HEADERS([windows.h])
# enable win32 code
if test "x$ac_cv_header_windows_h" = xyes -a "x$host_os" != xcygwin -a "x$host_os" != xmidipix; then
win32_specific_codes=enabled
fi
android_build=no
case "$host" in
@@ -198,6 +239,40 @@ case "$host" in
;;
esac
if test x$win32_specific_codes = xenabled; then
# Check GetThreadErrorMode
if test x"$modules" != xdisabled; then
AC_MSG_CHECKING([if we have GetThreadErrorMode])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <windows.h>
int main(){
return GetThreadErrorMode();
}])],[win32_thread_error=yes],[win32_winver_bump=yes])
if test "x$win32_thread_error" != "xyes"; then
AC_MSG_CHECKING([if we have GetThreadErrorMode])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#define WINVER 0x600
#define _WIN32_WINNT 0x600
#include <windows.h>
int main(){
return GetThreadErrorMode();
}])],[win32_thread_error=yes],[win32_thread_error=no])
fi
if test "x$win32_thread_error" = "xyes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
if test "x$modules" = xenabled; then
AC_MSG_ERROR([GetThreadErrorMode is required for modules but not found.])
else
AC_MSG_WARN([Disabling modules because of missing GetThreadErrorMode()])
modules=disabled
fi
fi
fi
fi
LIBDL=
if test x"$modules" = xdisabled
@@ -291,7 +366,7 @@ AC_SUBST(EXEC_LT_LDFLAGS)
dnl ############## Configurable Options
AC_ARG_ENABLE(debug,
[ --enable-debug=[no/yes] turn on debugging],
[AS_HELP_STRING([--enable-debug], [turn on (lots of) debugging printouts])],
[
if test "x$enableval" = xyes
then
@@ -304,7 +379,7 @@ AC_ARG_ENABLE(debug,
)
AC_ARG_ENABLE(xdebug,
[ --enable-xdebug=[no/yes] turn on extreme debugging],
[AS_HELP_STRING([--enable-xdebug], [turn on (yet more) extreme debugging printouts])],
[
if test "x$enableval" = xyes
then
@@ -322,7 +397,7 @@ if test x"$xdebugging" = xenabled; then
fi
AC_ARG_ENABLE(nagging,
[ --enable-nagging=[no/yes] turn on GCC's pedantic nagging with error on warnings, does not include --enable-debug anymore ],
[AS_HELP_STRING([--enable-nagging], [turn on GCC's pedantic nagging with error on warnings])],
[
if test "x$enableval" = xyes
then
@@ -339,24 +414,23 @@ if test x"$debugging" = xenabled; then
fi
AC_ARG_ENABLE(gapless,
[ --enable-gapless=[no/yes] turn on gapless (enabled per default)],
[AS_HELP_STRING( [--disable-gapless], [turn off gapless decoding (please don't)])],
[
if test "x$enableval" = xyes
then
gapless="enabled"
AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ])
else
gapless="disabled"
fi
],
[
gapless="enabled"
AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ])
]
[ gapless="enabled" ]
)
if test "x$gapless" = xenabled; then
AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ])
fi
AC_ARG_ENABLE(fifo,
[ --enable-fifo=[no/yes] FIFO support for control interface (auto-enabled on linux) ],
[AS_HELP_STRING( [--enable-fifo], [FIFO support for control interface (auto-enabled on linux)])],
[
if test "x$enableval" = xyes
then
@@ -377,7 +451,7 @@ dnl Core features that can be disabled to reduce binary size.
id3v2=enabled
AC_ARG_ENABLE(id3v2,
[ --disable-id3v2=[no/yes] no ID3v2 parsing ],
[AS_HELP_STRING( [--disable-id3v2], [no ID3v2 parsing])],
[
if test "x$enableval" = xno; then
id3v2="disabled"
@@ -387,7 +461,7 @@ AC_ARG_ENABLE(id3v2,
# id3v2 depends on strings... so check that in between.
string=enabled
AC_ARG_ENABLE(string,
[ --disable-string=[no/yes] no string API (this will disable ID3v2; main mpg123 won't build anymore) ],
[AS_HELP_STRING( [--disable-string], [no string API (this will disable ID3v2; main mpg123 won't build anymore)])],
[
if test "x$enableval" = xno; then
string="disabled"
@@ -407,7 +481,7 @@ fi
icy=enabled
AC_ARG_ENABLE(icy,
[ --disable-icy=[no/yes] no ICY metainfo parsing/conversion (main mpg123 won't build!) ],
[AS_HELP_STRING( [--disable-icy], [no ICY metainfo parsing/conversion (main mpg123 won't build!)])],
[
if test "x$enableval" = xno; then
icy="disabled"
@@ -421,7 +495,7 @@ AM_CONDITIONAL([HAVE_ICY], [test "x$icy" = xenabled])
ntom=enabled
AC_ARG_ENABLE(ntom,
[ --disable-ntom=[no/yes] no flexible resampling ],
[AS_HELP_STRING( [--disable-ntom], [no flexible resampling])],
[
if test "x$enableval" = xno; then
ntom="disabled"
@@ -435,7 +509,7 @@ AM_CONDITIONAL([HAVE_NTOM], [test "x$ntom" = xenabled])
downsample=enabled
AC_ARG_ENABLE(downsample,
[ --disable-downsample=[no/yes] no downsampled decoding ],
[AS_HELP_STRING( [--disable-downsample], [no downsampled decoding])],
[
if test "x$enableval" = xno; then
downsample="disabled"
@@ -448,7 +522,7 @@ fi
feeder=enabled
AC_ARG_ENABLE(feeder,
[ --disable-feeder=[no/yes] no feeder decoding, no buffered readers ],
[AS_HELP_STRING( [--disable-feeder], [no feeder decoding, no buffered readers])],
[
if test "x$enableval" = xno; then
feeder="disabled"
@@ -461,7 +535,7 @@ fi
moreinfo=enabled
AC_ARG_ENABLE(moreinfo,
[ --disable-moreinfo=[no/yes] no extra information for frame analyzers ],
[AS_HELP_STRING( [--disable-moreinfo], [no extra information for frame analyzers])],
[
if test "x$enableval" = xno; then
moreinfo="disabled"
@@ -474,7 +548,7 @@ fi
messages=enabled
AC_ARG_ENABLE(messages,
[ --disable-messages=[no/yes] no error/warning messages on the console ],
[AS_HELP_STRING( [--disable-messages], [no error/warning messages on the console])],
[
if test "x$enableval" = xno; then
messages="disabled"
@@ -489,7 +563,7 @@ fi
runtimetables=disabled
AC_ARG_ENABLE(runtime-tables,
[ --enable-runtime-tables=[yes/no] calculate tables at runtime saving size at the expense of additional computation at load time ],
[AS_HELP_STRING([--enable-runtime-tables], [calculate tables at runtime saving size at the expense of additional computation at load time])],
[
if test "x$enableval" = xyes; then
runtimetables=enabled
@@ -505,7 +579,7 @@ AM_CONDITIONAL([HAVE_RUNTIME_TABLES], [test "x$runtimetables" = xenabled] )
newhuff=enabled
AC_ARG_ENABLE(new-huffman,
[ --enable-new-huffman=[yes/no] use new huffman decoding scheme by Taihei (faster on modern CPUs at least, so on by default) ],
[AS_HELP_STRING([--disable-new-huffman], [new huffman decoding scheme by Taihei (faster on modern CPUs at least, so on by default)])],
[
if test "x$enableval" = xno; then
newhuff=disabled
@@ -519,7 +593,7 @@ fi
integers=quality
AC_ARG_ENABLE(int-quality,
[ --enable-int-quality=[yes/no] use rounding instead of fast truncation for integer output, where possible ],
[AS_HELP_STRING([--disable-int-quality], [use rounding instead of fast truncation for integer output, where possible])],
[
if test "x$enableval" = xno; then
integers=fast
@@ -533,7 +607,7 @@ AM_CONDITIONAL([HAVE_ACCURATE], [ test x"$integers" = xquality ])
int16=enabled
AC_ARG_ENABLE(16bit,
[ --disable-16bit=[no/yes] no 16 bit integer output ],
[AS_HELP_STRING( [--disable-16bit], [no 16 bit integer output])],
[
if test "x$enableval" = xno; then
int16="disabled"
@@ -542,7 +616,7 @@ AC_ARG_ENABLE(16bit,
int8=enabled
AC_ARG_ENABLE(8bit,
[ --disable-8bit=[no/yes] no 8 bit integer output ],
[AS_HELP_STRING( [--disable-8bit], [no 8 bit integer output])],
[
if test "x$enableval" = xno; then
int8="disabled"
@@ -551,7 +625,7 @@ AC_ARG_ENABLE(8bit,
int32=enabled
AC_ARG_ENABLE(32bit,
[ --disable-32bit=[no/yes] no 32 bit integer output (also 24 bit) ],
[AS_HELP_STRING( [--disable-32bit], [no 32 bit integer output (also 24 bit)])],
[
if test "x$enableval" = xno; then
int32="disabled"
@@ -560,7 +634,7 @@ AC_ARG_ENABLE(32bit,
real=enabled
AC_ARG_ENABLE(real,
[ --disable-real=[no/yes] no real (floating point) output ],
[AS_HELP_STRING( [--disable-real], [no real (floating point) output])],
[
if test "x$enableval" = xno; then
real="disabled"
@@ -569,48 +643,49 @@ AC_ARG_ENABLE(real,
equalizer=enabled
AC_ARG_ENABLE(equalizer,
[ --disable-equalizer=[no/yes] no equalizer support ],
[AS_HELP_STRING( [--disable-equalizer], [no equalizer support])],
[
if test "x$enableval" = xno; then
equalizer="disabled"
fi
], [])
AC_ARG_WITH([cpu], [
--with-cpu=generic[[_fpu]] Use generic processor code with floating point arithmetic
--with-cpu=generic_float Plain alias to generic_fpu now... float output is a normal runtime option!
--with-cpu=generic_nofpu Use generic processor code with fixed point arithmetic (p.ex. ARM)
--with-cpu=generic_dither Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding.
--with-cpu=i386[[_fpu]] Use code optimized for i386 processors with floating point arithmetic
--with-cpu=i386_nofpu Use code optimized for i386 processors with fixed point arithmetic
--with-cpu=i486 Use code optimized for i486 processors (only usable alone!)
--with-cpu=i586 Use code optimized for i586 processors
--with-cpu=i586_dither Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size
--with-cpu=3dnow Use code optimized for 3DNow processors
--with-cpu=3dnow_vintage Use code optimized for older 3DNow processors (K6 family)
--with-cpu=3dnowext Use code optimized for 3DNowExt processors (K6-3+, Athlon)
--with-cpu=3dnowext_alone Really only 3DNowExt decoder, without 3DNow fallback for flexible rate
--with-cpu=3dnow_vintage Use code optimized for older extended 3DNow processors (like K6-III+)
--with-cpu=mmx Use code optimized for MMX processors
--with-cpu=mmx_alone Really only MMX decoder, without i586 fallback for flexible rate
--with-cpu=sse Use code optimized for SSE processors
--with-cpu=sse_vintage Use code optimized for older SSE processors (plain C DCT36)
--with-cpu=sse_alone Really only SSE decoder, without i586 fallback for flexible rate
--with-cpu=avx Use code optimized for x86-64 with AVX processors
--with-cpu=x86 Pack all x86 opts into one binary (excluding i486, including dither)
--with-cpu=x86-64 Use code optimized for x86-64 processors (AMD64 and Intel64, including AVX and dithered generic)
--with-cpu=altivec Use code optimized for Altivec processors (PowerPC G4 and G5)
--with-cpu=ppc_nofpu Use code optimized for PowerPC processors with fixed point arithmetic
--with-cpu=neon Use code optimized for ARM NEON SIMD engine (Cortex-A series)
--with-cpu=arm_fpu Pack neon and generic[[_dither]] decoders, for ARM processors with FPU and/or NEON
--with-cpu=arm_nofpu Use code optimized for ARM processors with fixed point arithmetic
--with-cpu=neon64 Use code optimized for AArch64 NEON SIMD engine
--with-cpu=aarch64 Pack neon64 and generic[[_dither]] decoders, for 64bit ARM processors
AC_ARG_WITH([cpu], [AS_HELP_STRING([--with-cpu=<type>], [select CPU optimization. Choices are:])
generic[[_fpu]] Use generic processor code with floating point arithmetic
generic_float Plain alias to generic_fpu now... float output is a normal runtime option!
generic_nofpu Use generic processor code with fixed point arithmetic (p.ex. ARM)
generic_dither Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding.
i386[[_fpu]] Use code optimized for i386 processors with floating point arithmetic
i386_nofpu Use code optimized for i386 processors with fixed point arithmetic
i486 Use code optimized for i486 processors (only usable alone!)
i586 Use code optimized for i586 processors
i586_dither Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size
3dnow Use code optimized for 3DNow processors
3dnow_vintage Use code optimized for older 3DNow processors (K6 family)
3dnowext Use code optimized for 3DNowExt processors (K6-3+, Athlon)
3dnowext_alone Really only 3DNowExt decoder, without 3DNow fallback for flexible rate
3dnow_vintage Use code optimized for older extended 3DNow processors (like K6-III+)
mmx Use code optimized for MMX processors
mmx_alone Really only MMX decoder, without i586 fallback for flexible rate
sse Use code optimized for SSE processors
sse_vintage Use code optimized for older SSE processors (plain C DCT36)
sse_alone Really only SSE decoder, without i586 fallback for flexible rate
avx Use code optimized for x86-64 with AVX processors
x86 Pack all x86 opts into one binary (excluding i486, including dither)
x86-64 Use code optimized for x86-64 processors (AMD64 and Intel64, including AVX and dithered generic)
altivec Use code optimized for Altivec processors (PowerPC G4 and G5)
ppc_nofpu Use code optimized for PowerPC processors with fixed point arithmetic
neon Use code optimized for ARM NEON SIMD engine (Cortex-A series)
arm_fpu Pack neon and generic[[_dither]] decoders, for ARM processors with FPU and/or NEON
arm_nofpu Use code optimized for ARM processors with fixed point arithmetic
neon64 Use code optimized for AArch64 NEON SIMD engine
aarch64 Pack neon64 and generic[[_dither]] decoders, for 64bit ARM processors
])
use_yasm=auto
AC_ARG_ENABLE(yasm,
[ --enable-yasm=[no/yes] enforce yasm instad of default assembler for some optimizations (AVX, currently) ],
[AS_HELP_STRING( [--enable-yasm], [enforce yasm instad of default assembler for some optimizations (AVX, currently)])],
[
if test "x$enableval" = xyes; then
use_yasm="enabled"
@@ -623,7 +698,7 @@ if test x"$use_yasm" = xenabled; then
fi
AC_ARG_ENABLE(ieeefloat,
[ --enable-ieeefloat=[yes/no] use special hackery relying on IEEE 754 floating point storage format (to accurately round to 16 bit integer at bit more efficiently in generic decoder, enabled by default, disable in case you have a very special computer) ],
[AS_HELP_STRING( [--disable-ieeefloat], [use special hackery relying on IEEE 754 floating point storage format (to accurately round to 16 bit integer at bit more efficiently in generic decoder, enabled by default, disable in case you have a very special computer)])],
[
if test "x$enableval" = xyes; then
ieee=enabled
@@ -638,7 +713,7 @@ if test "x$ieee" = xenabled; then
fi
AC_ARG_ENABLE(cases,
[ --enable-cases=[yes/no] include special cases for likely parameter values (channel count, encoding sizes in libsyn123 routines) in the hope of better optimization at the expense of some code bloat (default enabled) ],
[AS_HELP_STRING([--disable-cases], [include special cases for likely parameter values (channel count, encoding sizes in libsyn123 routines) in the hope of better optimization at the expense of some code bloat])],
[
if test "x$enableval" = xyes; then
specialcases=enabled
@@ -846,7 +921,7 @@ case $host in
esac
AC_ARG_ENABLE(buffer,
[ --enable-buffer=[yes/no] disable audio buffer code (default uses system whitelist... proper checks later) ],
[AS_HELP_STRING([--disable-buffer], [disable audio buffer code (default enabled by some heuristics)])],
[
if test "x$enableval" = xyes
then
@@ -860,7 +935,7 @@ AC_ARG_ENABLE(buffer,
)
AC_ARG_ENABLE(newoldwritesample,
[ --enable-newoldwritesample=[no/yes] enable new/old WRITE_SAMPLE macro for non-accurate 16 bit output, faster on certain CPUs (default on on x86-32)],
[AS_HELP_STRING( [--enable-newoldwritesample], [new/old WRITE_SAMPLE macro for non-accurate 16 bit output, faster on certain CPUs (default on on 32 bit x86)])],
[
if test "x$enableval" = xyes
then
@@ -919,7 +994,7 @@ AM_CONDITIONAL([HAVE_EQUALIZER], [ test x"$equalizer" = xenabled ] )
layer1=enabled
AC_ARG_ENABLE(layer1,
[ --disable-layer1=[no/yes] no layer I decoding ],
[AS_HELP_STRING( [--disable-layer1], [no layer I decoding])],
[
if test "x$enableval" = xno; then
layer1="disabled"
@@ -931,7 +1006,7 @@ AM_CONDITIONAL([HAVE_LAYER1], [test "x$layer1" = xenabled] )
layer2=enabled
AC_ARG_ENABLE(layer2,
[ --disable-layer2=[no/yes] no layer II decoding ],
[AS_HELP_STRING( [--disable-layer2], [no layer II decoding])],
[
if test "x$enableval" = xno; then
layer2="disabled"
@@ -943,7 +1018,7 @@ AM_CONDITIONAL([HAVE_LAYER2], [test "x$layer2" = xenabled] )
layer3=enabled
AC_ARG_ENABLE(layer3,
[ --disable-layer3=[no/yes] no layer III decoding ],
[AS_HELP_STRING( [--disable-layer3], [no layer III decoding])],
[
if test "x$enableval" = xno; then
layer3="disabled"
@@ -954,7 +1029,8 @@ AC_ARG_ENABLE(layer3,
AM_CONDITIONAL([HAVE_LAYER3], [test "x$layer3" = xenabled] )
AC_ARG_WITH([audio], [
--with-audio=<list of modules> Select a list (or only one) of audio output modules (comma or space separated list). Choices are:
AS_HELP_STRING([--with-audio=<list of modules>], [Select a list (or only one) of audio output modules (comma or space separated list). Choices are:])
aix Use AIX as default audio output sub-system
alib Use Alib as default audio output sub-system (for HPUX)
alsa Use ALSA as default audio output sub-system (libasound)
@@ -1112,99 +1188,137 @@ AC_CHECK_HEADERS([stdio.h stdlib.h string.h unistd.h sched.h sys/ioctl.h sys/typ
dnl ############## Types
dnl Large file support stuff needs cleanup. There are superfluous variables.
dnl Detect large file support, enable switches if needed.
AC_SYS_LARGEFILE
dnl If we do have a switch for large files, rename off_t-aware API calls.
dnl Using the file_offset_bits variable here is fine for linux (possibly Solaris),
dnl Others... we'll have to see.
dnl Note: I started writing this with with multiline replacements.
dnl Does not work. Automake insists on putting these into Makefiles where they break things.
dnl It is also assumed that a system that does not set file offset bits is not
dnl sensitive to largefile changes, i.e. FreeBSD always using 64 bit off_t.
if test "x$ac_cv_sys_file_offset_bits" = x || echo "$ac_cv_sys_file_offset_bits" | $GREP '@<:@^0-9@:>@' > /dev/null; then
dnl if it has non-numeric chars or is empty... ignore...
largefile_sensitive=no
BUILD_NO_LARGENAME=1
AC_DEFINE(BUILD_NO_LARGENAME, 1, [ No suffixed symbols for large file support (only alias for backwards compat.) ])
else
largefile_sensitive=yes
BUILD_NO_LARGENAME=0
fi
# Add dual-mode wrapper code.
AM_CONDITIONAL([HAVE_LFS_WRAP], [ test x"$largefile_sensitive" = xyes ] )
# Any non-sensitive platform does not bother with off_t-based function renaming.
AC_SUBST(BUILD_NO_LARGENAME)
# Using the lower level macros instead of AC_TYPE_* for compatibility with not freshest autoconf.
# Re-think this list. Some things just should be a given. We assume C99 now.
# Rather think about assumptions like int64_t >= ptrdiff_t.
AC_CHECK_TYPE(size_t, unsigned long)
AC_CHECK_TYPE(uintptr_t, unsigned long)
AC_CHECK_TYPE(ssize_t, long)
AC_CHECK_TYPE(off_t, long int)
AC_CHECK_TYPE(ptrdiff_t, long)
AC_CHECK_TYPE(int32_t, int)
AC_CHECK_TYPE(int64_t, long long)
AC_CHECK_TYPE(uint32_t, unsigned int)
AC_CHECK_TYPE(int16_t, short)
AC_CHECK_TYPE(uint16_t, unsigned short)
AC_CHECK_SIZEOF(size_t,4)
AC_CHECK_SIZEOF(ssize_t,4)
AC_CHECK_SIZEOF(off_t,4)
AC_CHECK_SIZEOF(off64_t,8)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(ssize_t)
AC_CHECK_SIZEOF(int32_t)
AC_CHECK_SIZEOF(long,4)
AC_CHECK_SIZEOF(long)
dnl The native type used for aliases is what off_t maps to without any largefile-
dnl enabling switches. So, it's long int if the system is largefile-senstive,
dnl but it is actual plain off_t if the system does not have such switches.
if test "x$largefile_sensitive" = xyes; then
lfs_alias_type=long
lfs_alias_size=$ac_cv_sizeof_long
elif test "x$android_build" = xyes; then
lfs_alias_type=off64_t
lfs_alias_size=$ac_cv_sizeof_off64_t
else
lfs_alias_type=off_t
lfs_alias_size=$ac_cv_sizeof_off_t
fi
# We do not need to know if off_t actually changes size using
# _FILE_OFFSET_BITS, only need to know what size it has.
if test "x$lfs_alias_size" = "x"; then
AC_MSG_ERROR([Cannot determine sizeof(lfs_alias_t)?])
else
LFS_ALIAS_BITS=`expr "$lfs_alias_size" "*" "8"`
AC_DEFINE_UNQUOTED([lfs_alias_t], $lfs_alias_type,
[Define to the native offset type (long or actually off_t).])
AC_DEFINE_UNQUOTED([LFS_ALIAS_BITS], $LFS_ALIAS_BITS,
[Define this to the size of native offset type in bits, used for LFS alias functions.])
fi
dnl ############## LFS stuff
AC_SUBST(LFS_ALIAS_BITS)
lfs_alias=enabled
AC_ARG_ENABLE(lfs-alias,
[ --disable-lfs-alias disable alias wrappers for largefile bitness (mpg123_seek_32 or mpg123_seek_64 in addition to mpg123_seek, or the other way around; It is a mess, do not play with this!) ],
portable_api=no
AC_ARG_ENABLE(portable,
[AS_HELP_STRING( [--enable-portable], [only build portable API (no off_t, no internal I/O)])],
[
if test "x$enableval" = xno; then
lfs_alias="disabled"
if test "x$enableval" = xyes; then
portable_api="yes"
fi
],
[
case $host in
*-cygwin*)
lfs_alias="disabled"
AC_MSG_NOTICE([lfs-alias disabled for Cygwin, use --enable-lfs-alias explicitly to enable, only if you know what you are doing])
;;
esac
], [])
if test "x$portable_api" = xyes; then
AC_DEFINE(PORTABLE_API, 1, [ Define to only include portable library API (no off_t, no internal I/O). ])
fi
])
AM_CONDITIONAL([HAVE_LFS_WRAP], [ test x"$portable_api" = xno ] )
AC_MSG_CHECKING([if we want to enable alias wrappers for largefile])
if test "x$lfs_alias" = "xenabled"; then
# Check for shape-shifting off_t just for the mpg123 client application.
# At least at first, mpg123 itself will excercise the wrappers, otherwise
# we don't know they work.
# Do not use AC_CHECK_SIZEOF twice to avoid redefinition of SIZEOF_OFF_T
# in further tests via confdefs.h.
AC_MSG_CHECKING([switched off_t size])
AC_COMPUTE_INT(switched_off_size, sizeof(off_t), [
#undef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
])
AC_MSG_RESULT([$switched_off_size])
# If you have predefined _FILE_OFFSET_BITS, I will treat that as a system
# property.
AC_CHECK_SIZEOF(off_t, [], [
#include <sys/types.h>
])
# Some paranoia about the limited choices we accept.
# 32 or 64 bit offsets, an the switched one better not be smaller.
if test "x$ac_cv_sizeof_off_t" = x0; then
AC_MSG_ERROR([Not even off_t found. I need some POSIX.])
fi
if test "x$ac_cv_sizeof_off_t" != x8 &&
test "x$ac_cv_sizeof_off_t" != x4; then
AC_MSG_ERROR([unexpected size of off_t])
fi
if test "x$ac_cv_sizeof_off_t" != "x$switched_off_size"; then
if test "x$switched_off_size" != x8; then
AC_MSG_ERROR([bad switched off_t size])
fi
lfs_sensitive=yes
AC_DEFINE(LFS_SENSITIVE, 1, [ System redefines off_t when defining _FILE_OFFSET_BITS to 64. ])
else
lfs_sensitive=no
fi
use_largefile=auto
AC_MSG_CHECKING([if native off_t is already 64 bits])
if test "x$ac_cv_sizeof_off_t" = x8; then
AC_MSG_RESULT([yes])
use_largefile=no
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([HAVE_LFS_ALIAS], [ test x"$lfs_alias" = xenabled ])
AC_ARG_ENABLE(largefile,
[AS_HELP_STRING([--disable-largefile], [to not attempt to use 64 bit file offsets internally])],
[ if test "x$enableval" = xno; then
use_largefile=no
fi
],
[])
# Large file support without the magic. Check for the API explicitly.
# The shape-shifting off_t has to be avoided for the library builds.
# The mpg123 application might still use it to check if the API works.
# Or we limit it to portable, off_t-less API at some point.
if test x"$use_largefile" != xno; then
# Expect usual_LARGEFILE64_SOURCE mechanics with off64_t and lseek64 present.
AC_CHECK_FUNCS([lseek64])
AC_CHECK_TYPE(off64_t, [have_off64_t=yes], [have_off64_t=no], [[
#define _LARGEFILE64_SOURCE
#include <sys/types.h>
#include <unistd.h>
]])
if test "x$have_off64_t" = xyes && test "x$ac_cv_func_lseek64" = xyes; then
use_largefile=yes
AC_DEFINE(LFS_LARGEFILE_64, 1, [ Define if we use _LARGEFILE64_SOURCE with off64_t and lseek64. ])
AC_MSG_CHECKING([if we have O_LARGEFILE])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#define _LARGEFILE64_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
int foo()
{
return open("foo", O_RDONLY|O_LARGEFILE);
}
])],[have_o_largefile=yes],[have_o_largefile=no])
AC_MSG_RESULT([$have_o_largefile])
if test x"$have_o_largefile" = xno; then
AC_DEFINE(O_LARGEFILE, 0, [ Define to 0 if system does not have/need it. ])
fi
else
use_largefile=no
fi
fi # use_largefile auto or yes
dnl ############## Function Checks
@@ -1244,7 +1358,7 @@ AC_CHECK_FUNCS( sched_setscheduler setuid getuid)
# Check for setpriority
AC_CHECK_FUNCS( setpriority )
AC_CHECK_FUNCS( strerror )
AC_CHECK_FUNCS( strerror strerror_l uselocale )
AC_CHECK_FUNCS( setlocale nl_langinfo mbstowcs wcstombs wcswidth iswprint )
@@ -1310,29 +1424,6 @@ AC_SEARCH_LIBS(socket, socket)
AC_CHECK_FUNCS( getaddrinfo, [ have_ipv6=yes ], [ have_ipv6=no ] )
# Substitutions for the installable mpg123.h header
if test "x$ac_cv_header_stdio_h" = "xyes"; then
INCLUDE_STDIO_H="#include <stdio.h>"
else
INCLUDE_STDIO_H="/* #include <stdio.h> is not available on this system */"
fi
AC_SUBST(INCLUDE_STDIO_H)
if test "x$ac_cv_header_stdlib_h" = "xyes"; then
INCLUDE_STDLIB_H="#include <stdlib.h>"
else
INCLUDE_STDLIB_H="/* #include <stdlib.h> is not available on this system */"
fi
AC_SUBST(INCLUDE_STDLIB_H)
if test "x$ac_cv_header_sys_types_h" = "xyes"; then
INCLUDE_SYS_TYPE_H="#include <sys/types.h>"
else
INCLUDE_SYS_TYPE_H="/* #include <sys/types.h> is not available on this system */"
fi
AC_SUBST(INCLUDE_SYS_TYPE_H)
# Checks for maths libraries.
AC_CHECK_LIB([m], [sqrt])
AC_CHECK_LIB([mx], [powf])
@@ -1600,7 +1691,7 @@ AC_SUBST(YASM_FORMAT)
AC_MSG_CHECKING([if we want feature report function])
feature_report=enabled
AC_ARG_ENABLE(feature_report,
[ --disable-feature_report Disable feature report function ],
[AS_HELP_STRING([--disable-feature_report], [Disable feature report function])],
[
if test "x$enableval" = xno; then
AC_MSG_RESULT([no])
@@ -2344,11 +2435,6 @@ case $host_os in
;;
esac
# enable win32 code
if test "x$ac_cv_header_windows_h" = xyes -a "x$host_os" != xcygwin -a "x$host_os" != xmidipix; then
win32_specific_codes=enabled
fi
dnl We do not support non-unicode Windows.
if test "x$win32_specific_codes" = xenabled; then
#### Check for Wide functions
@@ -2485,31 +2571,6 @@ if test x$win32_specific_codes = xenabled; then
else
AC_MSG_RESULT([no])
fi
# Check GetThreadErrorMode
if test x"$modules" != xdisabled; then
AC_MSG_CHECKING([if we have GetThreadErrorMode])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <windows.h>
int main(){
return GetThreadErrorMode();
}])],[win32_thread_error=yes],[win32_winver_bump=yes])
if test "x$win32_thread_error" != "xyes"; then
AC_MSG_CHECKING([if we have GetThreadErrorMode])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#define WINVER 0x600
#define _WIN32_WINNT 0x600
#include <windows.h>
int main(){
return GetThreadErrorMode();
}])],[win32_thread_error=yes],[win32_thread_error=no])
fi
if test "x$win32_thread_error" = "xyes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR(GetThreadErrorMode is required but not found)
fi
fi
fi
#### WINVER Bump
@@ -2542,7 +2603,7 @@ AS_IF([test "x$eoverflow_present" = "xyes"],[],[AC_DEFINE([EOVERFLOW],[EFBIG],[U
# old network choice
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6=[no/yes] IPv6 support in internal network stack ],
[AS_HELP_STRING( [--enable-ipv6], [IPv6 support in internal network stack])],
[
if test "x$enableval" = xyes
then
@@ -2563,7 +2624,7 @@ dnl This is to be kept in sync with --with-network, it is a shortcut that
dnl keep the old semantics of being able to --disable-network support altogether.
dnl The default should match the --with-network default.
AC_ARG_ENABLE(network,
[ --enable-network=[no/yes] network support (http streams / webradio), if available (overruled by --with-network!) ],
[AS_HELP_STRING( [--enable-network], [network support (http streams / webradio), if available (overruled by --with-network!)])],
[
if test "x$enableval" = xyes
then
@@ -2726,13 +2787,127 @@ if test x"$ipv6" = xenabled; then
fi
fi
dnl ############## Component selection
AC_ARG_ENABLE(components,
[AS_HELP_STRING([--disable-components], [(not) build end-user programs with default components, select individual components via --enable-libmpg123 etc.])],
[
if test "x$enableval" = xyes
then
build_all=yes
else
build_all=no
fi
],
[
build_all=yes
]
)
AC_ARG_ENABLE(libmpg123,
[AS_HELP_STRING([--enable-libmpg123], [build (only) libmpg123 (with --disable-components)])],
[
if test "x$enableval" = xyes
then
build_libmpg123=yes
else
build_libmpg123=no
fi
],
[
build_libmpg123=no
]
)
AC_ARG_ENABLE(libout123,
[AS_HELP_STRING([--enable-libout123], [build (only) libout123 (with --disable-components)])],
[
if test "x$enableval" = xyes
then
build_libout123=yes
else
build_libout123=no
fi
],
[
build_libout123=no
]
)
AC_ARG_ENABLE(libout123-modules,
[AS_HELP_STRING([--enable-libout123-modules], [build (only) libout123 modules (with --disable-components)])],
[
if test "x$enableval" = xyes
then
build_libout123_modules=yes
else
build_libout123_modules=no
fi
],
[
build_libout123_modules=no
]
)
AC_ARG_ENABLE(libsyn123,
[AS_HELP_STRING([--enable-libsyn123], [build (only) libsyn123 (with --disable-components)])],
[
if test "x$enableval" = xyes
then
build_libsyn123=yes
else
build_libsyn123=no
fi
],
[
build_libsyn123=no
]
)
if test "x$build_all" = xyes; then
build_programs=yes
build_libmpg123=yes
build_libout123=yes
build_libout123_modules=yes
build_libsyn123=yes
components="programs"
else
build_programs=no
fi
AM_CONDITIONAL([BUILD_PROGRAMS], [ test "x$build_programs" = xyes ])
AM_CONDITIONAL([BUILD_LIBMPG123], [ test "x$build_libmpg123" = xyes ])
AM_CONDITIONAL([BUILD_LIBOUT123], [ test "x$build_libout123" = xyes ])
AM_CONDITIONAL([BUILD_LIBOUT123_MODULES], [ test "x$build_libout123_modules" = xyes ])
AM_CONDITIONAL([BUILD_LIBSYN123], [ test "x$build_libsyn123" = xyes ])
AM_CONDITIONAL([NEED_FMT123], [ test "x$build_libmpg123" = xyes || test "x$build_libout123" = xyes || test "x$build_libsyn123" = xyes ])
# If we install libraries, prompting pkgconfig and include directories.
AM_CONDITIONAL([NEED_LIB], [ test "x$build_libmpg123" = xyes || test "x$build_libout123" = xyes || test "x$build_libout123_modules" = xyes || test "x$build_libsyn123" = xyes ])
AM_CONDITIONAL([NEED_MAINLIB], [ test "x$build_libmpg123" = xyes || test "x$build_libout123" = xyes || test "x$build_libsyn123" = xyes ])
AM_CONDITIONAL([NEED_MAN], [ test "x$build_programs"= = xyes ])
if test "x$build_libmpg123" = xyes; then
components="$components libmpg123"
fi
if test "x$build_libout123" = xyes; then
components="$components libout123"
fi
if test "x$build_libout123_modules" = xyes; then
components="$components libout123-modules"
fi
if test "x$build_libsyn123" = xyes; then
components="$components libsyn123"
fi
components=$(echo $components)
dnl ############## Library cleanup
PROG_LIBS=$LIBS
LIBS=
LIBMPG123_LIBS="$LIBM $COMPAT_LIBS"
LIBSYN123_LIBS=$LIBM
LIBOUT123_LIBS="$LIBM $COMPAT_LIBS"
LIBOUT123_LIBS="$LIBRT $LIBM $COMPAT_LIBS"
AC_SUBST(PROG_LIBS)
AC_SUBST(LIBM)
@@ -2748,22 +2923,28 @@ AC_CONFIG_FILES([
libout123.pc
libsyn123.pc
mpg123.spec
src/libmpg123/mpg123.h
src/libout123/out123.h
src/libsyn123/syn123.h
])
AC_OUTPUT
dnl ############## Display Message
default_offset_bits=`expr "$ac_cv_sizeof_off_t" "*" "8"`
echo "
$PACKAGE_NAME $PACKAGE_VERSION
Install path ............ $prefix
Components .............. $components
CPU Optimization ........ $cpu_type
Compiler Optimization ... $with_optimization
Gapless Support ......... $gapless
Compiler Optimization ... $with_optimization"
if test x"$use_yasm_for_avx" = xyes; then
echo " Use yasm (for AVX only) . enabled"
else
echo " Use yasm (for AVX only) . disabled"
fi
echo " Gapless Support ......... $gapless
Debugging ............... $debugging
Terminal control ........ $term_type
Extreme debugging ....... $xdebugging
@@ -2777,19 +2958,10 @@ if test x$network_type != xdisabled; then
echo " Internal network type ... $network_internal
IPv6 (getaddrinfo) ...... $ipv6"
fi
if test x"$LARGEFILE_BITS" = x; then
echo " File offsets ............ default"
else
echo " File offsets ............ $LARGEFILE_BITS"
echo " The lib will (try to) support default offset size, too."
fi
echo " LFS alias symbols ....... $lfs_alias ($LFS_ALIAS_BITS)"
echo " LFS alias type .......... $lfs_alias_type"
if test x"$use_yasm_for_avx" = xyes; then
echo " Use yasm (for AVX only) . enabled"
else
echo " Use yasm (for AVX only) . disabled"
fi
echo " largefile sensitive ..... $lfs_sensitive"
echo " default offsets ......... $default_offset_bits"
echo " explicit 64 bit offsets . $use_largefile"
echo " only portable API ....... $portable_api"
echo "
Core libmpg123 features: