build: error out on undefined symbols
authorRan Benita <ran234@gmail.com>
Mon, 13 Jan 2014 16:19:36 +0000 (18:19 +0200)
committerRan Benita <ran234@gmail.com>
Mon, 13 Jan 2014 16:24:24 +0000 (18:24 +0200)
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>
Makefile.am
configure.ac

index 6775733..3168b55 100644 (file)
@@ -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_
 
index 9f957ec..b8e242e 100644 (file)
@@ -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