Branch: Tag:

2007-12-13

2007-12-13 17:50:21 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Avoid using pthread-config on FreeBSD 5.x or later.

Rev: src/configure.in:1.1026

1: - AC_REVISION("$Id: configure.in,v 1.1025 2007/10/03 17:45:05 grubba Exp $") + AC_REVISION("$Id: configure.in,v 1.1026 2007/12/13 17:50:21 grubba Exp $")   AC_INIT(interpret.c)   AC_CONFIG_HEADER(machine.h)   
2311:    # MinGW system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1025 2007/10/03 17:45:05 grubba Exp $. + # Automatically generated by $Id: configure.in,v 1.1026 2007/12/13 17:50:21 grubba Exp $.   # MinGW-version. Do NOT edit.   posix_name="`cat`"   posix_prefix="/"
2349:    # Native POSIX system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1025 2007/10/03 17:45:05 grubba Exp $. + # Automatically generated by $Id: configure.in,v 1.1026 2007/12/13 17:50:21 grubba Exp $.   # POSIX-version. Do NOT edit.   cat   EOF
2358:    # rntcl-style    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1025 2007/10/03 17:45:05 grubba Exp $. + # Automatically generated by $Id: configure.in,v 1.1026 2007/12/13 17:50:21 grubba Exp $.   # RNTCL-version. Do NOT edit.   sed -e "$PIKE_PATH_TRANSLATE"   EOF
3611:    else    AC_MSG_RESULT(yes)    +  AC_MSG_CHECKING(if this version of FreeBSD might require use of pthread-config) +  AC_CACHE_VAL(pike_cv_freebsd_pthread_config, [ +  AC_TRY_RUN([ + #include <osreldate.h> +  + int main(int argc, char **argv) + { +  /* pthread-config is a remnant of the GNU pth library, and should not +  * be used on more recent versions of FreeBSD. */ +  if (__FreeBSD_version < 500000) +  return(0); +  return(1); + } +  ], pike_cv_freebsd_pthread_config=yes, pike_cv_freebsd_pthread_config=no, +  pike_cv_freebsd_pthread_config=yes) +  ]) +  if test "x$pike_cv_freebsd_pthread_config" = "xyes"; then +  AC_MSG_RESULT(yes)    AC_PATH_PROG(PTHREAD_CONFIG,${ac_tool_prefix}pthread-config,no) -  +  else +  AC_MSG_RESULT(no) +  PTHREAD_CONFIG=no +  fi    if test "x$PTHREAD_CONFIG" = xno ; then -  +  # -pthread should work with all versions of FreeBSD, +  # but some custom compilers (ie tcc) may not support it. +  AC_SYS_COMPILER_FLAG(-pthread, pthread, CFLAGS, [    # FIXME: Might want to look at OS version:    # 500000 <= version < 500016: -pthread    # 500016 <= version < 502102: -lc_r    # 502102 <= version : -lpthread -  AC_SYS_COMPILER_FLAG(-pthread, pthread, CFLAGS, LIBS="$LIBS -lc_r") +  # +  LIBS="$LIBS -lc_r"    LDFLAGS="${LDFLAGS-} -lc_r" -  +  ], [ +  LDFLAGS="${LDFLAGS-} -pthread" +  ])    else    CFLAGS="$CFLAGS `${PTHREAD_CONFIG} --cflags`"    LIBS="${OLDLIBS} `${PTHREAD_CONFIG} --libs`"