From ac2afc3a992a4ff4d0ec77e384eae2ad48334df2 Mon Sep 17 00:00:00 2001 From: paulc Date: Mon, 1 Jun 2009 15:42:34 +0000 Subject: [PATCH] Detect the proper threading library where pthread_mutexattr_settype is located. Look for regcomp only when not using internal regexp. git-svn-id: http://yate.null.ro/svn/yate/trunk@2672 acf43c95-373e-0410-b603-e72c3f656dc1 --- Makefile.in | 2 +- clients/Makefile.in | 2 +- configure.in | 12 +++++++++--- libs/ysig/Makefile.in | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index 8ca74c05..649b7e27 100644 --- a/Makefile.in +++ b/Makefile.in @@ -10,7 +10,7 @@ DEBUG := CXX := @CXX@ -Wall SED := sed DEFS := -LIBTHR:= -lpthread +LIBTHR:= @THREAD_LIB@ INCLUDES := -I. -I@srcdir@ CFLAGS := -O2 @MODULE_CPPFLAGS@ @INLINE_FLAGS@ LDFLAGS:= @LDFLAGS@ diff --git a/clients/Makefile.in b/clients/Makefile.in index efa6bafe..964393a2 100644 --- a/clients/Makefile.in +++ b/clients/Makefile.in @@ -10,7 +10,7 @@ DEBUG := CXX := @CXX@ -Wall SED := sed DEFS := -LIBTHR:= -lpthread +LIBTHR:= @THREAD_LIB@ INCLUDES := -I.. -I@top_srcdir@ CFLAGS := -O2 @MODULE_CPPFLAGS@ @INLINE_FLAGS@ LDFLAGS:= @LDFLAGS@ -L.. -lyate diff --git a/configure.in b/configure.in index b1a60ada..c015a561 100644 --- a/configure.in +++ b/configure.in @@ -92,12 +92,17 @@ AC_HEADER_TIME # Checks for library functions. AC_FUNC_MALLOC AC_TYPE_SIGNAL -AC_CHECK_FUNCS([gettimeofday inet_ntoa memmove regcomp strerror], , [AC_MSG_ERROR([This function is required.])]) +AC_CHECK_FUNCS([gettimeofday inet_ntoa memmove strerror], , [AC_MSG_ERROR([This function is required.])]) AC_CACHE_SAVE # Checks for required libraries. -AC_CHECK_LIB([pthread], [pthread_mutexattr_settype], , [AC_MSG_ERROR([This library is required.])]) +THREAD_LIB="" +AC_CHECK_LIB([pthread], [pthread_mutexattr_settype], [THREAD_LIB="-lpthread"]) +if [[ "x$THREAD_LIB" = "x" ]]; then +AC_CHECK_LIB([c], [pthread_mutexattr_settype], , [AC_MSG_ERROR([This function is required.])]) +fi +AC_SUBST(THREAD_LIB) AC_MSG_CHECKING([for dlopen in default libs]) AC_LANG_SAVE @@ -106,7 +111,7 @@ AC_TRY_LINK([#include ],[dlopen("",0);],[have_dl=yes],[have_dl=no]) AC_LANG_RESTORE AC_MSG_RESULT([$have_dl]) if [[ "x$have_dl" != "xyes" ]]; then -AC_CHECK_LIB([dl], [dlopen], , [AC_MSG_ERROR([This library is required.])]) +AC_CHECK_LIB([dl], [dlopen], , [AC_MSG_ERROR([This function is required.])]) DLOPEN_LIB="-ldl" fi AC_SUBST(DLOPEN_LIB) @@ -263,6 +268,7 @@ case "x$want_internalregex" in ;; esac AC_MSG_RESULT([$INTERNAL_REGEX]) +AC_CHECK_FUNCS([regcomp], , [INTERNAL_REGEX=yes]) AC_SUBST(INTERNAL_REGEX) HAVE_PGSQL=no diff --git a/libs/ysig/Makefile.in b/libs/ysig/Makefile.in index 76072f63..3a1a0cea 100644 --- a/libs/ysig/Makefile.in +++ b/libs/ysig/Makefile.in @@ -6,7 +6,7 @@ DEBUG := CXX := @CXX@ -Wall AR := ar DEFS := -LIBTHR := -lpthread +LIBTHR := @THREAD_LIB@ INCLUDES := -I@top_srcdir@ -I../.. -I@srcdir@ CFLAGS := -O2 @MODULE_CPPFLAGS@ @INLINE_FLAGS@ LDFLAGS:= @LDFLAGS@ -L../.. -lyate