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