Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] lua: fix pkg-config file
@ 2017-07-31 21:17 Jörg Krause
  2017-07-31 21:18 ` [Buildroot] [PATCH 2/2] swupdate: support for Lua 5.1 is broken Jörg Krause
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jörg Krause @ 2017-07-31 21:17 UTC (permalink / raw)
  To: buildroot

When Lua is linked with additional libraries, these libraries should go
into the pkg-config file as well.

Otherwise, linking swupdate with the lua library fails:

```
/home/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblua.so: undefined reference to `dlopen'
/home/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblua.so: undefined reference to `dlclose'
/home/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblua.so: undefined reference to `dlerror'
/home/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblua.so: undefined reference to `dlsym'
```

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 package/lua/5.2.4/0004-lua-pc.patch | 4 +++-
 package/lua/5.3.4/0004-lua-pc.patch | 4 +++-
 package/lua/lua.mk                  | 8 ++++----
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/package/lua/5.2.4/0004-lua-pc.patch b/package/lua/5.2.4/0004-lua-pc.patch
index 62acb201f2..31ff61157a 100644
--- a/package/lua/5.2.4/0004-lua-pc.patch
+++ b/package/lua/5.2.4/0004-lua-pc.patch
@@ -1,6 +1,8 @@
 add lua.pc
 
 Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+[J?rg Krause: add @MYLIBS@]
+Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
 
 Index: b/etc/lua.pc
 ===================================================================
@@ -34,7 +36,7 @@ Index: b/etc/lua.pc
 +Description: An Extensible Extension Language
 +Version: ${R}
 +Requires: 
-+Libs: -L${libdir} -llua -lm
++Libs: -L${libdir} -llua -lm @MYLIBS@
 +Cflags: -I${includedir}
 +
 +# (end of lua.pc)
diff --git a/package/lua/5.3.4/0004-lua-pc.patch b/package/lua/5.3.4/0004-lua-pc.patch
index 615a7db8fc..11258329d1 100644
--- a/package/lua/5.3.4/0004-lua-pc.patch
+++ b/package/lua/5.3.4/0004-lua-pc.patch
@@ -1,6 +1,8 @@
 add lua.pc
 
 Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+[J?rg Krause: add @MYLIBS@]
+Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
 
 Index: b/etc/lua.pc
 ===================================================================
@@ -34,7 +36,7 @@ Index: b/etc/lua.pc
 +Description: An Extensible Extension Language
 +Version: ${R}
 +Requires:
-+Libs: -L${libdir} -llua -lm
++Libs: -L${libdir} -llua -lm @MYLIBS@
 +Cflags: -I${includedir}
 +
 +# (end of lua.pc)
diff --git a/package/lua/lua.mk b/package/lua/lua.mk
index 93339ad9ce..0692c53764 100644
--- a/package/lua/lua.mk
+++ b/package/lua/lua.mk
@@ -86,8 +86,8 @@ endef
 
 define LUA_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) INSTALL_TOP="$(STAGING_DIR)/usr" -C $(@D) install
-	$(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
-		$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc
+	sed -e "s/@MYLIBS@/$(LUA_MYLIBS)/g" $(@D)/etc/lua.pc \
+		> $(STAGING_DIR)/usr/lib/pkgconfig/lua.pc
 endef
 
 define LUA_INSTALL_TARGET_CMDS
@@ -96,8 +96,8 @@ endef
 
 define HOST_LUA_INSTALL_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) INSTALL_TOP="$(HOST_DIR)" -C $(@D) install
-	$(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
-		$(HOST_DIR)/lib/pkgconfig/lua.pc
+	sed -e "s/@MYLIBS@/$(HOST_LUA_MYLIBS)/g" $(@D)/etc/lua.pc \
+		> $(HOST_DIR)/lib/pkgconfig/lua.pc
 endef
 
 $(eval $(generic-package))
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-09-05 21:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-31 21:17 [Buildroot] [PATCH 1/2] lua: fix pkg-config file Jörg Krause
2017-07-31 21:18 ` [Buildroot] [PATCH 2/2] swupdate: support for Lua 5.1 is broken Jörg Krause
2017-08-01 17:10   ` Thomas Petazzoni
2017-08-02  6:42     ` Jörg Krause
2017-08-02  7:46       ` Jörg Krause
2017-08-10 12:51   ` Arnout Vandecappelle
2017-08-01 17:08 ` [Buildroot] [PATCH 1/2] lua: fix pkg-config file Thomas Petazzoni
2017-08-02  8:04   ` Jörg Krause
2017-09-05 21:52 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox