summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-11-26 23:01:11 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-11-26 23:01:11 (GMT)
commitc10a11b7c746587768ab716cc775c1a30c95c857 (patch)
treeec667ca87a1f78cd1ccaea8b2727216b93dd4373 /Mac
parentfed0d0907530a2a6588ede5db8d241dc1eecc84c (diff)
downloadcpython-c10a11b7c746587768ab716cc775c1a30c95c857.zip
cpython-c10a11b7c746587768ab716cc775c1a30c95c857.tar.gz
cpython-c10a11b7c746587768ab716cc775c1a30c95c857.tar.bz2
Generate plugin projects automatically using mkcwproject. There are as of yet only
three modules done (and one doesn't work:-), the rest TBD.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Build/genpluginprojects.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/Mac/Build/genpluginprojects.py b/Mac/Build/genpluginprojects.py
new file mode 100644
index 0000000..c0022e2
--- /dev/null
+++ b/Mac/Build/genpluginprojects.py
@@ -0,0 +1,43 @@
+import mkcwproject
+import sys
+import os
+
+PROJECTDIR = os.path.join(sys.prefix, ":Mac:Build")
+MODULEDIRS = [ # Relative to projectdirs
+ "::Modules:%s",
+ "::Modules",
+ ":::Modules",
+]
+
+def genpluginproject(module,
+ project=None, projectdir=None,
+ sources=[], sourcedirs=[],
+ libraries=[], extradirs=[]):
+ if not project:
+ project = module + '.mcp'
+ if not projectdir:
+ projectdir = PROJECTDIR
+ if not sources:
+ sources = [module + 'module.c']
+ if not sourcedirs:
+ for moduledir in MODULEDIRS:
+ if '%' in moduledir:
+ moduledir = moduledir % module
+ fn = os.path.join(projectdir, os.path.join(moduledir, sources[0]))
+ if os.path.exists(fn):
+ sourcedirs = [moduledir]
+ break
+ else:
+ print "Warning: %s: sourcefile not found: %s"%(module, sources[0])
+ sourcedirs = []
+ dict = {
+ "sysprefix" : sys.prefix,
+ "sources" : sources,
+ "extrasearchdirs" : sourcedirs + extradirs,
+ "libraries": libraries,
+ }
+ mkcwproject.mkproject(os.path.join(projectdir, project), module, dict)
+
+genpluginproject("Cm", libraries=["QuickTimeLib"])
+genpluginproject("calldll", sources=["calldll.c"])
+genpluginproject("zlib", libraries=["zlib.ppc.Lib"], extradirs=["::::imglibs:zlib"])