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