From: aliguori Date: Fri, 12 Dec 2008 20:02:52 +0000 (+0000) Subject: Make sure to link librt if we need to. X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~13289 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da93a1fd49778e3107c346317a044455f8b46e2f;p=sdk%2Femulator%2Fqemu.git Make sure to link librt if we need to. This is really a stop-gap. The recent thread pool changes uncovered a deeper issue with how we use librt. We really should be probing for timer_create and then conditionally enabling that code. Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5997 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/configure b/configure index d1f0c04..e997a32 100755 --- a/configure +++ b/configure @@ -972,6 +972,26 @@ if [ -x "`which texi2html 2>/dev/null`" ] && \ build_docs="yes" fi +########################################## +# Do we need librt +cat > $TMPC < +#include +int main(void) { clockid_t id; return clock_gettime(id, NULL); } +EOF + +rt=no +if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + : +elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt 2> /dev/null ; then + rt=yes +fi + +if test "$rt" = "yes" ; then + # Hack, we should have a general purpose LIBS for this sort of thing + AIOLIBS="$AIOLIBS -lrt" +fi + if test "$mingw32" = "yes" ; then if test -z "$prefix" ; then prefix="c:\\\\Program Files\\\\Qemu"