[patch] Do not use GNU specific linker options on systems without GNU linker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello corosync users,

here's the patch that makes possible to flawlessly build latest Corosync on SunOS 5.11
and Mac OS X 10.8.3 (as well as on earlier versions of both OSes).


Best regards,
Andrei


From 9145f6fba35d2b893d15b727be36ef058d52373c Mon Sep 17 00:00:00 2001
From: Andrei Belov <defanator@xxxxxxxxx>
Date: Wed, 3 Apr 2013 06:12:54 +0000
Subject: [PATCH] Do not use GNU specific linker options on systems without GNU
 linker.

This makes possible to build Corosync from sources on SunOS 5.11
and Mac OS X 10.8.3.
---
 configure.ac    | 11 ++++++++++-
 lib/Makefile.am |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 52ad39b..bfc86bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -621,7 +621,16 @@ CFLAGS="$ENV_CFLAGS $lt_prog_compiler_pic $SEC_FLAGS $OPT_CFLAGS $GDB_FLAGS \
 	$WERROR_CFLAGS $NSS_CFLAGS $LIBQB_CFLAGS \
 	$SNMP_INCLUDES"
 CPPFLAGS="$ENV_CPPFLAGS $ANSI_CPPFLAGS $INCLUDE_DIRS"
-LDFLAGS="$ENV_LDFLAGS $lt_prog_compiler_pic $SEC_LDFLAGS -Wl,--as-needed $COVERAGE_LDFLAGS"
+case "$host_os" in
+*Linux*|*linux*|*bsd*)
+	LDFLAGS="$ENV_LDFLAGS $lt_prog_compiler_pic $SEC_LDFLAGS -Wl,--as-needed $COVERAGE_LDFLAGS"
+	AC_SUBST(EXTRA_LDFLAGS, ["-Wl,-version-script=\$(srcdir)/lib\$(call get_libname,\$<).versions"])
+	;;
+*)
+	LDFLAGS="$ENV_LDFLAGS $lt_prog_compiler_pic $SEC_LDFLAGS $COVERAGE_LDFLAGS"
+	AC_SUBST(EXTRA_LDFLAGS, [""])
+	;;
+esac
 
 # substitute what we need:
 AC_SUBST([BASHPATH])
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 3bcdb2c..c5d4457 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -49,7 +49,7 @@ noinst_HEADERS		= util.h
 
 # override global LIBS that pulls in lots of craft we don't need here
 LIBS			= -version-number $(call get_soname,$<) \
-			  -Wl,-version-script=$(srcdir)/lib$(call get_libname,$<).versions \
+			  @EXTRA_LDFLAGS@ \
 			  -lpthread \
 			  $(top_builddir)/common_lib/libcorosync_common.la \
 			  $(LIBQB_LIBS)
-- 
1.8.0.1

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss

[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux