[PATCH] build: make librt optional for some platforms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 configure.ac     |  7 +++++--
 doc/INSTALL      |  6 +++++-
 m4/package_rt.m4 | 12 ++++++++++++
 3 files changed, 22 insertions(+), 3 deletions(-)
 create mode 100644 m4/package_rt.m4

diff --git a/configure.ac b/configure.ac
index 6d012ce..ed67e74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/doc/INSTALL b/doc/INSTALL
index b0443a3..0879612 100644
--- a/doc/INSTALL
+++ b/doc/INSTALL
@@ -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
index 0000000..9ad1009
--- /dev/null
+++ b/m4/package_rt.m4
@@ -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)
+])
-- 
2.6.0

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux