Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a34c3135
Commit
a34c3135
authored
Dec 05, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New batch of patches by Jeff Rush; moved his readme.txt portion here.
parent
cee1dca4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
148 additions
and
13 deletions
+148
-13
PC/os2vacpp/config.c
PC/os2vacpp/config.c
+2
-0
PC/os2vacpp/config.h
PC/os2vacpp/config.h
+3
-8
PC/os2vacpp/getpathp.c
PC/os2vacpp/getpathp.c
+23
-3
PC/os2vacpp/makefile
PC/os2vacpp/makefile
+6
-2
PC/os2vacpp/readme.txt
PC/os2vacpp/readme.txt
+114
-0
No files found.
PC/os2vacpp/config.c
View file @
a34c3135
...
...
@@ -63,6 +63,7 @@ extern void inittime();
extern
void
initthread
();
extern
void
initcStringIO
();
extern
void
initcPickle
();
extern
void
initpcre
();
#ifdef WIN32
extern
void
initmsvcrt
();
#endif
...
...
@@ -113,6 +114,7 @@ struct _inittab _PyImport_Inittab[] = {
#endif
{
"cStringIO"
,
initcStringIO
},
{
"cPickle"
,
initcPickle
},
{
"pcre"
,
initpcre
},
#ifdef WIN32
{
"msvcrt"
,
initmsvcrt
},
#endif
...
...
PC/os2vacpp/config.h
View file @
a34c3135
...
...
@@ -74,11 +74,6 @@
/* Configuration Options for Finding Modules */
#define PREFIX ""
#define EXEC_PREFIX ""
//#define VPATH "."
//#define PYTHONPATH PREFIX "/lib/python" VERSION DELIM \
// PREFIX "/lib/python" VERSION "/test" DELIM \
// EXEC_PREFIX "/lib/python" VERSION "/sharedmodules"
/***************************************************/
/* 32-Bit IBM VisualAge C/C++ v3.0 for OS/2 */
...
...
@@ -91,7 +86,7 @@
#define PYCC_VACPP
/* Define Indicator of C Compiler */
/* Platform Filesystem */
#define PYTHONPATH ".;.\\lib;.\\lib\\plat-
os2;.\\lib\\dos_
8x3;.\\lib\\lib-tk"
#define PYTHONPATH ".;.\\lib;.\\lib\\plat-
win;.\\lib\\dos-
8x3;.\\lib\\lib-tk"
#define DOSFILESYS
/* OS/2 Uses the DOS File Naming Conventions */
/* #define IMPORT_8x3_NAMES */
...
...
@@ -483,7 +478,7 @@
/* #define WITH_READLINE 1 */
/* Define if you have clock. */
/* #define HAVE_CLOCK */
#define HAVE_CLOCK
/* Define if you have ftime. */
#define HAVE_FTIME
...
...
@@ -540,7 +535,7 @@
/* #undef HAVE_TCSETPGRP */
/* Define if you have times. */
/* #undef HAVE_TIMES */
#define HAVE_TIMES
/* Define if you have uname. */
/* #undef HAVE_UNAME */
...
...
PC/os2vacpp/getpathp.c
View file @
a34c3135
...
...
@@ -50,7 +50,11 @@ extern BOOL PyWin_IsWin32s();
/* Search in some common locations for the associated Python libraries.
*
* This version always returns "" for both prefix and exec_prefix.
* Two directories must be found, the platform independent directory
* (prefix), containing the common .py and .pyc files, and the platform
* dependent directory (exec_prefix), containing the shared library
* modules. Note that prefix and exec_prefix can be the same directory,
* but for some installations, they are different.
*
* Py_GetPath() tries to return a sensible Python module search path.
*
...
...
@@ -75,6 +79,7 @@ extern BOOL PyWin_IsWin32s();
#endif
static
char
prefix
[
MAXPATHLEN
+
1
];
static
char
exec_prefix
[
MAXPATHLEN
+
1
];
static
char
progpath
[
MAXPATHLEN
+
1
];
static
char
*
module_search_path
=
NULL
;
...
...
@@ -345,9 +350,21 @@ calculate_path()
else
pythonhome
=
NULL
;
}
else
else
{
char
*
delim
;
strcpy
(
prefix
,
pythonhome
);
/* Extract Any Optional Trailing EXEC_PREFIX */
/* e.g. PYTHONHOME=<prefix>:<exec_prefix> */
delim
=
strchr
(
prefix
,
DELIM
);
if
(
delim
)
{
*
delim
=
'\0'
;
strcpy
(
exec_prefix
,
delim
+
1
);
}
else
strcpy
(
exec_prefix
,
EXEC_PREFIX
);
}
if
(
envpath
&&
*
envpath
==
'\0'
)
envpath
=
NULL
;
...
...
@@ -475,7 +492,10 @@ Py_GetPrefix()
char
*
Py_GetExecPrefix
()
{
return
Py_GetPrefix
();
if
(
!
module_search_path
)
calculate_path
();
return
exec_prefix
;
}
char
*
...
...
PC/os2vacpp/makefile
View file @
a34c3135
...
...
@@ -165,6 +165,9 @@ MODULES = \
$(PATHOBJ)
\M
D5Module.obj
\
$(PATHOBJ)
\N
ewModule.obj
\
$(PATHOBJ)
\O
perator.obj
\
$(PATHOBJ)
\P
CREModule.obj
\
$(PATHOBJ)
\P
yPCRE.obj
\
$(PATHOBJ)
\R
otorModule.obj
\
$(PATHOBJ)
\P
osixModule.obj
\
$(PATHOBJ)
\R
egexModule.obj
\
$(PATHOBJ)
\R
egExpr.obj
\
...
...
@@ -197,7 +200,7 @@ _BASE = /Q /W2 /I$(PROJINCLUDE)
# /Q = Omit IBM Copyright
# /W2 = Show Warnings/Errors Only
_GEN
=
/G4 /Gm /Gd
_GEN
=
/G4 /Gm /Gd
-
# /G4 = Generate Code for 486 (Use 386 for Debugger)
# /Gm = Use Multithread Runtime
# /Gd = Dynamically Load Runtime
...
...
@@ -208,7 +211,8 @@ _OPT = /O /Gl
# /Gu = Advise Linker All Ext Data is ID'd
# /Gl = Have Linker Remove Unused Fns
_DBG
=
/DHAVE_CONFIG_H /DUSE_SOCKET
_DBG
=
/Wpro- /Ti- /DHAVE_CONFIG_H /DUSE_SOCKET
# /Wpro= Generate Compiler Warnings re Missing Prototypes
# /Ti = Embed Debugger/Analyzer Recs
# /Tm = Enable Debug Memory Fns
# /Tx = Request Full Dump Upon Exception
...
...
PC/os2vacpp/readme.txt
0 → 100644
View file @
a34c3135
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