]> code.delx.au - pulseaudio/commitdiff
Check for support of -z nodelete LD flag, don't use it unconditionally.
authorDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
Fri, 17 Jul 2009 12:18:07 +0000 (14:18 +0200)
committerDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
Fri, 17 Jul 2009 12:18:07 +0000 (14:18 +0200)
On non-GNU, non-Sun linkers, the -z option is often not understood; make
sure that the -z nodelete option is usable before making use of it.

Unbreaks build on Mac OS X.

configure.ac
src/Makefile.am

index cc7f674abc4a170b738e86a9befec5e23577df3d..112a1a8fc64c1ea62ccac14ab8769d79be6ca61e 100644 (file)
@@ -119,6 +119,15 @@ dnl  other linkes might be added later
 CC_CHECK_LDFLAGS([-Wl,-z,now], [IMMEDIATE_LDFLAGS="-Wl,-z,now"])
 AC_SUBST([IMMEDIATE_LDFLAGS])
 
+dnl On ELF systems we don't want the libraries to be unloaded since we
+dnl don't clean them up properly, so we request the nodelete flag to be
+dnl enabled.
+dnl
+dnl On other systems, we don't really know how to do that, but it's
+dnl welcome if somebody can tell.
+CC_CHECK_LDFLAGS([-Wl,-z,nodelete], [NODELETE_LDFLAGS="-Wl,-z,nodelete"])
+AC_SUBST([NODELETE_LDFLAGS])
+
 dnl Check for the proper way to build libraries that have no undefined
 dnl symbols; on some hosts this needs to be avoided but the macro
 dnl takes care of it.
index ac627c84e6ba76a20b0f4037b4e8a68a5416fe15..c022fa7ca101cf90ea90c027a20644b03b998b23 100644 (file)
@@ -87,7 +87,7 @@ AM_CFLAGS = \
 
 AM_LIBADD = $(PTHREAD_LIBS) $(INTLLIBS)
 AM_LDADD = $(PTHREAD_LIBS) $(INTLLIBS)
-AM_LDFLAGS = -Wl,-z,nodelete
+AM_LDFLAGS = $(NODELETE_LDFLAGS)
 
 if STATIC_BINS
 BINLDFLAGS = -static