|
47 | 47 | import re
|
48 | 48 | import subprocess
|
49 | 49 | from distutils import sysconfig, version
|
50 |
| - |
51 |
| -basedir = { |
| 50 | +from collections import defaultdict |
| 51 | + |
| 52 | +# basedir is a dictionary keyed by sys.platform, and on most platforms it is |
| 53 | +# set to ['/usr/local', '/usr']. Giving this defaultdict a factory that |
| 54 | +# returns this default removes the need to update this code every time a new |
| 55 | +# version of freebsd comes out, for example, provided that the default basedir |
| 56 | +# remains sufficient on that platform |
| 57 | +basedir = defaultdict(lambda: ['/usr/local', '/usr'], { |
| 58 | + # execptions to the ['/usr/local', '/usr'] defaults |
52 | 59 | 'win32' : ['win32_static',],
|
53 |
| - 'linux2-alpha' : ['/usr/local', '/usr'], |
54 |
| - 'linux2-hppa' : ['/usr/local', '/usr'], |
55 |
| - 'linux2-mips' : ['/usr/local', '/usr'], |
56 |
| - 'linux2-sparc' : ['/usr/local', '/usr'], |
57 |
| - 'linux2' : ['/usr/local', '/usr'], |
58 |
| - 'linux3' : ['/usr/local', '/usr'], |
59 |
| - 'linux' : ['/usr/local', '/usr',], |
60 |
| - 'cygwin' : ['/usr/local', '/usr',], |
61 | 60 | 'darwin' : ['/usr/local/', '/usr', '/usr/X11'],
|
62 |
| - 'freebsd4' : ['/usr/local', '/usr'], |
63 |
| - 'freebsd5' : ['/usr/local', '/usr'], |
64 |
| - 'freebsd6' : ['/usr/local', '/usr'], |
65 | 61 | 'sunos5' : [os.getenv('MPLIB_BASE') or '/usr/local',],
|
66 |
| - 'gnukfreebsd5' : ['/usr/local', '/usr'], |
67 |
| - 'gnukfreebsd6' : ['/usr/local', '/usr'], |
68 |
| - 'gnukfreebsd7' : ['/usr/local', '/usr'], |
69 |
| - 'gnukfreebsd8' : ['/usr/local', '/usr'], |
70 | 62 | 'gnu0' : ['/usr'],
|
71 | 63 | 'aix5' : ['/usr/local'],
|
72 |
| -} |
| 64 | + }) |
73 | 65 |
|
74 |
| -import sys, os, stat |
| 66 | +import sys |
75 | 67 |
|
76 | 68 | from textwrap import fill
|
77 | 69 | from distutils.core import Extension
|
|
0 commit comments