diff --git a/m4/acx_pthread.m4 b/m4/acx_pthread.m4 index dcd7f26b..a67ba039 100644 --- a/m4/acx_pthread.m4 +++ b/m4/acx_pthread.m4 @@ -57,6 +57,7 @@ acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -m # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) @@ -66,13 +67,13 @@ case "${host_cpu}-${host_os}" in # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthread or + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # 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="-pthreads pthread -mt $acx_pthread_flags" + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" ;; esac @@ -146,14 +147,14 @@ if test "x$acx_pthread_ok" = xyes; then AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_TRY_LINK([#include ], [int attr=$attr;], + AC_TRY_LINK([#include ], [int attr=$attr; return 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.]) + uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) @@ -166,13 +167,17 @@ if test "x$acx_pthread_ok" = xyes; then if test "x$flag" != xno; then PTHREAD_CPPFLAGS="$flag $PTHREAD_CPPFLAGS" fi - AC_CHECK_TYPES(pthread_rwlock_t,,,[#include ]) + AC_CHECK_FUNCS([pthread_spin_lock]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" - # More AIX lossage: must compile with cc_r - AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi else PTHREAD_CC="$CC" fi diff --git a/m4/vorbis.m4 b/m4/vorbis.m4 index 6401ab6c..17add29b 100644 --- a/m4/vorbis.m4 +++ b/m4/vorbis.m4 @@ -58,16 +58,17 @@ AC_TRY_LINK_FUNC(ogg_stream_init, [xt_lib_vorbis=ok], ) ]) -AC_MSG_RESULT([$xt_lib_vorbis]) if test "x$xt_lib_vorbis" = "xok"; then # # Now check if the installed Vorbis is sufficiently new. # -AC_CHECK_TYPES([struct ovectl_ratemanage_arg],, - [xt_lib_vorbis="old version found"], [ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #include - ]) + ], [ +struct ovectl_ratemanage_arg a; +])],,[xt_lib_vorbis="old version found"]) +AC_MSG_RESULT([$xt_lib_vorbis]) fi CPPFLAGS="$xt_save_CPPFLAGS" LIBS="$xt_save_LIBS" diff --git a/m4/xiph_compiler.m4 b/m4/xiph_compiler.m4 index b80b49cf..e1739c18 100644 --- a/m4/xiph_compiler.m4 +++ b/m4/xiph_compiler.m4 @@ -178,9 +178,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[const char *x = __func__;])], [ AH_TEMPLATE([__func__], [Replace __func__ if not supported]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[const char *x = __FUNCTION__;])], [ AC_DEFINE([__func__],[__FUNCTION__]) - AC_MSG_RESULT([yes])], - [ AC_DEFINE([__func__],[""]) - AC_MSG_RESULT([no]) + AC_MSG_RESULT([Using __FUNCTION__])], + [ AC_DEFINE([__func__],["__FILE__"]) + AC_MSG_RESULT([using __FILE__]) ]) ]) ])dnl XIPH_C__FUNC__ diff --git a/m4/xiph_curl.m4 b/m4/xiph_curl.m4 index 9e2786e6..f2b49aaf 100644 --- a/m4/xiph_curl.m4 +++ b/m4/xiph_curl.m4 @@ -9,7 +9,13 @@ dnl Get the cflags and libraries dnl AC_ARG_WITH(curl, AC_HELP_STRING([--with-curl=PFX],[Prefix where libcurl is installed (optional)]), - curl_prefix="$withval", curl_prefix="") + curl_prefix="$withval", curl_prefix="$CURL_PREFIX") + +if test "x$curl_prefix" = "xno" +then + AC_MSG_RESULT([libcurl support disabled by request]) +else + AC_ARG_WITH(curl-config, AC_HELP_STRING([--with-curl-config=curl-config],[Use curl-config to find libcurl]), CURL_CONFIG="$withval", [AC_PATH_PROGS(CURL_CONFIG, [curl-config], "")]) @@ -66,4 +72,7 @@ else fi CPPFLAGS="$xt_curl_CPPFLAGS" LIBS="$xt_curl_LIBS" +fi +AC_SUBST(CURL_CFLAGS) +AC_SUBST(CURL_LIBS) ])