lua: fix pkg-config file
authorJörg Krause <joerg.krause@embedded.rocks>
Mon, 31 Jul 2017 21:17:59 +0000 (23:17 +0200)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Thu, 10 Aug 2017 10:54:57 +0000 (12:54 +0200)
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@embedded.rocks>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/lua/5.2.4/0004-lua-pc.patch
package/lua/5.3.4/0004-lua-pc.patch
package/lua/lua.mk

index 62acb201f2f8032068e3bbbc2aa66a85d0956667..31ff61157a19c1a32a3206d775d0138574cfa408 100644 (file)
@@ -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)
index 615a7db8fce9c4fd4539c71338917cb0c9c245eb..11258329d14c758458bdbae61900dbd0ff381889 100644 (file)
@@ -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)
index 93339ad9cee3d81932d163b1be1e6822d4dde569..0692c537642a14f083ca10988e1139df8f840e6b 100644 (file)
@@ -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))