Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From 9a16800738547d117284354bbcad7dd77d9d0344 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Thu, 21 Apr 2016 03:05:57 -0400 |
| 4 | Subject: [PATCH] support cross-complication |
| 5 | |
| 6 | Upstream-Status: Inappropriate [oe specific] |
| 7 | |
| 8 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 9 | --- |
| 10 | setup.py | 35 ----------------------------------- |
| 11 | 1 file changed, 35 deletions(-) |
| 12 | |
| 13 | diff --git a/setup.py b/setup.py |
| 14 | index 658d1a5..e8be7eb 100755 |
| 15 | --- a/setup.py |
| 16 | +++ b/setup.py |
| 17 | @@ -13,41 +13,6 @@ import sys |
| 18 | # - Need gcc |
| 19 | # - Need C headers |
| 20 | # - Need libcap headers |
| 21 | -if not sys.platform.startswith('linux'): |
| 22 | - sys.stderr.write("This module only works on linux\n") |
| 23 | - sys.exit(1) |
| 24 | - |
| 25 | -kvers = os.uname()[2] |
| 26 | -if kvers < '2.6.18' and not os.environ.get("PRCTL_SKIP_KERNEL_CHECK",False): |
| 27 | - sys.stderr.write("This module requires linux 2.6.18 or newer\n") |
| 28 | - sys.exit(1) |
| 29 | - |
| 30 | -if sys.version_info[:2] < (2,4): |
| 31 | - sys.stderr.write("This module requires python 2.4 or newer\n") |
| 32 | - sys.exit(1) |
| 33 | - |
| 34 | -exit = False |
| 35 | -try: |
| 36 | - subprocess.call(['gcc','-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 37 | -except: |
| 38 | - sys.stderr.write("You need to install gcc to build this module\n") |
| 39 | - sys.exit(1) |
| 40 | - |
| 41 | -sp = subprocess.Popen(['cpp'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 42 | -sp.communicate('#include <sys/prctl.h>\n'.encode()) |
| 43 | -if sp.returncode: |
| 44 | - sys.stderr.write("You need to install libc development headers to build this module\n") |
| 45 | - exit = True |
| 46 | - |
| 47 | -sp = subprocess.Popen(['cpp'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 48 | -sp.communicate('#include <sys/capability.h>\n'.encode()) |
| 49 | -if sp.returncode: |
| 50 | - sys.stderr.write("You need to install libcap development headers to build this module\n") |
| 51 | - exit = True |
| 52 | - |
| 53 | -if exit: |
| 54 | - sys.exit(1) |
| 55 | - |
| 56 | _prctl = Extension("_prctl", |
| 57 | sources = ['_prctlmodule.c'], |
| 58 | depends = ['securebits.h'], |
| 59 | -- |
| 60 | 2.8.1 |
| 61 | |