[Python-bugs-list] [ python-Bugs-616786 ] Problems (fixes) compiling 2.2.1 on sun4
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 02 Oct 2002 13:44:09 -0700
Bugs item #616786, was opened at 2002-09-30 17:57
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=616786&group_id=5470
Category: Build
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: No Spam (not4spam)
Assigned to: Nobody/Anonymous (nobody)
Summary: Problems (fixes) compiling 2.2.1 on sun4
Initial Comment:
I had a few problems compiling "Python-2.2.1" on
"SunOS 4.1.4 1 sun4m" using gcc "version egcs-2.91.5"
(sorry it's not my system and I had no choice). I'd
guess this applies to other versions of python as well,
but this is the first time I tried this.
The most serious problem was in the function
"PyOS_vsnprintf"
in the file "Python/mysnprintf.c". For the case where
HAVE_SNPRINTF is NOT #defined there is the call,
len = vsprintf(buffer, format, va);
But on "SunOS 4.1.4", on success "vsprintf" returns the
first argument (buffer) and NOT the length of the string!
I "fixed" this by adding after the above call,
if (len == (int)buffer) len = strlen(buffer);
I guess a better way would be to have a #ifdef for the OS
but this seems to work OK for all systems.
Three other source files needed minor tweaking:
-- In Objects/fileobject.c at the beginning of
function
file_init() I needed to add the line:
extern int fclose(FILE *);
-- In Modules/posixmodule.c at the beginning of
function
posix_chroot() I needed to add the line:
int chroot();
-- In Modules/xxsubtype.c at the beginning of function
spam_bench() I needed to add the lines:
#ifndef CLOCKS_PER_SEC
# define CLOCKS_PER_SEC 1000000l /* ? */
#endif
Seems like the first 2 would be OK in general. And perhaps
there's an equivalent of CLOCKS_PER_SEC in some "sun4"
header
file but I couldn't find it.
I realize supporting this antiquated operation system
and "gcc"
isn't a high priority, but since the changes are so minimal
perhaps they could be added to save some other poor
soul some
headaches.
----------------------------------------------------------------------
>Comment By: No Spam (not4spam)
Date: 2002-10-02 16:44
Message:
Logged In: YES
user_id=620948
I guess forget it then. I did't realize suport for SunOS 4
was being
discontinued, but I can't blame you. I'll try to get my ISP
(eskimo.com)
to upgrade to something more modern and hopefully I can use this
to help pursuade them. Thanks.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-10-02 10:17
Message:
Logged In: YES
user_id=21627
According to PEP 11
(http://www.python.org/peps/pep-0011.html) SunOS 4 will
become unsupported in Python 2.3, and the remaining pieces
will be removed in Python 2.4.
If you volunteer to support the SunOS port, we can
re-support it, you can then submit patches for both 2.2 and
2.3. Without a volunteer who actively maintains the port, we
will have to close this report as "Won't fix".
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=616786&group_id=5470