summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorStepan Kasal2007-12-11 18:47:37 +0100
committerKarel Zak2008-02-18 13:27:26 +0100
commit64754af9760f5d8db57ead93f6929ae6118dc244 (patch)
treed0fdb43cce807676954ee7d8598525a7031a2dc4 /configure.ac
parentbuild-sys: do not add -luuid to BLKID_LIBS (diff)
downloadkernel-qcow2-util-linux-64754af9760f5d8db57ead93f6929ae6118dc244.tar.gz
kernel-qcow2-util-linux-64754af9760f5d8db57ead93f6929ae6118dc244.tar.xz
kernel-qcow2-util-linux-64754af9760f5d8db57ead93f6929ae6118dc244.zip
build-sys: use pkg-config to find the libs for static build
Signed-off-by: Stepan Kasal <skasal@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
1 files changed, 17 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 911799045..bf6787fb4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -154,15 +154,27 @@ if test $have_blkid = no && test $have_volume_id = no; then
AC_MSG_ERROR([blkid or volume_id is needed to build util-linux-ng.])
fi
+dnl UTIL_PKG_STATIC(VARIABLE, MODULES)
+dnl ----------------------------------
+AC_DEFUN([UTIL_PKG_STATIC], [
+ if AC_RUN_LOG([pkg-config --exists --print-errors "$2"]); then
+ $1=`pkg-config --libs --static "$2"`
+ else
+ AC_MSG_ERROR([pkg-config description of $2, needed for static build, is not available])
+ fi
+])
+
# These default values should work in most cases:
: ${BLKID_LIBS='-lblkid'}
: ${VOLUMEID_LIBS='-lvolume_id'}
-# OTOH, the following two has little chance to succeed; please specify the
-# right values on the configure command-line:
-#
-: ${BLKID_LIBS_STATIC='$(BLKID_LIBS)'}
-: ${VOLUMEID_LIBS_STATIC='$(VOLUMEID_LIBS)'}
+# ... but for static build, we need to consult pkg-config:
+if test -n "$enable_static_programs"; then
+ case $with_fsprobe in
+ blkid) UTIL_PKG_STATIC([BLKID_LIBS_STATIC], [blkid]) ;;
+ volume_id) UTIL_PKG_STATIC([VOLUMEID_LIBS_STATIC], [libvolume_id]) ;;
+ esac
+fi
AC_ARG_VAR([BLKID_LIBS], [-l options for linking dynamically with blkid])
AC_ARG_VAR([BLKID_LIBS_STATIC], [-l options for linking statically with blkid])