openbsd-ports/telephony/pjsua/patches/patch-aconfigure_ac
dcoppa 482e8f7461 Update to pjsua-1.7
OK sthen@
2010-09-14 07:37:19 +00:00

47 lines
1.2 KiB
Plaintext

$OpenBSD: patch-aconfigure_ac,v 1.3 2010/09/14 07:37:19 dcoppa Exp $
zap CROSS_COMPILE variable
use -pthread instead of -lpthread
--- aconfigure.ac.orig Thu Aug 5 08:27:20 2010
+++ aconfigure.ac Mon Sep 13 13:22:45 2010
@@ -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
@@ -92,7 +85,23 @@ case $host 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)