[PATCH] build: make librt optional for some platforms
Jan Tulak
jtulak at redhat.com
Thu Apr 14 12:14:59 CDT 2016
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 at redhat.com>
---
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
More information about the xfs
mailing list