Commit ddbefda383cccbf8d537b30471fc2ce893826d35

Ran Benita 2014-01-13T18:19:36

build: error out on undefined symbols This helps ensure we don't ship a library with undefined symbols, which can easily happen with multiple inter-dependent DSOs. Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/Makefile.am b/Makefile.am
index 6775733..3168b55 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,6 +17,9 @@ AM_CPPFLAGS = \
 AM_CFLAGS = $(BASE_CFLAGS)
 
 AM_LDFLAGS = -no-undefined
+if HAVE_NO_UNDEFINED
+AM_LDFLAGS += -Wl,--no-undefined
+endif
 
 AM_YFLAGS = -d -p _xkbcommon_
 
diff --git a/configure.ac b/configure.ac
index 9f957ec..b8e242e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,6 +84,9 @@ AM_CONDITIONAL(BUILD_LINUX_TESTS, [test "x$ac_cv_header_linux_input_h" = xyes])
 
 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-fvisibility=hidden])
 
+XORG_CHECK_LINKER_FLAGS([-Wl,--no-undefined], [have_no_undefined=yes])
+AM_CONDITIONAL([HAVE_NO_UNDEFINED], [test "x$have_no_undefined" = xyes])
+
 # Define a configuration option for the XKB config root
 xkb_base=`$PKG_CONFIG --variable=xkb_base xkeyboard-config`
 if test "x$xkb_base" = x; then