Branch: Tag:

1998-11-06

1998-11-06 21:34:31 by Honza Petrous <hop@unibase.cz>

Now preferrs POSIX threads to UNIX threads.
Applied some UnixWare patches by Honza Petrous.

Rev: src/configure.in:1.250

1: - AC_REVISION("$Id: configure.in,v 1.249 1998/11/06 11:12:07 hubbe Exp $") + AC_REVISION("$Id: configure.in,v 1.250 1998/11/06 21:34:31 grubba Exp $")   AC_INIT(interpret.c)   AC_CONFIG_HEADER(machine.h)   
157:    BSD/OS*)    LD="$BINDIR/smartlink shlicc"    ;; +  UnixWare*) +  if test "$GCC" != "yes"; then +  # We are using built-in inline function +  CFLAGS="$CFLAGS -Kalloca" +  fi +  ;;   esac      AC_SUBST(LD)
844:      else    -  AC_MSG_CHECKING(unix threads) -  case "x$pike_cv_sys_os" in -  xUnixWare) -  if test "$GCC" = yes ; then -  LIBS="${LIBS} -lthread" -  else -  LIBS="${LIBS} -Kthread" -  fi -  CFLAGS="${CFLAGS} -D_UNIXWARE_THREADS_" -  ;; -  *) -  LIBS="${LIBS} -lthread" -  ;; -  esac +  # Test for POSIX threads    -  AC_CACHE_VAL(pike_cv_unix_threads, [ -  AC_TRY_RUN([ - #define _REENTRANT - #define _THREAD_SAFE - #define _MIT_POSIX_THREADS 1 - #include <thread.h> - #ifdef _UNIXWARE_THREADS_ - #include <synch.h> - #endif -  - void *foo(void *bar) { thr_exit(0); return 0; } - mutex_t tmp; - thread_t gazonk; -  - int main() - { -  void *sune; -  mutex_lock(& tmp); -  thr_create(0,0,foo,0,0,&gazonk); -  thr_join(gazonk,0,&sune); -  exit(0); - } -  ],pike_cv_unix_threads=yes,pike_cv_unix_threads=no,pike_cv_unix_threads=no) -  ]) -  -  if test x$pike_cv_unix_threads = xyes ; then -  AC_MSG_RESULT(yes) -  AC_DEFINE(_REENTRANT) -  AC_DEFINE(_THREAD_SAFE) -  AC_DEFINE(_UNIX_THREADS) -  else -  AC_MSG_RESULT(no) -  -  # Test for POSIX threads instead -  +     case "x$pike_cv_sys_os" in    xOSF1)    LIBS="${OLDLIBS} -lpthread -lmach -lexc -lc"
907:    if test "$GCC" = yes ; then    LIBS="${LIBS} -lthread"    else -  LIBS="${LIBS} -Kthread" +  CFLAGS="${CFLAGS} -Kthread"    fi    ;;   
1093:    AC_MSG_RESULT(no)    LIBS="$OLDLIBS"    +  # No POSIX threads. +  +  # Try UNIX threads instead +  +  AC_MSG_CHECKING(unix threads) +  case "x$pike_cv_sys_os" in +  xUnixWare) +  if test "$GCC" = yes ; then +  LIBS="${LIBS} -lthread" +  else +  CFLAGS="${CFLAGS} -Kthread" +  fi +  CFLAGS="${CFLAGS} -D_UNIXWARE_THREADS_" +  ;; +  *) +  LIBS="${LIBS} -lthread" +  ;; +  esac +  +  AC_CACHE_VAL(pike_cv_unix_threads, [ +  AC_TRY_RUN([ + #define _REENTRANT + #define _THREAD_SAFE + #define _MIT_POSIX_THREADS 1 + #include <thread.h> + #ifdef _UNIXWARE_THREADS_ + #include <synch.h> + #endif +  + void *foo(void *bar) { thr_exit(0); return 0; } + mutex_t tmp; + thread_t gazonk; +  + int main() + { +  void *sune; +  mutex_lock(& tmp); +  thr_create(0,0,foo,0,0,&gazonk); +  thr_join(gazonk,0,&sune); +  exit(0); + } +  ],pike_cv_unix_threads=yes,pike_cv_unix_threads=no,pike_cv_unix_threads=no) +  ]) +  +  if test x$pike_cv_unix_threads = xyes ; then +  AC_MSG_RESULT(yes) +  AC_DEFINE(_REENTRANT) +  AC_DEFINE(_THREAD_SAFE) +  AC_DEFINE(_UNIX_THREADS) +  else +  AC_MSG_RESULT(no) +  LIBS="$OLDLIBS" +     # Now we've sunk really low -- test for proprietary threads       # SGI old-style shared group processes
1110:    # AC_MSG_RESULT(no)    # :    # fi -  fi -  fi +  fi # UNIX threads +  fi # POSIX threads   fi # NT   else    # Without threads
2502:   # 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   AC_MSG_CHECKING(LDSHARED) - if test -z "$LDSHARED" - then + if test -z "$LDSHARED" ; then    case "$pike_cv_sys_os" in    AIX*)    if test "$GCC" = yes ; then
2548:    SunOS*) LDSHARED="ld";;    Solaris) LDSHARED="/usr/ccs/bin/ld -G";;    hp*|HP*) LDSHARED="ld -b";; -  OSF*) -  LDSHARED="ld -expect_unresolved '*' -shared -msym -O3" -  ;; +  OSF*) LDSHARED="ld -expect_unresolved '*' -shared -msym -O3";;    DYNIX/ptx*) LDSHARED="ld -G";;    next) LDSHARED="$CC $CFLAGS -nostdlib -r";;    Linux*) LDSHARED="$CC -shared";;
2561:    BSD/OS*) LDSHARED="shlicc -r";;    SCO_SV*) LDSHARED="cc -G -KPIC -Wl,-Bexport";;    UNIX_SV) LDSHARED="ld -G";; -  UnixWare) LDSHARED="ld -G";; +  UnixWare) +  if test "$GCC" = yes ; then +  LDSHARED="ld -G" +  else +  LDSHARED="cc -G -KPIC -Wl,-Bexport" +  fi +  ;;    Windows_NT*) LDSHARED="$CC -shared";;    *) LDSHARED="ld";;    esac
2618:   );}   ],LINKFORSHARED=-rdynamic)    ;; -  +     esac    else    case $pike_cv_sys_os in