mirror of
https://github.com/python/cpython
synced 2024-09-05 08:17:45 +00:00
Patches by William Lewis for Nextstep descendants.
This commit is contained in:
parent
b5cebfe164
commit
54ecc3d24f
12
Makefile.in
12
Makefile.in
|
@ -161,6 +161,7 @@ DIST= $(DISTFILES) $(DISTDIRS)
|
|||
CFLAGS= $(OPT) -I. $(DEFS)
|
||||
|
||||
LIBRARY= libpython$(VERSION).a
|
||||
LDLIBRARY= @LDLIBRARY@
|
||||
|
||||
# Default target
|
||||
all: $(LIBRARY) python sharedmods
|
||||
|
@ -173,10 +174,10 @@ python: $(LIBRARY) buildno Modules/python.o
|
|||
$(srcdir)/Modules/getbuildinfo.c
|
||||
$(AR) cr $(LIBRARY) getbuildinfo.o
|
||||
$(RANLIB) $(LIBRARY)
|
||||
@DGUX_IS_BROKEN@
|
||||
@MAKE_LDLIBRARY@
|
||||
cd Modules; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
|
||||
prefix="$(prefix)" exec_prefix="$(exec_prefix)" \
|
||||
LIBRARY=../$(LIBRARY) link
|
||||
LIBRARY=../$(LDLIBRARY) link
|
||||
|
||||
Modules/python.o: $(srcdir)/Modules/python.c
|
||||
cd Modules; $(MAKE) OPT="$(OPT)" python.o
|
||||
|
@ -204,6 +205,10 @@ libpython$(VERSION).so: $(LIBRARY)
|
|||
(cd dgux;ar x ../$^;ld -G -o ../$@ * )
|
||||
/bin/rm -rf ./dgux
|
||||
|
||||
# This rule is here for OPENSTEP/Rhapsody/MacOSX
|
||||
libpython$(VERSION).dylib: $(LIBRARY)
|
||||
libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) -framework System @LIBTOOL_CRUFT@
|
||||
|
||||
$(SUBDIRS): Makefiles
|
||||
|
||||
Parser:
|
||||
|
@ -258,7 +263,6 @@ altbininstall: python
|
|||
fi; \
|
||||
done
|
||||
$(INSTALL_PROGRAM) python$(EXE) $(BINDIR)/python$(VERSION)$(EXE)
|
||||
@DGUX_IS_BROKEN@
|
||||
if test -f libpython$(VERSION).so; then \
|
||||
$(INSTALL_DATA) libpython$(VERSION).so $(LIBDIR); \
|
||||
else true; \
|
||||
|
@ -504,7 +508,7 @@ clean: localclean
|
|||
done
|
||||
|
||||
localclobber: localclean
|
||||
-rm -f tags TAGS python $(LIBRARY) *.o
|
||||
-rm -f tags TAGS python $(LIBRARY) $(LDLIBRARY) *.o
|
||||
-rm -f config.log config.cache config.h
|
||||
|
||||
clobber: localclobber
|
||||
|
|
|
@ -100,7 +100,7 @@ MAINOBJ= python.o
|
|||
SYSLIBS= $(LIBM) $(LIBC)
|
||||
|
||||
LIBRARY= ../libpython$(VERSION).a
|
||||
REALLIBRARY= ../@REALLIBRARY@
|
||||
LDLIBRARY= ../@LDLIBRARY@
|
||||
|
||||
# === Rules ===
|
||||
|
||||
|
@ -123,7 +123,7 @@ EXE=
|
|||
# This target is used by the master Makefile to link the final binary.
|
||||
link: $(MAINOBJ)
|
||||
$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \
|
||||
$(LIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST)
|
||||
$(LDLIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST)
|
||||
mv python$(EXE) ../python$(EXE)
|
||||
|
||||
clean:
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
const char *
|
||||
Py_GetBuildInfo()
|
||||
{
|
||||
static char buildinfo[40];
|
||||
sprintf(buildinfo, "#%d, %.12s, %.8s", BUILD, DATE, TIME);
|
||||
static char buildinfo[50];
|
||||
sprintf(buildinfo, "#%d, %.20s, %.9s", BUILD, DATE, TIME);
|
||||
return buildinfo;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,10 @@ PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
|
||||
#ifdef WITH_NEXT_FRAMEWORK
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
/* Search in some common locations for the associated Python libraries.
|
||||
*
|
||||
* Two directories must be found, the platform independent directory
|
||||
|
@ -394,7 +398,24 @@ calculate_path()
|
|||
int bufsz;
|
||||
int prefixsz;
|
||||
char *defpath = pythonpath;
|
||||
#ifdef WITH_NEXT_FRAMEWORK
|
||||
NSModule pythonModule;
|
||||
#endif
|
||||
|
||||
#ifdef WITH_NEXT_FRAMEWORK
|
||||
pythonModule = NSModuleForSymbol(NSLookupAndBindSymbol("_Py_Initialize"));
|
||||
/* Use dylib functions to find out where the framework was loaded from */
|
||||
buf = NSLibraryNameForModule(pythonModule);
|
||||
if (buf != NULL) {
|
||||
/* We're in a framework. */
|
||||
strcpy(progpath, buf);
|
||||
|
||||
/* Frameworks have support for versioning */
|
||||
strcpy(lib_python, "lib");
|
||||
} else {
|
||||
/* If we're not in a framework, fall back to the old way (even though NSNameOfModule() probably does the same thing.) */
|
||||
#endif
|
||||
|
||||
/* Initialize this dynamically for K&R C */
|
||||
sprintf(lib_python, "lib/python%s", VERSION);
|
||||
|
||||
|
@ -430,6 +451,9 @@ calculate_path()
|
|||
}
|
||||
else
|
||||
progpath[0] = '\0';
|
||||
#ifdef WITH_NEXT_FRAMEWORK
|
||||
}
|
||||
#endif
|
||||
|
||||
strcpy(argv0_path, progpath);
|
||||
|
||||
|
|
|
@ -146,6 +146,7 @@ corresponding Unix manual entries for more information on calls.";
|
|||
#undef HAVE_UTIME_H
|
||||
#define HAVE_WAITPID
|
||||
/* #undef HAVE_GETCWD */
|
||||
#define UNION_WAIT /* This should really be checked for by autoconf */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
|
@ -255,6 +256,23 @@ extern int lstat Py_PROTO((const char *, struct stat *));
|
|||
#include <io.h>
|
||||
#endif /* OS2 */
|
||||
|
||||
#ifdef UNION_WAIT
|
||||
/* Emulate some macros on systems that have a union instead of macros */
|
||||
|
||||
#ifndef WIFEXITED
|
||||
#define WIFEXITED(u_wait) (!(u_wait).w_termsig && !(u_wait).w_coredump)
|
||||
#endif
|
||||
|
||||
#ifndef WEXITSTATUS
|
||||
#define WEXITSTATUS(u_wait) (WIFEXITED(u_wait)?((u_wait).w_retcode):-1)
|
||||
#endif
|
||||
|
||||
#ifndef WTERMSIG
|
||||
#define WTERMSIG(u_wait) ((u_wait).w_termsig)
|
||||
#endif
|
||||
|
||||
#endif /* UNION_WAIT */
|
||||
|
||||
/* Return a dictionary corresponding to the POSIX environment table */
|
||||
|
||||
#if !defined(_MSC_VER) && ( !defined(__WATCOMC__) || defined(__QNX__) )
|
||||
|
@ -1986,20 +2004,25 @@ posix_waitpid(self, args)
|
|||
PyObject *self;
|
||||
PyObject *args;
|
||||
{
|
||||
int pid, options, sts = 0;
|
||||
int pid, options;
|
||||
#ifdef UNION_WAIT
|
||||
union wait status;
|
||||
#define status_i (status.w_status)
|
||||
#else
|
||||
int status;
|
||||
#define status_i status
|
||||
#endif
|
||||
status_i = 0;
|
||||
|
||||
if (!PyArg_Parse(args, "(ii)", &pid, &options))
|
||||
return NULL;
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#ifdef NeXT
|
||||
pid = wait4(pid, (union wait *)&sts, options, NULL);
|
||||
#else
|
||||
pid = waitpid(pid, &sts, options);
|
||||
#endif
|
||||
pid = wait4(pid, &status, options, NULL);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (pid == -1)
|
||||
return posix_error();
|
||||
else
|
||||
return Py_BuildValue("ii", pid, sts);
|
||||
return Py_BuildValue("ii", pid, status_i);
|
||||
}
|
||||
#endif /* HAVE_WAITPID */
|
||||
|
||||
|
@ -2015,17 +2038,21 @@ posix_wait(self, args)
|
|||
PyObject *args;
|
||||
{
|
||||
int pid, sts;
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#ifdef NeXT
|
||||
pid = wait((union wait *)&sts);
|
||||
#ifdef UNION_WAIT
|
||||
union wait status;
|
||||
#define status_i (status.w_status)
|
||||
#else
|
||||
pid = wait(&sts);
|
||||
int status;
|
||||
#define status_i status
|
||||
#endif
|
||||
status_i = 0;
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
pid = wait(&status);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (pid == -1)
|
||||
return posix_error();
|
||||
else
|
||||
return Py_BuildValue("ii", pid, sts);
|
||||
return Py_BuildValue("ii", pid, status_i);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2821,9 +2848,16 @@ posix_WIFSTOPPED(self, args)
|
|||
PyObject *self;
|
||||
PyObject *args;
|
||||
{
|
||||
int status = 0;
|
||||
#ifdef UNION_WAIT
|
||||
union wait status;
|
||||
#define status_i (status.w_status)
|
||||
#else
|
||||
int status;
|
||||
#define status_i status
|
||||
#endif
|
||||
status_i = 0;
|
||||
|
||||
if (!PyArg_Parse(args, "i", &status))
|
||||
if (!PyArg_Parse(args, "i", &status_i))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2842,9 +2876,16 @@ posix_WIFSIGNALED(self, args)
|
|||
PyObject *self;
|
||||
PyObject *args;
|
||||
{
|
||||
int status = 0;
|
||||
#ifdef UNION_WAIT
|
||||
union wait status;
|
||||
#define status_i (status.w_status)
|
||||
#else
|
||||
int status;
|
||||
#define status_i status
|
||||
#endif
|
||||
status_i = 0;
|
||||
|
||||
if (!PyArg_Parse(args, "i", &status))
|
||||
if (!PyArg_Parse(args, "i", &status_i))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2863,9 +2904,16 @@ posix_WIFEXITED(self, args)
|
|||
PyObject *self;
|
||||
PyObject *args;
|
||||
{
|
||||
int status = 0;
|
||||
#ifdef UNION_WAIT
|
||||
union wait status;
|
||||
#define status_i (status.w_status)
|
||||
#else
|
||||
int status;
|
||||
#define status_i status
|
||||
#endif
|
||||
status_i = 0;
|
||||
|
||||
if (!PyArg_Parse(args, "i", &status))
|
||||
if (!PyArg_Parse(args, "i", &status_i))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2874,7 +2922,7 @@ posix_WIFEXITED(self, args)
|
|||
}
|
||||
#endif /* WIFEXITED */
|
||||
|
||||
#ifdef WIFSTOPPED
|
||||
#ifdef WEXITSTATUS
|
||||
static char posix_WEXITSTATUS__doc__[] =
|
||||
"WEXITSTATUS(status) -> integer\n\
|
||||
See Unix documentation.";
|
||||
|
@ -2884,9 +2932,16 @@ posix_WEXITSTATUS(self, args)
|
|||
PyObject *self;
|
||||
PyObject *args;
|
||||
{
|
||||
int status = 0;
|
||||
#ifdef UNION_WAIT
|
||||
union wait status;
|
||||
#define status_i (status.w_status)
|
||||
#else
|
||||
int status;
|
||||
#define status_i status
|
||||
#endif
|
||||
status_i = 0;
|
||||
|
||||
if (!PyArg_Parse(args, "i", &status))
|
||||
if (!PyArg_Parse(args, "i", &status_i))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2905,9 +2960,16 @@ posix_WTERMSIG(self, args)
|
|||
PyObject *self;
|
||||
PyObject *args;
|
||||
{
|
||||
int status = 0;
|
||||
#ifdef UNION_WAIT
|
||||
union wait status;
|
||||
#define status_i (status.w_status)
|
||||
#else
|
||||
int status;
|
||||
#define status_i status
|
||||
#endif
|
||||
status_i = 0;
|
||||
|
||||
if (!PyArg_Parse(args, "i", &status))
|
||||
if (!PyArg_Parse(args, "i", &status_i))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2926,9 +2988,16 @@ posix_WSTOPSIG(self, args)
|
|||
PyObject *self;
|
||||
PyObject *args;
|
||||
{
|
||||
int status = 0;
|
||||
#ifdef UNION_WAIT
|
||||
union wait status;
|
||||
#define status_i (status.w_status)
|
||||
#else
|
||||
int status;
|
||||
#define status_i status
|
||||
#endif
|
||||
status_i = 0;
|
||||
|
||||
if (!PyArg_Parse(args, "i", &status))
|
||||
if (!PyArg_Parse(args, "i", &status_i))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ extern int rl_bind_key();
|
|||
extern int rl_bind_key_in_map();
|
||||
extern int rl_initialize();
|
||||
extern int add_history();
|
||||
extern Function *rl_event_hook;
|
||||
#endif
|
||||
|
||||
/* Pointers needed from outside (but not declared in a header file). */
|
||||
|
|
|
@ -38,8 +38,8 @@ PERFORMANCE OF THIS SOFTWARE.
|
|||
const char *
|
||||
Py_GetVersion()
|
||||
{
|
||||
static char version[80];
|
||||
sprintf(version, "%.10s (%.30s) %.30s", PY_VERSION,
|
||||
static char version[100];
|
||||
sprintf(version, "%.10s (%.40s) %.40s", PY_VERSION,
|
||||
Py_GetBuildInfo(), Py_GetCompiler());
|
||||
return version;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,8 @@ PERFORMANCE OF THIS SOFTWARE.
|
|||
symbol -- defined for:
|
||||
|
||||
DYNAMIC_LINK -- any kind of dynamic linking
|
||||
USE_RLD -- NeXT dynamic linking
|
||||
USE_RLD -- NeXT dynamic linking with FVM shlibs
|
||||
USE_DYLD -- NeXT dynamic linking with frameworks
|
||||
USE_DL -- Jack's dl for IRIX 4 or GNU dld with emulation for Jack's dl
|
||||
USE_SHLIB -- SunOS or IRIX 5 (SVR4?) shared libraries
|
||||
_AIX -- AIX style dynamic linking
|
||||
|
@ -117,7 +118,15 @@ typedef FARPROC dl_funcptr;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NeXT
|
||||
#ifdef WITH_DYLD
|
||||
#define DYNAMIC_LINK
|
||||
#define USE_DYLD
|
||||
#define SHORT_EXT ".so"
|
||||
#define LONG_EXT "module.so"
|
||||
#define FUNCNAME_PATTERN "_init%.200s"
|
||||
#endif
|
||||
|
||||
#if defined(NeXT) && !defined(DYNAMIC_LINK)
|
||||
#define DYNAMIC_LINK
|
||||
#define USE_RLD
|
||||
/* Define this to 1 if you want be able to load ObjC modules as well:
|
||||
|
@ -251,16 +260,22 @@ typedef void (*dl_funcptr)();
|
|||
|
||||
#ifdef USE_RLD
|
||||
#include <mach-o/rld.h>
|
||||
#define FUNCNAME_PATTERN "_init%.200s"
|
||||
#ifndef _DL_FUNCPTR_DEFINED
|
||||
typedef void (*dl_funcptr)();
|
||||
#endif
|
||||
#endif /* USE_RLD */
|
||||
|
||||
#ifdef USE_DYLD
|
||||
#include <mach-o/dyld.h>
|
||||
#ifndef _DL_FUNCPTR_DEFINED
|
||||
typedef void (*dl_funcptr)();
|
||||
#endif
|
||||
#endif /* USE_DYLD */
|
||||
|
||||
extern char *Py_GetProgramName();
|
||||
|
||||
#ifndef FUNCNAME_PATTERN
|
||||
#if defined(__hp9000s300) || (defined(__NetBSD__) || defined(__FreeBSD__)) && !defined(__ELF__) || defined(__OpenBSD__) || defined(__BORLANDC__)
|
||||
#if defined(__hp9000s300) || (defined(__NetBSD__) || defined(__FreeBSD__)) && !defined(__ELF__) || defined(__OpenBSD__) || defined(__BORLANDC__) || defined(NeXT)
|
||||
#define FUNCNAME_PATTERN "_init%.200s"
|
||||
#else
|
||||
#define FUNCNAME_PATTERN "init%.200s"
|
||||
|
@ -653,6 +668,58 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
|
|||
return NULL;
|
||||
}
|
||||
#endif /* USE_RLD */
|
||||
#ifdef USE_DYLD
|
||||
/* This is also NeXT-specific. However, frameworks (the new style
|
||||
of shared library) and rld() can't be used in the same program;
|
||||
instead, you have to use dyld, which is mostly unimplemented. */
|
||||
{
|
||||
NSObjectFileImageReturnCode rc;
|
||||
NSObjectFileImage image;
|
||||
NSModule newModule;
|
||||
NSSymbol theSym;
|
||||
void *symaddr;
|
||||
const char *errString;
|
||||
|
||||
rc = NSCreateObjectFileImageFromFile(pathname, &image);
|
||||
switch(rc) {
|
||||
default:
|
||||
case NSObjectFileImageFailure:
|
||||
NSObjectFileImageFormat:
|
||||
/* for these a message is printed on stderr by dyld */
|
||||
errString = "Can't create object file image";
|
||||
break;
|
||||
case NSObjectFileImageSuccess:
|
||||
errString = NULL;
|
||||
break;
|
||||
case NSObjectFileImageInappropriateFile:
|
||||
errString = "Inappropriate file type for dynamic loading";
|
||||
break;
|
||||
case NSObjectFileImageArch:
|
||||
errString = "Wrong CPU type in object file";
|
||||
break;
|
||||
NSObjectFileImageAccess:
|
||||
errString = "Can't read object file (no access)";
|
||||
break;
|
||||
}
|
||||
if (errString == NULL) {
|
||||
newModule = NSLinkModule(image, pathname, TRUE);
|
||||
if (!newModule)
|
||||
errString = "Failure linking new module";
|
||||
}
|
||||
if (errString != NULL) {
|
||||
PyErr_SetString(PyExc_ImportError, errString);
|
||||
return NULL;
|
||||
}
|
||||
if (!NSIsSymbolNameDefined(funcname)) {
|
||||
/* UnlinkModule() isn't implimented in current versions, but calling it does no harm */
|
||||
NSUnLinkModule(newModule, FALSE);
|
||||
PyErr_Format(PyExc_ImportError, "Loaded module does not contain symbol %s", funcname);
|
||||
return NULL;
|
||||
}
|
||||
theSym = NSLookupAndBindSymbol(funcname);
|
||||
p = (dl_funcptr)NSAddressOfSymbol(theSym);
|
||||
}
|
||||
#endif /* USE_DYLD */
|
||||
#ifdef hpux
|
||||
{
|
||||
shl_t lib;
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
/* strdup() replacement (from stdwin, if you must know) */
|
||||
|
||||
#include "config.h"
|
||||
#include "myproto.h"
|
||||
#include "mymalloc.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "pgenheaders.h"
|
||||
|
||||
char *
|
||||
strdup(str)
|
||||
|
|
12
acconfig.h
12
acconfig.h
|
@ -18,6 +18,9 @@
|
|||
/* Define to `long' if <time.h> doesn't define. */
|
||||
#undef clock_t
|
||||
|
||||
/* Used for BeOS configuration */
|
||||
#undef DL_EXPORT_HEADER
|
||||
|
||||
/* Define if getpgrp() must be called as getpgrp(0). */
|
||||
#undef GETPGRP_HAVE_ARG
|
||||
|
||||
|
@ -93,9 +96,18 @@
|
|||
shared libraries */
|
||||
#undef WITH_DL_DLD
|
||||
|
||||
/* Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
|
||||
dynamic linker (dyld) instead of the old-style (NextStep) dynamic
|
||||
linker (rld). Dyld is necessary to support frameworks. */
|
||||
#undef WITH_DYLD
|
||||
|
||||
/* Define if you want to compile in rudimentary thread support */
|
||||
#undef WITH_THREAD
|
||||
|
||||
/* Define if you want to produce an OpenStep/Rhapsody framework
|
||||
(shared library plus accessory files). */
|
||||
#undef WITH_NEXT_FRAMEWORK
|
||||
|
||||
/* The number of bytes in an off_t. */
|
||||
#undef SIZEOF_OFF_T
|
||||
|
||||
|
|
18
config.h.in
18
config.h.in
|
@ -79,6 +79,9 @@
|
|||
/* Define to `long' if <time.h> doesn't define. */
|
||||
#undef clock_t
|
||||
|
||||
/* Used for BeOS configuration */
|
||||
#undef DL_EXPORT_HEADER
|
||||
|
||||
/* Define if getpgrp() must be called as getpgrp(0). */
|
||||
#undef GETPGRP_HAVE_ARG
|
||||
|
||||
|
@ -148,9 +151,18 @@
|
|||
shared libraries */
|
||||
#undef WITH_DL_DLD
|
||||
|
||||
/* Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
|
||||
dynamic linker (dyld) instead of the old-style (NextStep) dynamic
|
||||
linker (rld). Dyld is necessary to support frameworks. */
|
||||
#undef WITH_DYLD
|
||||
|
||||
/* Define if you want to compile in rudimentary thread support */
|
||||
#undef WITH_THREAD
|
||||
|
||||
/* Define if you want to produce an OpenStep/Rhapsody framework
|
||||
(shared library plus accessory files). */
|
||||
#undef WITH_NEXT_FRAMEWORK
|
||||
|
||||
/* The number of bytes in an off_t. */
|
||||
#undef SIZEOF_OFF_T
|
||||
|
||||
|
@ -453,9 +465,3 @@
|
|||
|
||||
/* Define if you have the m library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
|
||||
/* Define if you have special dynamic linkage requirements in declarations. */
|
||||
#undef DL_EXPORT_HEADER
|
||||
#ifdef DL_EXPORT_HEADER
|
||||
#include DL_EXPORT_HEADER
|
||||
#endif
|
||||
|
|
116
configure.in
116
configure.in
|
@ -9,7 +9,7 @@ AC_SUBST(VERSION)
|
|||
VERSION=1.5
|
||||
|
||||
# NEXTSTEP stuff
|
||||
if test -f /usr/lib/NextStep/software_version; then
|
||||
if test -f /usr/lib/NextStep/software_version -o -f /System/Library/CoreServices/software_version ; then
|
||||
|
||||
AC_MSG_CHECKING(for --with-next-archs)
|
||||
AC_ARG_WITH(next-archs,
|
||||
|
@ -24,7 +24,7 @@ if test -f /usr/lib/NextStep/software_version; then
|
|||
|
||||
if test -z "$MACHDEP"
|
||||
then
|
||||
set X `hostinfo | grep 'NeXT Mach.*:' | \
|
||||
set X `hostinfo | egrep '(NeXT Mach|Kernel Release).*:' | \
|
||||
sed -e 's/://' -e 's/\./_/'` && \
|
||||
ac_sys_system=next && ac_sys_release=$4
|
||||
|
||||
|
@ -32,6 +32,10 @@ if test -f /usr/lib/NextStep/software_version; then
|
|||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(next-framework,
|
||||
[--with-next-framework Build (OpenStep|Rhapsody|MacOS10) framework],,)
|
||||
AC_ARG_WITH(dyld,
|
||||
[--with-dyld Use (OpenStep|Rhapsody|MacOS10) dynamic linker],,)
|
||||
|
||||
# Set name for machine-dependent library files
|
||||
AC_SUBST(MACHDEP)
|
||||
|
@ -172,6 +176,14 @@ BeOS*)
|
|||
esac;;
|
||||
esac
|
||||
|
||||
# LDLIBRARY is the name of the library to link against (as opposed to the
|
||||
# name of the library into which to insert object files). On systems
|
||||
# without shared libraries, LDLIBRARY is the same as LIBRARY (defined in
|
||||
# the Makefiles).
|
||||
AC_SUBST(MAKE_LDLIBRARY)
|
||||
AC_SUBST(LDLIBRARY)
|
||||
LDLIBRARY=''
|
||||
|
||||
# LINKCC is the command that links the python executable -- default is $(CC).
|
||||
# This is altered for AIX and BeOS in order to build the export list before
|
||||
# linking.
|
||||
|
@ -184,7 +196,7 @@ then
|
|||
LINKCC="\$(srcdir)/makexp_aix python.exp \"\" \$(LIBRARY); \$(PURIFY) \$(CC)";;
|
||||
BeOS*)
|
||||
LINKCC="\$(srcdir)/../BeOS/linkcc \$(LIBRARY) \$(PURIFY) \$(CC) \$(OPT)"
|
||||
REALLIBRARY='libpython$(VERSION).so';;
|
||||
LDLIBRARY='libpython$(VERSION).so';;
|
||||
dgux*)
|
||||
LINKCC="LD_RUN_PATH=$libdir \$(PURIFY) \$(CC)";;
|
||||
*) LINKCC="\$(PURIFY) \$(CC)";;
|
||||
|
@ -192,13 +204,38 @@ then
|
|||
fi
|
||||
AC_MSG_RESULT($LINKCC)
|
||||
|
||||
AC_MSG_CHECKING(LDLIBRARY)
|
||||
|
||||
# NeXT framework builds require that the 'ar' library be converted into
|
||||
# a bundle using libtool.
|
||||
if test "$with_next_framework"
|
||||
then
|
||||
LDLIBRARY='libpython$(VERSION).dylib'
|
||||
fi
|
||||
|
||||
# DG/UX requires some fancy ld contortions to produce a .so from an .a
|
||||
if test "$MACHDEP" = "dguxR4"
|
||||
then
|
||||
LDLIBRARY='libpython$(VERSION).so'
|
||||
OPT="$OPT -pic"
|
||||
fi
|
||||
AC_MSG_RESULT($LDLIBRARY)
|
||||
|
||||
# If LDLIBRARY is different from LIBRARY, emit a rule to build it.
|
||||
if test -z "$LDLIBRARY"
|
||||
then
|
||||
LDLIBRARY='libpython$(VERSION).a'
|
||||
MAKE_LDLIBRARY="true"
|
||||
else
|
||||
MAKE_LDLIBRARY='$(MAKE) $(LDLIBRARY)'
|
||||
fi
|
||||
|
||||
AC_PROG_RANLIB
|
||||
AC_SUBST(AR)
|
||||
AC_CHECK_PROGS(AR, ar aal, ar)
|
||||
AC_SUBST(INSTALL)
|
||||
AC_SUBST(INSTALL_PROGRAM)
|
||||
AC_SUBST(INSTALL_DATA)
|
||||
AC_SUBST(REALLIBRARY)
|
||||
# Install just never works :-(
|
||||
if test -z "$INSTALL"
|
||||
then
|
||||
|
@ -268,17 +305,6 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(DGUX_IS_BROKEN)
|
||||
if test "$MACHDEP" != "dguxR4"
|
||||
then
|
||||
REALLIBRARY='libpython$(VERSION).a'
|
||||
DGUX_IS_BROKEN="true"
|
||||
else
|
||||
REALLIBRARY='libpython$(VERSION).so'
|
||||
OPT="$OPT -pic"
|
||||
DGUX_IS_BROKEN="make $REALLIBRARY"
|
||||
fi
|
||||
|
||||
# check for ANSI or K&R ("traditional") preprocessor
|
||||
AC_MSG_CHECKING(for C preprocessor type)
|
||||
AC_TRY_COMPILE([
|
||||
|
@ -356,6 +382,45 @@ else
|
|||
fi
|
||||
|
||||
|
||||
# Minor variations in building a framework between NextStep versions 4 and 5
|
||||
AC_SUBST(LIBTOOL_CRUFT)
|
||||
case $ac_sys_system/$ac_sys_release in
|
||||
next/4*)
|
||||
ns_undef_sym='__environ'
|
||||
LIBTOOL_CRUFT="-U $ns_undef_sym" ;;
|
||||
next/5*)
|
||||
ns_undef_sym='_environ'
|
||||
LIBTOOL_CRUFT="-lcc_dynamic -U $ns_undef_sym" ;;
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING(for --with-next-framework)
|
||||
if test "$with_next_framework"
|
||||
then
|
||||
OPT="$OPT -fno-common"
|
||||
# -U __environ is needed since bundles don't have access
|
||||
# to crt0 when built but will always be linked against it
|
||||
LDFLAGS="$LDFLAGS -Wl,-U,$ns_undef_sym"
|
||||
AC_DEFINE(WITH_NEXT_FRAMEWORK)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for --with-dyld)
|
||||
if test "$with_next_framework" -o "$with_dyld"
|
||||
then
|
||||
if test "$with_dyld"
|
||||
then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(required for framework build)
|
||||
fi
|
||||
AC_DEFINE(WITH_DYLD)
|
||||
ns_dyld='set'
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
# Set info about shared libraries.
|
||||
AC_SUBST(SO)
|
||||
AC_SUBST(LDSHARED)
|
||||
|
@ -374,6 +439,8 @@ fi
|
|||
AC_MSG_RESULT($SO)
|
||||
# LDSHARED is the ld *command* used to create shared library
|
||||
# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
|
||||
# (Shared libraries in this instance are shared modules to be loaded into
|
||||
# Python, as opposed to building Python itself as a shared library.)
|
||||
AC_MSG_CHECKING(LDSHARED)
|
||||
if test -z "$LDSHARED"
|
||||
then
|
||||
|
@ -387,7 +454,14 @@ then
|
|||
hp*|HP*) LDSHARED="ld -b";;
|
||||
OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
|
||||
DYNIX/ptx*) LDSHARED="ld -G";;
|
||||
next/*) LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';;
|
||||
next/*)
|
||||
if test "$ns_dyld"
|
||||
then LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind'
|
||||
else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';
|
||||
fi
|
||||
if test "$with_next_framework" ; then
|
||||
LDSHARED="$LDSHARED \$(LDLIBRARY)"
|
||||
fi ;;
|
||||
Linux*) LDSHARED="gcc -shared";;
|
||||
dgux*) LDSHARED="ld -G";;
|
||||
FreeBSD*/3*) LDSHARED="gcc -shared";;
|
||||
|
@ -405,7 +479,7 @@ then
|
|||
fi
|
||||
AC_MSG_RESULT($LDSHARED)
|
||||
# CCSHARED are the C *flags* used to create objects to go into a shared
|
||||
# library -- this is only needed for a few systems
|
||||
# library (module) -- this is only needed for a few systems
|
||||
AC_MSG_CHECKING(CCSHARED)
|
||||
if test -z "$CCSHARED"
|
||||
then
|
||||
|
@ -436,7 +510,13 @@ then
|
|||
LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
|
||||
FreeBSD/3*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
||||
Linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
||||
next/*) LINKFORSHARED="-u libsys_s";;
|
||||
# -u libsys_s pulls in all symbols in libsys
|
||||
next/2*|next/3*) LINKFORSHARED="-u libsys_s";;
|
||||
# -u __dummy makes the linker aware of the objc runtime
|
||||
# in System.framework; otherwise, __objcInit (referenced in
|
||||
# crt1.o) gets erroneously defined as common, which breaks dynamic
|
||||
# loading of any modules which reference it in System.framework
|
||||
next/4*|next/5*) LINKFORSHARED="-u __dummy -framework System" ;;
|
||||
SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
|
||||
NetBSD*)
|
||||
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
||||
|
|
Loading…
Reference in a new issue