[Buildroot] [git commit] lua: fix pkg-config file

Arnout Vandecappelle (Essensium/Mind) arnout at mind.be
Thu Aug 10 10:54:57 UTC 2017


commit: https://git.buildroot.net/buildroot/commit/?id=8d845683e37640d33c186c0091ccce6ae3ef0777
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

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'
```

Fixes http://autobuild.buildroot.net/results/1c3/1c349cc5904868e4def292b9fbfa164828e46156

Signed-off-by: Jörg Krause <joerg.krause at embedded.rocks>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>
---
 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 62acb20..31ff611 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 at gadz.org>
+[Jörg Krause: add @MYLIBS@]
+Signed-off-by: Jörg Krause <joerg.krause at 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 615a7db..1125832 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 at gadz.org>
+[Jörg Krause: add @MYLIBS@]
+Signed-off-by: Jörg Krause <joerg.krause at 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 93339ad..0692c53 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))


More information about the buildroot mailing list