e02205e7d4
From Holger Mikolon, thanks.
47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
$OpenBSD: patch-aconfigure_ac,v 1.4 2012/05/05 19:54:04 dcoppa Exp $
|
|
|
|
zap CROSS_COMPILE variable
|
|
use -pthread instead of -lpthread
|
|
|
|
--- aconfigure.ac.orig Fri Apr 27 03:22:15 2012
|
|
+++ aconfigure.ac Sat May 5 21:30:07 2012
|
|
@@ -41,13 +41,6 @@ AC_PROG_CC
|
|
AC_PROG_CXX
|
|
AC_LANG_C
|
|
|
|
-dnl #
|
|
-dnl # Setup CROSS_COMPILE variable
|
|
-dnl #
|
|
-if test -z "$CROSS_COMPILE"; then
|
|
- CROSS_COMPILE=`echo ${CC} | sed 's/gcc//'`
|
|
-fi
|
|
-
|
|
if test "$AR" = ""; then AR="${CROSS_COMPILE}ar rv"; fi
|
|
AC_SUBST(AR)
|
|
if test "$LD" = ""; then LD="$CC"; fi
|
|
@@ -105,7 +98,23 @@ case $target in
|
|
;;
|
|
esac
|
|
|
|
-AC_CHECK_LIB(pthread,pthread_create)
|
|
+AC_CHECK_HEADER(pthread.h, have_pthread_h=yes)
|
|
+if test "X$have_pthread_h" = "Xyes" ; then
|
|
+ save_LDFLAGS="$LDFLAGS";
|
|
+ LDFLAGS="$LDFLAGS -pthread"
|
|
+ AC_LINK_IFELSE(
|
|
+ [AC_LANG_PROGRAM(
|
|
+ [[#include <pthread.h>
|
|
+ pthread_t thr;]],
|
|
+ [pthread_create(&thr, NULL, NULL, NULL);])],
|
|
+ [ac_cv_support_pthreads=yes],
|
|
+ [LDFLAGS="$save_LDFLAGS"])
|
|
+ if test "X$ac_cv_support_pthreads" != "Xyes" ; then
|
|
+ AC_CHECK_LIB(pthread, pthread_create,
|
|
+ LIBS="-lpthread $LIBS")
|
|
+ fi
|
|
+fi
|
|
+
|
|
AC_CHECK_LIB(wsock32,puts)
|
|
AC_CHECK_LIB(ws2_32,puts)
|
|
AC_CHECK_LIB(ole32,puts)
|