annotate Mac/Tools/fixapplepython23.py @ 58765:2ba7677bfa95 legacy-trunk

testCopysign was defined twice in test_math; combine the definitions
author Mark Dickinson <dickinsm@gmail.com>
date Sat, 06 Feb 2010 23:11:25 +0000
parents cedea9e23a95
children ef48e48f066e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38643
2af5757de7b1 Move Mac/OSX/Tools one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 34358
diff changeset
1 #!/usr/bin/python
34257
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2 """fixapplepython23 - Fix Apple-installed Python 2.3 (on Mac OS X 10.3)
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4 Python 2.3 (and 2.3.X for X<5) have the problem that building an extension
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
5 for a framework installation may accidentally pick up the framework
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
6 of a newer Python, in stead of the one that was used to build the extension.
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
7
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8 This script modifies the Makefile (in .../lib/python2.3/config) to use
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9 the newer method of linking extensions with "-undefined dynamic_lookup"
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
10 which fixes this problem.
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
11
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
12 The script will first check all prerequisites, and return a zero exit
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
13 status also when nothing needs to be fixed.
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
14 """
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
15 import sys
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
16 import os
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
17 import gestalt
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
19 MAKEFILE='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/Makefile'
34304
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
20 CHANGES=((
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
21 'LDSHARED=\t$(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK)\n',
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
22 'LDSHARED=\t$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup\n'
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
23 ),(
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
24 'BLDSHARED=\t$(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK)\n',
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
25 'BLDSHARED=\t$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup\n'
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
26 ),(
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
27 'CC=\t\tgcc\n',
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
28 'CC=\t\t/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-gcc\n'
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
29 ),(
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
30 'CXX=\t\tc++\n',
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
31 'CXX=\t\t/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-g++\n'
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
32 ))
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
33
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
34 GCC_SCRIPT='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-gcc'
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
35 GXX_SCRIPT='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-g++'
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
36 SCRIPT="""#!/bin/sh
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
37 export MACOSX_DEPLOYMENT_TARGET=10.3
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
38 exec %s "${@}"
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
39 """
34257
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
40
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
41 def findline(lines, start):
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
42 """return line starting with given string or -1"""
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
43 for i in range(len(lines)):
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
44 if lines[i][:len(start)] == start:
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
45 return i
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
46 return -1
34358
b1a84233d855 Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 34304
diff changeset
47
34257
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
48 def fix(makefile, do_apply):
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
49 """Fix the Makefile, if required."""
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
50 fixed = False
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
51 lines = open(makefile).readlines()
34358
b1a84233d855 Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 34304
diff changeset
52
34304
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
53 for old, new in CHANGES:
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
54 i = findline(lines, new)
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
55 if i >= 0:
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
56 # Already fixed
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
57 continue
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
58 i = findline(lines, old)
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
59 if i < 0:
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
60 print 'fixapplepython23: Python installation not fixed (appears broken)'
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
61 print 'fixapplepython23: missing line:', old
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
62 return 2
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
63 lines[i] = new
34257
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
64 fixed = True
34358
b1a84233d855 Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 34304
diff changeset
65
34257
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
66 if fixed:
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
67 if do_apply:
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
68 print 'fixapplepython23: Fix to Apple-installed Python 2.3 applied'
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
69 os.rename(makefile, makefile + '~')
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
70 open(makefile, 'w').writelines(lines)
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
71 return 0
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
72 else:
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
73 print 'fixapplepython23: Fix to Apple-installed Python 2.3 should be applied'
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
74 return 1
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
75 else:
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
76 print 'fixapplepython23: No fix needed, appears to have been applied before'
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
77 return 0
34358
b1a84233d855 Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 34304
diff changeset
78
34304
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
79 def makescript(filename, compiler):
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
80 """Create a wrapper script for a compiler"""
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
81 dirname = os.path.split(filename)[0]
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
82 if not os.access(dirname, os.X_OK):
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
83 os.mkdir(dirname, 0755)
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
84 fp = open(filename, 'w')
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
85 fp.write(SCRIPT % compiler)
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
86 fp.close()
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
87 os.chmod(filename, 0755)
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
88 print 'fixapplepython23: Created', filename
34358
b1a84233d855 Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 34304
diff changeset
89
34257
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
90 def main():
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
91 # Check for -n option
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
92 if len(sys.argv) > 1 and sys.argv[1] == '-n':
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
93 do_apply = False
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
94 else:
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
95 do_apply = True
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
96 # First check OS version
38752
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38643
diff changeset
97 if sys.byteorder == 'little':
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38643
diff changeset
98 # All intel macs are fine
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38643
diff changeset
99 print "fixapplypython23: no fix is needed on MacOSX on Intel"
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38643
diff changeset
100 sys.exit(0)
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38643
diff changeset
101
34257
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
102 if gestalt.gestalt('sysv') < 0x1030:
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
103 print 'fixapplepython23: no fix needed on MacOSX < 10.3'
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
104 sys.exit(0)
38752
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38643
diff changeset
105
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38643
diff changeset
106 if gestalt.gestalt('sysv') >= 0x1040:
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38643
diff changeset
107 print 'fixapplepython23: no fix needed on MacOSX >= 10.4'
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38643
diff changeset
108 sys.exit(0)
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38643
diff changeset
109
34257
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
110 # Test that a framework Python is indeed installed
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
111 if not os.path.exists(MAKEFILE):
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
112 print 'fixapplepython23: Python framework does not appear to be installed (?), nothing fixed'
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
113 sys.exit(0)
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
114 # Check that we can actually write the file
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
115 if do_apply and not os.access(MAKEFILE, os.W_OK):
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
116 print 'fixapplepython23: No write permission, please run with "sudo"'
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
117 sys.exit(2)
34304
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
118 # Create the shell scripts
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
119 if do_apply:
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
120 if not os.access(GCC_SCRIPT, os.X_OK):
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
121 makescript(GCC_SCRIPT, "gcc")
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
122 if not os.access(GXX_SCRIPT, os.X_OK):
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
123 makescript(GXX_SCRIPT, "g++")
991041f76447 Create the wrapper scripts for gcc/g++ too.
Jack Jansen <jack.jansen@cwi.nl>
parents: 34267
diff changeset
124 # Finally fix the makefile
34257
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
125 rv = fix(MAKEFILE, do_apply)
39852
cedea9e23a95 Port of revision 51902 in release25-maint to the trunk
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
126 #sys.exit(rv)
cedea9e23a95 Port of revision 51902 in release25-maint to the trunk
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
127 sys.exit(0)
34358
b1a84233d855 Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 34304
diff changeset
128
34257
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
129 if __name__ == '__main__':
0d9163da61a3 A script to fix Apple-installed Python 2.3 (and a test whether the user
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
130 main()