bye, lele.
From: Lele Gaifax <lele>
Date: Sat, 15 Apr 95 16:46:39 +0200
To: guido@cwi.nl
Subject: Python 1.2 on NeXTSTEP
Reply-To: lele@nautilus.eclipse.it
Hi Guido,
I just finished to install 1.2 on my NS 3.3 machine. I had some
problem with the POSIX stuff.
As far as I understand, the POSIX functionalities are not (yet)
completely merged in NeXTSTEP, and I ever considered a bad strategy
simply add -posix to the compiler to get them. Well, I built python,
installed it, and I was doing "make libinstall" when:
lele@nautilus Python-1.2 $ make libinstall
if test ! -d /usr/local/lib/python; then mkdir
/usr/local/lib/python; fi
cp -r ./Lib/* /usr/local/lib/python
PYTHONPATH=/usr/local/lib/python ./python
/usr/local/lib/python/compileall.py /usr/local/lib/python
Listing /usr/local/lib/python ...
Traceback (innermost last):
File "/usr/local/lib/python/compileall.py", line 70, in ?
main()
File "/usr/local/lib/python/compileall.py", line 65, in main
compile_dir(dir, maxlevels)
File "/usr/local/lib/python/compileall.py", line 22, in compile_dir
if os.path.isfile(fullname):
File "/usr/local/lib/python/posixpath.py", line 143, in isfile
st = posix.stat(path)
TypeError: string without null bytes, string
*** Exit 1
Stop.
Please note that it passed the test suite.
So I checked a little, and it seems to me that there is no valid
reason to use the POSIX extensions over the standard features of NS,
and I changed things to let me build python without them. Now I
have a functional python, able to pass either "make test" and "make
libinstall" ;-)
Below I'm attaching the simple patch: to mathmodule.c since it
redeclares hypot, but mainly to posixmodule.c, to declare functions
that NS' unistd.h does not without -posix.
In the FAQ this is indicated as a workaround to a problem with
listdir: I'd like to hear more on this, so I can check that too, but
the (semplicistic) cases I tried passed the exam.
Another little thing: I noted that in the 1.2 distribution
configure.in states revision 1.20, while the derived configure is
1.19.
bye, and thanx,
lele.
Index: ./Modules/mathmodule.c
*** Python-1.2/./Modules/mathmodule.c Wed Mar 1 11:34:29 1995
--- Python-1.2-NeXT/./Modules/mathmodule.c Sat Apr 15 16:21:55 1995
***************
*** 40,47 ****
--- 40,50 ----
extern double modf PROTO((double, double *));
#endif
+ #ifndef NeXT
+ /* NS' math.h declares this in a slightly different way */
#ifdef HAVE_HYPOT
extern double hypot PROTO((double, double));
+ #endif
#endif
#ifdef i860
Index: ./Modules/posixmodule.c
*** Python-1.2/./Modules/posixmodule.c Thu Mar 30 12:56:54 1995
--- Python-1.2-NeXT/./Modules/posixmodule.c Sat Apr 15 16:09:40 1995
***************
*** 74,79 ****
--- 74,91 ----
extern int pclose();
extern int lstat();
extern int symlink();
+ #ifdef NeXT
+ /* XXX and these are for NS 3.3: its unistd.h contains almost only
+ POSIX declarations */
+ extern int chmod PROTO((const char *, mode_t));
+ extern int chown PROTO((const char *, uid_t, gid_t));
+ extern char *getcwd PROTO((char *, int));
+ extern int link PROTO((const char *, const char *));
+ extern int mkdir PROTO((const char *, mode_t));
+ extern int chdir PROTO((const char *));
+ extern int rmdir PROTO((const char *));
+ extern int unlink PROTO((const char *));
+ #endif /* NeXT */
#else /* !HAVE_UNISTD_H */
extern int mkdir PROTO((const char *, mode_t));
extern int chdir PROTO((const char *));
***************
*** 573,584 ****
long atime, mtime;
int res;
! #ifdef HAVE_UTIME_H
struct utimbuf buf;
#define ATIME buf.actime
#define MTIME buf.modtime
#define UTIME_ARG &buf
! #else /* HAVE_UTIME_H */
time_t buf[2];
#define ATIME buf[0]
#define MTIME buf[1]
--- 585,596 ----
long atime, mtime;
int res;
! #if defined(HAVE_UTIME_H) && !defined(NeXT)
struct utimbuf buf;
#define ATIME buf.actime
#define MTIME buf.modtime
#define UTIME_ARG &buf
! #else /* HAVE_UTIME_H || NeXT */
time_t buf[2];
#define ATIME buf[0]
#define MTIME buf[1]
Index: ./configure.in
*** Python-1.2/./configure.in Thu Mar 9 15:09:54 1995
--- Python-1.2-NeXT/./configure.in Sat Apr 15 15:28:32 1995
***************
*** 52,66 ****
AC_ISC_POSIX
AC_MINIX
! was_it_defined=no
! AC_TRY_RUN([
! #ifdef _NEXT_SOURCE
! main() { exit(0); }
! #endif
! ], AC_DEFINE(_POSIX_SOURCE)
! CC="$CC -posix"; was_it_defined=yes)
! AC_MSG_CHECKING(for NeXT)
! AC_MSG_RESULT($was_it_defined)
# checks for header files
AC_HEADER_STDC
--- 52,66 ----
AC_ISC_POSIX
AC_MINIX
! dnl was_it_defined=no
! dnl AC_TRY_RUN([
! dnl #ifdef _NEXT_SOURCE
! dnl main() { exit(0); }
! dnl #endif
! dnl ], AC_DEFINE(_POSIX_SOURCE)
! dnl CC="$CC -posix"; was_it_defined=yes)
! dnl AC_MSG_CHECKING(for NeXT)
! dnl AC_MSG_RESULT($was_it_defined)
# checks for header files
AC_HEADER_STDC