Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 1 | # |
| 2 | # Local customizations for generating the Carbon interface modules. |
| 3 | # Edit this file to reflect where things should be on your system. |
| 4 | # Note that pathnames are unix-style for OSX MachoPython/unix-Python, |
| 5 | # but mac-style for MacPython, whether running on OS9 or OSX. |
| 6 | # |
| 7 | |
| 8 | import sys, os |
| 9 | |
| 10 | Error = "bgenlocations.Error" |
| 11 | # |
| 12 | # Where bgen is. For unix-Python bgen isn't installed, so you have to refer to |
| 13 | # the source tree here. |
| 14 | if sys.platform == 'mac': |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 15 | # For MacPython we know where it is |
| 16 | def _pardir(p): return os.path.split(p)[0] |
| 17 | BGENDIR=os.path.join(sys.prefix, "Tools", "bgen", "bgen") |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 18 | else: |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 19 | # for unix-Python we don't know, please set it yourself. |
| 20 | BGENDIR="/Users/jack/src/python/Tools/bgen/bgen" |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 21 | |
| 22 | # |
| 23 | # Where to find the Universal Header include files. If you have CodeWarrior |
| 24 | # installed you can use the Universal Headers from there, otherwise you can |
| 25 | # download them from the Apple website. Bgen can handle both unix- and mac-style |
| 26 | # end of lines, so don't worry about that. |
| 27 | # |
| 28 | if sys.platform == 'mac': |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 29 | _MWERKSDIR="Sap:Applications (Mac OS 9):Metrowerks CodeWarrior 7.0:Metrowerks CodeWarrior" |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 30 | else: |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 31 | _MWERKSDIR="/Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/" |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 32 | INCLUDEDIR=os.path.join(_MWERKSDIR, "MacOS Support", "Universal", "Interfaces", "CIncludes") |
| 33 | |
| 34 | # |
| 35 | # Where to put the python definitions files. Note that, on unix-Python, |
| 36 | # if you want to commit your changes to the CVS repository this should refer to |
| 37 | # your source directory, not your installed directory. |
| 38 | # |
| 39 | if sys.platform == 'mac': |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 40 | TOOLBOXDIR=os.path.join(sys.prefix, "Lib", "plat-mac", "Carbon") |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 41 | else: |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 42 | TOOLBOXDIR="/Users/jack/src/python/Lib/plat-mac/Carbon" |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 43 | |
| 44 | # Creator for C files: |
| 45 | CREATOR="CWIE" |
| 46 | |
| 47 | if not os.path.exists(BGENDIR): |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 48 | raise Error, "Please fix bgenlocations.py, BGENDIR does not exist: %s" % BGENDIR |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 49 | if not os.path.exists(INCLUDEDIR): |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 50 | raise Error, "Please fix bgenlocations.py, INCLUDEDIR does not exist: %s" % INCLUDEDIR |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 51 | if not os.path.exists(TOOLBOXDIR): |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 52 | raise Error, "Please fix bgenlocations.py, TOOLBOXDIR does not exist: %s" % TOOLBOXDIR |
| 53 | |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 54 | # Sigh, due to the way these are used make sure they end with : or /. |
| 55 | if BGENDIR[-1] != os.sep: |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 56 | BGENDIR = BGENDIR + os.sep |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 57 | if INCLUDEDIR[-1] != os.sep: |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 58 | INCLUDEDIR = INCLUDEDIR + os.sep |
Jack Jansen | 6573f31 | 2002-08-05 14:56:04 +0000 | [diff] [blame] | 59 | if TOOLBOXDIR[-1] != os.sep: |
Jack Jansen | 0ae3220 | 2003-04-09 13:25:43 +0000 | [diff] [blame^] | 60 | TOOLBOXDIR = TOOLBOXDIR + os.sep |
| 61 | |