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

Skip to content

Commit c0af2aa

Browse files
committed
Add'l notes by Guido
1 parent 6522eb0 commit c0af2aa

1 file changed

Lines changed: 59 additions & 2 deletions

File tree

Mac/MPW/README

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,62 @@ at the end of the function "finddfa", line 46,
4545
try defining the preprocessor symbol "MPW_881_BUG" in
4646
file "Parser:acceler.c", function "fixstate", line 107.
4747

48-
XXX Note that you have to edit test_grammar.py because of a bug
49-
in int overflow det that I haven't found yet.
48+
---------------------------------------------------------------
49+
50+
Additional notes by Guido for Python 1.1:
51+
-----------------------------------------
52+
53+
I have tried this with MPW 3.2 and tweaked Richards Makefiles and
54+
buildall script slightly to work with Python 1.1. The same configure
55+
file now works for THINK C 6.0 and MPW 3.2. It is essential that
56+
'MPW' is defined when compiling with MPW; for both compilers,
57+
'HAVE_CONFIG_H' should also be defined. For MPW, the buildall script
58+
takes care of this.
59+
60+
I moved some files around or renamed them and modified the Makefiles
61+
accordingly. All Mac specific files are now in the Mac subdirectory,
62+
especially config.c, config.h, macmodule.c, and (new) macmain.c.
63+
64+
I wouldn't bother with the Grammar subdirectory or the Parser generator
65+
(Pgen) -- the needed Pgen output files are part of the distribution.
66+
67+
If the buildall script stops at a compilation error you are usually
68+
left in one of the subordinate directories.
69+
70+
Instead of using the buildall script you can also once execute the Set
71+
and Export commands listed at its top (which set compiler and linker
72+
options) and in each of the directories Mac, Parser, Python, Objects,
73+
Modules and finally the python rot directory, execute the two command
74+
75+
make >makefile.out
76+
makefile.out
77+
78+
Or you could execute
79+
80+
make
81+
82+
have a look at its output and execute selected commands from it.
83+
84+
The buildall script executes
85+
86+
Directory {Python}
87+
88+
which normally prints the current directory, because {Python}
89+
is not defined. If it is set to the python root directory,
90+
you could place buildall somewhere in your command search path and
91+
execute it from anywhere.
92+
93+
If you are mixing THINK C and MPW, you may experience weird errors
94+
in correct modules. These disappear when you throw away the
95+
module's .pyc file. The errors usually have to do with string
96+
literals containing '\n' or '\r'. The reason is an incompatibility
97+
between their handling of '\n' and '\r' -- in MPW C, '\n' actually is
98+
ASCII CR while '\r' is ASCII LF, which is the reverse situation from
99+
any other ASCII based C implementation. This behaviour is inherited
100+
by Python compiled with MPW C. This is normally not a problem,
101+
but *binary* files written by one system will be mis-interpreted
102+
by the other, and this is what happens to the .pyc files. There is no
103+
easy way to fix this in the source. (This is a real shame, since the
104+
format of .pyc files was carefully designed to be independent of
105+
byte order and integer size -- deviations in the ASCII character codes
106+
were never anticipated.)

0 commit comments

Comments
 (0)