Commit da93a1fd49778e3107c346317a044455f8b46e2f
1 parent
3c529d93
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 <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5997 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
20 additions
and
0 deletions
configure
| ... | ... | @@ -972,6 +972,26 @@ if [ -x "`which texi2html 2>/dev/null`" ] && \ |
| 972 | 972 | build_docs="yes" |
| 973 | 973 | fi |
| 974 | 974 | |
| 975 | +########################################## | |
| 976 | +# Do we need librt | |
| 977 | +cat > $TMPC <<EOF | |
| 978 | +#include <signal.h> | |
| 979 | +#include <time.h> | |
| 980 | +int main(void) { clockid_t id; return clock_gettime(id, NULL); } | |
| 981 | +EOF | |
| 982 | + | |
| 983 | +rt=no | |
| 984 | +if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then | |
| 985 | + : | |
| 986 | +elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt 2> /dev/null ; then | |
| 987 | + rt=yes | |
| 988 | +fi | |
| 989 | + | |
| 990 | +if test "$rt" = "yes" ; then | |
| 991 | + # Hack, we should have a general purpose LIBS for this sort of thing | |
| 992 | + AIOLIBS="$AIOLIBS -lrt" | |
| 993 | +fi | |
| 994 | + | |
| 975 | 995 | if test "$mingw32" = "yes" ; then |
| 976 | 996 | if test -z "$prefix" ; then |
| 977 | 997 | prefix="c:\\\\Program Files\\\\Qemu" | ... | ... |