[vorbis-dev] Re: ogg123 testing
Christian Weisgerber
naddy at mips.inka.de
Fri Nov 23 17:48:11 PST 2001
Jack Moffitt <jack at xiph.org> wrote:
> Um, -pthread should go in CFLAGS.
I guess you are right, but I wish I could find this documented
anywhere.
Miod Vallat <miod at openbsd.org> suggests this general fragment, which
looks very good indeed:
AC_CACHE_CHECK(
[if compiler recognizes -pthread],
myapp_cv_gcc_pthread,
ac_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -pthread"
AC_LANG_SAVE
AC_LANG_C
AC_TRY_LINK([#include <pthread.h>],
[void *p = pthread_create;],
myapp_cv_gcc_pthread=yes,
myapp_cv_gcc_pthread=no
)
AC_LANG_RESTORE
CFLAGS=$ac_save_CFLAGS
)
if test $myapp_cv_gcc_pthread = yes
then
myapp_threads=""
CFLAGS="$CFLAGS -pthread"
else
dnl AC_CHECK_HEADERS(pthread.h) unreliable
AC_CHECK_LIB(pthread,pthread_create,myapp_threads=-lpthread,
[AC_CHECK_LIB(c_r,pthread_create,myapp_threads=-lc_r)])
fi
--
Christian "naddy" Weisgerber naddy at mips.inka.de
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis-dev
mailing list