Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e8afe516
Kaydet (Commit)
e8afe516
authored
Eyl 28, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
New set of files for the OS/2 port by Jeff Rush.
üst
be70450f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
154 additions
and
135 deletions
+154
-135
_tkinter.def
PC/os2vacpp/_tkinter.def
+8
-0
config.c
PC/os2vacpp/config.c
+0
-2
config.h
PC/os2vacpp/config.h
+0
-0
makefile
PC/os2vacpp/makefile
+32
-19
python.def
PC/os2vacpp/python.def
+0
-0
readme.txt
PC/os2vacpp/readme.txt
+114
-114
No files found.
PC/os2vacpp/_tkinter.def
0 → 100644
Dosyayı görüntüle @
e8afe516
LIBRARY _TKINTER INITINSTANCE TERMINSTANCE
DESCRIPTION 'Python Extension DLL v1.0 for Access to Tcl/Tk Environment'
PROTMODE
DATA MULTIPLE NONSHARED
EXPORTS
init_tkinter
PC/os2vacpp/config.c
Dosyayı görüntüle @
e8afe516
...
...
@@ -50,7 +50,6 @@ extern void initos2();
extern
void
initoperator
();
extern
void
initposix
();
extern
void
initregex
();
extern
void
initreop
();
extern
void
initrgbimg
();
extern
void
initrotor
();
extern
void
initsignal
();
...
...
@@ -97,7 +96,6 @@ struct _inittab _PyImport_Inittab[] = {
#endif
{
"operator"
,
initoperator
},
{
"regex"
,
initregex
},
{
"reop"
,
initreop
},
// {"rgbimg", initrgbimg},
// {"rotor", initrotor},
{
"signal"
,
initsignal
},
...
...
PC/os2vacpp/config.h
Dosyayı görüntüle @
e8afe516
This diff is collapsed.
Click to expand it.
PC/os2vacpp/makefile
Dosyayı görüntüle @
e8afe516
...
...
@@ -26,6 +26,7 @@
#
# History (Most Recent First)
#
# 26-Sep-98 jrr Retested and adjusted for building w/Python 1.5.2a1
# 20-Nov-97 jrr Cleaned Up for Applying to Distribution
# 29-Oct-97 jrr Modified for Use with Python 1.5 Alpha 4
# 03-Aug-96 jrr Original for Use with Python 1.4 Release
...
...
@@ -48,18 +49,24 @@ ERRS = make.out
# Where to Find the IBM TCP/IP Socket Includes and Libraries
OS2TCPIP
=
C:
\M
PTN
# Where to Find the Tcl/Tk Base Directory for Libs/Includes
TCLTK
=
D:
\T
clTk
TCLBASE
=
D:
\T
cl7.6
\O
S2
TKBASE
=
D:
\T
k4.2
\O
S2
# Where to Put the .OBJ Files, To Keep Them Out of the Way
PATHOBJ
=
obj
# Search Path for Include Files
PROJINCLUDE
=
.
;
$(OS2TCPIP)
\I
nclude
;
$(PY_INCLUDES)
PROJINCLUDE
=
.
;
$(
TCLBASE)
;
$(TKBASE)
;
$(
OS2TCPIP)
\I
nclude
;
$(PY_INCLUDES)
# Place to Search for Sources re OpusMAKE Dependency Generator (Commercial)
MKMF_SRCS
=
$(PY_MODULES)
\*
.c
$(PY_OBJECTS)
\*
.c
$(PY_PARSER)
\*
.c
$(PY_PYTHON)
\*
.c
#.HDRPATH.c := $(PROJINCLUDE,;= ) $(.HDRPATH.c)
#.PATH.c = .;$(PY_MODULES);$(PY_OBJECTS);$(PY_PARSER);$(PY_PYTHON)
OTHERLIBS
=
$(OS2TCPIP)
\l
ib
\s
o32dll.lib
$(OS2TCPIP)
\l
ib
\t
cp32dll.lib
OTHERLIBS
=
$(OS2TCPIP)
\l
ib
\s
o32dll.lib
$(OS2TCPIP)
\l
ib
\t
cp32dll.lib
\
$(TCLTK)
\L
ib
\T
cl76.lib
$(TCLTK)
\L
ib
\T
k42.lib
#################
# Inference Rules
...
...
@@ -171,7 +178,6 @@ MODULES = \
$(PATHOBJ)
\P
osixModule.obj
\
$(PATHOBJ)
\R
egexModule.obj
\
$(PATHOBJ)
\R
egExpr.obj
\
$(PATHOBJ)
\R
eopModule.obj
\
$(PATHOBJ)
\S
electModule.obj
\
$(PATHOBJ)
\S
ignalModule.obj
\
$(PATHOBJ)
\S
ocketModule.obj
\
...
...
@@ -204,6 +210,8 @@ _GEN = /G4 /Gm /Gd-
# /G4 = Generate Code for 486 (Use 386 for Debugger)
# /Gm = Use Multithread Runtime
# /Gd = Dynamically Load Runtime
# /Ms = Use _System Calling Convention (vs _Optlink)
# (to allow non-VAC++ code to call into Python15.dll)
_OPT
=
/O /Gl
# /O = Enable Speed-Optimizations
...
...
@@ -238,7 +246,8 @@ CFLAGS = $(_BASE) $(_GEN) $(_OPT) $(_DBG) $(_OUT) $(_EXE) /Ss
###################
# Primary Target(s)
###################
All
:
obj noise PyCore.lib Python15.lib Python15.dll Python.exe PGen.exe
All
:
obj noise PyCore.lib Python15.lib PGen.exe
\
Python.exe PythonPM.exe Python15.dll _tkinter.dll
Modules
:
$(MODULES)
Objects
:
$(OBJECTS)
...
...
@@ -257,6 +266,15 @@ noise:
#
##############
# Python Extension DLL: Tcl/Tk Interface
_tkinter.dll
:
$(PATHOBJ)
\_
tkinter.obj Python15.lib _tkinter.def
@
Echo Linking
$@
As DLL
@
$(CC)
$(CFLAGS)
/B
"/NOE"
$(_DLL)
/Fe
$@
$(_MAP)
$*
*
$(OTHERLIBS)
>>
$(ERRS)
$(PATHOBJ)\_tkinter.obj
:
$(PY_MODULES)
\_
tkinter.c
@
Echo Compiling
$*
*
@
$(CC)
-c
$(CFLAGS)
$(_DLL)
-Fo
$@
$*
*
>>
$(ERRS)
# Object Library of All Essential Python Routines
PyCore.lib
:
$(MODULES) $(OBJECTS) $(PARSER) $(PYTHON) $(PATHOBJ)
\C
onfig.obj
@
Echo Adding Updated Object Files to Link Library
$@
...
...
@@ -265,6 +283,8 @@ PyCore.lib: $(MODULES) $(OBJECTS) $(PARSER) $(PYTHON) $(PATHOBJ)\Config.obj
Python15.dll
:
$(PATHOBJ)
\C
ompile.obj PyCore.lib Python.def
@
Echo Linking
$@
As DLL
@
$(CC)
$(CFLAGS)
/B
"/NOE"
$(_DLL)
/Fe
$@
$(_MAP)
$*
*
$(OTHERLIBS)
>>
$(ERRS)
@
Echo Compressing
$@
with LxLite
@
lxlite
$@
# IBM Linker Requires One Explicit .OBJ To Build a .DLL from a .LIB
$(PATHOBJ)\Compile.obj
:
$(PY_PYTHON)
\C
ompile.c
...
...
@@ -277,10 +297,15 @@ Python15.lib: Python.def
@
IMPLIB /NOLOGO /NOIGNORE
$@
$*
*
>>
$(ERRS)
@
ILIB /NOLOGO /CONVFORMAT /NOEXTDICTIONARY /NOBROWSE /NOBACKUP
$@
;
>>
$(ERRS)
# Small Program to Start Interpreter in Python15.dll
# Small
Command-Line
Program to Start Interpreter in Python15.dll
Python.exe
:
$(PATHOBJ)
\P
ython.obj Python15.lib
@
Echo Linking
$@
As EXE
@
$(CC)
$(CFLAGS)
$(_EXE)
/B
"/STACK:360000"
/Fe
$@
$(_MAP)
$*
*
$(OTHERLIBS)
>>
$(ERRS)
@
$(CC)
$(CFLAGS)
$(_EXE)
/B
"/PM:VIO /STACK:360000"
/Fe
$@
$(_MAP)
$*
*
$(OTHERLIBS)
>>
$(ERRS)
# Small PM-GUI Program to Start Interpreter in Python15.dll
PythonPM.exe
:
$(PATHOBJ)
\P
ython.obj Python15.lib
@
Echo Linking
$@
As EXE
@
$(CC)
$(CFLAGS)
$(_EXE)
/B
"/PM:PM /STACK:360000"
/Fe
$@
$(_MAP)
$*
*
$(OTHERLIBS)
>>
$(ERRS)
PGen.exe
:
$(PGEN) PyCore.lib
@
Echo Linking
$@
As EXE
...
...
@@ -305,6 +330,7 @@ release: Python.exe Python15.dll Python15.lib
-
- @Echo Y | copy /U Python.exe D:
\E
XEs
-
- @Echo Y | copy /U Python15.dll D:
\D
LLs
-
- @Echo Y | copy /U Python15.lib E:
\T
au
\L
ib
-
- @Echo Y | copy /U _tkinter.dll D:
\P
ython
test
:
python
..\..\lib\test\regrtest.py
...
...
@@ -947,19 +973,6 @@ regexpr.obj: $(PY_INCLUDE)\abstract.h $(PY_PARSER)\assert.h $(PY_INCLUDE)\ceval.
$(PY_INCLUDE)
\s
tringobject.h $(PY_INCLUDE)
\s
ysmodule.h $(PY_INCLUDE)
\t
raceback.h
\
$(PY_INCLUDE)
\t
upleobject.h
reopmodule.obj
:
$(PY_INCLUDE)
\a
bstract.h $(PY_INCLUDE)
\c
eval.h $(PY_INCLUDE)
\c
lassobject.h
\
$(PY_INCLUDE)
\c
object.h $(PY_INCLUDE)
\c
omplexobject.h config.h
\
$(PY_INCLUDE)
\d
ictobject.h $(PY_INCLUDE)
\f
ileobject.h $(PY_INCLUDE)
\f
loatobject.h
\
$(PY_INCLUDE)
\f
uncobject.h $(PY_INCLUDE)
\i
mport.h $(PY_INCLUDE)
\i
ntobject.h
\
$(PY_INCLUDE)
\i
ntrcheck.h $(PY_INCLUDE)
\l
istobject.h $(PY_INCLUDE)
\l
ongobject.h
\
$(PY_INCLUDE)
\m
ethodobject.h $(PY_INCLUDE)
\m
odsupport.h
\
$(PY_INCLUDE)
\m
oduleobject.h $(PY_INCLUDE)
\m
ymalloc.h $(PY_INCLUDE)
\m
yproto.h
\
$(PY_INCLUDE)
\o
bject.h $(PY_INCLUDE)
\o
bjimpl.h $(PY_INCLUDE)
\p
ydebug.h
\
$(PY_INCLUDE)
\p
yerrors.h $(PY_INCLUDE)
\p
yfpe.h $(PY_INCLUDE)
\p
ystate.h
\
$(PY_INCLUDE)
\p
ython.h $(PY_INCLUDE)
\p
ythonrun.h $(PY_INCLUDE)
\r
angeobject.h
\
$(PY_MODULES)
\r
egexpr.h $(PY_INCLUDE)
\s
liceobject.h $(PY_INCLUDE)
\s
tringobject.h
\
$(PY_INCLUDE)
\s
ysmodule.h $(PY_INCLUDE)
\t
raceback.h $(PY_INCLUDE)
\t
upleobject.h
resource.obj
:
$(PY_INCLUDE)
\a
bstract.h $(OS2TCPIP)
\I
nclude
\s
ys
\t
ime.h $(PY_INCLUDE)
\c
eval.h
\
$(PY_INCLUDE)
\c
lassobject.h $(PY_INCLUDE)
\c
object.h $(PY_INCLUDE)
\c
omplexobject.h
\
config.h $(PY_INCLUDE)
\d
ictobject.h $(PY_INCLUDE)
\f
ileobject.h
\
...
...
PC/os2vacpp/python.def
Dosyayı görüntüle @
e8afe516
This diff is collapsed.
Click to expand it.
PC/os2vacpp/readme.txt
Dosyayı görüntüle @
e8afe516
IBM VisualAge C/C++ for OS/2
============================
To build Python for OS/2, change into ./os2vacpp and issue an 'NMAKE'
command. This will build a PYTHON15.DLL containing the set of Python
modules listed in config.c and a small PYTHON.EXE to start the
interpreter.
By changing the C compiler flag /Gd- in the makefile to /Gd+, you can
reduce the size of these by causing Python to dynamically link to the
C runtime DLLs instead of including their bulk in your binaries.
However, this means that any system on which you run Python must have
the VAC++ compiler installed in order to have those DLLs available.
During the build process you may see a couple of harmless warnings:
From the C Compiler, "No function prototype given for XXX", which
comes from the use of K&R parameters within Python for portability.
From the ILIB librarian, "Module Not Found (XXX)", which comes
from its attempt to perform the (-+) operation, which removes and
then adds a .OBJ to the library. The first time a build is done,
it obviously cannot remove what is not yet built.
This build includes support for most Python functionality as well as
TCP/IP sockets. It omits the Posix ability to 'fork' a process but
supports threads using OS/2 native capabilities. I have tried to
support everything possible but here are a few usage notes.
-- os.popen() Usage Warnings
With respect to my implementation of popen() under OS/2:
import os
fd = os.popen("pkzip.exe -@ junk.zip", 'wb')
fd.write("file1.txt\n")
fd.write("file2.txt\n")
fd.write("file3.txt\n")
fd.write("\x1a") # Should Not Be Necessary But Is
fd.close()
There is a bug, either in the VAC++ compiler or OS/2 itself, where the
simple closure of the write-side of a pipe -to- a process does not
send an EOF to that process. I find I must explicitly write a
control-Z (EOF) before closing the pipe. This is not a problem when
using popen() in read mode.
One other slight difference with my popen() is that I return None
from the close(), instead of the Unix convention of the return code
of the spawned program. I could find no easy way to do this under
OS/2.
-- BEGINLIBPATH/ENDLIBPATH
With respect to environment variables, this OS/2 port supports the
special-to-OS/2 magic names of 'BEGINLIBPATH' and 'ENDLIBPATH' to
control where to load conventional DLLs from. Those names are
intercepted and converted to calls on the OS/2 kernel APIs and
are inherited by child processes, whether Python-based or not.
A few new attributes have been added to the os module:
os.meminstalled # Count of Bytes of RAM Installed on Machine
os.memkernel # Count of Bytes of RAM Reserved (Non-Swappable)
os.memvirtual # Count of Bytes of Virtual RAM Possible
os.timeslice # Duration of Scheduler Timeslice, in Milliseconds
os.maxpathlen # Maximum Length of a Path Specification, in chars
os.maxnamelen # Maximum Length of a Single Dir/File Name, in chars
os.version # Version of OS/2 Being Run e.g. "4.00"
os.revision # Revision of OS/2 Being Run (usually zero)
os.bootdrive # Drive that System Booted From e.g. "C:"
# (useful to find the CONFIG.SYS used to boot with)
-- Using Python as the Default OS/2 Batch Language
Note that OS/2 supports the Unix technique of putting the special
comment line at the time of scripts e.g. "#!/usr/bin/python" in
a different syntactic form. To do this, put your script into a file
with a .CMD extension and added 'extproc' to the top as follows:
extproc C:\Python\Python.exe -x
import os
print "Hello from Python"
The '-x' option tells Python to skip the first line of the file
while processing the rest as normal Python source.
-- Suggested Environment Variable Setup
With respect to the environment variables for Python, I use the
following setup:
Set PYTHONHOME=E:\Tau\Projects\Python;D:\DLLs
Set PYTHONPATH=.;E:\Tau\Projects\Python\Lib; \
E:\Tau\Projects\Python\Lib\plat-win
The EXEC_PREFIX (optional second pathspec on PYTHONHOME) is where
you put any Python extension DLLs you may create/obtain. There
are none provided with this release.
-- Contact Info
If you have questions, suggestions or problems specifically with
the OS/2 VAC++ port of Python, please contact me at:
Jeff Rush <jrush@summit-research.com>.
I support no other platform but OS/2 (and eventually AmigaDOS).
IBM VisualAge C/C++ for OS/2
============================
To build Python for OS/2, change into ./os2vacpp and issue an 'NMAKE'
command. This will build a PYTHON15.DLL containing the set of Python
modules listed in config.c and a small PYTHON.EXE to start the
interpreter.
By changing the C compiler flag /Gd- in the makefile to /Gd+, you can
reduce the size of these by causing Python to dynamically link to the
C runtime DLLs instead of including their bulk in your binaries.
However, this means that any system on which you run Python must have
the VAC++ compiler installed in order to have those DLLs available.
During the build process you may see a couple of harmless warnings:
From the C Compiler, "No function prototype given for XXX", which
comes from the use of K&R parameters within Python for portability.
From the ILIB librarian, "Module Not Found (XXX)", which comes
from its attempt to perform the (-+) operation, which removes and
then adds a .OBJ to the library. The first time a build is done,
it obviously cannot remove what is not yet built.
This build includes support for most Python functionality as well as
TCP/IP sockets. It omits the Posix ability to 'fork' a process but
supports threads using OS/2 native capabilities. I have tried to
support everything possible but here are a few usage notes.
-- os.popen() Usage Warnings
With respect to my implementation of popen() under OS/2:
import os
fd = os.popen("pkzip.exe -@ junk.zip", 'wb')
fd.write("file1.txt\n")
fd.write("file2.txt\n")
fd.write("file3.txt\n")
fd.write("\x1a") # Should Not Be Necessary But Is
fd.close()
There is a bug, either in the VAC++ compiler or OS/2 itself, where the
simple closure of the write-side of a pipe -to- a process does not
send an EOF to that process. I find I must explicitly write a
control-Z (EOF) before closing the pipe. This is not a problem when
using popen() in read mode.
One other slight difference with my popen() is that I return None
from the close(), instead of the Unix convention of the return code
of the spawned program. I could find no easy way to do this under
OS/2.
-- BEGINLIBPATH/ENDLIBPATH
With respect to environment variables, this OS/2 port supports the
special-to-OS/2 magic names of 'BEGINLIBPATH' and 'ENDLIBPATH' to
control where to load conventional DLLs from. Those names are
intercepted and converted to calls on the OS/2 kernel APIs and
are inherited by child processes, whether Python-based or not.
A few new attributes have been added to the os module:
os.meminstalled # Count of Bytes of RAM Installed on Machine
os.memkernel # Count of Bytes of RAM Reserved (Non-Swappable)
os.memvirtual # Count of Bytes of Virtual RAM Possible
os.timeslice # Duration of Scheduler Timeslice, in Milliseconds
os.maxpathlen # Maximum Length of a Path Specification, in chars
os.maxnamelen # Maximum Length of a Single Dir/File Name, in chars
os.version # Version of OS/2 Being Run e.g. "4.00"
os.revision # Revision of OS/2 Being Run (usually zero)
os.bootdrive # Drive that System Booted From e.g. "C:"
# (useful to find the CONFIG.SYS used to boot with)
-- Using Python as the Default OS/2 Batch Language
Note that OS/2 supports the Unix technique of putting the special
comment line at the time of scripts e.g. "#!/usr/bin/python" in
a different syntactic form. To do this, put your script into a file
with a .CMD extension and added 'extproc' to the top as follows:
extproc C:\Python\Python.exe -x
import os
print "Hello from Python"
The '-x' option tells Python to skip the first line of the file
while processing the rest as normal Python source.
-- Suggested Environment Variable Setup
With respect to the environment variables for Python, I use the
following setup:
Set PYTHONHOME=E:\Tau\Projects\Python;D:\DLLs
Set PYTHONPATH=.;E:\Tau\Projects\Python\Lib; \
E:\Tau\Projects\Python\Lib\plat-win
The EXEC_PREFIX (optional second pathspec on PYTHONHOME) is where
you put any Python extension DLLs you may create/obtain. There
are none provided with this release.
-- Contact Info
If you have questions, suggestions or problems specifically with
the OS/2 VAC++ port of Python, please contact me at:
Jeff Rush <jrush@summit-research.com>.
I support no other platform but OS/2 (and eventually AmigaDOS).
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment