Mercurial > cpython-lru_cache-weakref
annotate PC/python32gen.py @ 66755:062907f685ac
Automate build for python3.dll.
Package missing files.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Sun, 05 Dec 2010 23:07:58 +0000 |
| parents | |
| children | 1ea492ea40fd |
| rev | line source |
|---|---|
|
66755
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
1 # Generate python32stub.def out of python3.def |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
2 # The regular import library cannot be used, |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
3 # since it doesn't provide the right symbols for |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
4 # data forwarding |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
5 out = open("python32stub.def", "w") |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
6 out.write('LIBRARY "python32"\n') |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
7 out.write('EXPORTS\n') |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
8 |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
9 inp = open("python3.def") |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
10 inp.readline() |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
11 line = inp.readline() |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
12 assert line.strip()=='EXPORTS' |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
13 |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
14 for line in inp: |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
15 # SYM1=python32.SYM2[ DATA] |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
16 head, tail = line.split('.') |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
17 if 'DATA' in tail: |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
18 symbol, tail = tail.split(' ') |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
19 else: |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
20 symbol = tail.strip() |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
21 out.write(symbol+'\n') |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
22 |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
23 inp.close() |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
24 out.close() |
|
062907f685ac
Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
25 |
