summaryrefslogtreecommitdiffstats
path: root/meta-tpm/recipes-tpm/swtpm/files/fix_lib_search_path.patch
blob: 28aca4a6c5edb362dbbc82524ce706221c078131 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 85706ceb6877ade3b589d3c390abf5b3492bb718 Mon Sep 17 00:00:00 2001
From: Armin Kuster <akuster808@gmail.com>
Date: Thu, 13 Oct 2016 02:03:56 -0700
Subject: [PATCH] swtpm: add new package

Upstream-Status: Inappropriate [OE config]

Signed-off-by: Armin Kuster <akuster808@gmail.com>

Rebased to current tip.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>

---
 configure.ac | 32 ++++++++++----------------------
 1 file changed, 10 insertions(+), 22 deletions(-)

diff --git a/configure.ac b/configure.ac
index c4a9c6d..6267f64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -395,29 +395,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-security"
 dnl We have to make sure libtpms is using the same crypto library
 dnl to avoid problems
 AC_MSG_CHECKING([the crypto library libtpms is using])
-dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \
-       sed -n '/SEARCH_DIR/p' | \
-       sed 's/SEARCH_DIR("=\?\(@<:@^"@:>@\+\)"); */\1\n/g')
-for dir in $dirs $LIBRARY_PATH; do
-  if test -r $dir/libtpms.so; then
-    if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
-      libtpms_cryptolib="openssl"
-      break
-    fi
-    if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
-      libtpms_cryptolib="freebl"
-      break
-    fi
+dir="$SEARCH_DIR"
+if test -r $dir/libtpms.so; then
+  if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
+    libtpms_cryptolib="openssl"
+    break
   fi
-  case $host_os in
-  cygwin)
-    if test -r $dir/libtpms.a; then
-      if test -n "$(nm $dir/libtpms.a | grep "U AES_encrypt")"; then
-        libtpms_cryptolib="openssl"
-      fi
-    fi
-  esac
-done
+  if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
+    libtpms_cryptolib="freebl"
+    break
+  fi
+fi
 
 if test -z "$libtpms_cryptolib"; then
   AC_MSG_ERROR([Could not determine libtpms crypto library.])
-- 
2.1.4