Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c70815a

Browse files
committed
Disabled non-carbon builds (for the moment still optional) and made
these scripts work with the new precompiled headers.
1 parent 80a3e0a commit c70815a

2 files changed

Lines changed: 27 additions & 20 deletions

File tree

Mac/scripts/fullbuild.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# NOTE: You should proably make a copy of python with which to execute this
1010
# script, rebuilding running programs does not work...
1111

12+
CARBON_ONLY = 1
13+
1214
MACBUILDNO=":Mac:Include:macbuildno.h"
1315

1416
import os
@@ -24,15 +26,7 @@
2426
import aetools
2527
from Carbon import AppleEvents
2628

27-
OLDAESUPPORT = 0
28-
29-
if OLDAESUPPORT:
30-
from Metrowerks_Shell_Suite import Metrowerks_Shell_Suite
31-
from CodeWarrior_suite import CodeWarrior_suite
32-
from Metrowerks_Standard_Suite import Metrowerks_Standard_Suite
33-
from Required_Suite import Required_Suite
34-
else:
35-
import CodeWarrior
29+
import CodeWarrior
3630

3731
from Carbon import Res
3832
from Carbon import Dlg
@@ -74,18 +68,24 @@
7468

7569
N_BUTTONS=27
7670

77-
if OLDAESUPPORT:
78-
class MwShell(Metrowerks_Shell_Suite, CodeWarrior_suite, Metrowerks_Standard_Suite,
79-
Required_Suite, aetools.TalkTo):
80-
pass
71+
if 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+
]
8181
else:
82-
MwShell = CodeWarrior.CodeWarrior
83-
82+
BUTTONS_DISABLE = []
83+
8484
RUNNING=[]
8585

8686
def buildmwproject(top, creator, projects):
8787
"""Build projects with an MW compiler"""
88-
mgr = MwShell(creator, start=1)
88+
mgr = CodeWarrior.CodeWarrior(creator, start=1)
8989
mgr.send_timeout = AppleEvents.kNoTimeOut
9090

9191
failed = []
@@ -177,6 +177,9 @@ def handle_dialog(filename):
177177
d.SetDialogDefaultItem(I_OK)
178178
d.SetDialogCancelItem(I_CANCEL)
179179
results = [0]*N_BUTTONS
180+
for n in BUTTONS_DISABLE:
181+
ctl = d.GetDialogItemAsControl(n)
182+
ctl.HideControl()
180183
while 1:
181184
n = Dlg.ModalDialog(None)
182185
if n == I_OK:

Mac/scripts/genpluginprojects.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import os
44
import string
55

6+
CARBON_ONLY=1
7+
68
PYTHONDIR = sys.prefix
79
PROJECTDIR = os.path.join(PYTHONDIR, ":Mac:Build")
810
MODULEDIRS = [ # Relative to projectdirs
@@ -38,6 +40,8 @@ def genpluginproject(architecture, module,
3840
extraexportsymbols=[], outputdir=":::Lib:lib-dynload",
3941
libraryflags=None, stdlibraryflags=None, prefixname=None,
4042
initialize=None):
43+
if CARBON_ONLY and architecture == "ppc":
44+
return
4145
if architecture == "all":
4246
# For the time being we generate two project files. Not as nice as
4347
# a single multitarget project, but easier to implement for now.
@@ -82,7 +86,7 @@ def genpluginproject(architecture, module,
8286
if prefixname:
8387
pass
8488
elif architecture == "carbon":
85-
prefixname = "mwerks_carbonplugin_config.h"
89+
prefixname = "mwerks_shcarbon_pch"
8690
else:
8791
prefixname = "mwerks_plugin_config.h"
8892
dict = {
@@ -112,12 +116,12 @@ def genallprojects(force=0):
112116
genpluginproject("ppc", "pyexpat",
113117
sources=["pyexpat.c", "xmlparse.c", "xmlrole.c", "xmltok.c"],
114118
extradirs=[":::Modules:expat"],
115-
prefixname="mwerks_pyexpat_config.h"
119+
prefixname="mwerks_shared_config.h"
116120
)
117121
genpluginproject("carbon", "pyexpat",
118122
sources=["pyexpat.c", "xmlparse.c", "xmlrole.c", "xmltok.c"],
119123
extradirs=[":::Modules:expat"],
120-
prefixname="mwerks_carbonpyexpat_config.h"
124+
prefixname="mwerks_shcarbon_config.h"
121125
)
122126
genpluginproject("all", "zlib",
123127
libraries=["zlib.ppc.Lib"],
@@ -194,7 +198,7 @@ def genallprojects(force=0):
194198
genpluginproject("ppc", "_Win", libraries=["CarbonAccessors.o", "WindowsLib", "AppearanceLib"],
195199
libraryflags="Debug, WeakImport", outputdir="::Lib:Carbon")
196200
# Carbon Only?
197-
genpluginproject("carbon", "_CF", outputdir="::Lib:Carbon")
201+
genpluginproject("carbon", "_CF", sources=[":cf:_CFmodule.c", ":cf:pycfbridge.c"], outputdir="::Lib:Carbon")
198202
genpluginproject("carbon", "_CarbonEvt", outputdir="::Lib:Carbon")
199203
genpluginproject("carbon", "hfsplus")
200204

0 commit comments

Comments
 (0)