[flac-dev] [PATCH] Link with -no-undefined regardless of the OS

Cristian Rodríguez crrodriguez at opensuse.org
Sat Jul 20 22:28:51 PDT 2013


libFLAC* must never have undefined symbols no matter
what is the target platform.
---
 configure.ac              | 10 +---------
 src/libFLAC++/Makefile.am |  2 +-
 src/libFLAC/Makefile.am   |  2 +-
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 50ef80e..ba46caf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,19 +129,11 @@ AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
 os_is_windows=no
 case "$host" in
 	*-*-cygwin|*mingw*)
-		# define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
-		LT_NO_UNDEFINED="-no-undefined"
 		CPPFLAGS="-D__MSVCRT_VERSION__=0x0601 $CPPFLAGS"
 		os_is_windows=yes
 		;;
-	*emx*)
-		LT_NO_UNDEFINED="-no-undefined"
-		;;
-	*)
-		LT_NO_UNDEFINED=
-		;;
 esac
-AC_SUBST(LT_NO_UNDEFINED)
+
 AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes)
 
 case "$host" in
diff --git a/src/libFLAC++/Makefile.am b/src/libFLAC++/Makefile.am
index 51b8cf8..b84f3e4 100644
--- a/src/libFLAC++/Makefile.am
+++ b/src/libFLAC++/Makefile.am
@@ -45,7 +45,7 @@ EXTRA_DIST = \
 	libFLAC++.m4
 
 # see 'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' for numbering convention
-libFLAC___la_LDFLAGS = $(AM_LDFLAGS) -version-info 9:0:3 @LT_NO_UNDEFINED@
+libFLAC___la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 9:0:3
 libFLAC___la_LIBADD = ../libFLAC/libFLAC.la
 
 libFLAC___la_SOURCES = \
diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am
index 86155ab..939f706 100644
--- a/src/libFLAC/Makefile.am
+++ b/src/libFLAC/Makefile.am
@@ -113,7 +113,7 @@ extra_ogg_sources = \
 endif
 
 # see 'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' for numbering convention
-libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -version-info 11:0:3 $(LOCAL_EXTRA_LDFLAGS) @LT_NO_UNDEFINED@
+libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 11:0:3 $(LOCAL_EXTRA_LDFLAGS)
 
 libFLAC_sources = \
 	bitmath.c \
-- 
1.8.3.1



More information about the flac-dev mailing list