1detect.py: fix the ZMQ version check to the ZMQ version of the buildroot
2
3The setup.py script tries to compile a test C program and runs it, to
4retrieve a version string for the installed ZMQ library, but if the cross
5compiler links it together, the result cannot be run on the host, due to
6different architectures and libraries.
7
8And if the host compiler would compile/link it, it would not link with
9the library version inside buildroot but with the library from the
10host, possibly returning a wrong version number.
11
12Instead of trying to run the compiled test program to get the version
13dynamically, return the version of the buildroot environment.
14
15Written by Michael Rommel, modified for version 16.0.2 by Lionel
16Flandrin.
17
18Modified for version 18.0.2 by Asaf Kahlon
19
20Signed-off-by: Lionel Flandrin <lionel@svkt.org>
21Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
22---
23 buildutils/detect.py | 14 ++++++++------
24 1 file changed, 8 insertions(+), 6 deletions(-)
25
26diff --git a/buildutils/detect.py b/buildutils/detect.py
27index d1380fe..4a91351 100644
28--- a/buildutils/detect.py
29+++ b/buildutils/detect.py
30@@ -120,13 +120,15 @@ def detect_zmq(basedir, compiler=None, **compiler_attrs):
31
32     cc = get_compiler(compiler=compiler, **compiler_attrs)
33     efile = test_compilation(cfile, compiler=cc, **compiler_attrs)
34-    patch_lib_paths(efile, cc.library_dirs)
35+    #patch_lib_paths(efile, cc.library_dirs)
36
37-    rc, so, se = get_output_error([efile])
38-    if rc:
39-        msg = "Error running version detection script:\n%s\n%s" % (so,se)
40-        logging.error(msg)
41-        raise IOError(msg)
42+    #rc, so, se = get_output_error([efile])
43+    # if rc:
44+    #     msg = "Error running version detection script:\n%s\n%s" % (so,se)
45+    #     logging.error(msg)
46+    #     raise IOError(msg)
47+
48+    so = "vers: ##ZEROMQ_VERSION##"
49
50     handlers = {'vers':  lambda val: tuple(int(v) for v in val.split('.'))}
51
52--
532.20.1
54
55