libnbd/0005-macOS-Do-not-use-versi...

52 lines
1.3 KiB
Diff

From 02d25dfb0809facb8c4038fb3be64fa6d55efdf8 Mon Sep 17 00:00:00 2001
From: Martin Kletzander <mkletzan@redhat.com>
Date: Tue, 13 Jul 2021 13:13:42 +0200
Subject: [PATCH] macOS: Do not use --version_script
The linker does not support this option.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit 013ec1280911fd2e9ad578a92497e3c23989f037)
---
configure.ac | 10 ++++++++++
lib/Makefile.am | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 1641e16..dd971e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -507,6 +507,16 @@ AS_IF([test "x$enable_golang" != "xno"],[
],[GOLANG=no])
AM_CONDITIONAL([HAVE_GOLANG],[test "x$GOLANG" != "xno"])
+case $host_os in
+ darwin*)
+ VERSION_SCRIPT=
+ ;;
+ *)
+ VERSION_SCRIPT="-Wl,--version-script=${srcdir}/libnbd.syms"
+ ;;
+esac
+AC_SUBST([VERSION_SCRIPT])
+
dnl Produce output files.
AC_CONFIG_HEADERS([config.h])
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 968e41a..ece5077 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -78,7 +78,7 @@ libnbd_la_LIBADD = \
$(NULL)
libnbd_la_LDFLAGS = \
$(PTHREAD_LIBS) \
- -Wl,--version-script=$(srcdir)/libnbd.syms \
+ $(VERSION_SCRIPT) \
-version-info 0:0:0 \
$(NULL)
--
2.31.1