]> err.no Git - util-linux/commitdiff
build-sys: add UTIL_{SET,RESTORE}_FLAGS
authorKarel Zak <kzak@redhat.com>
Mon, 18 May 2009 07:35:32 +0000 (09:35 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 22 May 2009 08:06:15 +0000 (10:06 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac

index 70b89c4a8dd69b3f5cbeda73811df6cc7c324115..27d8fa3540fe0831604acca0fdeb97f478fbde68 100644 (file)
@@ -183,6 +183,24 @@ AC_DEFUN([UTIL_CHECK_LIB], [
   AM_CONDITIONAL(AS_TR_CPP([HAVE_]suffix), [test [$have_]suffix = yes])
 ])
 
+dnl UTIL_SET_FLAGS(CFLAGS, CPPFLAGS, LDFLAGS)
+AC_DEFUN([UTIL_SET_FLAGS], [
+  old_CFLAGS="$CFLAGS"
+  old_CPPFLAGS="$CPPFLAGS"
+  old_LDFLAGS="$LDFLAGS"
+  CFLAGS="$CFLAGS $1"
+  CPPFLAGS="$CPPFLAGS $2"
+  LDFLAGS="$LDFLAGS $3"
+])
+
+dnl UTIL_RESTORE_FLAGS()
+AC_DEFUN([UTIL_RESTORE_FLAGS], [
+  CFLAGS="$old_CFLAGS"
+  CPPFLAGS="$old_CPPFLAGS"
+  LDFLAGS="$old_LDFLAGS"
+])
+
+
 UTIL_CHECK_LIB(uuid, uuid_is_null)
 if test "x$have_uuid" = xno; then
   AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
@@ -205,17 +223,10 @@ have_volume_id=no
 if test "x$with_fsprobe" = xblkid; then
   PKG_CHECK_MODULES(BLKID, blkid, [have_blkid=yes], [])
   if test "x$have_blkid" = xyes; then
-    old_CFLAGS="$CFLAGS"
-    old_CPPFLAGS="$CPPFLAGS"
-    old_LDFLAGS="$LDFLAGS"
-    CFLAGS="$CFLAGS $BLKID_CFLAGS"
-    CPPFLAGS="$CPPFLAGS $BLKID_CFLAGS"
-    LDFLAGS="$LDFLAGS $BLKID_LIBS"
+    UTIL_SET_FLAGS($BLKID_CFLAGS, $BLKID_CFLAGS, $BLKID_LIBS)
     AC_CHECK_HEADERS([blkid.h blkid/blkid.h], [break], [])
     AC_CHECK_FUNC(blkid_evaluate_tag, [have_blkid_evaluate=yes], [])
-    CFLAGS="$old_CFLAGS"
-    CPPFLAGS="$old_CPPFLAGS"
-    LDFLAGS="$old_LDFLAGS"
+    UTIL_RESTORE_FLAGS
   fi
 elif test "x$with_fsprobe" = xvolume_id; then
   PKG_CHECK_MODULES(VOLUME_ID, volume_id, [have_volume_id=yes], [])