aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Fabrice Fontaine <fontaine.fabrice@gmail.com>2019-03-04 22:47:20 +0100
committerGravatar Peter Korsgaard <peter@korsgaard.com>2019-03-28 10:52:29 +0100
commit4bf53582cf53bb3fcd4e02b9d8da3d05a6005029 (patch)
tree6bd1ed323064bd5084c0ca279224d043287c94ac
parenta4b34dc6522e66c8c284fba5dd654d0c7334c62d (diff)
downloadbuildroot-4bf53582cf53bb3fcd4e02b9d8da3d05a6005029.tar.gz
buildroot-4bf53582cf53bb3fcd4e02b9d8da3d05a6005029.tar.bz2
package/swupdate: fix static build without lua
The lua_swupdate.so library was still built (without any object files) and linked against swupdate even when HAVE_LUA was not set. This fails in some static-only configurations. Fixes: - http://autobuild.buildroot.org/results/c11c4d26983e0347d96f3dda62e6d72b031967bb Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> (cherry picked from commit b251f50c8d555bdbbd2f7bd378fdb3d3de7fe84d) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/swupdate/0001-Makefile-fix-static-build.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/package/swupdate/0001-Makefile-fix-static-build.patch b/package/swupdate/0001-Makefile-fix-static-build.patch
new file mode 100644
index 0000000000..56901f9871
--- /dev/null
+++ b/package/swupdate/0001-Makefile-fix-static-build.patch
@@ -0,0 +1,62 @@
+From 15a324f8c67548f219256a5a75ba8123cc5bdac6 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Mon, 4 Mar 2019 21:51:36 +0100
+Subject: [PATCH] Makefile: fix static build
+
+Don't build and install lua_swupdate.so if HAVE_LUA isn't set to y
+otherwise build will fail if the toolchain only suports building static
+libraries
+
+Fixes:
+ - http://autobuild.buildroot.org/results/c11c4d26983e0347d96f3dda62e6d72b031967bb
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/sbabic/swupdate/pull/49]
+---
+ Makefile | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index cfeb9a6..cac99b5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -369,11 +369,15 @@ tools-bins := $(patsubst $(tools-y)/%.c,$(tools-y)/%,$(wildcard $(tools-y)/*.c))
+ tools-bins-unstr:= $(patsubst %,%_unstripped,$(tools-bins))
+ tools-all := $(tools-objs)
+
++ifeq ($(HAVE_LUA),y)
++lua_swupdate := lua_swupdate.so
++endif
++
+ shared-dirs := $(shareds-y)
+ shared-libs := $(patsubst %,%/built-in.o, $(shareds-y))
+ shared-all := $(shared-libs)
+
+-all: swupdate ${tools-bins} lua_swupdate.so
++all: swupdate ${tools-bins} ${lua_swupdate}
+
+ # Do modpost on a prelinked vmlinux. The finally linked vmlinux has
+ # relevant sections renamed as per the linker script.
+@@ -434,7 +438,6 @@ install: all
+ install -d ${DESTDIR}/usr/bin
+ install -d ${DESTDIR}/usr/include
+ install -d ${DESTDIR}/usr/lib
+- install -d ${DESTDIR}/usr/lib/lua/$(LUAVER)
+ install -m 755 swupdate ${DESTDIR}/usr/bin
+ for i in ${tools-bins};do \
+ install -m 755 $$i ${DESTDIR}/usr/bin; \
+@@ -443,7 +446,10 @@ install: all
+ install -m 0644 include/swupdate_status.h ${DESTDIR}/usr/include
+ install -m 0644 include/progress_ipc.h ${DESTDIR}/usr/include
+ install -m 0755 ipc/lib.a ${DESTDIR}/usr/lib/libswupdate.a
+- install -m 0755 lua_swupdate.so $(DESTDIR)/usr/lib/lua/$(LUAVER)
++ if [ $(HAVE_LUA) = y ]; then \
++ install -d ${DESTDIR}/usr/lib/lua/$(LUAVER); \
++ install -m 0755 ${lua_swupdate} $(DESTDIR)/usr/lib/lua/$(LUAVER); \
++ fi
+
+ PHONY += run-tests
+ tests: \
+--
+2.14.1
+