| 58 |
|
try:
|
| 59 |
|
config = _load_data(os.path.join(HOMEPATH, 'config.dat'))
|
| 60 |
|
except IOError:
|
| 61 |
|
print "You must run Configure.py before building!"
|
| 62 |
|
sys.exit(1)
|
| 63 |
|
|
| 64 |
|
target_platform = config.get('target_platform', sys.platform)
|
| 65 |
|
target_iswin = target_platform[:3] == 'win'
|
| 66 |
|
|
| 67 |
|
if target_platform == sys.platform:
|
| 68 |
|
# _not_ cross compiling
|
| 69 |
|
if config['pythonVersion'] != sys.version:
|
| 70 |
|
print "The current version of Python is not the same with which PyInstaller was configured."
|
| 71 |
|
print "Please re-run Configure.py with this version."
|
| 72 |
|
sys.exit(1)
|
| 73 |
|
|
| 74 |
|
if config['hasRsrcUpdate']:
|
| 75 |
|
import icon, versionInfo
|
| 76 |
|
|
| 88 |
|
if config['hasUPX']:
|
| 89 |
|
setupUPXFlags()
|
| 90 |
|
|
| 91 |
|
def build(spec):
|
| 92 |
|
global SPECPATH, BUILDPATH, WARNFILE, rthooks
|
| 93 |
|
rthooks = _load_data(os.path.join(HOMEPATH, 'rthooks.dat'))
|
| 94 |
|
SPECPATH, specnm = os.path.split(spec)
|
| 95 |
|
specnm = os.path.splitext(specnm)[0]
|
| 96 |
|
if SPECPATH == '':
|
| 97 |
|
SPECPATH = os.getcwd()
|
| 98 |
|
WARNFILE = os.path.join(SPECPATH, 'warn%s.txt' % specnm)
|
| 99 |
|
BUILDPATH = os.path.join(SPECPATH, 'build%s' % specnm)
|
| 100 |
|
if '-o' in sys.argv:
|
| 101 |
|
bpath = sys.argv[sys.argv.index('-o')+1]
|
| 102 |
|
if os.path.isabs(bpath):
|
| 103 |
|
BUILDPATH = bpath
|
| 104 |
|
else:
|
| 105 |
|
BUILDPATH = os.path.join(SPECPATH, bpath)
|
| 106 |
|
if not os.path.exists(BUILDPATH):
|
| 107 |
|
os.mkdir(BUILDPATH)
|
| 108 |
|
execfile(spec)
|
| 109 |
|
|
| |
901 |
#---
|
| |
902 |
|
| |
903 |
def build(spec):
|
| |
904 |
global SPECPATH, BUILDPATH, WARNFILE, rthooks
|
| |
905 |
rthooks = _load_data(os.path.join(HOMEPATH, 'rthooks.dat'))
|
| |
906 |
SPECPATH, specnm = os.path.split(spec)
|
| |
907 |
specnm = os.path.splitext(specnm)[0]
|
| |
908 |
if SPECPATH == '':
|
| |
909 |
SPECPATH = os.getcwd()
|
| |
910 |
WARNFILE = os.path.join(SPECPATH, 'warn%s.txt' % specnm)
|
| |
911 |
BUILDPATH = os.path.join(SPECPATH, 'build%s' % specnm)
|
| |
912 |
if '-o' in sys.argv:
|
| |
913 |
bpath = sys.argv[sys.argv.index('-o')+1]
|
| |
914 |
if os.path.isabs(bpath):
|
| |
915 |
BUILDPATH = bpath
|
| |
916 |
else:
|
| |
917 |
BUILDPATH = os.path.join(SPECPATH, bpath)
|
| |
918 |
if not os.path.exists(BUILDPATH):
|
| |
919 |
os.mkdir(BUILDPATH)
|
| |
920 |
execfile(spec)
|
| |
921 |
|
| |
922 |
|
| |
929 |
try:
|
| |
930 |
config = _load_data(os.path.join(HOMEPATH, 'config.dat'))
|
| |
931 |
except IOError:
|
| |
932 |
print "You must run Configure.py before building!"
|
| |
933 |
sys.exit(1)
|
| |
934 |
|
| |
935 |
target_platform = config.get('target_platform', sys.platform)
|
| |
936 |
target_iswin = target_platform[:3] == 'win'
|
| |
937 |
|
| |
938 |
if target_platform == sys.platform:
|
| |
939 |
# _not_ cross compiling
|
| |
940 |
if config['pythonVersion'] != sys.version:
|
| |
941 |
print "The current version of Python is not the same with which PyInstaller was configured."
|
| |
942 |
print "Please re-run Configure.py with this version."
|
| |
943 |
sys.exit(1)
|
| |
944 |
|
| |
945 |
if config['hasRsrcUpdate']:
|
| |
946 |
import icon, versionInfo
|
| |
947 |
|
| |
948 |
if config['hasUPX']:
|
| |
949 |
setupUPXFlags()
|
| |
950 |
|
| |
951 |
if not config['useELFEXE']:
|
| |
952 |
EXE.append_pkg = 0
|
| |
953 |
|