]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
build: make librt optional for some platforms
authorJan Tulak <jtulak@redhat.com>
Tue, 10 May 2016 07:16:06 +0000 (17:16 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 10 May 2016 07:16:06 +0000 (17:16 +1000)
The functions that we use from librt on Linux are in other libraries
on OS X. So make it possible to disable librt.

The hardcoded librt dependency was added in 0caa2bae.

Signed-off-by: Jan Tulak <jtulak@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
configure.ac
doc/INSTALL
m4/package_rt.m4 [new file with mode: 0644]

index 7d4b1553704a175a8e5f96d1983a3112459d5df8..a4a6cfa199e1997a2167905c2b247049ba42376f 100644 (file)
@@ -56,8 +56,10 @@ AC_ARG_ENABLE(lib64,
        enable_lib64=yes)
 AC_SUBST(enable_lib64)
 
-librt="-lrt"
-AC_SUBST(librt)
+AC_ARG_ENABLE(librt,
+[ --enable-librt=[yes/no] Enable librt support [default=yes]],,
+       enable_librt=yes)
+AC_SUBST(enable_librt)
 
 #
 # If the user specified a libdir ending in lib64 do not append another
@@ -103,6 +105,7 @@ AC_SUBST(LOCALIZED_FILES)
 AC_PACKAGE_GLOBALS(xfsprogs)
 AC_PACKAGE_UTILITIES(xfsprogs)
 AC_MULTILIB($enable_lib64)
+AC_RT($enable_librt)
 
 AC_PACKAGE_NEED_UUID_H
 AC_PACKAGE_NEED_UUIDCOMPARE
index b0443a3cdbc3ef9bcb1b33151ac7afdf0858e2f7..0879612785d25214b7f82e2b3ff269e997103f42 100644 (file)
@@ -89,7 +89,11 @@ Mac OS X Instructions
        TAR=/usr/bin/gnutar
        LIBTOOL=/usr/bin/glibtool
        INSTALL_GROUP=wheel
-       LOCAL_CONFIGURE_OPTIONS="--enable-gettext=no --enable-blkid=no"
+       LOCAL_CONFIGURE_OPTIONS="\
+                                --enable-gettext=no\
+                                --enable-blkid=no\
+                                --enable-librt=no\
+                                "
 
        $ make
        $ su root
diff --git a/m4/package_rt.m4 b/m4/package_rt.m4
new file mode 100644 (file)
index 0000000..9ad1009
--- /dev/null
@@ -0,0 +1,12 @@
+# Check if the platform has librt
+#
+
+AC_DEFUN([AC_RT],
+[
+  if test "$enable_librt" = "yes"; then
+    librt="-lrt"
+  else
+    librt=""
+  fi
+  AC_SUBST(librt)
+])