1006 | | elif sys.platform == 'darwin': |
1007 | | # this config section lifted directly from Imaging - thanks to |
1008 | | # the effbot! |
1009 | | |
1010 | | # First test for a MacOSX/darwin framework install |
1011 | | from os.path import join, exists |
1012 | | framework_dirs = [ |
1013 | | join(os.getenv('HOME'), '/Library/Frameworks'), |
1014 | | '/Library/Frameworks', |
1015 | | '/System/Library/Frameworks/', |
1016 | | ] |
1017 | | |
1018 | | # Find the directory that contains the Tcl.framework and Tk.framework |
1019 | | # bundles. |
1020 | | # XXX distutils should support -F! |
1021 | | tk_framework_found = 0 |
1022 | | for F in framework_dirs: |
1023 | | # both Tcl.framework and Tk.framework should be present |
1024 | | for fw in 'Tcl', 'Tk': |
1025 | | if not exists(join(F, fw + '.framework')): |
1026 | | break |
1027 | | else: |
1028 | | # ok, F is now directory with both frameworks. Continure |
1029 | | # building |
1030 | | tk_framework_found = 1 |
1031 | | break |
1032 | | if tk_framework_found: |
1033 | | # For 8.4a2, we must add -I options that point inside the Tcl and Tk |
1034 | | # frameworks. In later release we should hopefully be able to pass |
1035 | | # the -F option to gcc, which specifies a framework lookup path. |
1036 | | # |
1037 | | tk_include_dirs = [ |
1038 | | join(F, fw + '.framework', H) |
1039 | | for fw in 'Tcl', 'Tk' |
1040 | | for H in 'Headers', 'Versions/Current/PrivateHeaders' |
1041 | | ] |
1042 | | |
1043 | | # For 8.4a2, the X11 headers are not included. Rather than include a |
1044 | | # complicated search, this is a hard-coded path. It could bail out |
1045 | | # if X11 libs are not found... |
1046 | | # tk_include_dirs.append('/usr/X11R6/include') |
1047 | | frameworks = ['-framework', 'Tcl', '-framework', 'Tk'] |
1048 | | module.include_dirs.extend(tk_include_dirs) |
1049 | | module.extra_link_args.extend(frameworks) |
1050 | | module.extra_compile_args.extend(frameworks) |
1051 | | |