0 | |
From: Simon McVittie <smcv@collabora.com>
|
1 | |
Date: Fri, 17 Jun 2022 12:10:20 +0100
|
2 | |
Subject: autotools: Move mandatory dependencies from EXTRA_LDFLAGS to
|
3 | |
MIXER_LIBS
|
4 | |
|
5 | |
Autotools variables whose names end with _LDFLAGS are usually for
|
6 | |
linker options such as -Wl,--export-dynamic which would not be
|
7 | |
appropriate to copy into the pkg-config or CMake metadata.
|
8 | |
|
9 | |
Move these dependencies into a separate _LIBS variable, which is
|
10 | |
conventionally a list of -L and -l options (only) and *can* be copied
|
11 | |
into pkg-config or CMake metadata. This follows the same pattern as
|
12 | |
IMG_LIBS and TTF_LIBS in SDL_image and SDL_ttf.
|
13 | |
|
14 | |
Exclude SDL_LIBS from this, because the CMake metadata has a special
|
15 | |
case for finding SDL, and linking to a different SDL causes link failure
|
16 | |
on our macOS CI. Link SDL via $(SDL_LIBS) instead.
|
17 | |
|
18 | |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
19 | |
Forwarded: https://github.com/libsdl-org/SDL_mixer/pull/412
|
20 | |
---
|
21 | |
Makefile.in | 3 ++-
|
22 | |
configure.ac | 27 ++++++++++++++-------------
|
23 | |
2 files changed, 16 insertions(+), 14 deletions(-)
|
24 | |
|
25 | |
diff --git a/Makefile.in b/Makefile.in
|
26 | |
index ae88591..006a8fb 100644
|
27 | |
--- a/Makefile.in
|
28 | |
+++ b/Makefile.in
|
29 | |
@@ -25,6 +25,7 @@ CFLAGS = @BUILD_CFLAGS@
|
30 | |
EXTRA_CFLAGS = @EXTRA_CFLAGS@
|
31 | |
LDFLAGS = @BUILD_LDFLAGS@
|
32 | |
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
|
33 | |
+MIXER_LIBS = @MIXER_LIBS@
|
34 | |
LIBTOOL = @LIBTOOL@
|
35 | |
INSTALL = @INSTALL@
|
36 | |
AR = @AR@
|
37 | |
@@ -94,7 +95,7 @@ $(objects)/.created:
|
38 | |
.PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist
|
39 | |
|
40 | |
$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
|
41 | |
- $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
|
42 | |
+ $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) $(SDL_LIBS) $(MIXER_LIBS)
|
43 | |
|
44 | |
$(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET)
|
45 | |
$(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(objects)/$(TARGET) $(SDL_LIBS) $(LDFLAGS)
|
46 | |
diff --git a/configure.ac b/configure.ac
|
47 | |
index 8d4e5de..7b4f201 100644
|
48 | |
--- a/configure.ac
|
49 | |
+++ b/configure.ac
|
50 | |
@@ -111,6 +111,7 @@ BUILD_CFLAGS="$CFLAGS $CPPFLAGS -I$srcdir/include -I$srcdir/src -I$srcdir/src/co
|
51 | |
EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
|
52 | |
BUILD_LDFLAGS="$LDFLAGS"
|
53 | |
EXTRA_LDFLAGS="$BASE_LDFLAGS"
|
54 | |
+MIXER_LIBS=
|
55 | |
## These are common directories to find software packages
|
56 | |
#for path in /usr/freeware /usr/pkg /usr/local; do
|
57 | |
# if test -d $path/include; then
|
58 | |
@@ -279,7 +280,6 @@ AM_PATH_SDL2($SDL_VERSION,
|
59 | |
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
|
60 | |
)
|
61 | |
EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
|
62 | |
-EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS"
|
63 | |
|
64 | |
dnl check for GCC warning options
|
65 | |
CheckWarnAll
|
66 | |
@@ -367,7 +367,7 @@ if test x$enable_music_mod = xyes -a x$enable_music_mod_modplug = xyes; then
|
67 | |
echo "-- dynamic libmodplug -> $modplug_lib"
|
68 | |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_DYNAMIC=\\\"$modplug_lib\\\""
|
69 | |
else
|
70 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MODPLUG_LIBS"
|
71 | |
+ MIXER_LIBS="$MIXER_LIBS $MODPLUG_LIBS"
|
72 | |
if test x$have_libmodplug_pc = xyes; then
|
73 | |
PC_REQUIRES="$PC_REQUIRES libmodplug"
|
74 | |
else
|
75 | |
@@ -426,7 +426,7 @@ if test x$enable_music_mod = xyes -a x$enable_music_mod_xmp = xyes; then
|
76 | |
echo "-- dynamic libxmp -> $xmp_lib"
|
77 | |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DXMP_DYNAMIC=\\\"$xmp_lib\\\""
|
78 | |
else
|
79 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $XMP_LIBS"
|
80 | |
+ MIXER_LIBS="$MIXER_LIBS $XMP_LIBS"
|
81 | |
if test x$have_libxmp_pc = xyes; then
|
82 | |
PC_REQUIRES="$PC_REQUIRES lib$xmplib"
|
83 | |
else
|
84 | |
@@ -476,17 +476,17 @@ if test x$enable_music_midi = xyes; then
|
85 | |
case "$host" in
|
86 | |
*-*-cygwin* | *-*-mingw*)
|
87 | |
use_music_midi_native=yes
|
88 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
|
89 | |
+ MIXER_LIBS="$MIXER_LIBS -lwinmm"
|
90 | |
PC_LIBS="$PC_LIBS -lwinmm"
|
91 | |
;;
|
92 | |
*-*-darwin*)
|
93 | |
use_music_midi_native=yes
|
94 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices"
|
95 | |
+ MIXER_LIBS="$MIXER_LIBS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices"
|
96 | |
PC_LIBS="$PC_LIBS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices"
|
97 | |
;;
|
98 | |
*-*-haiku*)
|
99 | |
use_music_midi_native=yes_cpp
|
100 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmidi"
|
101 | |
+ MIXER_LIBS="$MIXER_LIBS -lmidi"
|
102 | |
PC_LIBS="$PC_LIBS -lmidi"
|
103 | |
;;
|
104 | |
esac
|
105 | |
@@ -540,7 +540,7 @@ if test x$enable_music_midi = xyes; then
|
106 | |
echo "-- dynamic libfluidsynth -> $fluidsynth_lib"
|
107 | |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLUIDSYNTH_DYNAMIC=\\\"$fluidsynth_lib\\\""
|
108 | |
else
|
109 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FLUIDSYNTH_LIBS"
|
110 | |
+ MIXER_LIBS="$MIXER_LIBS $FLUIDSYNTH_LIBS"
|
111 | |
if test x$have_fluidsynth_pc = xyes; then
|
112 | |
PC_REQUIRES="$PC_REQUIRES fluidsynth"
|
113 | |
else
|
114 | |
@@ -615,7 +615,7 @@ if test x$enable_music_ogg = xyes -a x$enable_music_ogg_vorbis = xyes; then
|
115 | |
echo "-- dynamic libvorbisfile -> $ogg_lib"
|
116 | |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
|
117 | |
else
|
118 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $VORBIS_LIBS"
|
119 | |
+ MIXER_LIBS="$MIXER_LIBS $VORBIS_LIBS"
|
120 | |
if test x$have_ogg_pc = xyes; then
|
121 | |
PC_REQUIRES="$PC_REQUIRES vorbisfile"
|
122 | |
else
|
123 | |
@@ -671,7 +671,7 @@ if test x$enable_music_ogg = xyes -a x$enable_music_ogg_tremor = xyes; then
|
124 | |
echo "-- dynamic libvorbisidec -> $ogg_lib"
|
125 | |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
|
126 | |
else
|
127 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $TREMOR_LIBS"
|
128 | |
+ MIXER_LIBS="$MIXER_LIBS $TREMOR_LIBS"
|
129 | |
if test x$have_tremor_pc = xyes; then
|
130 | |
PC_REQUIRES="$PC_REQUIRES vorbisidec"
|
131 | |
else
|
132 | |
@@ -758,7 +758,7 @@ if test x$enable_music_flac = xyes -a x$enable_music_flac_libflac = xyes; then
|
133 | |
echo "-- dynamic libFLAC -> $flac_lib"
|
134 | |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\""
|
135 | |
else
|
136 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FLAC_LIBS"
|
137 | |
+ MIXER_LIBS="$MIXER_LIBS $FLAC_LIBS"
|
138 | |
if test x$have_flac_pc = xyes; then
|
139 | |
PC_REQUIRES="$PC_REQUIRES flac"
|
140 | |
else
|
141 | |
@@ -824,7 +824,7 @@ if test x$enable_music_mp3 = xyes -a x$enable_music_mp3_mpg123 = xyes; then
|
142 | |
echo "-- dynamic libmpg123 -> $mpg123_lib"
|
143 | |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMPG123_DYNAMIC=\\\"$mpg123_lib\\\""
|
144 | |
else
|
145 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MPG123_LIBS"
|
146 | |
+ MIXER_LIBS="$MIXER_LIBS $MPG123_LIBS"
|
147 | |
if test x$have_mpg123_pc = xyes; then
|
148 | |
PC_REQUIRES="$PC_REQUIRES libmpg123"
|
149 | |
else
|
150 | |
@@ -881,7 +881,7 @@ if test x$enable_music_opus = xyes; then
|
151 | |
echo "-- dynamic opusfile -> $opusfile_lib"
|
152 | |
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOPUS_DYNAMIC=\\\"$opusfile_lib\\\""
|
153 | |
else
|
154 | |
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $OPUSFILE_LIBS"
|
155 | |
+ MIXER_LIBS="$MIXER_LIBS $OPUSFILE_LIBS"
|
156 | |
if test x$have_opusfile_pc = xyes; then
|
157 | |
PC_REQUIRES="$PC_REQUIRES opusfile"
|
158 | |
else
|
159 | |
@@ -898,7 +898,7 @@ fi
|
160 | |
dnl check for LD --no-undefined option
|
161 | |
CheckNoUndef
|
162 | |
|
163 | |
-EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBM"
|
164 | |
+MIXER_LIBS="$MIXER_LIBS $LIBM"
|
165 | |
|
166 | |
OBJECTS=`echo $SOURCES`
|
167 | |
DEPENDS=`echo $SOURCES`
|
168 | |
@@ -959,6 +959,7 @@ AC_SUBST(BUILD_CFLAGS)
|
169 | |
AC_SUBST(EXTRA_CFLAGS)
|
170 | |
AC_SUBST(BUILD_LDFLAGS)
|
171 | |
AC_SUBST(EXTRA_LDFLAGS)
|
172 | |
+AC_SUBST(MIXER_LIBS)
|
173 | |
AC_SUBST(EXE)
|
174 | |
AC_SUBST(SDL_VERSION)
|
175 | |
AC_SUBST(SDL_CFLAGS)
|