deluge/library/setup.py

66 lines
1.8 KiB
Python
Raw Normal View History

2006-12-05 09:22:53 +00:00
#
# Copyright (c) 2006 Alon Zakai ('Kripken') <kripkensteiner@gmail.com>
#
# 2006-15-9
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
import sys
command = sys.argv[1]
removals = ['-g', '-DNDEBUG', '-O2', '-Wstrict-prototypes']
2006-12-05 09:32:31 +00:00
addition = "-DNDEBUG -O2" # Oddly, -O2 gives smaller .o's than -Os
2006-12-05 09:22:53 +00:00
import platform
pythonVersion = platform.python_version()[0:3]
2006-12-08 14:28:03 +00:00
print "====================================="
print "Creating flood_core for Python " + pythonVersion
print "====================================="
2006-12-05 09:22:53 +00:00
import os
2006-12-08 20:40:43 +00:00
p = os.popen("python setup_naive.py --dry-run " + command)
2006-12-05 09:22:53 +00:00
data = p.readlines()
p.close()
print "Executing modified commands: "
for line in data:
if line[0:3] in ['gcc', 'g++']:
# print "OLD: ", line
for removal in removals:
line = line.replace(" " + removal + " ", " ")
line = line[0:4] + addition + " " + line[4:]
print line
p = os.popen(line)
data = p.readlines()
p.close()
print ""
2006-12-08 14:17:36 +00:00
# else:
# print "NOT DOING: ", line
2006-12-05 09:22:53 +00:00
# Now redo it, for real. Nothing should occur, except for installation, if requested
print "Finalizing..."
2006-12-05 09:32:31 +00:00
p = os.popen("python setup_naive.py " + command)
2006-12-05 09:22:53 +00:00
data = p.readlines()
p.close()
2006-12-05 09:32:31 +00:00
#print "".join(data) # Errors from the pipe are shown before we print... not good