[xiph-commits] r9556 - icecast/trunk/m4
karl at svn.xiph.org
karl at svn.xiph.org
Sun Jul 10 07:24:11 PDT 2005
Author: karl
Date: 2005-07-10 07:24:08 -0700 (Sun, 10 Jul 2005)
New Revision: 9556
Modified:
icecast/trunk/m4/acx_pthread.m4
icecast/trunk/m4/ogg.m4
icecast/trunk/m4/speex.m4
icecast/trunk/m4/theora.m4
icecast/trunk/m4/vorbis.m4
icecast/trunk/m4/xiph_curl.m4
Log:
update pthread check, for the pth lib and a solaris -pthreads check. Update the
other m4 macros for the --with-X prefix check
Modified: icecast/trunk/m4/acx_pthread.m4
===================================================================
--- icecast/trunk/m4/acx_pthread.m4 2005-07-09 02:30:09 UTC (rev 9555)
+++ icecast/trunk/m4/acx_pthread.m4 2005-07-10 14:24:08 UTC (rev 9556)
@@ -37,9 +37,10 @@
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
-# which indicates that we try without any flags at all.
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
@@ -58,6 +59,7 @@
# also defines -D_REENTRANT)
# pthread: Linux, etcetera
# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
case "${host_cpu}-${host_os}" in
*solaris*)
@@ -70,7 +72,7 @@
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
- acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
+ acx_pthread_flags="-pthreads pthread -mt $acx_pthread_flags"
;;
esac
@@ -87,6 +89,13 @@
PTHREAD_CFLAGS="$flag"
;;
+ pthread-config)
+ AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
+ if test x"$acx_pthread_config" = xno; then continue; fi
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ ;;
+
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
@@ -133,36 +142,29 @@
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- # Detect AIX lossage: threads are created detached by default
- # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_MSG_CHECKING([for joinable pthread attribute])
- AC_TRY_LINK([#include <pthread.h>],
- [int attr=PTHREAD_CREATE_JOINABLE;],
- ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
- if test x"$ok" = xunknown; then
- AC_TRY_LINK([#include <pthread.h>],
- [int attr=PTHREAD_CREATE_UNDETACHED;],
- ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
+ attr_name=unknown
+ for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ AC_TRY_LINK([#include <pthread.h>], [int attr=$attr;],
+ [attr_name=$attr; break])
+ done
+ AC_MSG_RESULT($attr_name)
+ if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+ [Define to necessary symbol if this constant
+ uses a non-standard name on your system.])
fi
- if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
- AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
- [Define to the necessary symbol if this constant
- uses a non-standard name on your system.])
- fi
- AC_MSG_RESULT(${ok})
- if test x"$ok" = xunknown; then
- AC_MSG_WARN([we do not know how to create joinable pthreads])
- fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
- *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
- *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+ *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+ *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
- PTHREAD_CPPFLAGS="$flag $PTHREAD_CPPFLAGS"
+ PTHREAD_CPPFLAGS="$flag $PTHREAD_CPPFLAGS"
fi
AC_CHECK_TYPES(pthread_rwlock_t,,,[#include <pthread.h>])
Modified: icecast/trunk/m4/ogg.m4
===================================================================
--- icecast/trunk/m4/ogg.m4 2005-07-09 02:30:09 UTC (rev 9555)
+++ icecast/trunk/m4/ogg.m4 2005-07-10 14:24:08 UTC (rev 9556)
@@ -15,7 +15,7 @@
ogg_prefix="$withval",
ogg_prefix="$OGG_PREFIX"
)
-if test "x$ogg_prefix" = "x"; then
+if test "x$ogg_prefix" = "x" -o "x$ogg_prefix" = "xyes"; then
if test "x$prefix" = "xNONE"; then
ogg_prefix=/usr/local
else
Modified: icecast/trunk/m4/speex.m4
===================================================================
--- icecast/trunk/m4/speex.m4 2005-07-09 02:30:09 UTC (rev 9555)
+++ icecast/trunk/m4/speex.m4 2005-07-10 14:24:08 UTC (rev 9556)
@@ -23,7 +23,7 @@
then
AC_MSG_RESULT([Speex support disabled by request])
else
- if test "x$speex_prefix" = "x"; then
+ if test "x$speex_prefix" = "x" -o "x$speex_prefix" = "xyes"; then
if test "x$prefix" = "xNONE"; then
speex_prefix="/usr/local"
else
Modified: icecast/trunk/m4/theora.m4
===================================================================
--- icecast/trunk/m4/theora.m4 2005-07-09 02:30:09 UTC (rev 9555)
+++ icecast/trunk/m4/theora.m4 2005-07-10 14:24:08 UTC (rev 9556)
@@ -23,7 +23,7 @@
then
AC_MSG_RESULT([Theora support disabled by request])
else
- if test "x$theora_prefix" = "x"; then
+ if test "x$theora_prefix" = "x" -o "x$theora_prefix" = "xyes"; then
if test "x$prefix" = "xNONE"; then
theora_prefix="/usr/local"
else
Modified: icecast/trunk/m4/vorbis.m4
===================================================================
--- icecast/trunk/m4/vorbis.m4 2005-07-09 02:30:09 UTC (rev 9555)
+++ icecast/trunk/m4/vorbis.m4 2005-07-10 14:24:08 UTC (rev 9556)
@@ -21,7 +21,7 @@
vorbis_prefix="$withval",
vorbis_prefix="$VORBIS_PREFIX"
)
-if test "x$vorbis_prefix" = "x"; then
+if test "x$vorbis_prefix" = "x" -o "x$vorbis_prefix" = "xyes"; then
if test "x$prefix" = "xNONE"; then
vorbis_prefix="/usr/local"
else
Modified: icecast/trunk/m4/xiph_curl.m4
===================================================================
--- icecast/trunk/m4/xiph_curl.m4 2005-07-09 02:30:09 UTC (rev 9555)
+++ icecast/trunk/m4/xiph_curl.m4 2005-07-10 14:24:08 UTC (rev 9556)
@@ -14,7 +14,7 @@
AC_HELP_STRING([--with-curl-config=curl-config],[Use curl-config to find libcurl]),
CURL_CONFIG="$withval", [AC_PATH_PROGS(CURL_CONFIG, [curl-config], "")])
-if test "x$curl_prefix" != "x"; then
+if test "x$curl_prefix" != "x" -a "x$curl_prefix" != "xyes"; then
CURL_LIBS="-L$curl_prefix/lib -lcurl"
CURL_CFLAGS="-I$curl_prefix/include"
elif test "x$CURL_CONFIG" != "x"; then
More information about the commits
mailing list