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

@@ -8,6 +8,8 @@ include(CheckSymbolExists)
include(CMakeDependentOption)
include(TestBigEndian)
option(PORTABLE_API "Only build portable library API (no off_t, no internal I/O." OFF)
check_include_file("arpa/inet.h" HAVE_ARPA_INET_H)
check_include_file("dirent.h" HAVE_DIRENT_H)
check_include_file("dlfcn.h" HAVE_DLFCN_H)
@@ -54,15 +56,32 @@ check_function_exists(random HAVE_RANDOM)
check_function_exists(setenv HAVE_SETENV)
check_function_exists(unsetenv HAVE_UNSETENV)
check_function_exists(setlocale HAVE_SETLOCALE)
check_function_exists(uselocale HAVE_USELOCALE)
check_function_exists(setpriority HAVE_SETPRIORITY)
check_function_exists(shmget HAVE_SHMGET)
check_function_exists(shmat HAVE_SHMAT)
check_function_exists(shmdt HAVE_SHMDT)
check_function_exists(shmctl HAVE_SHMCTL)
check_function_exists(strerror HAVE_STRERROR)
check_function_exists(strerror_l HAVE_STRERROR_L)
check_function_exists(fork HAVE_FORK)
check_function_exists(execvp HAVE_EXECVP)
check_function_exists(ctermid HAVE_CTERMID)
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
check_function_exists(lseek64 LFS_LARGEFILE_64)
if(LFS_LARGEFILE_64)
check_c_source_compiles(
" #define _LARGEFILE64_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
int fd = open(\"/foo\", O_RDONLY|O_LARGEFILE);
" HAVE_O_LARGEFILE)
endif()
search_libs(gethostbyname GETHOSTBYNAME_LIB nsl socket network)
search_libs(socket SOCKET_LIB socket)
@@ -83,26 +102,6 @@ check_c_source_compiles(
"int main() { __attribute__((aligned(16))) float var; return 0; }"
CCALIGN)
if(MSVC)
# Here, off_t is always 32 bit, the whole machinery doesn't work without explicit
# API for 64 bit file access.
unset(_FILE_OFFSET_BITS)
set(LFS_SENSITIVE OFF)
set(LFS_INSENSITIVE ON)
set(MPG123_LARGE_FILE_SUPPORT OFF)
# We disable all the dynamic naming with MSVC to avoid confusing consumers.
# Maybe it would be more proper to conditionit on LFS_INSENSTIIVE.
set(BUILD_NO_LARGENAME 1)
else()
option(MPG123_LARGE_FILE_SUPPORT "Support large files (define _FILE_OFFSET_BITS)" ON)
if(MPG123_LARGE_FILE_SUPPORT)
set(_FILE_OFFSET_BITS 64)
else()
unset(_FILE_OFFSET_BITS)
endif()
set(BUILD_NO_LARGENAME 0)
endif()
if(NOT LFS_INSENSITIVE)
check_c_source_compiles("
#include <sys/types.h>
@@ -132,17 +131,6 @@ if(NOT LFS_INSENSITIVE)
endif()
check_type_size(long SIZEOF_LONG)
check_type_size(off_t SIZEOF_OFF_T)
if(LFS_SENSITIVE)
set(LFS_ALIAS_TYPE long)
math(EXPR LFS_ALIAS_BITS "${SIZEOF_LONG} * 8")
elseif(CMAKE_ANDROID_ARCH_ABI)
check_type_size(off64_t SIZEOF_OFF64_T)
set(LFS_ALIAS_TYPE off64_t)
math(EXPR LFS_ALIAS_BITS "${SIZEOF_OFF64_T} * 8")
else()
set(LFS_ALIAS_TYPE off_t)
math(EXPR LFS_ALIAS_BITS "${SIZEOF_OFF_T} * 8")
endif()
if(WIN32 AND HAVE_WINDOWS_H)
check_c_source_compiles("
@@ -330,13 +318,6 @@ cmake_dependent_option(NO_BUFFER "enable audio buffer code (default uses system
option(NO_DOWNSAMPLE "no downsampled decoding" OFF)
option(NO_EQUALIZER "no equalizer support" OFF)
option(NO_FEEDER "no feeder decoding, no buffered readers" OFF)
if(CYGWIN)
option(NO_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!)" ON)
elseif(MSVC)
set(NO_LFS_ALIAS ON)
else()
option(NO_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!)" OFF)
endif()
option(NO_ICY "ICY metainfo parsing/conversion" OFF)
option(NO_LAYER1 "no layer I decoding" OFF)
option(NO_LAYER2 "no layer II decoding" OFF)
@@ -359,6 +340,8 @@ include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/"
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/compat"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/libsyn123"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/libout123"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/libmpg123")
add_compile_definitions(
@@ -376,8 +359,8 @@ if(BUILD_LIBOUT123)
endif()
add_subdirectory("libsyn123")
if(UNIX)
option(BUILD_PROGRAMS "Build programs" ON)
if(UNIX AND NOT PORTABLE_API)
option(BUILD_PROGRAMS "Build programs (mpg123 executable and others)" ON)
if(BUILD_PROGRAMS)

View File

@@ -1,3 +1,6 @@
// Define to only include portable API in libraries.
#cmakedefine PORTABLE_API 1
// Define to use proper rounding.
#cmakedefine ACCURATE_ROUNDING 1
@@ -36,12 +39,18 @@
#cmakedefine HAVE_RANDOM 1
#cmakedefine HAVE_SCHED_H 1
#cmakedefine HAVE_SETLOCALE 1
#cmakedefine HAVE_USELOCALE 1
#cmakedefine HAVE_SETPRIORITY 1
#cmakedefine HAVE_SIGNAL_H 1
#cmakedefine HAVE_STDIO_H 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_STDLIB_H 1
#cmakedefine HAVE_STRERROR 1
#cmakedefine HAVE_STRERROR_L 1
#cmakedefine HAVE_FORK 1
#cmakedefine HAVE_EXECVP 1
#cmakedefine HAVE_CTERMID 1
#cmakedefine HAVE_CLOCK_GETTIME 1
#cmakedefine HAVE_STRING_H 1
#cmakedefine HAVE_STRINGS_H 1
#cmakedefine HAVE_SYS_IOCTL_H 1
@@ -67,7 +76,6 @@
// Define if IPV6 support is enabled.
#cmakedefine IPV6 1
#define LFS_ALIAS_BITS @LFS_ALIAS_BITS@
#define LT_MODULE_EXT "@CMAKE_SHARED_MODULE_SUFFIX@"
// Define if network support is enabled.
@@ -140,8 +148,10 @@
#define PKGLIBDIR "@CMAKE_INSTALL_LIBDIR@/@PROJECT_NAME@"
#define SIZEOF_LONG @SIZEOF_LONG@
#define SIZEOF_OFF_T @SIZEOF_OFF_T@
// CMake leaves it emtpy for non-existing type. Autoconf sets it to 0.
#define SIZEOF_LONG (@SIZEOF_LONG@+0)
#define SIZEOF_OFF_T (@SIZEOF_OFF_T@+0)
#define SIZEOF_OFF64_T (@SIZEOF_OFF64_T@+0)
#cmakedefine STDERR_FILENO @STDERR_FILENO@
#cmakedefine STDIN_FILENO @STDIN_FILENO@
@@ -158,7 +168,7 @@
// Define to use Unicode for Windows
#cmakedefine WANT_WIN32_UNICODE 1
#if WANT_WIN32_UNICODE == 1
#ifdef WANT_WIN32_UNICODE
# define strcasecmp _stricmp
# define strncasecmp _strnicmp
#endif
@@ -168,8 +178,9 @@
#cmakedefine WORDS_BIGENDIAN 1
// Number of bits in a file offset, on hosts where this is settable.
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
// Define to the native offset type (long or actually off_t).
#define lfs_alias_t @LFS_ALIAS_TYPE@
#cmakedefine LFS_LARGEFILE_64 1
#cmakedefine LFS_SENSITIVE 1
#cmakedefine HAVE_O_LARGEFILE 1
#ifndef HAVE_O_LARGEFILE
#define O_LARGEFILE 0
#endif

View File

@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.12)
option(NO_FEATURE_REPORT "Disable feature report function" OFF)
option(NO_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!)" OFF)
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/")
@@ -40,8 +39,6 @@ else()
endif()
message(STATUS "Detected machine: ${MACHINE}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/mpg123.h.in" mpg123.h)
set(TARGET lib${PROJECT_NAME})
add_library(${TARGET}
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/parse.c"
@@ -60,7 +57,6 @@ add_library(${TARGET}
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<NOT:$<BOOL:${NO_LAYER1}>>:layer1.c>"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<NOT:$<OR:$<BOOL:${NO_LAYER1}>,$<BOOL:${NO_LAYER2}>>>:layer2.c>"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<NOT:$<BOOL:${NO_LAYER3}>>:layer3.c>"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<NOT:$<BOOL:${NO_LFS_ALIAS}>>:lfs_alias.c>"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<NOT:$<BOOL:${NO_NTOM}>>:ntom.c>"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<NOT:$<BOOL:${NO_8BIT}>>:synth_8bit.c>"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<NOT:$<BOOL:${NO_16BIT}>>:synth.c>"
@@ -68,7 +64,7 @@ add_library(${TARGET}
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<AND:$<BOOL:${HAVE_FPU}>,$<NOT:$<BOOL:${NO_REAL}>>>:synth_real.c>"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<NOT:$<BOOL:${NO_STRING}>>:stringbuf.c>"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<NOT:$<BOOL:${NO_FEATURE_REPORT}>>:feature.c>"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<BOOL:${LFS_SENSITIVE}>:lfs_wrap.c>"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<NOT:$<BOOL:${PORTABLE_API}>>:lfs_wrap.c>"
$<TARGET_OBJECTS:compat>)
if(MSVC)
@@ -252,7 +248,7 @@ install(TARGETS ${TARGET} EXPORT targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/mpg123.h"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/mpg123.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/fmt123.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

View File

@@ -1,7 +1,5 @@
cmake_minimum_required(VERSION 3.12)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libout123/out123.h.in" out123.h)
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libout123/")
add_subdirectory("modules")
@@ -33,5 +31,5 @@ install(TARGETS ${TARGET} EXPORT targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/out123.h"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libout123/out123.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

View File

@@ -1,7 +1,5 @@
cmake_minimum_required(VERSION 3.12)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libsyn123/syn123.h.in" syn123.h)
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../../src/libsyn123/")
set(TARGET libsyn123)
@@ -28,5 +26,5 @@ install(TARGETS ${TARGET} EXPORT targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/syn123.h"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libsyn123/syn123.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")