configure: add Linux libnuma detection

Add detection of libnuma (mostly contained in the numactl package)
to the configure script. Can be enabled or disabled on the command
line, default is use if available.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Wanlong Gao 2014-05-14 17:43:28 +08:00 committed by Michael S. Tsirkin
parent 7bd4f430a3
commit a99d57bb6a
1 changed files with 32 additions and 0 deletions

32
configure vendored
View File

@ -334,6 +334,7 @@ tpm="no"
libssh2="" libssh2=""
vhdx="" vhdx=""
quorum="" quorum=""
numa=""
# parse CC options first # parse CC options first
for opt do for opt do
@ -1118,6 +1119,10 @@ for opt do
;; ;;
--enable-quorum) quorum="yes" --enable-quorum) quorum="yes"
;; ;;
--disable-numa) numa="no"
;;
--enable-numa) numa="yes"
;;
*) *)
echo "ERROR: unknown option $opt" echo "ERROR: unknown option $opt"
echo "Try '$0 --help' for more information" echo "Try '$0 --help' for more information"
@ -1384,6 +1389,8 @@ Advanced options (experts only):
--enable-vhdx enable support for the Microsoft VHDX image format --enable-vhdx enable support for the Microsoft VHDX image format
--disable-quorum disable quorum block filter support --disable-quorum disable quorum block filter support
--enable-quorum enable quorum block filter support --enable-quorum enable quorum block filter support
--disable-numa disable libnuma support
--enable-numa enable libnuma support
NOTE: The object files are built at the place where configure is launched NOTE: The object files are built at the place where configure is launched
EOF EOF
@ -3167,6 +3174,26 @@ if compile_prog "" "" ; then
splice=yes splice=yes
fi fi
##########################################
# libnuma probe
if test "$numa" != "no" ; then
cat > $TMPC << EOF
#include <numa.h>
int main(void) { return numa_available(); }
EOF
if compile_prog "" "-lnuma" ; then
numa=yes
libs_softmmu="-lnuma $libs_softmmu"
else
if test "$numa" = "yes" ; then
feature_not_found "numa" "install numactl devel"
fi
numa=no
fi
fi
########################################## ##########################################
# signalfd probe # signalfd probe
signalfd="no" signalfd="no"
@ -4241,6 +4268,7 @@ echo "vhdx $vhdx"
echo "Quorum $quorum" echo "Quorum $quorum"
echo "lzo support $lzo" echo "lzo support $lzo"
echo "snappy support $snappy" echo "snappy support $snappy"
echo "NUMA host support $numa"
if test "$sdl_too_old" = "yes"; then if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support" echo "-> Your SDL version is too old - please upgrade to have SDL support"
@ -5210,6 +5238,10 @@ if [ "$dtc_internal" = "yes" ]; then
echo "config-host.h: subdir-dtc" >> $config_host_mak echo "config-host.h: subdir-dtc" >> $config_host_mak
fi fi
if test "$numa" = "yes"; then
echo "CONFIG_NUMA=y" >> $config_host_mak
fi
# build tree in object directory in case the source is not in the current directory # build tree in object directory in case the source is not in the current directory
DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests" DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests"
DIRS="$DIRS fsdev" DIRS="$DIRS fsdev"