package/sg3_utils: ensure to build against librt when needed
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 10 Feb 2019 13:51:30 +0000 (14:51 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 11 Feb 2019 14:37:24 +0000 (15:37 +0100)
The sg3_utils has provisions to build against librt when needed, but
forgot to use that mechanism for the sg_turs program. This commit
fixes that. The patch has been submitted upstream to the sg3_utils
author.

Fixes:

  http://autobuild.buildroot.net/results/67b890a41d05497820ea4f44e187257dd6818b0b/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Tested-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/sg3_utils/0002-src-Makefile.am-add-missing-RT_LIB-for-sg_turs.patch [new file with mode: 0644]
package/sg3_utils/sg3_utils.mk

diff --git a/package/sg3_utils/0002-src-Makefile.am-add-missing-RT_LIB-for-sg_turs.patch b/package/sg3_utils/0002-src-Makefile.am-add-missing-RT_LIB-for-sg_turs.patch
new file mode 100644 (file)
index 0000000..34a4e11
--- /dev/null
@@ -0,0 +1,29 @@
+From 68b0591cf37760e09e358533bbcecf36eddfceed Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Date: Sun, 10 Feb 2019 14:46:41 +0100
+Subject: [PATCH] src/Makefile.am: add missing @RT_LIB@ for sg_turs
+
+The sg_turs program uses clock_gettime(), so it should link against
+librt, as provided by @RT_LIB@.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ src/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 881cf29..0eba680 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -170,7 +170,7 @@ sg_test_rwbuf_LDADD = ../lib/libsgutils2.la
+ sg_timestamp_LDADD = ../lib/libsgutils2.la
+-sg_turs_LDADD = ../lib/libsgutils2.la
++sg_turs_LDADD = ../lib/libsgutils2.la @RT_LIB@
+ sg_unmap_LDADD = ../lib/libsgutils2.la
+-- 
+2.20.1
+
index b3a79d68eec36ba393aad6f70382bb9162be3ae1..79521fd06e210508574be1e6ec809ca1089094b7 100644 (file)
@@ -14,7 +14,7 @@ SG3_UTILS_LICENSE := $(SG3_UTILS_LICENSE), GPL-2.0+ (programs), BSD-3-Clause (pr
 endif
 SG3_UTILS_LICENSE_FILES = COPYING BSD_LICENSE
 
-# Patching configure.ac
+# Patching configure.ac/Makefile.am
 SG3_UTILS_AUTORECONF = YES
 
 # install the libsgutils2 library