gluster: Use pkg-config to configure GlusterFS block driver

Use pkg-config to determine the version and library dependency
for GlusterFS block driver.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Bharata B Rao 2013-07-16 21:47:41 +05:30 committed by Stefan Hajnoczi
parent 24943978cb
commit e01bee0881
1 changed files with 6 additions and 11 deletions

17
configure vendored
View File

@ -2570,23 +2570,18 @@ fi
########################################## ##########################################
# glusterfs probe # glusterfs probe
if test "$glusterfs" != "no" ; then if test "$glusterfs" != "no" ; then
cat > $TMPC <<EOF if $pkg_config --atleast-version=3 glusterfs-api >/dev/null 2>&1; then
#include <glusterfs/api/glfs.h> glusterfs="yes"
int main(void) { glusterfs_cflags=`$pkg_config --cflags glusterfs-api 2>/dev/null`
(void) glfs_new("volume"); glusterfs_libs=`$pkg_config --libs glusterfs-api 2>/dev/null`
return 0; CFLAGS="$CFLAGS $glusterfs_cflags"
}
EOF
glusterfs_libs="-lgfapi -lgfrpc -lgfxdr"
if compile_prog "" "$glusterfs_libs" ; then
glusterfs=yes
libs_tools="$glusterfs_libs $libs_tools" libs_tools="$glusterfs_libs $libs_tools"
libs_softmmu="$glusterfs_libs $libs_softmmu" libs_softmmu="$glusterfs_libs $libs_softmmu"
else else
if test "$glusterfs" = "yes" ; then if test "$glusterfs" = "yes" ; then
feature_not_found "GlusterFS backend support" feature_not_found "GlusterFS backend support"
fi fi
glusterfs=no glusterfs="no"
fi fi
fi fi