Ty Sarna writes:

The following patches (relative to 1.5.2b1) enable Python dynamic
loading to work on NetBSD platforms that use ELF (presnetly mips and
alpha systems).  They automaticly determine wether the system is ELF or
a.out rather than using astatic list of platforms so that when other
NetBSD platforms move to ELF, python will continue to work without
change.
This commit is contained in:
Guido van Rossum 1999-01-07 21:50:41 +00:00
parent 257fd514a3
commit df69365f5f
3 changed files with 181 additions and 153 deletions

View file

@ -260,7 +260,7 @@ typedef void (*dl_funcptr)();
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__)
#define FUNCNAME_PATTERN "_init%.200s"
#else
#define FUNCNAME_PATTERN "init%.200s"

312
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -359,7 +359,14 @@ then
Linux*) LDSHARED="gcc -shared";;
dgux*) LDSHARED="ld -G";;
FreeBSD*/3*) LDSHARED="gcc -shared";;
FreeBSD*|NetBSD*|OpenBSD*) LDSHARED="ld -Bshareable";;
FreeBSD*|OpenBSD*) LDSHARED="ld -Bshareable";;
NetBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
then
LDSHARED="cc -shared"
else
LDSHARED="ld -Bshareable"
fi;;
SCO_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
*) LDSHARED="ld";;
esac
@ -376,7 +383,8 @@ then
else CCSHARED="+z";
fi;;
Linux*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*) CCSHARED="-fpic";;
FreeBSD*|OpenBSD*) CCSHARED="-fpic";;
NetBSD*) CCSHARED="-fPIC";;
SCO_SV*) CCSHARED="-KPIC -dy -Bdynamic";;
IRIX*/6*) case $CC in
*gcc*) CCSHARED="-shared";;
@ -398,6 +406,11 @@ then
Linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
next/*) LINKFORSHARED="-u libsys_s";;
SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
NetBSD*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
then
LINKFORSHARED="-Wl,--export-dynamic"
fi;;
SunOS/5*) case $CC in
*gcc*)
if $CC -Xlinker -V 2>/dev/null | grep BFD >/dev/null
@ -537,7 +550,8 @@ DLINCLDIR=${dldir}
LIBS="$LIBS -ldl -ldld"], AC_MSG_RESULT(no))
# checks for library functions
AC_CHECK_FUNCS(alarm chown clock dlopen execv flock fork ftime ftruncate \
AC_CHECK_FUNCS(alarm chown clock dlopen execv flock fork \
fsync fdatasync ftime ftruncate \
gethostname_r getpeername getpgrp getpid getpwent gettimeofday getwd \
kill link lstat mkfifo mktime nice pause plock pthread_init putenv readlink \
select setgid setlocale setuid setsid setpgid setpgrp setvbuf \