blob: 98d250c74cc9a9d431af609c228d708e4909d1e8 [file] [log] [blame]
Andrew Geisslerac970dd2021-02-12 15:32:45 -06001From 5f3911737c63a098caf73f1365320fe1b3a7638b Mon Sep 17 00:00:00 2001
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002From: 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>
Andrew Geisslerac970dd2021-02-12 15:32:45 -06009Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010---
11 setup.py | 35 -----------------------------------
12 1 file changed, 35 deletions(-)
13
14diff --git a/setup.py b/setup.py
Andrew Geisslerac970dd2021-02-12 15:32:45 -060015index eb83cfe..3f9567b 100755
Brad Bishopd7bf8c12018-02-25 22:55:05 -050016--- 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-
Andrew Geisslerac970dd2021-02-12 15:32:45 -060042-sp = subprocess.Popen(['cpp'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=os.environ)
Brad Bishopd7bf8c12018-02-25 22:55:05 -050043-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-
Andrew Geisslerac970dd2021-02-12 15:32:45 -060048-sp = subprocess.Popen(['cpp'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=os.environ)
Brad Bishopd7bf8c12018-02-25 22:55:05 -050049-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--
Andrew Geisslerac970dd2021-02-12 15:32:45 -0600612.17.1
Brad Bishopd7bf8c12018-02-25 22:55:05 -050062