From: Jan Tulak Date: Tue, 10 May 2016 07:16:06 +0000 (+1000) Subject: build: make librt optional for some platforms X-Git-Tag: v4.7.0-rc1~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d43056b1a9172b673e4c0ca13b6f6d0c6283221;p=thirdparty%2Fxfsprogs-dev.git build: make librt optional for some platforms 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 Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/configure.ac b/configure.ac index 7d4b15537..a4a6cfa19 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 b0443a3cd..087961278 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 000000000..9ad1009cc --- /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) +])