Skip to content

Commit

Permalink
Merge remote-tracking branch 'mpg123/master' into master-with-github-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mpg123 GitHub bot committed Dec 6, 2023
2 parents aec9bb1 + ca6550a commit 6b8057b
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 28 deletions.
8 changes: 4 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ check_PROGRAMS =
AM_CPPFLAGS = -DPKGLIBDIR="\"$(pkglibdir)\""
# That can be trimmed down later when adapting the sources to
# use relative paths for includes.
# Watch out for generated headers (that's why top_builddir is also present).
# TODO: Actually do more relative includes.
AM_CPPFLAGS += \
$(LTDLINCL) \
-I$(top_srcdir)/src \
Expand Down Expand Up @@ -64,22 +64,22 @@ endif
include src/Makemodule.am
include doc/Makemodule.am

# Always use our set of API headers.
AM_CPPFLAGS+= -I$(top_srcdir)/src/include

if NEED_MAINLIB
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =

# Pkg-config files and library includes.
if BUILD_LIBMPG123
pkgconfig_DATA += libmpg123.pc
AM_CPPFLAGS += -I$(top_srcdir)/src/libmpg123
endif
if BUILD_LIBOUT123
pkgconfig_DATA += libout123.pc
AM_CPPFLAGS += -I$(top_srcdir)/src/libout123
endif
if BUILD_LIBSYN123
pkgconfig_DATA += libsyn123.pc
AM_CPPFLAGS += -I$(top_srcdir)/src/libsyn123
endif
endif

Expand Down
7 changes: 4 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
1.32.4
------
- build:
-- Reorganize shared headers.
-- Reorganize shared headers, API headers into src/include.
-- Group C99 feature checks and make several standard headers
mandatory.
-- Get rid of SIZE_P, OFF_P and friends.
-- Only enforce dummy module together with libout123, to be able
to build individual modules using --disable-components logic.
-- Allow building of programs with installed mpg123 libraries (--enable-programs,
using pkg-config to locate libmpg123 et al., prompted by
https://github.com/madebr/mpg123/pull/11).
-- Only libmpg123 component installs fmt123.h.
https://github.com/madebr/mpg123/pull/11). Use with care (will fail on
version mismatch). Also handle that fmt123.h is installed identically
by each library component.
- out123:
-- added --libversion

Expand Down
17 changes: 13 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ m4_undefine([V_HEADER])

AC_INIT([mpg123], V_MAJOR.V_MINOR.V_PATCH[]V_SUFFIX, [[email protected]])

m4_define([V_HEADER], m4_esyscmd(grep -e _API_VERSION -e _PATCHLEVEL src/libmpg123/mpg123.h src/libout123/out123.h src/libsyn123/syn123.h))
m4_define([V_HEADER], m4_esyscmd(grep -e _API_VERSION -e _PATCHLEVEL src/include/mpg123.h src/include/out123.h src/include/syn123.h))

