Patch #418659: Fixes for UnixWare and ReliantUnix.
back-out 1.215 of configure.in and 1.34 of Makefile.pre.in Check for -Kpthread compiler support, and use this as the sole option for MT if available.
This commit is contained in:
parent
d0cd95ce7f
commit
130fb17578
|
@ -314,7 +314,7 @@ $(LIBRARY): $(LIBRARY_OBJS)
|
|||
$(AR) cr $@ $(MODOBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
# This rule is only here for DG/UX, UnixWare, and BeOS!!!
|
||||
# This rule is only here for DG/UX and BeOS!!!
|
||||
libpython$(VERSION).so: $(LIBRARY)
|
||||
case `uname -s | tr -d '/ ' | tr '[A-Z]' '[a-z]'` in \
|
||||
*dgux*) \
|
||||
|
@ -322,9 +322,6 @@ libpython$(VERSION).so: $(LIBRARY)
|
|||
(cd dgux;ar x ../$^;ld -G -o ../$@ * ); \
|
||||
/bin/rm -rf ./dgux \
|
||||
;; \
|
||||
unixware*) \
|
||||
$(LDSHARED) -o $@ $(LIBRARY_OBJS) \
|
||||
;; \
|
||||
beos) \
|
||||
$(AR) so $(LIBRARY) $@ \
|
||||
;; \
|
||||
|
|
195
configure.in
195
configure.in
|
@ -52,9 +52,7 @@ AC_MSG_CHECKING(MACHDEP)
|
|||
if test -z "$MACHDEP"
|
||||
then
|
||||
ac_sys_system=`uname -s`
|
||||
if test "$ac_sys_system" = "AIX" -o \
|
||||
"$ac_sys_system" = "Monterey64" -o \
|
||||
"$ac_sys_system" = "UnixWare"; then
|
||||
if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64"; then
|
||||
ac_sys_release=`uname -v`
|
||||
else
|
||||
ac_sys_release=`uname -r`
|
||||
|
@ -127,15 +125,8 @@ AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [
|
|||
;;
|
||||
Monterey*)
|
||||
RANLIB=:
|
||||
without_gcc=
|
||||
;;
|
||||
UnixWare*)
|
||||
RANLIB=:
|
||||
without_gcc=
|
||||
;;
|
||||
*)
|
||||
without_gcc=no
|
||||
;;
|
||||
without_gcc=;;
|
||||
*) without_gcc=no;;
|
||||
esac])
|
||||
AC_MSG_RESULT($without_gcc)
|
||||
|
||||
|
@ -273,9 +264,6 @@ cygwin*)
|
|||
LDLIBRARY='libpython$(VERSION).dll.a'
|
||||
DLLLIBRARY='libpython$(VERSION).dll'
|
||||
;;
|
||||
unixware*)
|
||||
LDLIBRARY='libpython$(VERSION).so'
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT($LDLIBRARY)
|
||||
|
||||
|
@ -530,6 +518,24 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# -Kpthread, if available, provides the right #defines
|
||||
# and linker options to make pthread_create available
|
||||
AC_MSG_CHECKING(whether $CC accepts -Kpthread)
|
||||
AC_CACHE_VAL(ac_cv_kpthread,
|
||||
[ac_save_cc="$CC"
|
||||
CC="$CC -Kpthread"
|
||||
AC_TRY_LINK([#include <pthread.h>],[pthread_create(0,0,0,0)],
|
||||
ac_cv_kpthread=yes,
|
||||
ac_cv_kpthread=no)
|
||||
CC="$ac_save_cc"])
|
||||
|
||||
# GCC does not reject -Kpthread as an illegal option, it merely complains that
|
||||
# it is unrecognized
|
||||
if test "$GCC" = "yes"
|
||||
then ac_cv_kpthread="no, we have gcc"
|
||||
fi
|
||||
AC_MSG_RESULT($ac_cv_kpthread)
|
||||
|
||||
dnl # check for ANSI or K&R ("traditional") preprocessor
|
||||
dnl AC_MSG_CHECKING(for C preprocessor type)
|
||||
dnl AC_TRY_COMPILE([
|
||||
|
@ -779,7 +785,7 @@ then
|
|||
UnixWare*)
|
||||
if test "$GCC" = "yes"
|
||||
then LDSHARED="$(CC) -shared"
|
||||
else LDSHARED="ld -G -dy -Bdynamic"
|
||||
else LDSHARED="$(CC) -G"
|
||||
fi;;
|
||||
SCO_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
|
||||
Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";;
|
||||
|
@ -809,7 +815,7 @@ then
|
|||
UnixWare*)
|
||||
if test "$GCC" = "yes"
|
||||
then CCSHARED="-fPIC"
|
||||
else CCSHARED="-KPIC -G -dy -Bdynamic"
|
||||
else CCSHARED="-KPIC"
|
||||
fi;;
|
||||
SCO_SV*) CCSHARED="-KPIC -dy -Bdynamic";;
|
||||
Monterey*) CCSHARED="-G";;
|
||||
|
@ -840,7 +846,7 @@ then
|
|||
# loading of any modules which reference it in System.framework
|
||||
next/4*|next/5*) LINKFORSHARED="-u __dummy -framework System" ;;
|
||||
Darwin/*) LINKFORSHARED="-u __dummy -u _PyMac_Error -framework System -framework Foundation -framework Carbon" ;;
|
||||
UnixWare*) LINKFORSHARED="-dy -Bdynamic -Wl,-Bexport";;
|
||||
UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
|
||||
SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
|
||||
ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
|
||||
FreeBSD*|NetBSD*)
|
||||
|
@ -964,87 +970,84 @@ AC_MSG_RESULT($with_threads)
|
|||
if test "$with_threads" = "no"
|
||||
then
|
||||
USE_THREAD_MODULE="#"
|
||||
elif test "$ac_cv_kpthread" = "yes"
|
||||
then
|
||||
CC="$CC -Kpthread"
|
||||
AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBOBJS="$LIBOBJS thread.o"
|
||||
else
|
||||
if test "$ac_sys_system" = "UnixWare"
|
||||
then
|
||||
CC="${CC} -Kthread"
|
||||
LIBOBJS="$LIBOBJS thread.o"
|
||||
AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
USE_THREAD_MODULE=""
|
||||
else
|
||||
if test ! -z "$with_threads" -a -d "$with_threads"
|
||||
then LDFLAGS="$LDFLAGS -L$with_threads"
|
||||
fi
|
||||
if test ! -z "$withval" -a -d "$withval"
|
||||
then LDFLAGS="$LDFLAGS -L$withval"
|
||||
fi
|
||||
AC_DEFINE(_REENTRANT)
|
||||
AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(C_THREADS)
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
AC_MSG_CHECKING(for --with-pth)
|
||||
AC_ARG_WITH(pth,
|
||||
[ --with-pth use GNU pth threading libraries], [
|
||||
AC_MSG_RESULT($withval)
|
||||
AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(HAVE_PTH)
|
||||
LIBS="-lpth $LIBS"
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="-lpthread $LIBS"
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
|
||||
case $ac_sys_system in
|
||||
Darwin*) ;;
|
||||
*) AC_DEFINE(_POSIX_THREADS);;
|
||||
esac
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(BEOS_THREADS)
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="$LIBS -lpthreads"
|
||||
LIBOBJS="$LIBOBJS thread.o"], [
|
||||
AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="$LIBS -lc_r"
|
||||
LIBOBJS="$LIBOBJS thread.o"], [
|
||||
AC_CHECK_LIB(thread, __d6_pthread_create, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="$LIBS -lthread"
|
||||
LIBOBJS="$LIBOBJS thread.o"], [
|
||||
AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="$LIBS -lpthread"
|
||||
LIBOBJS="$LIBOBJS thread.o"], [
|
||||
AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="$LIBS -lcma"
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
USE_THREAD_MODULE="#"])
|
||||
])])])])])])])])])
|
||||
if test ! -z "$with_threads" -a -d "$with_threads"
|
||||
then LDFLAGS="$LDFLAGS -L$with_threads"
|
||||
fi
|
||||
if test ! -z "$withval" -a -d "$withval"
|
||||
then LDFLAGS="$LDFLAGS -L$withval"
|
||||
fi
|
||||
AC_DEFINE(_REENTRANT)
|
||||
AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(C_THREADS)
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
AC_MSG_CHECKING(for --with-pth)
|
||||
AC_ARG_WITH(pth,
|
||||
[ --with-pth use GNU pth threading libraries], [
|
||||
AC_MSG_RESULT($withval)
|
||||
AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(HAVE_PTH)
|
||||
LIBS="-lpth $LIBS"
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="-lpthread $LIBS"
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
|
||||
case $ac_sys_system in
|
||||
Darwin*) ;;
|
||||
*) AC_DEFINE(_POSIX_THREADS);;
|
||||
esac
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(BEOS_THREADS)
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="$LIBS -lpthreads"
|
||||
LIBOBJS="$LIBOBJS thread.o"], [
|
||||
AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="$LIBS -lc_r"
|
||||
LIBOBJS="$LIBOBJS thread.o"], [
|
||||
AC_CHECK_LIB(thread, __d6_pthread_create, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="$LIBS -lthread"
|
||||
LIBOBJS="$LIBOBJS thread.o"], [
|
||||
AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="$LIBS -lpthread"
|
||||
LIBOBJS="$LIBOBJS thread.o"], [
|
||||
AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
|
||||
AC_DEFINE(_POSIX_THREADS)
|
||||
LIBS="$LIBS -lcma"
|
||||
LIBOBJS="$LIBOBJS thread.o"],[
|
||||
USE_THREAD_MODULE="#"])
|
||||
])])])])])])])])])
|
||||
|
||||
AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
|
||||
LIBS="$LIBS -lmpc"
|
||||
LIBOBJS="$LIBOBJS thread.o"
|
||||
USE_THREAD_MODULE=""])
|
||||
AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
|
||||
LIBS="$LIBS -lthread"
|
||||
LIBOBJS="$LIBOBJS thread.o"
|
||||
USE_THREAD_MODULE=""])
|
||||
AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
|
||||
LIBS="$LIBS -lmpc"
|
||||
LIBOBJS="$LIBOBJS thread.o"
|
||||
USE_THREAD_MODULE=""])
|
||||
AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
|
||||
LIBS="$LIBS -lthread"
|
||||
LIBOBJS="$LIBOBJS thread.o"
|
||||
USE_THREAD_MODULE=""])
|
||||
|
||||
if test "$USE_THREAD_MODULE" != "#"
|
||||
then
|
||||
# If the above checks didn't disable threads, (at least) OSF1
|
||||
# needs this '-threads' argument during linking.
|
||||
case $ac_sys_system in
|
||||
OSF1) LDLAST=-threads;;
|
||||
esac
|
||||
fi
|
||||
if test "$USE_THREAD_MODULE" != "#"
|
||||
then
|
||||
# If the above checks didn't disable threads, (at least) OSF1
|
||||
# needs this '-threads' argument during linking.
|
||||
case $ac_sys_system in
|
||||
OSF1) LDLAST=-threads;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue