All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libsdl2: Fix build with static libraries disabled
@ 2016-02-17 13:33 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2016-02-17 13:33 UTC (permalink / raw)
  To: openembedded-core

libsdl2 was using foo.o in Makefile dependencies but if libtool is
being used then those are the statically linked intermediate files. 
 When static libraries are globally disabled they won't be generated by
libtool so the build fails.

Instead, use the libtool intermediate wrapper .lo files so the build
succeeds.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/meta/recipes-graphics/libsdl2/libsdl2/linkage.patch b/meta/recipes-graphics/libsdl2/libsdl2/linkage.patch
new file mode 100644
index 0000000..08315e7
--- /dev/null
+++ b/meta/recipes-graphics/libsdl2/libsdl2/linkage.patch
@@ -0,0 +1,46 @@
+When building use the libtool intermediate .lo files instead of explicitly using
+the .o files. Under libtool foo.lo is the libtool intermediate wrapper, foo.o is
+a static build, and .libs/foo.o is a shared build.
+
+If static libraries have been disabled globally then libtool won't generate them
+and explicit references to foo.o won't be satisfied.
+
+Upstream-Status: Pending
+RP
+2016/1/16
+
+
+Index: SDL2-2.0.3/configure.in
+===================================================================
+--- SDL2-2.0.3.orig/configure.in
++++ SDL2-2.0.3/configure.in
+@@ -3136,23 +3136,23 @@ done
+ 
+ VERSION_OBJECTS=`echo $VERSION_SOURCES`
+ VERSION_DEPENDS=`echo $VERSION_SOURCES`
+-VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
++VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.lo,g'`
+ VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.rc\\\\
++\\$(objects)/\\2.lo: \\1/\\2.rc\\\\
+ 	\\$(WINDRES) \\$< \\$@,g"`
+ 
+ SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
+ SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
+-SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
++SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+ SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.c\\\\
++\\$(objects)/\\2.lo: \\1/\\2.c\\\\
+ 	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+ 
+ SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
+ SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
+-SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
++SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+ SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.c\\\\
++\\$(objects)/\\2.lo: \\1/\\2.c\\\\
+ 	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+ 
+ # Set runtime shared library paths as needed
diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.0.3.bb b/meta/recipes-graphics/libsdl2/libsdl2_2.0.3.bb
index 61d9c1e..0dc1a85 100644
--- a/meta/recipes-graphics/libsdl2/libsdl2_2.0.3.bb
+++ b/meta/recipes-graphics/libsdl2/libsdl2_2.0.3.bb
@@ -14,7 +14,8 @@ PROVIDES = "virtual/libsdl2"
 
 DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
 
-SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz"
+SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
+           file://linkage.patch"
 
 S = "${WORKDIR}/SDL2-${PV}"
 





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-17 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-17 13:33 [PATCH] libsdl2: Fix build with static libraries disabled Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.