1From 8eae1193457f72899f9cc2254ae1489026df9bb6 Mon Sep 17 00:00:00 2001 2From: Michael Rommel <rommel@layer-7.net> 3Date: Sat, 10 Aug 2013 00:44:35 +0200 4Subject: [PATCH] detect.py: fix the ZMQ version check to the ZMQ version of 5 the buildroot 6 7The setup.py script tries to compile a test C program and runs it, to 8retrieve a version string for the installed ZMQ library, but if the cross 9compiler links it together, the result cannot be run on the host, due to 10different architectures and libraries. 11 12And if the host compiler would compile/link it, it would not link with 13the library version inside buildroot but with the library from the 14host, possibly returning a wrong version number. 15 16Instead of trying to run the compiled test program to get the version 17dynamically, return the version of the buildroot environment. 18 19Written by Michael Rommel, modified for version 16.0.2 by Lionel 20Flandrin. 21 22Modified for version 18.0.2 by Asaf Kahlon 23 24Modified for version 24.0.1 by James Hilliard 25 26Signed-off-by: Michael Rommel <rommel@layer-7.net> 27Signed-off-by: Lionel Flandrin <lionel@svkt.org> 28Signed-off-by: Asaf Kahlon <asafka7@gmail.com> 29Signed-off-by: James Hilliard <james.hilliard1@gmail.com> 30--- 31 buildutils/detect.py | 14 ++++++++------ 32 1 file changed, 8 insertions(+), 6 deletions(-) 33 34diff --git a/buildutils/detect.py b/buildutils/detect.py 35index 842e3b14..e2eca744 100644 36--- a/buildutils/detect.py 37+++ b/buildutils/detect.py 38@@ -120,18 +120,20 @@ def detect_zmq(basedir, compiler, **compiler_attrs): 39 40 cc = get_compiler(compiler=compiler, **compiler_attrs) 41 efile = test_compilation(cfile, compiler=cc, **compiler_attrs) 42- patch_lib_paths(efile, cc.library_dirs) 43+ #patch_lib_paths(efile, cc.library_dirs) 44 45 # add library dirs to %PATH% for windows 46 env = os.environ.copy() 47 if sys.platform.startswith("win"): 48 env["PATH"] = os.pathsep.join([env["PATH"]] + cc.library_dirs) 49 50- rc, so, se = get_output_error([efile], env=env) 51- if rc: 52- msg = f"Error running version detection script:\n{so}\n{se}" 53- logging.error(msg) 54- raise OSError(msg) 55+ #rc, so, se = get_output_error([efile], env=env) 56+ #if rc: 57+ # msg = f"Error running version detection script:\n{so}\n{se}" 58+ # logging.error(msg) 59+ # raise OSError(msg) 60+ 61+ so = "vers: ##ZEROMQ_VERSION##" 62 63 handlers = {'vers': lambda val: tuple(int(v) for v in val.split('.'))} 64 65-- 662.34.1 67 68