|
32 | 32 | import os |
33 | 33 |
|
34 | 34 | basedir = { |
35 | | - |
36 | 35 | 'win32' : ['win32_static',], |
37 | 36 | 'linux2' : ['/usr/local', '/usr',], |
38 | 37 | 'linux' : ['/usr/local', '/usr',], |
39 | | - 'darwin' : ['/usr/local', '/usr', '/sw'], |
| 38 | + 'darwin' : [os.getenv('MBLIB_BASE') or '/usr/local', '/usr', '/sw'], |
40 | 39 | 'sunos5' : [os.getenv('MPLIB_BASE') or '/usr/local',], |
41 | 40 | } |
42 | 41 |
|
|
59 | 58 | BUILT_TKAGG = False |
60 | 59 | BUILT_WINDOWING = False |
61 | 60 |
|
62 | | - |
63 | 61 | def add_base_flags(module): |
64 | 62 | incdirs = [os.path.join(p, 'include') for p in basedir[sys.platform] |
65 | 63 | if os.path.exists(p)] |
@@ -184,6 +182,7 @@ def find_tcltk(): |
184 | 182 | o.tcl_lib = "/usr/local/lib" |
185 | 183 | o.tcl_inc = "/usr/local/include" |
186 | 184 | o.tk_lib = "/usr/local/lib" |
| 185 | + o.tk_inc = "/usr/local/include" |
187 | 186 | o.tkv = "" |
188 | 187 | else: |
189 | 188 | tk.withdraw() |
@@ -212,14 +211,16 @@ def add_tk_flags(module): |
212 | 211 | module.include_dirs.extend(['win32_static/include/tcl']) |
213 | 212 | module.library_dirs.extend(['C:/Python23/dlls']) |
214 | 213 | module.libraries.extend(['tk84', 'tcl84']) |
215 | | - elif sys.platform == 'darwin': |
216 | | - module.extra_link_args.extend(['-framework','Tcl']) |
217 | | - module.extra_link_args.extend(['-framework','Tk']) |
218 | 214 | else: |
219 | | - o = find_tcltk() |
220 | | - module.include_dirs.extend([o.tcl_inc, o.tk_inc]) |
221 | | - module.library_dirs.extend([o.tcl_lib, o.tk_lib]) |
222 | | - module.libraries.extend(['tk'+o.tkv, 'tcl'+o.tkv]) |
| 215 | + o = find_tcltk() |
| 216 | + if sys.platform == 'darwin' and '/Library/Framework' in o.tk_lib: |
| 217 | + module.extra_link_args.extend(['-framework','Tcl']) |
| 218 | + module.extra_link_args.extend(['-framework','Tk']) |
| 219 | + else: |
| 220 | + module.include_dirs.extend([o.tcl_inc, o.tk_inc]) |
| 221 | + module.library_dirs.extend([o.tcl_lib, o.tk_lib]) |
| 222 | + module.libraries.extend(['tk'+o.tkv, 'tcl'+o.tkv]) |
| 223 | + |
223 | 224 |
|
224 | 225 | def add_windowing_flags(module): |
225 | 226 | 'Add the module flags to build extensions using windowing api' |
|
0 commit comments