]> xenbits.xensource.com Git - libvirt.git/commit
random: link with -lm when needed
authorEric Blake <eblake@redhat.com>
Tue, 14 Aug 2012 17:36:38 +0000 (11:36 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 14 Aug 2012 21:33:10 +0000 (15:33 -0600)
commitc606671aaad10a9bc87f226bc473a091e00a9629
treeec8ba2693e20fe6c65b5c597477c54f5d80da2c9
parent6a3691b7436505835989e7464a50c8c8bd542d75
random: link with -lm when needed

Use of ldexp() requires -lm on some platforms; use gnulib to determine
this for our makefile.  Also, optimize virRandomInt() for the case
of a power-of-two limit (actually rather common, given that Daniel
has a pending patch to replace virRandomBits(10) with code that will
default to virRandomInt(1024) on default SELinux settings).

* .gnulib: Update to latest, for ldexp.
* bootstrap.conf (gnulib_modules): Import ldexp.
* src/Makefile.am (libvirt_util_la_CFLAGS): Link with -lm when
needed.
* src/util/virrandom.c (virRandomInt): Optimize powers of 2.
.gnulib
bootstrap.conf
src/Makefile.am
src/util/virrandom.c