| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | # | 
					
						
							|  |  |  | # fullbuild creates everything that needs to be created before a | 
					
						
							|  |  |  | # distribution can be made, and puts it all in the right place. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # It expects the projects to be in the places where Jack likes them: | 
					
						
							| 
									
										
										
										
											1997-09-01 15:37:07 +00:00
										 |  |  | # in directories named like 'build.mac'. That is fixable, | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | # however. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # NOTE: You should proably make a copy of python with which to execute this | 
					
						
							|  |  |  | # script, rebuilding running programs does not work... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1997-09-01 15:37:07 +00:00
										 |  |  | MACBUILDNO=":Mac:Include:macbuildno.h" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | import os | 
					
						
							|  |  |  | import sys | 
					
						
							|  |  |  | import macfs | 
					
						
							| 
									
										
										
										
											1996-02-21 15:28:49 +00:00
										 |  |  | import MacOS | 
					
						
							| 
									
										
										
										
											1996-04-10 14:51:14 +00:00
										 |  |  | import EasyDialogs | 
					
						
							| 
									
										
										
										
											2001-01-02 22:02:02 +00:00
										 |  |  | import re | 
					
						
							| 
									
										
										
										
											1997-09-01 15:37:07 +00:00
										 |  |  | import string | 
					
						
							| 
									
										
										
										
											2001-08-16 20:39:17 +00:00
										 |  |  | import genpluginprojects | 
					
						
							| 
									
										
										
										
											2001-08-27 21:41:23 +00:00
										 |  |  | import macresource | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | import aetools | 
					
						
							| 
									
										
										
										
											2001-08-25 12:15:04 +00:00
										 |  |  | from Carbon import AppleEvents | 
					
						
							| 
									
										
										
										
											2000-08-17 22:12:12 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | OLDAESUPPORT = 0 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if OLDAESUPPORT: | 
					
						
							|  |  |  | 	from Metrowerks_Shell_Suite import Metrowerks_Shell_Suite | 
					
						
							|  |  |  | 	from CodeWarrior_suite import CodeWarrior_suite | 
					
						
							|  |  |  | 	from Metrowerks_Standard_Suite import Metrowerks_Standard_Suite | 
					
						
							|  |  |  | 	from Required_Suite import Required_Suite | 
					
						
							|  |  |  | else: | 
					
						
							|  |  |  | 	import CodeWarrior | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-08-25 12:15:04 +00:00
										 |  |  | from Carbon import Res | 
					
						
							|  |  |  | from Carbon import Dlg | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1998-07-31 09:45:27 +00:00
										 |  |  | import buildtools | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | import cfmfile | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Dialog resource. Note that the item numbers should correspond | 
					
						
							|  |  |  | # to those in the DITL resource. Also note that the order is important: | 
					
						
							|  |  |  | # things are built in this order, so there should be no forward dependencies. | 
					
						
							|  |  |  | DIALOG_ID = 512 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | I_OK=1 | 
					
						
							|  |  |  | I_CANCEL=2 | 
					
						
							| 
									
										
										
										
											2001-01-03 11:12:21 +00:00
										 |  |  | # label 3 | 
					
						
							|  |  |  | I_PPC_EXTLIBS=4 | 
					
						
							|  |  |  | I_GEN_PROJECTS=5 | 
					
						
							| 
									
										
										
										
											2001-01-21 22:25:11 +00:00
										 |  |  | I_GEN_PROJECTS_FORCE=6 | 
					
						
							|  |  |  | I_GEN_IMGPROJECTS=7 | 
					
						
							|  |  |  | I_GEN_IMGPROJECTS_FORCE=8 | 
					
						
							|  |  |  | I_INC_BUILDNO=9 | 
					
						
							|  |  |  | # label 10 | 
					
						
							|  |  |  | I_PPC_CORE=11 | 
					
						
							|  |  |  | I_PPC_PLUGINS=12 | 
					
						
							|  |  |  | I_PPC_EXTENSIONS=13 | 
					
						
							|  |  |  | # label 14 | 
					
						
							|  |  |  | I_CARBON_CORE=15 | 
					
						
							|  |  |  | I_CARBON_PLUGINS=16 | 
					
						
							|  |  |  | I_CARBON_EXTENSIONS=17 | 
					
						
							| 
									
										
										
										
											2001-02-12 14:46:53 +00:00
										 |  |  | I_INTERPRETER=18 | 
					
						
							|  |  |  | # label 19 | 
					
						
							|  |  |  | I_PPC_FULL=20 | 
					
						
							|  |  |  | I_PPC_SMALL=21 | 
					
						
							|  |  |  | # label 22 | 
					
						
							|  |  |  | I_CARBON_FULL=23 | 
					
						
							|  |  |  | I_CARBON_SMALL=24 | 
					
						
							|  |  |  | # label 25 | 
					
						
							|  |  |  | I_APPLETS=26 | 
					
						
							| 
									
										
										
										
											2001-01-21 22:25:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-02-12 14:46:53 +00:00
										 |  |  | N_BUTTONS=27 | 
					
						
							| 
									
										
										
										
											1997-08-27 14:10:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-08-17 22:12:12 +00:00
										 |  |  | if OLDAESUPPORT: | 
					
						
							|  |  |  | 	class MwShell(Metrowerks_Shell_Suite, CodeWarrior_suite, Metrowerks_Standard_Suite, | 
					
						
							|  |  |  | 					Required_Suite, aetools.TalkTo): | 
					
						
							|  |  |  | 		pass | 
					
						
							|  |  |  | else: | 
					
						
							|  |  |  | 	MwShell = CodeWarrior.CodeWarrior | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-04-10 14:51:14 +00:00
										 |  |  | RUNNING=[] | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | def buildmwproject(top, creator, projects): | 
					
						
							|  |  |  | 	"""Build projects with an MW compiler""" | 
					
						
							| 
									
										
										
										
											1996-09-20 15:30:52 +00:00
										 |  |  | 	mgr = MwShell(creator, start=1) | 
					
						
							| 
									
										
										
										
											1996-02-21 15:28:49 +00:00
										 |  |  | 	mgr.send_timeout = AppleEvents.kNoTimeOut | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2000-07-24 19:45:07 +00:00
										 |  |  | 	failed = [] | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 	for file in projects: | 
					
						
							| 
									
										
										
										
											1997-08-27 14:10:29 +00:00
										 |  |  | 		if type(file) == type(()): | 
					
						
							|  |  |  | 			file, target = file | 
					
						
							|  |  |  | 		else: | 
					
						
							|  |  |  | 			target = '' | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 		file = os.path.join(top, file) | 
					
						
							| 
									
										
										
										
											1999-01-30 18:27:12 +00:00
										 |  |  | 		try: | 
					
						
							|  |  |  | 			fss = macfs.FSSpec(file) | 
					
						
							| 
									
										
										
										
											2001-01-03 11:12:21 +00:00
										 |  |  | 		except MacOS.Error: | 
					
						
							| 
									
										
										
										
											1999-01-30 18:27:12 +00:00
										 |  |  | 			print '** file not found:', file | 
					
						
							|  |  |  | 			continue | 
					
						
							| 
									
										
										
										
											1997-08-27 14:10:29 +00:00
										 |  |  | 		print 'Building', file, target | 
					
						
							| 
									
										
										
										
											1999-01-30 18:27:12 +00:00
										 |  |  | 		try: | 
					
						
							|  |  |  | 			mgr.open(fss) | 
					
						
							|  |  |  | 		except aetools.Error, detail: | 
					
						
							|  |  |  | 			print '**', detail, file | 
					
						
							|  |  |  | 			continue | 
					
						
							| 
									
										
										
										
											1997-08-27 14:10:29 +00:00
										 |  |  | 		if target: | 
					
						
							|  |  |  | 			try: | 
					
						
							|  |  |  | 				mgr.Set_Current_Target(target) | 
					
						
							|  |  |  | 			except aetools.Error, arg: | 
					
						
							|  |  |  | 				print '**', file, target, 'Cannot select:', arg | 
					
						
							| 
									
										
										
										
											1996-02-21 15:28:49 +00:00
										 |  |  | 		try: | 
					
						
							|  |  |  | 			mgr.Make_Project() | 
					
						
							| 
									
										
										
										
											1996-09-20 15:30:52 +00:00
										 |  |  | 		except aetools.Error, arg: | 
					
						
							| 
									
										
										
										
											1997-08-27 14:10:29 +00:00
										 |  |  | 			print '**', file, target, 'Failed:', arg | 
					
						
							| 
									
										
										
										
											2000-07-24 19:45:07 +00:00
										 |  |  | 			failed.append(fss) | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 		mgr.Close_Project() | 
					
						
							| 
									
										
										
										
											2000-07-24 19:45:07 +00:00
										 |  |  | 	if failed: | 
					
						
							|  |  |  | 		print 'Open failed projects and exit?', | 
					
						
							|  |  |  | 		rv = sys.stdin.readline() | 
					
						
							|  |  |  | 		if rv[0] in ('y', 'Y'): | 
					
						
							|  |  |  | 			for fss in failed: | 
					
						
							|  |  |  | 				mgr.open(fss) | 
					
						
							|  |  |  | 			sys.exit(0) | 
					
						
							| 
									
										
										
										
											1996-04-10 14:51:14 +00:00
										 |  |  | ##	mgr.quit() | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | def buildapplet(top, dummy, list): | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 	"""Create python applets""" | 
					
						
							| 
									
										
										
										
											2001-02-17 23:31:48 +00:00
										 |  |  | 	for src, dst, tmpl in list: | 
					
						
							|  |  |  | 		template = buildtools.findtemplate(tmpl) | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 		if src[-3:] != '.py': | 
					
						
							|  |  |  | 			raise 'Should end in .py', src | 
					
						
							|  |  |  | 		base = os.path.basename(src) | 
					
						
							|  |  |  | 		src = os.path.join(top, src) | 
					
						
							| 
									
										
										
										
											1999-02-01 01:21:18 +00:00
										 |  |  | 		dst = os.path.join(top, dst) | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 		try: | 
					
						
							|  |  |  | 			os.unlink(dst) | 
					
						
							|  |  |  | 		except os.error: | 
					
						
							|  |  |  | 			pass | 
					
						
							|  |  |  | 		print 'Building applet', dst | 
					
						
							| 
									
										
										
										
											2001-02-17 23:31:48 +00:00
										 |  |  | 		try: | 
					
						
							|  |  |  | 			buildtools.process(template, src, dst, 1) | 
					
						
							|  |  |  | 		except buildtools.BuildError, arg: | 
					
						
							|  |  |  | 			print '**', dst, arg | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 		 | 
					
						
							| 
									
										
										
										
											2001-01-21 22:25:11 +00:00
										 |  |  | def buildprojectfile(top, arg, list): | 
					
						
							| 
									
										
										
										
											2001-01-03 11:12:21 +00:00
										 |  |  | 	"""Create CodeWarrior project files with a script""" | 
					
						
							|  |  |  | 	for folder, module, routine in list: | 
					
						
							|  |  |  | 		print "Generating project files with", module | 
					
						
							|  |  |  | 		sys.path.insert(0, os.path.join(top, folder)) | 
					
						
							|  |  |  | 		m = __import__(module) | 
					
						
							|  |  |  | 		r = getattr(m, routine) | 
					
						
							| 
									
										
										
										
											2001-01-21 22:25:11 +00:00
										 |  |  | 		r(arg) | 
					
						
							| 
									
										
										
										
											2001-01-03 11:12:21 +00:00
										 |  |  | 		del sys.path[0] | 
					
						
							|  |  |  | 		 | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | def buildfat(top, dummy, list): | 
					
						
							|  |  |  | 	"""Build fat binaries""" | 
					
						
							|  |  |  | 	for dst, src1, src2 in list: | 
					
						
							|  |  |  | 		dst = os.path.join(top, dst) | 
					
						
							|  |  |  | 		src1 = os.path.join(top, src1) | 
					
						
							|  |  |  | 		src2 = os.path.join(top, src2) | 
					
						
							|  |  |  | 		print 'Building fat binary', dst | 
					
						
							|  |  |  | 		cfmfile.mergecfmfiles((src1, src2), dst) | 
					
						
							|  |  |  | 		 | 
					
						
							| 
									
										
										
										
											2001-02-12 14:46:53 +00:00
										 |  |  | def buildcopy(top, dummy, list): | 
					
						
							|  |  |  | 	import macostools | 
					
						
							|  |  |  | 	for src, dst in list: | 
					
						
							|  |  |  | 		src = os.path.join(top, src) | 
					
						
							|  |  |  | 		dst = os.path.join(top, dst) | 
					
						
							| 
									
										
										
										
											2001-03-06 22:46:25 +00:00
										 |  |  | 		macostools.copy(src, dst, forcetype="APPL") | 
					
						
							| 
									
										
										
										
											2001-02-12 14:46:53 +00:00
										 |  |  | 		 | 
					
						
							| 
									
										
										
										
											1997-09-09 13:57:15 +00:00
										 |  |  | def handle_dialog(filename): | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 	"""Handle selection dialog, return list of selected items""" | 
					
						
							|  |  |  | 	d = Dlg.GetNewDialog(DIALOG_ID, -1) | 
					
						
							|  |  |  | 	d.SetDialogDefaultItem(I_OK) | 
					
						
							|  |  |  | 	d.SetDialogCancelItem(I_CANCEL) | 
					
						
							|  |  |  | 	results = [0]*N_BUTTONS | 
					
						
							|  |  |  | 	while 1: | 
					
						
							|  |  |  | 		n = Dlg.ModalDialog(None) | 
					
						
							|  |  |  | 		if n == I_OK: | 
					
						
							|  |  |  | 			break | 
					
						
							|  |  |  | 		if n == I_CANCEL: | 
					
						
							|  |  |  | 			return [] | 
					
						
							| 
									
										
										
										
											1997-09-09 13:57:15 +00:00
										 |  |  | 		if n == I_INC_BUILDNO: | 
					
						
							|  |  |  | 			incbuildno(filename) | 
					
						
							|  |  |  | 			continue | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 		if n < len(results): | 
					
						
							|  |  |  | 			results[n] = (not results[n]) | 
					
						
							| 
									
										
										
										
											1999-12-24 13:39:23 +00:00
										 |  |  | 			ctl = d.GetDialogItemAsControl(n) | 
					
						
							|  |  |  | 			ctl.SetControlValue(results[n]) | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 	rv = [] | 
					
						
							|  |  |  | 	for i in range(len(results)): | 
					
						
							|  |  |  | 		if results[i]: | 
					
						
							|  |  |  | 			rv.append(i) | 
					
						
							|  |  |  | 	return rv | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # The build instructions. Entries are (routine, arg, list-of-files) | 
					
						
							|  |  |  | # XXXX We could also include the builds for stdwin and such here... | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | BUILD_DICT = { | 
					
						
							| 
									
										
										
										
											2001-01-21 22:25:11 +00:00
										 |  |  | I_GEN_PROJECTS : (buildprojectfile, 0, [ | 
					
						
							|  |  |  | 	(":Mac:scripts", "genpluginprojects", "genallprojects") | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | I_GEN_PROJECTS_FORCE : (buildprojectfile, 1, [ | 
					
						
							| 
									
										
										
										
											2001-01-03 11:12:21 +00:00
										 |  |  | 	(":Mac:scripts", "genpluginprojects", "genallprojects") | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2001-01-21 22:25:11 +00:00
										 |  |  | I_GEN_IMGPROJECTS : (buildprojectfile, 0, [ | 
					
						
							| 
									
										
										
										
											2001-01-03 11:12:21 +00:00
										 |  |  | 	(":Extensions:img:Mac", "genimgprojects", "genallprojects") | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2001-01-21 22:25:11 +00:00
										 |  |  | I_GEN_IMGPROJECTS_FORCE : (buildprojectfile, 1, [ | 
					
						
							|  |  |  | 	(":Extensions:img:Mac", "genimgprojects", "genallprojects") | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2001-02-12 14:46:53 +00:00
										 |  |  | I_INTERPRETER : (buildcopy, None, [ | 
					
						
							|  |  |  | 		("PythonInterpreterCarbon", "PythonInterpreter"), | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-21 22:25:11 +00:00
										 |  |  | I_PPC_CORE : (buildmwproject, "CWIE", [ | 
					
						
							| 
									
										
										
										
											2000-12-03 22:36:42 +00:00
										 |  |  | 		(":Mac:Build:PythonCore.mcp", "PythonCore"), | 
					
						
							| 
									
										
										
										
											2001-02-12 14:46:53 +00:00
										 |  |  | 		(":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterClassic"), | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 	]), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-21 22:25:11 +00:00
										 |  |  | I_CARBON_CORE : (buildmwproject, "CWIE", [ | 
					
						
							|  |  |  | 		(":Mac:Build:PythonCore.mcp", "PythonCoreCarbon"), | 
					
						
							|  |  |  | 		(":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterCarbon"), | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-03 11:12:21 +00:00
										 |  |  | I_PPC_EXTLIBS : (buildmwproject, "CWIE", [ | 
					
						
							|  |  |  | ##	(":Mac:Build:buildlibs.mcp", "buildlibs ppc plus tcl/tk"), | 
					
						
							|  |  |  | 	(":Mac:Build:buildlibs.mcp", "buildlibs ppc"), | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | I_PPC_PLUGINS : (buildmwproject, "CWIE", [ | 
					
						
							| 
									
										
										
										
											2001-02-12 14:46:53 +00:00
										 |  |  | 	(":Mac:Build:_weakref.mcp", "_weakref.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_symtable.mcp", "_symtable.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_testcapi.mcp", "_testcapi.ppc"), | 
					
						
							| 
									
										
										
										
											2001-10-23 22:23:44 +00:00
										 |  |  | 	(":Mac:Build:_hotshot.mcp", "_hotshot.ppc"), | 
					
						
							| 
									
										
										
										
											2001-08-29 22:08:06 +00:00
										 |  |  | 	(":Mac:Build:xx.mcp", "xx.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:xxsubtype.mcp", "xxsubtype.ppc"), | 
					
						
							| 
									
										
										
										
											2000-12-03 22:36:42 +00:00
										 |  |  | 	(":Mac:Build:pyexpat.mcp", "pyexpat.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:calldll.mcp", "calldll.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:ctb.mcp", "ctb.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:gdbm.mcp", "gdbm.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:icglue.mcp", "icglue.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:macspeech.mcp", "macspeech.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:waste.mcp", "waste.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:zlib.mcp", "zlib.ppc"), | 
					
						
							|  |  |  | ##	(":Mac:Build:_tkinter.mcp", "_tkinter.ppc"), | 
					
						
							| 
									
										
										
										
											2001-01-01 21:51:33 +00:00
										 |  |  | 	(":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"), | 
					
						
							| 
									
										
										
										
											2000-12-03 22:36:42 +00:00
										 |  |  | 	(":Mac:Build:ColorPicker.mcp", "ColorPicker.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:Printing.mcp", "Printing.ppc"), | 
					
						
							| 
									
										
										
										
											2001-08-23 13:51:46 +00:00
										 |  |  | 	(":Mac:Build:_AE.mcp", "_AE.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_App.mcp", "_App.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Cm.mcp", "_Cm.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Ctl.mcp", "_Ctl.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Dlg.mcp", "_Dlg.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Drag.mcp", "_Drag.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Evt.mcp", "_Evt.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Fm.mcp", "_Fm.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Help.mcp", "_Help.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Icn.mcp", "_Icn.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_List.mcp", "_List.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Menu.mcp", "_Menu.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Mlte.mcp", "_Mlte.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Qd.mcp", "_Qd.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Qdoffs.mcp", "_Qdoffs.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Qt.mcp", "_Qt.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Res.mcp", "_Res.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Scrap.mcp", "_Scrap.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Snd.mcp", "_Snd.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Sndihooks.mcp", "_Sndihooks.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_TE.mcp", "_TE.ppc"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Win.mcp", "_Win.ppc"), | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 	]), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-23 22:36:52 +00:00
										 |  |  | I_CARBON_PLUGINS :  (buildmwproject, "CWIE", [ | 
					
						
							| 
									
										
										
										
											2001-02-12 14:46:53 +00:00
										 |  |  | 	(":Mac:Build:_weakref.carbon.mcp", "_weakref.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_symtable.carbon.mcp", "_symtable.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_testcapi.carbon.mcp", "_testcapi.carbon"), | 
					
						
							| 
									
										
										
										
											2001-10-23 22:23:44 +00:00
										 |  |  | 	(":Mac:Build:_hotshot.carbon.mcp", "_hotshot.carbon"), | 
					
						
							| 
									
										
										
										
											2001-08-29 22:08:06 +00:00
										 |  |  | 	(":Mac:Build:xx.carbon.mcp", "xx.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:xxsubtype.carbon.mcp", "xxsubtype.carbon"), | 
					
						
							| 
									
										
										
										
											2001-01-23 22:36:52 +00:00
										 |  |  | 	(":Mac:Build:pyexpat.carbon.mcp", "pyexpat.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:calldll.carbon.mcp", "calldll.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:gdbm.carbon.mcp", "gdbm.carbon"), | 
					
						
							| 
									
										
										
										
											2001-01-29 13:27:46 +00:00
										 |  |  | 	(":Mac:Build:icglue.carbon.mcp", "icglue.carbon"), | 
					
						
							| 
									
										
										
										
											2001-01-24 16:02:07 +00:00
										 |  |  | 	(":Mac:Build:waste.carbon.mcp", "waste.carbon"), | 
					
						
							| 
									
										
										
										
											2001-01-23 22:36:52 +00:00
										 |  |  | 	(":Mac:Build:zlib.carbon.mcp", "zlib.carbon"), | 
					
						
							| 
									
										
										
										
											2001-03-20 23:30:06 +00:00
										 |  |  | 	(":Mac:Build:_dummy_tkinter.mcp", "_tkinter.carbon"), | 
					
						
							| 
									
										
										
										
											2001-01-23 22:36:52 +00:00
										 |  |  | ##	(":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), | 
					
						
							| 
									
										
										
										
											2001-08-23 13:51:46 +00:00
										 |  |  | 	(":Mac:Build:_AE.carbon.mcp", "_AE.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_App.carbon.mcp", "_App.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_CF.carbon.mcp", "_CF.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Cm.carbon.mcp", "_Cm.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Ctl.carbon.mcp", "_Ctl.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Dlg.carbon.mcp", "_Dlg.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Drag.carbon.mcp", "_Drag.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Evt.carbon.mcp", "_Evt.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Fm.carbon.mcp", "_Fm.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Icn.carbon.mcp", "_Icn.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_List.carbon.mcp", "_List.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Menu.carbon.mcp", "_Menu.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Mlte.carbon.mcp", "_Mlte.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Qd.carbon.mcp", "_Qd.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Qdoffs.carbon.mcp", "_Qdoffs.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Qt.carbon.mcp", "_Qt.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Res.carbon.mcp", "_Res.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Scrap.carbon.mcp", "_Scrap.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Snd.carbon.mcp", "_Snd.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Sndihooks.carbon.mcp", "_Sndihooks.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_TE.carbon.mcp", "_TE.carbon"), | 
					
						
							|  |  |  | 	(":Mac:Build:_Win.carbon.mcp", "_Win.carbon"), | 
					
						
							| 
									
										
										
										
											2001-06-26 21:52:08 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2001-01-23 22:36:52 +00:00
										 |  |  | 	]), | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-24 14:06:35 +00:00
										 |  |  | I_PPC_FULL : (buildmwproject, "CWIE", [ | 
					
						
							|  |  |  | 		(":Mac:Build:PythonStandalone.mcp", "PythonStandalone"), | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | I_PPC_SMALL : (buildmwproject, "CWIE", [ | 
					
						
							| 
									
										
										
										
											2000-12-03 22:36:42 +00:00
										 |  |  | 		(":Mac:Build:PythonStandSmall.mcp", "PythonStandSmall"), | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 	]), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-02-12 14:46:53 +00:00
										 |  |  | I_CARBON_FULL : (buildmwproject, "CWIE", [ | 
					
						
							|  |  |  | 		(":Mac:Build:PythonStandalone.mcp", "PythonCarbonStandalone"), | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | I_CARBON_SMALL : (buildmwproject, "CWIE", [ | 
					
						
							|  |  |  | 		(":Mac:Build:PythonStandSmall.mcp", "PythonStandSmallCarbon"), | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | I_PPC_EXTENSIONS : (buildmwproject, "CWIE", [ | 
					
						
							| 
									
										
										
										
											2000-12-03 22:36:42 +00:00
										 |  |  | 		(":Extensions:Imaging:_imaging.mcp", "_imaging.ppc"), | 
					
						
							|  |  |  | ##		(":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"), | 
					
						
							| 
									
										
										
										
											2001-01-23 23:19:41 +00:00
										 |  |  | 		(":Extensions:img:Mac:imgmodules.mcp", "imgmodules.ppc"), | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 	]), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-01-23 23:19:41 +00:00
										 |  |  | I_CARBON_EXTENSIONS : (buildmwproject, "CWIE", [ | 
					
						
							| 
									
										
										
										
											2001-03-01 23:15:01 +00:00
										 |  |  | 		(":Extensions:Imaging:_imaging.mcp", "_imaging.carbon"), | 
					
						
							| 
									
										
										
										
											2001-01-23 23:19:41 +00:00
										 |  |  | ##		(":Extensions:Imaging:_tkinter.mcp", "_tkinter.carbon"), | 
					
						
							|  |  |  | 		(":Extensions:img:Mac:imgmodules.mcp", "imgmodules.carbon"), | 
					
						
							|  |  |  | 	]), | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | I_APPLETS : (buildapplet, None, [ | 
					
						
							| 
									
										
										
										
											2001-02-17 23:31:48 +00:00
										 |  |  | 		(":Mac:scripts:EditPythonPrefs.py", "EditPythonPrefs", None), | 
					
						
							|  |  |  | 		(":Mac:scripts:BuildApplet.py", "BuildApplet", None), | 
					
						
							|  |  |  | 		(":Mac:scripts:BuildApplication.py", "BuildApplication", None), | 
					
						
							|  |  |  | 		(":Mac:scripts:ConfigurePython.py", "ConfigurePython", None), | 
					
						
							|  |  |  | 		(":Mac:scripts:ConfigurePython.py", "ConfigurePythonCarbon", "PythonInterpreterCarbon"), | 
					
						
							|  |  |  | 		(":Mac:scripts:ConfigurePython.py", "ConfigurePythonClassic", "PythonInterpreterClassic"), | 
					
						
							|  |  |  | 		(":Mac:Tools:IDE:PythonIDE.py", "Python IDE", None), | 
					
						
							|  |  |  | 		(":Mac:Tools:CGI:PythonCGISlave.py", ":Mac:Tools:CGI:PythonCGISlave", None), | 
					
						
							|  |  |  | 		(":Mac:Tools:CGI:BuildCGIApplet.py", ":Mac:Tools:CGI:BuildCGIApplet", None), | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 	]), | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											1997-09-01 15:37:07 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | def incbuildno(filename): | 
					
						
							|  |  |  | 	fp = open(filename) | 
					
						
							|  |  |  | 	line = fp.readline() | 
					
						
							|  |  |  | 	fp.close() | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2001-01-02 22:02:02 +00:00
										 |  |  | 	pat = re.compile('#define BUILD ([0-9]+)') | 
					
						
							|  |  |  | 	m = pat.search(line) | 
					
						
							|  |  |  | 	if not m or not m.group(1): | 
					
						
							| 
									
										
										
										
											1997-09-01 15:37:07 +00:00
										 |  |  | 		raise 'Incorrect macbuildno.h line', line | 
					
						
							| 
									
										
										
										
											2001-01-02 22:02:02 +00:00
										 |  |  | 	buildno = m.group(1) | 
					
						
							| 
									
										
										
										
											1997-09-01 15:37:07 +00:00
										 |  |  | 	new = string.atoi(buildno) + 1 | 
					
						
							|  |  |  | 	fp = open(filename, 'w') | 
					
						
							|  |  |  | 	fp.write('#define BUILD %d\n'%new) | 
					
						
							|  |  |  | 	fp.close() | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 				 | 
					
						
							|  |  |  | def main(): | 
					
						
							| 
									
										
										
										
											2001-08-27 21:41:23 +00:00
										 |  |  | 	macresource.need('DLOG', DIALOG_ID, 'fullbuild.rsrc') | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 	dir, ok = macfs.GetDirectory('Python source folder:') | 
					
						
							|  |  |  | 	if not ok: | 
					
						
							|  |  |  | 		sys.exit(0) | 
					
						
							|  |  |  | 	dir = dir.as_pathname() | 
					
						
							| 
									
										
										
										
											2001-08-16 20:39:17 +00:00
										 |  |  | 	# Set genpluginprojects to use this folder (slight hack) | 
					
						
							|  |  |  | 	genpluginprojects.PYTHONDIR = dir | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											1997-09-09 13:57:15 +00:00
										 |  |  | 	todo = handle_dialog(os.path.join(dir, MACBUILDNO)) | 
					
						
							|  |  |  | 		 | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 	instructions = [] | 
					
						
							|  |  |  | 	for i in todo: | 
					
						
							|  |  |  | 		instructions.append(BUILD_DICT[i]) | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 	for routine, arg, list in instructions: | 
					
						
							| 
									
										
										
										
											1997-05-07 15:52:12 +00:00
										 |  |  | 		routine(dir, arg, list) | 
					
						
							| 
									
										
										
										
											1997-05-06 16:15:32 +00:00
										 |  |  | 		 | 
					
						
							| 
									
										
										
										
											2001-01-03 11:12:21 +00:00
										 |  |  | 	if todo: | 
					
						
							|  |  |  | 		print "All done!" | 
					
						
							| 
									
										
										
										
											1995-09-01 12:03:32 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | if __name__ == '__main__': | 
					
						
							|  |  |  | 	main() | 
					
						
							|  |  |  | 	 |