blob: 28ad59f9574e3107d2fa9e732ae62825432c8546 [file] [log] [blame]
Jack Jansen6655c4e1995-09-01 12:03:32 +00001#
2# fullbuild creates everything that needs to be created before a
3# distribution can be made, and puts it all in the right place.
4#
5# It expects the projects to be in the places where Jack likes them:
Jack Jansenfaad9951997-09-01 15:37:07 +00006# in directories named like 'build.mac'. That is fixable,
Jack Jansen6655c4e1995-09-01 12:03:32 +00007# however.
8#
9# NOTE: You should proably make a copy of python with which to execute this
10# script, rebuilding running programs does not work...
11
Jack Jansenc70815a2002-06-26 22:06:08 +000012CARBON_ONLY = 1
13
Jack Jansenfaad9951997-09-01 15:37:07 +000014MACBUILDNO=":Mac:Include:macbuildno.h"
15
Jack Jansen6655c4e1995-09-01 12:03:32 +000016import os
17import sys
Jack Jansen6fa2dc72003-03-21 12:56:27 +000018import Carbon.File
Jack Jansen1023dff1996-02-21 15:28:49 +000019import MacOS
Jack Jansenf04fa721996-04-10 14:51:14 +000020import EasyDialogs
Jack Jansenbe614ee2001-01-02 22:02:02 +000021import re
Jack Jansenfaad9951997-09-01 15:37:07 +000022import string
Jack Jansene791a642001-08-16 20:39:17 +000023import genpluginprojects
Jack Jansen3c06b9a2001-08-27 21:41:23 +000024import macresource
Jack Jansen6655c4e1995-09-01 12:03:32 +000025
Jack Jansen6655c4e1995-09-01 12:03:32 +000026import aetools
Jack Jansen5a6fdcd2001-08-25 12:15:04 +000027from Carbon import AppleEvents
Jack Jansen87426b92000-08-17 22:12:12 +000028
Jack Jansenc70815a2002-06-26 22:06:08 +000029import CodeWarrior
Jack Jansen0f00c5e1997-05-06 16:15:32 +000030
Jack Jansen5a6fdcd2001-08-25 12:15:04 +000031from Carbon import Res
32from Carbon import Dlg
Jack Jansen6655c4e1995-09-01 12:03:32 +000033
Jack Jansen490ec9c1998-07-31 09:45:27 +000034import buildtools
Jack Jansen0f00c5e1997-05-06 16:15:32 +000035import cfmfile
36
37# Dialog resource. Note that the item numbers should correspond
38# to those in the DITL resource. Also note that the order is important:
39# things are built in this order, so there should be no forward dependencies.
40DIALOG_ID = 512
41
42I_OK=1
43I_CANCEL=2
Jack Jansene56e87d2001-01-03 11:12:21 +000044# label 3
45I_PPC_EXTLIBS=4
46I_GEN_PROJECTS=5
Jack Jansen1f5cd702001-01-21 22:25:11 +000047I_GEN_PROJECTS_FORCE=6
48I_GEN_IMGPROJECTS=7
49I_GEN_IMGPROJECTS_FORCE=8
50I_INC_BUILDNO=9
51# label 10
52I_PPC_CORE=11
53I_PPC_PLUGINS=12
54I_PPC_EXTENSIONS=13
55# label 14
56I_CARBON_CORE=15
57I_CARBON_PLUGINS=16
58I_CARBON_EXTENSIONS=17
Jack Jansen5288c472001-02-12 14:46:53 +000059I_INTERPRETER=18
60# label 19
61I_PPC_FULL=20
62I_PPC_SMALL=21
63# label 22
64I_CARBON_FULL=23
65I_CARBON_SMALL=24
66# label 25
67I_APPLETS=26
Jack Jansen0f00c5e1997-05-06 16:15:32 +000068
Jack Jansen5288c472001-02-12 14:46:53 +000069N_BUTTONS=27
Jack Jansen6655c4e1995-09-01 12:03:32 +000070
Jack Jansenc70815a2002-06-26 22:06:08 +000071if CARBON_ONLY:
72 BUTTONS_DISABLE = [
73 I_PPC_EXTLIBS,
74 I_PPC_CORE,
75 I_PPC_PLUGINS,
76 I_PPC_EXTENSIONS,
77 I_INTERPRETER,
78 I_PPC_FULL,
79 I_PPC_SMALL,
80 ]
Jack Jansen87426b92000-08-17 22:12:12 +000081else:
Jack Jansenc70815a2002-06-26 22:06:08 +000082 BUTTONS_DISABLE = []
83
Jack Jansenf04fa721996-04-10 14:51:14 +000084RUNNING=[]
Jack Jansen6655c4e1995-09-01 12:03:32 +000085
86def buildmwproject(top, creator, projects):
87 """Build projects with an MW compiler"""
Jack Jansenc70815a2002-06-26 22:06:08 +000088 mgr = CodeWarrior.CodeWarrior(creator, start=1)
Jack Jansen1023dff1996-02-21 15:28:49 +000089 mgr.send_timeout = AppleEvents.kNoTimeOut
90
Jack Jansenbc66f952000-07-24 19:45:07 +000091 failed = []
Jack Jansen6655c4e1995-09-01 12:03:32 +000092 for file in projects:
Jack Jansen82bfde91997-08-27 14:10:29 +000093 if type(file) == type(()):
94 file, target = file
95 else:
96 target = ''
Jack Jansen6655c4e1995-09-01 12:03:32 +000097 file = os.path.join(top, file)
Just van Rossum2607a441999-01-30 18:27:12 +000098 try:
Jack Jansen6fa2dc72003-03-21 12:56:27 +000099 fss = Carbon.File.FSSpec(file)
Jack Jansene56e87d2001-01-03 11:12:21 +0000100 except MacOS.Error:
Just van Rossum2607a441999-01-30 18:27:12 +0000101 print '** file not found:', file
102 continue
Jack Jansen82bfde91997-08-27 14:10:29 +0000103 print 'Building', file, target
Just van Rossum2607a441999-01-30 18:27:12 +0000104 try:
105 mgr.open(fss)
106 except aetools.Error, detail:
107 print '**', detail, file
108 continue
Jack Jansen82bfde91997-08-27 14:10:29 +0000109 if target:
110 try:
111 mgr.Set_Current_Target(target)
112 except aetools.Error, arg:
113 print '**', file, target, 'Cannot select:', arg
Jack Jansen1023dff1996-02-21 15:28:49 +0000114 try:
115 mgr.Make_Project()
Jack Jansenb9e5e141996-09-20 15:30:52 +0000116 except aetools.Error, arg:
Jack Jansen82bfde91997-08-27 14:10:29 +0000117 print '**', file, target, 'Failed:', arg
Jack Jansenbc66f952000-07-24 19:45:07 +0000118 failed.append(fss)
Jack Jansen6655c4e1995-09-01 12:03:32 +0000119 mgr.Close_Project()
Jack Jansenbc66f952000-07-24 19:45:07 +0000120 if failed:
121 print 'Open failed projects and exit?',
122 rv = sys.stdin.readline()
123 if rv[0] in ('y', 'Y'):
124 for fss in failed:
125 mgr.open(fss)
126 sys.exit(0)
Jack Jansenf04fa721996-04-10 14:51:14 +0000127## mgr.quit()
Jack Jansen6655c4e1995-09-01 12:03:32 +0000128
129def buildapplet(top, dummy, list):
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000130 """Create python applets"""
Jack Jansencbb5d492001-02-17 23:31:48 +0000131 for src, dst, tmpl in list:
132 template = buildtools.findtemplate(tmpl)
Jack Jansen6655c4e1995-09-01 12:03:32 +0000133 if src[-3:] != '.py':
134 raise 'Should end in .py', src
135 base = os.path.basename(src)
Jack Jansen6655c4e1995-09-01 12:03:32 +0000136 src = os.path.join(top, src)
Just van Rossum9d609b41999-02-01 01:21:18 +0000137 dst = os.path.join(top, dst)
Jack Jansen6655c4e1995-09-01 12:03:32 +0000138 try:
139 os.unlink(dst)
140 except os.error:
141 pass
142 print 'Building applet', dst
Jack Jansencbb5d492001-02-17 23:31:48 +0000143 try:
144 buildtools.process(template, src, dst, 1)
145 except buildtools.BuildError, arg:
146 print '**', dst, arg
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000147
Jack Jansen1f5cd702001-01-21 22:25:11 +0000148def buildprojectfile(top, arg, list):
Jack Jansene56e87d2001-01-03 11:12:21 +0000149 """Create CodeWarrior project files with a script"""
150 for folder, module, routine in list:
151 print "Generating project files with", module
152 sys.path.insert(0, os.path.join(top, folder))
153 m = __import__(module)
154 r = getattr(m, routine)
Jack Jansen1f5cd702001-01-21 22:25:11 +0000155 r(arg)
Jack Jansene56e87d2001-01-03 11:12:21 +0000156 del sys.path[0]
157
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000158def buildfat(top, dummy, list):
159 """Build fat binaries"""
160 for dst, src1, src2 in list:
161 dst = os.path.join(top, dst)
162 src1 = os.path.join(top, src1)
163 src2 = os.path.join(top, src2)
164 print 'Building fat binary', dst
165 cfmfile.mergecfmfiles((src1, src2), dst)
166
Jack Jansen5288c472001-02-12 14:46:53 +0000167def buildcopy(top, dummy, list):
168 import macostools
169 for src, dst in list:
170 src = os.path.join(top, src)
171 dst = os.path.join(top, dst)
Jack Jansenc1463c982001-03-06 22:46:25 +0000172 macostools.copy(src, dst, forcetype="APPL")
Jack Jansen5288c472001-02-12 14:46:53 +0000173
Jack Jansen1892cf02002-06-27 22:09:19 +0000174def buildsetup(top, dummy, list):
175 print 'Building extensions with setup.py ', ' '.join(list)
176 argv = ['setup.py'] + list[:]
177 save_argv = sys.argv
178 sys.argv = argv
179 sys.path.insert(0, top)
180 m = __import__('setup')
181 r = getattr(m, 'main')
182 r()
183 del sys.path[0]
184 sys.argv = save_argv
185
186def buildcarbonplugins(top, dummy1, dummy2):
187## XXXX Need to convert pathnames, I guess, and adapt distutils Mac-specific
188## code to not call GetArgv if not needed.
189## buildsetup(top, None, [
190## '--dry_run',
191## 'install',
192## '--prefix=%s' % sys.prefix,
193## '--install-scripts=%s' % os.path.join(sys.prefix, 'Scripts'),
194## '--install-platlib=%s' % os.path.join(sys.prefix, 'Lib', 'lib-dynload')
195## ])
196 buildmwproject(top, "CWIE", [
Jack Jansen6fa2dc72003-03-21 12:56:27 +0000197 (":Mac:Build:_csv.carbon.mcp", "_csv.carbon"),
Jack Jansen1892cf02002-06-27 22:09:19 +0000198 (":Mac:Build:_weakref.carbon.mcp", "_weakref.carbon"),
199 (":Mac:Build:_symtable.carbon.mcp", "_symtable.carbon"),
200 (":Mac:Build:_testcapi.carbon.mcp", "_testcapi.carbon"),
201 (":Mac:Build:_hotshot.carbon.mcp", "_hotshot.carbon"),
202 (":Mac:Build:xx.carbon.mcp", "xx.carbon"),
203 (":Mac:Build:xxsubtype.carbon.mcp", "xxsubtype.carbon"),
204 (":Mac:Build:pyexpat.carbon.mcp", "pyexpat.carbon"),
205 (":Mac:Build:calldll.carbon.mcp", "calldll.carbon"),
Jack Jansen3e828722003-01-08 16:27:44 +0000206 (":Mac:Build:datetime.carbon.mcp", "datetime.carbon"),
Jack Jansen1892cf02002-06-27 22:09:19 +0000207 (":Mac:Build:gdbm.carbon.mcp", "gdbm.carbon"),
208 (":Mac:Build:icglue.carbon.mcp", "icglue.carbon"),
209 (":Mac:Build:waste.carbon.mcp", "waste.carbon"),
210 (":Mac:Build:zlib.carbon.mcp", "zlib.carbon"),
211 (":Mac:Build:hfsplus.carbon.mcp", "hfsplus.carbon"),
Jack Jansen1892cf02002-06-27 22:09:19 +0000212 (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"),
213 (":Mac:Build:_AE.carbon.mcp", "_AE.carbon"),
Jack Jansen25a8f0d2002-09-06 22:59:00 +0000214 (":Mac:Build:_AH.carbon.mcp", "_AH.carbon"),
Jack Jansen1892cf02002-06-27 22:09:19 +0000215 (":Mac:Build:_App.carbon.mcp", "_App.carbon"),
216 (":Mac:Build:_CF.carbon.mcp", "_CF.carbon"),
217 (":Mac:Build:_CG.carbon.mcp", "_CG.carbon"),
218 (":Mac:Build:_CarbonEvt.carbon.mcp", "_CarbonEvt.carbon"),
219 (":Mac:Build:_Cm.carbon.mcp", "_Cm.carbon"),
220 (":Mac:Build:_Ctl.carbon.mcp", "_Ctl.carbon"),
221 (":Mac:Build:_Dlg.carbon.mcp", "_Dlg.carbon"),
222 (":Mac:Build:_Drag.carbon.mcp", "_Drag.carbon"),
223 (":Mac:Build:_Evt.carbon.mcp", "_Evt.carbon"),
Jack Jansen9ea729c2002-12-13 23:34:03 +0000224 (":Mac:Build:_File.carbon.mcp", "_File.carbon"),
Jack Jansen1892cf02002-06-27 22:09:19 +0000225 (":Mac:Build:_Fm.carbon.mcp", "_Fm.carbon"),
Jack Jansen9ea729c2002-12-13 23:34:03 +0000226 (":Mac:Build:_Folder.carbon.mcp", "_Folder.carbon"),
227 (":Mac:Build:_Help.carbon.mcp", "_Help.carbon"),
Jack Jansen3bd3fed2002-08-05 14:12:24 +0000228 (":Mac:Build:_IBCarbon.carbon.mcp", "_IBCarbon.carbon"),
Jack Jansen1892cf02002-06-27 22:09:19 +0000229 (":Mac:Build:_Icn.carbon.mcp", "_Icn.carbon"),
230 (":Mac:Build:_List.carbon.mcp", "_List.carbon"),
231 (":Mac:Build:_Menu.carbon.mcp", "_Menu.carbon"),
232 (":Mac:Build:_Mlte.carbon.mcp", "_Mlte.carbon"),
233 (":Mac:Build:_Qd.carbon.mcp", "_Qd.carbon"),
234 (":Mac:Build:_Qdoffs.carbon.mcp", "_Qdoffs.carbon"),
235 (":Mac:Build:_Qt.carbon.mcp", "_Qt.carbon"),
236 (":Mac:Build:_Res.carbon.mcp", "_Res.carbon"),
237 (":Mac:Build:_Scrap.carbon.mcp", "_Scrap.carbon"),
238 (":Mac:Build:_Snd.carbon.mcp", "_Snd.carbon"),
239 (":Mac:Build:_Sndihooks.carbon.mcp", "_Sndihooks.carbon"),
240 (":Mac:Build:_TE.carbon.mcp", "_TE.carbon"),
241 (":Mac:Build:_Win.carbon.mcp", "_Win.carbon"),
242 ])
243
Jack Jansen675cda01997-09-09 13:57:15 +0000244def handle_dialog(filename):
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000245 """Handle selection dialog, return list of selected items"""
246 d = Dlg.GetNewDialog(DIALOG_ID, -1)
247 d.SetDialogDefaultItem(I_OK)
248 d.SetDialogCancelItem(I_CANCEL)
249 results = [0]*N_BUTTONS
Jack Jansenc70815a2002-06-26 22:06:08 +0000250 for n in BUTTONS_DISABLE:
251 ctl = d.GetDialogItemAsControl(n)
252 ctl.HideControl()
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000253 while 1:
254 n = Dlg.ModalDialog(None)
255 if n == I_OK:
256 break
257 if n == I_CANCEL:
258 return []
Jack Jansen675cda01997-09-09 13:57:15 +0000259 if n == I_INC_BUILDNO:
260 incbuildno(filename)
261 continue
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000262 if n < len(results):
263 results[n] = (not results[n])
Jack Jansenc9b1e901999-12-24 13:39:23 +0000264 ctl = d.GetDialogItemAsControl(n)
265 ctl.SetControlValue(results[n])
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000266 rv = []
267 for i in range(len(results)):
268 if results[i]:
269 rv.append(i)
270 return rv
Jack Jansen6655c4e1995-09-01 12:03:32 +0000271
272#
273# The build instructions. Entries are (routine, arg, list-of-files)
274# XXXX We could also include the builds for stdwin and such here...
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000275BUILD_DICT = {
Jack Jansen1f5cd702001-01-21 22:25:11 +0000276I_GEN_PROJECTS : (buildprojectfile, 0, [
Jack Jansene56e87d2001-01-03 11:12:21 +0000277 (":Mac:scripts", "genpluginprojects", "genallprojects")
278 ]),
279
Jack Jansen1f5cd702001-01-21 22:25:11 +0000280I_GEN_PROJECTS_FORCE : (buildprojectfile, 1, [
281 (":Mac:scripts", "genpluginprojects", "genallprojects")
282 ]),
283
284I_GEN_IMGPROJECTS : (buildprojectfile, 0, [
Jack Jansene56e87d2001-01-03 11:12:21 +0000285 (":Extensions:img:Mac", "genimgprojects", "genallprojects")
286 ]),
287
Jack Jansen1f5cd702001-01-21 22:25:11 +0000288I_GEN_IMGPROJECTS_FORCE : (buildprojectfile, 1, [
289 (":Extensions:img:Mac", "genimgprojects", "genallprojects")
290 ]),
291
Jack Jansen5288c472001-02-12 14:46:53 +0000292I_INTERPRETER : (buildcopy, None, [
293 ("PythonInterpreterCarbon", "PythonInterpreter"),
294 ]),
295
Jack Jansen1f5cd702001-01-21 22:25:11 +0000296I_PPC_CORE : (buildmwproject, "CWIE", [
Jack Jansena5d384d2000-12-03 22:36:42 +0000297 (":Mac:Build:PythonCore.mcp", "PythonCore"),
Jack Jansen5288c472001-02-12 14:46:53 +0000298 (":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterClassic"),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000299 ]),
300
Jack Jansen1f5cd702001-01-21 22:25:11 +0000301I_CARBON_CORE : (buildmwproject, "CWIE", [
302 (":Mac:Build:PythonCore.mcp", "PythonCoreCarbon"),
303 (":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterCarbon"),
304 ]),
305
Jack Jansene56e87d2001-01-03 11:12:21 +0000306I_PPC_EXTLIBS : (buildmwproject, "CWIE", [
307## (":Mac:Build:buildlibs.mcp", "buildlibs ppc plus tcl/tk"),
308 (":Mac:Build:buildlibs.mcp", "buildlibs ppc"),
309 ]),
310
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000311I_PPC_PLUGINS : (buildmwproject, "CWIE", [
Jack Jansen5288c472001-02-12 14:46:53 +0000312 (":Mac:Build:_weakref.mcp", "_weakref.ppc"),
313 (":Mac:Build:_symtable.mcp", "_symtable.ppc"),
314 (":Mac:Build:_testcapi.mcp", "_testcapi.ppc"),
Jack Jansen6f1da002001-10-23 22:23:44 +0000315 (":Mac:Build:_hotshot.mcp", "_hotshot.ppc"),
Jack Jansen7c100082001-08-29 22:08:06 +0000316 (":Mac:Build:xx.mcp", "xx.ppc"),
317 (":Mac:Build:xxsubtype.mcp", "xxsubtype.ppc"),
Jack Jansena5d384d2000-12-03 22:36:42 +0000318 (":Mac:Build:pyexpat.mcp", "pyexpat.ppc"),
319 (":Mac:Build:calldll.mcp", "calldll.ppc"),
320 (":Mac:Build:ctb.mcp", "ctb.ppc"),
321 (":Mac:Build:gdbm.mcp", "gdbm.ppc"),
322 (":Mac:Build:icglue.mcp", "icglue.ppc"),
323 (":Mac:Build:macspeech.mcp", "macspeech.ppc"),
324 (":Mac:Build:waste.mcp", "waste.ppc"),
325 (":Mac:Build:zlib.mcp", "zlib.ppc"),
326## (":Mac:Build:_tkinter.mcp", "_tkinter.ppc"),
Jack Jansen07d69f62001-01-01 21:51:33 +0000327 (":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"),
Jack Jansena5d384d2000-12-03 22:36:42 +0000328 (":Mac:Build:ColorPicker.mcp", "ColorPicker.ppc"),
329 (":Mac:Build:Printing.mcp", "Printing.ppc"),
Jack Jansen77105a92001-08-23 13:51:46 +0000330 (":Mac:Build:_AE.mcp", "_AE.ppc"),
331 (":Mac:Build:_App.mcp", "_App.ppc"),
332 (":Mac:Build:_Cm.mcp", "_Cm.ppc"),
333 (":Mac:Build:_Ctl.mcp", "_Ctl.ppc"),
334 (":Mac:Build:_Dlg.mcp", "_Dlg.ppc"),
335 (":Mac:Build:_Drag.mcp", "_Drag.ppc"),
336 (":Mac:Build:_Evt.mcp", "_Evt.ppc"),
337 (":Mac:Build:_Fm.mcp", "_Fm.ppc"),
338 (":Mac:Build:_Help.mcp", "_Help.ppc"),
339 (":Mac:Build:_Icn.mcp", "_Icn.ppc"),
340 (":Mac:Build:_List.mcp", "_List.ppc"),
341 (":Mac:Build:_Menu.mcp", "_Menu.ppc"),
342 (":Mac:Build:_Mlte.mcp", "_Mlte.ppc"),
343 (":Mac:Build:_Qd.mcp", "_Qd.ppc"),
344 (":Mac:Build:_Qdoffs.mcp", "_Qdoffs.ppc"),
345 (":Mac:Build:_Qt.mcp", "_Qt.ppc"),
346 (":Mac:Build:_Res.mcp", "_Res.ppc"),
347 (":Mac:Build:_Scrap.mcp", "_Scrap.ppc"),
348 (":Mac:Build:_Snd.mcp", "_Snd.ppc"),
349 (":Mac:Build:_Sndihooks.mcp", "_Sndihooks.ppc"),
350 (":Mac:Build:_TE.mcp", "_TE.ppc"),
351 (":Mac:Build:_Win.mcp", "_Win.ppc"),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000352 ]),
353
Jack Jansen1892cf02002-06-27 22:09:19 +0000354I_CARBON_PLUGINS : (buildcarbonplugins, None, []),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000355
Jack Jansen131c2882001-01-24 14:06:35 +0000356I_PPC_FULL : (buildmwproject, "CWIE", [
357 (":Mac:Build:PythonStandalone.mcp", "PythonStandalone"),
358 ]),
359
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000360I_PPC_SMALL : (buildmwproject, "CWIE", [
Jack Jansena5d384d2000-12-03 22:36:42 +0000361 (":Mac:Build:PythonStandSmall.mcp", "PythonStandSmall"),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000362 ]),
363
Jack Jansen5288c472001-02-12 14:46:53 +0000364I_CARBON_FULL : (buildmwproject, "CWIE", [
365 (":Mac:Build:PythonStandalone.mcp", "PythonCarbonStandalone"),
366 ]),
367
368I_CARBON_SMALL : (buildmwproject, "CWIE", [
369 (":Mac:Build:PythonStandSmall.mcp", "PythonStandSmallCarbon"),
370 ]),
371
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000372I_PPC_EXTENSIONS : (buildmwproject, "CWIE", [
Jack Jansena5d384d2000-12-03 22:36:42 +0000373 (":Extensions:Imaging:_imaging.mcp", "_imaging.ppc"),
374## (":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"),
Jack Jansen7b7e7132001-01-23 23:19:41 +0000375 (":Extensions:img:Mac:imgmodules.mcp", "imgmodules.ppc"),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000376 ]),
377
Jack Jansen7b7e7132001-01-23 23:19:41 +0000378I_CARBON_EXTENSIONS : (buildmwproject, "CWIE", [
Jack Jansena6478072001-03-01 23:15:01 +0000379 (":Extensions:Imaging:_imaging.mcp", "_imaging.carbon"),
Jack Jansen7b7e7132001-01-23 23:19:41 +0000380## (":Extensions:Imaging:_tkinter.mcp", "_tkinter.carbon"),
381 (":Extensions:img:Mac:imgmodules.mcp", "imgmodules.carbon"),
Jack Jansen7b7e7132001-01-23 23:19:41 +0000382 ]),
383
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000384I_APPLETS : (buildapplet, None, [
Jack Jansencbb5d492001-02-17 23:31:48 +0000385 (":Mac:scripts:EditPythonPrefs.py", "EditPythonPrefs", None),
386 (":Mac:scripts:BuildApplet.py", "BuildApplet", None),
387 (":Mac:scripts:BuildApplication.py", "BuildApplication", None),
388 (":Mac:scripts:ConfigurePython.py", "ConfigurePython", None),
Jack Jansenfd372aa2002-08-22 23:37:00 +0000389## (":Mac:scripts:ConfigurePython.py", "ConfigurePythonCarbon", "PythonInterpreterCarbon"),
390## (":Mac:scripts:ConfigurePython.py", "ConfigurePythonClassic", "PythonInterpreterClassic"),
Jack Jansencbb5d492001-02-17 23:31:48 +0000391 (":Mac:Tools:IDE:PythonIDE.py", "Python IDE", None),
392 (":Mac:Tools:CGI:PythonCGISlave.py", ":Mac:Tools:CGI:PythonCGISlave", None),
393 (":Mac:Tools:CGI:BuildCGIApplet.py", ":Mac:Tools:CGI:BuildCGIApplet", None),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000394 ]),
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000395}
Jack Jansenfaad9951997-09-01 15:37:07 +0000396
397def incbuildno(filename):
398 fp = open(filename)
399 line = fp.readline()
400 fp.close()
401
Jack Jansenbe614ee2001-01-02 22:02:02 +0000402 pat = re.compile('#define BUILD ([0-9]+)')
403 m = pat.search(line)
404 if not m or not m.group(1):
Jack Jansenfaad9951997-09-01 15:37:07 +0000405 raise 'Incorrect macbuildno.h line', line
Jack Jansenbe614ee2001-01-02 22:02:02 +0000406 buildno = m.group(1)
Jack Jansenfaad9951997-09-01 15:37:07 +0000407 new = string.atoi(buildno) + 1
408 fp = open(filename, 'w')
409 fp.write('#define BUILD %d\n'%new)
410 fp.close()
Jack Jansen6655c4e1995-09-01 12:03:32 +0000411
412def main():
Jack Jansen3c06b9a2001-08-27 21:41:23 +0000413 macresource.need('DLOG', DIALOG_ID, 'fullbuild.rsrc')
Jack Jansenb340acf2003-01-26 21:40:00 +0000414 dir = EasyDialogs.AskFolder(message='Python source folder:')
415 if not dir:
Jack Jansen6655c4e1995-09-01 12:03:32 +0000416 sys.exit(0)
Jack Jansene791a642001-08-16 20:39:17 +0000417 # Set genpluginprojects to use this folder (slight hack)
418 genpluginprojects.PYTHONDIR = dir
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000419
Jack Jansen675cda01997-09-09 13:57:15 +0000420 todo = handle_dialog(os.path.join(dir, MACBUILDNO))
421
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000422 instructions = []
423 for i in todo:
424 instructions.append(BUILD_DICT[i])
425
426 for routine, arg, list in instructions:
Jack Jansen8b4c9871997-05-07 15:52:12 +0000427 routine(dir, arg, list)
Jack Jansen0f00c5e1997-05-06 16:15:32 +0000428
Jack Jansene56e87d2001-01-03 11:12:21 +0000429 if todo:
430 print "All done!"
Jack Jansen6655c4e1995-09-01 12:03:32 +0000431
432if __name__ == '__main__':
433 main()
434