diff options
author | Khem Raj <raj.khem@gmail.com> | 2018-06-24 00:10:11 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-06-24 23:04:04 -0700 |
commit | badb14da1691cd14f5ba7ca54631bda30ed26194 (patch) | |
tree | e8767388efc5aee6fc7b4c9249dd704a6b078bf1 /meta-networking | |
parent | dddf4bdd3bae1b9e67bc33eea93b1d204a495f97 (diff) | |
download | meta-openembedded-badb14da1691cd14f5ba7ca54631bda30ed26194.tar.gz |
civetweb: Fix paths to librt and libm, use -l linker option
Fixes build where it pokes for libraries on host system
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
3 files changed, 45 insertions, 47 deletions
diff --git a/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Test-Fix-missing-librt-and-libm-during-native-compil.patch b/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Test-Fix-missing-librt-and-libm-during-native-compil.patch deleted file mode 100644 index 401cf39ad..000000000 --- a/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Test-Fix-missing-librt-and-libm-during-native-compil.patch +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | From cd93e2c538cecb3192fd24c0fbd6e834d0c47eec Mon Sep 17 00:00:00 2001 | ||
2 | From: Krzysztof Kozlowski <krzk@kernel.org> | ||
3 | Date: Wed, 18 Apr 2018 14:11:52 +0200 | ||
4 | Subject: [PATCH] Unittest: Fix missing librt and libm during native compilation | ||
5 | |||
6 | civetweb looks for librt and libm in weird places and for native build | ||
7 | this fails: | ||
8 | |||
9 | | ../third_party/lib/libcheck.a(check.c.o): In function `tcase_create': | ||
10 | | build/tmp/work/x86_64-linux/civetweb-native/1.10-r0/build/third_party/src/check-unit-test-framework/src/check.c:145: undefined reference to `floor' | ||
11 | | build/tmp/work/x86_64-linux/civetweb-native/1.10-r0/build/third_party/src/check-unit-test-framework/src/check.c:148: undefined reference to `floor' | ||
12 | |||
13 | These are needed dependencies so try regular system linkage in such | ||
14 | case. | ||
15 | |||
16 | Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> | ||
17 | --- | ||
18 | unittest/CMakeLists.txt | 4 ++++ | ||
19 | 1 file changed, 4 insertions(+) | ||
20 | |||
21 | diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt | ||
22 | index f34b2e0e4ce4..05d25702178c 100644 | ||
23 | --- a/unittest/CMakeLists.txt | ||
24 | +++ b/unittest/CMakeLists.txt | ||
25 | @@ -60,10 +60,14 @@ endif() | ||
26 | find_package(LibM) | ||
27 | if (LIBM_FOUND) | ||
28 | set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBM::LIBM") | ||
29 | +else() | ||
30 | + set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lm") | ||
31 | endif() | ||
32 | find_package(LibRt) | ||
33 | if (LIBRT_FOUND) | ||
34 | set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBRT::LIBRT") | ||
35 | +else() | ||
36 | + set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lrt") | ||
37 | endif() | ||
38 | |||
39 | # Build the C unit tests | ||
40 | -- | ||
41 | 2.7.4 | ||
42 | |||
diff --git a/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Unittest-Link-librt-and-libm-using-l-option.patch b/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Unittest-Link-librt-and-libm-using-l-option.patch new file mode 100644 index 000000000..eecbc1468 --- /dev/null +++ b/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Unittest-Link-librt-and-libm-using-l-option.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 21e9a4bb214648ffd43c66b535fbf096bfcc9f4f Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 24 Jun 2018 00:04:37 -0700 | ||
4 | Subject: [PATCH] Unittest: Link librt and libm using -l option | ||
5 | |||
6 | cmake'ry forces full path to .so files when found using | ||
7 | find_package and since we have proper sysrooted toolchain | ||
8 | -lm and -lrt is all we need | ||
9 | |||
10 | Upstream-Status: Inappropriate [Cross compile specific] | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | unittest/CMakeLists.txt | 10 ++-------- | ||
15 | 1 file changed, 2 insertions(+), 8 deletions(-) | ||
16 | |||
17 | diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt | ||
18 | index c4cdf229..e1b63caf 100644 | ||
19 | --- a/unittest/CMakeLists.txt | ||
20 | +++ b/unittest/CMakeLists.txt | ||
21 | @@ -57,14 +57,8 @@ elseif (WIN32) | ||
22 | else() | ||
23 | set(CHECK_LIBRARIES "${CHECK_INSTALL_DIR}/lib/libcheck.a") | ||
24 | endif() | ||
25 | -find_package(LibM) | ||
26 | -if (LIBM_FOUND) | ||
27 | - set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBM::LIBM") | ||
28 | -endif() | ||
29 | -find_package(LibRt) | ||
30 | -if (LIBRT_FOUND) | ||
31 | - set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBRT::LIBRT") | ||
32 | -endif() | ||
33 | +set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lm") | ||
34 | +set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lrt") | ||
35 | |||
36 | # Build the C unit tests | ||
37 | add_library(shared-c-unit-tests STATIC shared.c) | ||
38 | -- | ||
39 | 2.18.0 | ||
40 | |||
diff --git a/meta-networking/recipes-connectivity/civetweb/civetweb_git.bb b/meta-networking/recipes-connectivity/civetweb/civetweb_git.bb index 45d6ec886..471a66509 100644 --- a/meta-networking/recipes-connectivity/civetweb/civetweb_git.bb +++ b/meta-networking/recipes-connectivity/civetweb/civetweb_git.bb | |||
@@ -4,12 +4,12 @@ HOMEPAGE = "https://github.com/civetweb/civetweb" | |||
4 | LICENSE = "MIT" | 4 | LICENSE = "MIT" |
5 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=6f28fdcba0dda735eed62bac6a397562" | 5 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=6f28fdcba0dda735eed62bac6a397562" |
6 | 6 | ||
7 | SRCREV = "b8148afe8fa44c64f75e69655c4fdc9095565568" | 7 | SRCREV = "19f31ba8dd8443e86c7028a4b4c37f4b299aa68c" |
8 | PV = "1.10+git${SRCPV}" | 8 | PV = "1.10+git${SRCPV}" |
9 | SRC_URI = "git://github.com/civetweb/civetweb.git" | 9 | SRC_URI = "git://github.com/civetweb/civetweb.git \ |
10 | SRC_URI_append_class-native = " \ | 10 | file://0001-Unittest-Link-librt-and-libm-using-l-option.patch \ |
11 | file://0001-Test-Fix-missing-librt-and-libm-during-native-compil.patch \ | 11 | " |
12 | " | 12 | |
13 | S = "${WORKDIR}/git" | 13 | S = "${WORKDIR}/git" |
14 | 14 | ||
15 | # civetweb supports building with make or cmake (although cmake lacks few features) | 15 | # civetweb supports building with make or cmake (although cmake lacks few features) |