[Libguestfs] [libnbd PATCH 4/6] macOS: Do not use --version_script

Martin Kletzander mkletzan at redhat.com
Tue Jul 13 21:26:06 UTC 2021


The linker does not support this option.

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 configure.ac    | 10 ++++++++++
 lib/Makefile.am |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 9f6ba03a4773..18a66ee9114f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -513,6 +513,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 968e41aa177b..ece50770326e 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.32.0




More information about the Libguestfs mailing list