summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-01-03 16:44:56 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-01-03 16:44:56 (GMT)
commitb55b7bb3ab1cb0259e3ba2d9acaebbbd1cb78099 (patch)
treec14fd189e465eb5c3c8a9d8b298666e4642966a5 /Mac
parentb55e5f1b62534786cf7e5be9fe25473a78613b83 (diff)
downloadcpython-b55b7bb3ab1cb0259e3ba2d9acaebbbd1cb78099.zip
cpython-b55b7bb3ab1cb0259e3ba2d9acaebbbd1cb78099.tar.gz
cpython-b55b7bb3ab1cb0259e3ba2d9acaebbbd1cb78099.tar.bz2
Use relative path for outputdir.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/scripts/genpluginprojects.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/Mac/scripts/genpluginprojects.py b/Mac/scripts/genpluginprojects.py
index 5dbb4b3..a22af2b 100644
--- a/Mac/scripts/genpluginprojects.py
+++ b/Mac/scripts/genpluginprojects.py
@@ -1,6 +1,7 @@
import mkcwproject
import sys
import os
+import string
PROJECTDIR = os.path.join(sys.prefix, ":Mac:Build")
MODULEDIRS = [ # Relative to projectdirs
@@ -9,6 +10,23 @@ MODULEDIRS = [ # Relative to projectdirs
":::Modules",
]
+def relpath(base, path):
+ """Turn abs path into path relative to another. Only works for 2 abs paths
+ both pointing to folders"""
+ if not os.path.isabs(base) or not os.path.isabs(path):
+ raise 'Absolute paths only'
+ if base[-1] != ':':
+ base = base +':'
+ if path[-1] != ':':
+ path = path + ':'
+ basefields = string.split(base, os.sep)
+ pathfields = string.split(path, os.sep)
+ commonfields = len(os.path.commonprefix((basefields, pathfields)))
+ basefields = basefields[commonfields:]
+ pathfields = pathfields[commonfields:]
+ pathfields = ['']*len(basefields) + pathfields
+ return string.join(pathfields, os.sep)
+
def genpluginproject(module,
project=None, projectdir=None,
sources=[], sourcedirs=[],
@@ -38,7 +56,7 @@ def genpluginproject(module,
"sources" : sources,
"extrasearchdirs" : sourcedirs + extradirs,
"libraries": libraries,
- "mac_outputdir" : os.path.join(sys.prefix, ":Mac:Plugins"),
+ "mac_outputdir" : "::Plugins",
"extraexportsymbols" : extraexportsymbols,
}
mkcwproject.mkproject(os.path.join(projectdir, project), module, dict)