-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·39 lines (34 loc) · 1.23 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /usr/bin/python
import argparse
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--prefix',
help='Installation prefix',
default='/usr/local')
parser.add_argument('--compiler',
help='Manually set cc compiler',
default='DEFAULT')
parser.add_argument('--no_strip',
action='store_true',
help='Do not strip the listprice binary')
args = parser.parse_args()
print ("\n Installation prefix : " + args.prefix)
print (" cc compiler : " + args.compiler)
if (args.no_strip == False):
print (" Configured to strip the listprice binary")
else:
print (" Configured to not strip the listprice binary")
with open('config_cache.py', 'w') as f:
f.write("#!/usr/bin/python\n")
f.write("# Generated / overwritten by configure\n")
f.write("USRPREFIX = \"" + (args.prefix) + "\"\n")
f.write("LISTPRICE_CC = \"" + (args.compiler) + "\"\n")
if (args.no_strip == False):
f.write("STRIP_LISTPRICE = 1\n")
else:
f.write("STRIP_LISTPRICE = 0\n")
f.closed
print (" Created config_cache.py")
# Avoid config_cache.pyc being created root:root by sudo scons --install
import py_compile
py_compile.compile("config_cache.py")
print (" Created config_cache.pyc\n Configuration completed\n")