1 detect.py: replace compile_and_run with compile_and_forget
3 This function is only used in setup.py to detect the availability of
4 sys/un.h by compiling and running a small test program. Since we're
5 cross-compiling we can't run the generated program, however if the
6 header is missing the test will fail at the compilation step so
7 running the test in unnecessary.
9 Signed-off-by: Lionel Flandrin <lionel@svkt.org>
11 buildutils/detect.py | 16 ++++++++--------
13 2 files changed, 10 insertions(+), 10 deletions(-)
15 diff --git a/buildutils/detect.py b/buildutils/detect.py
16 index 7a6c115..9520da7 100644
17 --- a/buildutils/detect.py
18 +++ b/buildutils/detect.py
19 @@ -58,7 +58,7 @@ def test_compilation(cfile, compiler=None, **compiler_attrs):
20 cc.link_executable(objs, efile, extra_preargs=lpreargs)
23 -def compile_and_run(basedir, src, compiler=None, **compiler_attrs):
24 +def compile_and_forget(basedir, src, compiler=None, **compiler_attrs):
25 if not os.path.exists(basedir):
27 cfile = pjoin(basedir, os.path.basename(src))
28 @@ -66,16 +66,16 @@ def compile_and_run(basedir, src, compiler=None, **compiler_attrs):
30 cc = get_compiler(compiler, **compiler_attrs)
31 efile = test_compilation(cfile, compiler=cc)
32 - patch_lib_paths(efile, cc.library_dirs)
33 - result = Popen(efile, stdout=PIPE, stderr=PIPE)
34 - so, se = result.communicate()
38 + # patch_lib_paths(efile, cc.library_dirs)
39 + # result = Popen(efile, stdout=PIPE, stderr=PIPE)
40 + # so, se = result.communicate()
45 shutil.rmtree(basedir)
47 - return result.returncode, so, se
51 def detect_zmq(basedir, compiler=None, **compiler_attrs):
52 diff --git a/setup.py b/setup.py
53 index c3a2879..b8b0aaf 100755
56 @@ -54,7 +54,7 @@ from buildutils import (
57 info, warn, fatal, debug, line, copy_and_patch_libzmq, localpath,
58 fetch_libzmq, stage_platform_hpp,
59 bundled_version, customize_mingw,
65 @@ -327,7 +327,7 @@ class Configure(build_ext):
69 - compile_and_run(self.tempdir,
70 + compile_and_forget(self.tempdir,
71 pjoin('buildutils', 'check_sys_un.c'),