diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2001-07-19 11:00:41 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2001-07-19 11:00:41 (GMT) |
commit | 130fb175781ca6902ab8f711e2175206ecb74fcc (patch) | |
tree | fa69505e988fa8e104d5132fa5af3fb47d44f39c /configure.in | |
parent | d0cd95ce7febd97683d6e113e1b486b93bcf88eb (diff) | |
download | cpython-130fb175781ca6902ab8f711e2175206ecb74fcc.zip cpython-130fb175781ca6902ab8f711e2175206ecb74fcc.tar.gz cpython-130fb175781ca6902ab8f711e2175206ecb74fcc.tar.bz2 |
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.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 199 |
1 files changed, 101 insertions, 98 deletions
diff --git a/configure.in b/configure.in index c6b7a55..3e0248a 100644 --- a/configure.in +++ b/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="#"]) - ])])])])])])])])]) - - 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 ! -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=""]) + + 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 |