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 3, 2023
2 parents db41347 + 62aef4e commit aec9bb1
Show file tree
Hide file tree
Showing 34 changed files with 144 additions and 53 deletions.
20 changes: 20 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,26 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/src/compat \
-I$(top_srcdir)/src/common

# Automake cannot handle dependencies behind an autoconf expansion.
# So we need elaborate ifelsery here to make it see the libtool
# files for dependency rule generation. That is stupid. One point
# for those usurping build systems with new flaws.
if BUILD_LIBMPG123
LIBMPG123 = src/libmpg123/libmpg123.la
else
LIBMPG123 = @LIBMPG123_LD@
endif
if BUILD_LIBOUT123
LIBOUT123 = src/libout123/libout123.la
else
LIBOUT123 = @LIBOUT123_LD@
endif
if BUILD_LIBSYN123
LIBSYN123 = src/libsyn123/libsyn123.la
else
LIBSYN123 = @LIBSYN123_LD@
endif

# Include Make modules from subdirectories.
include src/Makemodule.am
include doc/Makemodule.am
Expand Down
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
-- 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.
- out123:
-- added --libversion

1.32.3
------
Expand Down
58 changes: 54 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,21 @@ AC_ARG_ENABLE(components,
]
)

AC_ARG_ENABLE(programs,
[AS_HELP_STRING([--enable-programs], [build (only) programs (with --disable-components)])],
[
if test "x$enableval" = xyes
then
build_programs=yes
else
build_programs=no
fi
],
[
build_programs=no
]
)

AC_ARG_ENABLE(libmpg123,
[AS_HELP_STRING([--enable-libmpg123], [build (only) libmpg123 (with --disable-components)])],
[
Expand Down Expand Up @@ -446,34 +461,69 @@ if test "x$build_all" = xyes; then
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_LIBOUT123_OR_MODULES], [ test "x$build_libout123" = xyes || 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 ])

dnl Some support for using separately installed lib*123. This is not perfect,
dnl with per-library CFLAGS just being lumped into global CFLAGS. So do not
dnl expect to mix differing prefixes with possibly conflicting versions of
dnl the libraries. The expectation is a version matching this source distribution,
dnl anyway.

missing_lib=no

components=""

if test "x$build_programs" = xyes; then
components="$components programs"
fi

LIBMPG123_LD=abugifused
if test "x$build_libmpg123" = xyes; then
components="$components libmpg123"
elif test "x$build_programs" = xyes; then
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
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
components="$components libout123-modules"
fi
LIBSYN123=abugifused
if test "x$build_libsyn123" = xyes; then
components="$components libsyn123"
elif test "x$build_programs" = xyes; then
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

if test "x$missing_lib" = xyes; then
AC_MSG_ERROR([Missing an external mpg123 library for the programs.])
fi

dnl Stupid names because @foo@ cannot coexist with foo.
AC_SUBST(LIBMPG123_LD)
AC_SUBST(LIBOUT123_LD)
AC_SUBST(LIBSYN123_LD)

components=$(echo $components)

