We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3539

Summary: SDL2, missing MIR LDFLAGS
Product: SDL Reporter: Gianfranco <costamagnagianfranco>
Component: *don't know*Assignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: brandontschaefer
Version: 2.0.5   
Hardware: x86_64   
OS: Linux   

Description Gianfranco 2016-12-30 21:34:16 UTC
Hello, patch attached:

Description: Add missing MIR libraries
Author: Gianfranco Costamagna <locutusofborg@debian.org>

--- libsdl2-2.0.5+dfsg1.orig/configure.in
+++ libsdl2-2.0.5+dfsg1/configure.in
@@ -1334,6 +1334,7 @@ AC_HELP_STRING([--enable-mir-shared], [d
                test x$xkbcommon_lib != x; then
                 echo "-- dynamic libmirclient -> $mirclient_lib"
                 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC, "$mirclient_lib", [ ])
                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
                 SUMMARY_video="${SUMMARY_video} mir(dynamic)"


you can even probably merge the two EXTRA_LDFLAGS in true and false branches.

thanks for considering it
Comment 1 Sam Lantinga 2016-12-31 18:35:30 UTC
Dynamically loading MIR is supposed to remove runtime dependencies on the MIR libraries. What is failing to link in the dynamic loading case?
Comment 2 Gianfranco 2017-01-02 17:17:09 UTC
Hello, this is the failure I got

https://launchpadlibrarian.net/300679206/buildlog_ubuntu-zesty-amd64.libsdl2_2.0.5+dfsg1-2ubuntu1_BUILDING.txt.gz

  CC     build/SDL_test_log.o
  CC     build/SDL_test_md5.o
  CC     build/SDL_test_random.o
  CC     build/wayland-protocol.lo
  CC     build/relative-pointer-unstable-v1-protocol.lo
  CC     build/pointer-constraints-unstable-v1-protocol.lo
  CC     build/SDL.lo
  AR     build/libSDL2main.a
ar: `u' modifier ignored since `D' is the default (see `U')
  RANLIB build/libSDL2main.a
  AR     build/libSDL2_test.a
ar: `u' modifier ignored since `D' is the default (see `U')
  RANLIB build/libSDL2_test.a
  LTLINK build/libSDL2.la
build/.libs/SDL_mirvideo.o: In function `MIR_InitDisplayFromOutput':
././src/video/mir/SDL_mirvideo.c:258: undefined reference to `mir_output_get_current_mode'
collect2: error: ld returned 1 exit status
Makefile:147: recipe for target 'build/libSDL2.la' failed
make[1]: *** [build/libSDL2.la] Error 1
make[1]: Leaving directory '/<<BUILDDIR>>/libsdl2-2.0.5+dfsg1'
dh_auto_build: make -j4 returned exit code 2
debian/rules:42: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
Comment 3 Sam Lantinga 2017-01-02 18:30:55 UTC
This should be fixed, thanks!
https://hg.libsdl.org/SDL/rev/3034ea08d805
Comment 4 Brandon Schaefer 2017-01-02 20:19:51 UTC
Yup, my mistake there. Thanks!