dnl libmpg123
m4_define([API_VERSION], m4_bregexp(V_HEADER,
Expand Down Expand Up @@ -487,20 +487,21 @@ if test "x$build_programs" = xyes; then
components="$components programs"
fi

use_extlib=no
LIBMPG123_LD=abugifused
if test "x$build_libmpg123" = xyes; then
components="$components libmpg123"
elif test "x$build_programs" = xyes; then
use_extlib=yes
PKG_CHECK_MODULES(LIBMPG123_PKG, libmpg123, HAVE_LIBMPG123="yes", HAVE_LIBMPG123="no" missing_lib=yes)
CFLAGS="$CFLAGS $LIBMPG123_PKG_CFLAGS"
LIBMPG123_LD="$LIBMPG123_PKG_LIBS"
fi
LIBOUT123_LD=abugifused
if test "x$build_libout123" = xyes; then
components="$components libout123"
elif test "x$build_programs" = xyes; then
use_extlib=yes
PKG_CHECK_MODULES(LIBOUT123_PKG, libout123, HAVE_LIBOUT123="yes", HAVE_LIBOUT123="no" missing_lib=yes)
CFLAGS="$CFLAGS $LIBOUT123_PKG_CFLAGS"
LIBOUT123_LD="$LIBOUT123_PKG_LIBS"
fi
if test "x$build_libout123_modules" = xyes; then
Expand All @@ -510,8 +511,8 @@ LIBSYN123=abugifused
if test "x$build_libsyn123" = xyes; then
components="$components libsyn123"
elif test "x$build_programs" = xyes; then
use_extlib=yes
PKG_CHECK_MODULES(LIBSYN123_PKG, libsyn123, HAVE_LIBSYN123="yes", HAVE_LIBSYN123="no" missing_lib=yes)
CFLAGS="$CFLAGS $LIBSYN123_PKG_CFLAGS"
LIBSYN123_LD="$LIBSYN123_PKG_LIBS"
fi

Expand Down Expand Up @@ -3062,6 +3063,14 @@ if test x"$cpu_type" = xi486; then
echo "only."
fi

if test "x$use_extlib" = xyes; then
echo
echo "Warning: You opted to use external builds of the mpg123 libraries. They need to"
echo " match the headers shipped with this source (which are used during build"
echo " regardless)."
echo
fi

echo
echo " CPPFLAGS='$CPPFLAGS'"
echo " CFLAGS='$CFLAGS'"
Expand Down
4 changes: 1 addition & 3 deletions ports/cmake/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,7 @@ include_directories(
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/compat"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/common"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/libsyn123"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/libout123"
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/libmpg123")
"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/include")

add_compile_definitions(
$<$<BOOL:${WIN32}>:_CRT_SECURE_NO_WARNINGS>
Expand Down
4 changes: 2 additions & 2 deletions ports/cmake/src/libmpg123/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ install(TARGETS ${TARGET} EXPORT targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/mpg123.h"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/include/mpg123.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/fmt123.h"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/include/fmt123.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

2 changes: 1 addition & 1 deletion ports/cmake/src/libout123/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,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_SOURCE_DIR}/../../../../src/libout123/out123.h"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/include/out123.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
2 changes: 1 addition & 1 deletion ports/cmake/src/libsyn123/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,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_SOURCE_DIR}/../../../../src/libsyn123/syn123.h"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/include/syn123.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
7 changes: 7 additions & 0 deletions src/Makemodule.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ bin_PROGRAMS += \
endif
endif

if NEED_LIB
if NEED_MAINLIB
# All main libraries need fmt123 header installed.
include_HEADERS += src/include/fmt123.h
endif
endif

src_mpg123_LDADD = \
src/compat/libcompat.la \
$(LIBMPG123) \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 1 addition & 5 deletions src/libmpg123/Makemodule.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ src_libmpg123_calctables_LDADD = @LIBM@

if BUILD_LIBMPG123
lib_LTLIBRARIES += src/libmpg123/libmpg123.la
include_HEADERS += src/libmpg123/mpg123.h
# All libs need it, but only libmpg123 installs it.
# Placing it in src/ helps other components to always find it.
include_HEADERS += src/fmt123.h
include_HEADERS += src/include/mpg123.h
endif

src_libmpg123_libmpg123_la_CFLAGS = @LIB_CFLAGS@
Expand All @@ -39,7 +36,6 @@ src_libmpg123_libmpg123_la_DEPENDENCIES = \
src/compat/libcompat.la

src_libmpg123_libmpg123_la_SOURCES = \
src/fmt123.h \
src/libmpg123/mpeghead.h \
src/libmpg123/parse.c \
src/libmpg123/parse.h \
Expand Down
2 changes: 1 addition & 1 deletion src/libout123/Makemodule.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if !HAVE_MODULES
include src/libout123/modules/Makemodule.am
endif

include_HEADERS += src/libout123/out123.h
include_HEADERS += src/include/out123.h

noinst_LTLIBRARIES += src/libout123/libmodule.la

Expand Down
2 changes: 1 addition & 1 deletion src/libsyn123/Makemodule.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and format conversion for the mpg123 project.

if BUILD_LIBSYN123
include_HEADERS += src/libsyn123/syn123.h
include_HEADERS += src/include/syn123.h

lib_LTLIBRARIES += src/libsyn123/libsyn123.la
endif
Expand Down
6 changes: 3 additions & 3 deletions src/tests/noise.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "config.h"
#include "compat.h"
#include "dither.h"
#include "debug.h"
#include "../compat/compat.h"
#include "../libmpg123/dither.h"
#include "../common/debug.h"

/* Directly include the code for testing, avoiding
build of same object with and without libtool. */
Expand Down

0 comments on commit 6b8057b

Please sign in to comment.