dnl ############## Configurable Options
Expand Down
2 changes: 1 addition & 1 deletion ports/cmake/src/libmpg123/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,6 @@ install(TARGETS ${TARGET} EXPORT targets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/mpg123.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/fmt123.h"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/fmt123.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

14 changes: 7 additions & 7 deletions src/Makemodule.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ endif

src_mpg123_LDADD = \
src/compat/libcompat.la \
src/libmpg123/libmpg123.la \
src/libout123/libout123.la \
src/libsyn123/libsyn123.la \
$(LIBMPG123) \
$(LIBOUT123) \
$(LIBSYN123) \
@PROG_LIBS@

src_mpg123_LDFLAGS = @EXEC_LT_LDFLAGS@

src_out123_LDADD = \
src/compat/libcompat.la \
src/libsyn123/libsyn123.la \
src/libout123/libout123.la \
$(LIBSYN123) \
$(LIBOUT123) \
@PROG_LIBS@

src_out123_LDFLAGS = @EXEC_LT_LDFLAGS@
Expand All @@ -47,12 +47,12 @@ CLEANFILES += src/*.a

src_mpg123_id3dump_LDADD = \
src/compat/libcompat.la \
src/libmpg123/libmpg123.la \
$(LIBMPG123) \
@PROG_LIBS@

src_mpg123_strip_LDADD = \
src/compat/libcompat.la \
src/libmpg123/libmpg123.la \
$(LIBMPG123) \
@PROG_LIBS@

src_mpg123_SOURCES = \
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/libmpg123/Makemodule.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ src_libmpg123_calctables_LDADD = @LIBM@
if BUILD_LIBMPG123
lib_LTLIBRARIES += src/libmpg123/libmpg123.la
include_HEADERS += src/libmpg123/mpg123.h
endif
if NEED_FMT123
include_HEADERS += src/libmpg123/fmt123.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
endif

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

src_libmpg123_libmpg123_la_SOURCES = \
src/libmpg123/fmt123.h \
src/fmt123.h \
src/libmpg123/mpeghead.h \
src/libmpg123/parse.c \
src/libmpg123/parse.h \
Expand Down
2 changes: 2 additions & 0 deletions src/libout123/modules/Makemodule.am
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \
endif
endif

if BUILD_LIBOUT123_OR_MODULES
if HAVE_MODULES
# Get rid of .la files, at least _after_ install.
install-exec-hook:
Expand All @@ -769,3 +770,4 @@ install-exec-hook:
uninstall-hook:
for m in @output_modules_la@; do eval $$(grep dlname= src/libout123/modules/$$m) && rm -f $(DESTDIR)$(pkglibdir)/$$dlname; done
endif
endif
2 changes: 1 addition & 1 deletion src/libout123/modules/aix.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
untested since quite some years now ...
*/

#include "out123_int.h"
#include "../out123_int.h"

#include <stdio.h>
#include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/alib.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

/**************************************************************************/

#include "out123_int.h"
#include "../out123_int.h"

#include <fcntl.h>

Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/* Things are still missing if _DEFAULT_SOURCE is not defined (for recent
glibc, I presume. */
#define _DEFAULT_SOURCE
#include "out123_int.h"
#include "../out123_int.h"
#include <errno.h>

/* make ALSA 0.9.x compatible to the 1.0.x API */
Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/arts.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/


#include "out123_int.h"
#include "../out123_int.h"
#include <artsc.h>
#include "debug.h"

Expand Down
4 changes: 2 additions & 2 deletions src/libout123/modules/coreaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/


#include "out123_int.h"
#include "../out123_int.h"

/* has been around since at least 10.4 */
#include <AvailabilityMacros.h>
Expand Down Expand Up @@ -44,7 +44,7 @@

/* Including the sfifo code locally, to avoid module linkage issues. */
#define SFIFO_STATIC
#include "sfifo.c"
#include "../sfifo.c"

#include "debug.h"

Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
see COPYING and AUTHORS files in distribution or http://mpg123.org
*/

#include "out123_int.h"
#include "../out123_int.h"
#include "debug.h"

static int open_dummy(out123_handle *ao)
Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/esd.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/* First the common header, including config.h
...this is important for stuff like _FILE_OFFSET_BITS */
#include "out123_int.h"
#include "../out123_int.h"

#include <esd.h>
#include <errno.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/hp.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
initially written by Michael Hipp
*/

#include "out123_int.h"
#include "../out123_int.h"
#include <fcntl.h>
#include <sys/audio.h>
#include "debug.h"
Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
There's always a deadlock. --ThOr
*/

#include "out123_int.h"
#include "../out123_int.h"

#include <math.h>

Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/mint.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
initially written by Petr Stehlik
*/

#include "out123_int.h"
#include "../out123_int.h"

/* derived from LINUX, VOXWARE and SUN for MiNT Audio Device by Petr Stehlik */
#include <fcntl.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/nas.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
initially written by Martin Denn
*/

#include "out123_int.h"
#include "../out123_int.h"
#include <fcntl.h>
#include <audio/audiolib.h>
#include <audio/soundlib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/openal.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define _DEFAULT_SOURCE
#define _BSD_SOURCE

#include "out123_int.h"
#include "../out123_int.h"

#ifdef OPENAL_SUBDIR_OPENAL
#include <OpenAL/al.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/os2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
initially written by Samuel Audet
*/

#include "out123_int.h"
#include "../out123_int.h"

#undef VERSION /* The VERSION macro conflicts with the OS/2 multimedia headers */

Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
initially written by Michael Hipp
*/

#include "out123_int.h"
#include "../out123_int.h"

#include <sys/ioctl.h>
#include <fcntl.h>
Expand Down
4 changes: 2 additions & 2 deletions src/libout123/modules/portaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/* Need usleep(). */
#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#include "out123_int.h"
#include "../out123_int.h"
#include <math.h>
#include <portaudio.h>

Expand All @@ -19,7 +19,7 @@

/* Including the sfifo code locally, to avoid module linkage issues. */
#define SFIFO_STATIC
#include "sfifo.c"
#include "../sfifo.c"

#include "debug.h"

Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/pulse.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
initially written by Nicholas J. Humfrey
*/

#include "out123_int.h"
#include "../out123_int.h"

#include <stdlib.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libout123/modules/qsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
written by Mike Gorchak <[email protected]>
*/

#include "out123_int.h"
#include "../out123_int.h"
#include <errno.h>

#include <stdint.h>
Expand Down
Loading

0 comments on commit aec9bb1

Please sign in to comment.