]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
build: Add fls check into autoconf
authorJan Tulak <jtulak@redhat.com>
Tue, 18 Aug 2015 07:53:18 +0000 (17:53 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 18 Aug 2015 07:53:18 +0000 (17:53 +1000)
Signed-off-by: Jan Tulak <jtulak@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
configure.ac
include/bitops.h
include/builddefs.in
m4/package_libcdev.m4

index 0aba90c36639b5738428f0b4359a41cda4dc959b..abb79045349c3c07db69da915d6861c2c2bb44ae 100644 (file)
@@ -116,6 +116,7 @@ AC_HAVE_FIEMAP
 AC_HAVE_PREADV
 AC_HAVE_SYNC_FILE_RANGE
 AC_HAVE_MNTENT
+AC_HAVE_FLS
 AC_HAVE_BLKID_TOPO
 AC_HAVE_READDIR
 
index 930f64a3258abb18dee27aecf786beaca89f57fa..44599a7843983f2ec49e78a207a95e465347bd36 100644 (file)
@@ -5,6 +5,7 @@
  * fls: find last bit set.
  */
 
+#ifndef HAVE_FLS
 static inline int fls(int x)
 {
        int r = 32;
@@ -32,6 +33,7 @@ static inline int fls(int x)
        }
        return r;
 }
+#endif /* HAVE_FLS */
 
 static inline int fls64(__u64 x)
 {
index e522243aadcf7ec0476130ec5b6e16f89e7df095..885195642c63206e4ca1083a541709605d3a6241 100644 (file)
@@ -104,6 +104,7 @@ HAVE_PREADV = @have_preadv@
 HAVE_SYNC_FILE_RANGE = @have_sync_file_range@
 HAVE_READDIR = @have_readdir@
 HAVE_MNTENT = @have_mntent@
+HAVE_FLS = @have_fls@
 
 GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall 
 #         -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
@@ -131,6 +132,9 @@ PLDLIBS = -L/usr/local/lib -lintl
 PCFLAGS = -I/usr/local/include $(GCCFLAGS)
 DEPENDFLAGS = -D__FreeBSD__
 endif
+ifeq ($(HAVE_FLS),yes)
+LCFLAGS+= -DHAVE_FLS
+endif
 ifeq ($(HAVE_MNTENT),yes)
 PCFLAGS+= -DHAVE_MNTENT
 endif
index 75aa61ee8698ad73c68b844dd1cccdf6e35efdab..4a963745c74138274f97ac1e7f0837833f6b458a 100644 (file)
@@ -202,6 +202,18 @@ AC_DEFUN([AC_HAVE_READDIR],
     AC_SUBST(have_readdir)
   ])
 
+#
+# Check if we have a flc call (Mac OS X)
+#
+AC_DEFUN([AC_HAVE_FLS],
+  [ AC_CHECK_DECL([fls],
+       have_fls=yes,
+       [],
+       [#include <string.h>]
+       )
+    AC_SUBST(have_fls)
+  ])
+
 #
 # Check if there is mntent.h
 #