summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-09-03 10:32:00 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-09-04 07:54:09 +1000
commit0b712e6f86ba2dbbc7170d90488a00174ff8e996 (patch)
treedb389a25a35e047ebc36a420ab574329c8717d1c
parent95df174f06f5e3b9b3ad59a7f5183d595e26e2db (diff)
downloadlibevdev-0b712e6f86ba2dbbc7170d90488a00174ff8e996.tar.gz
Check for GNU ld and use the flags depending on the outcome
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--configure.ac5
-rw-r--r--libevdev/Makefile.am5
2 files changed, 6 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 9b56500..b2fc7ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,11 @@ AC_PROG_CC
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT
+LT_PATH_LD
+if test "x$lt_cv_prog_gnu_ld" = "xyes"; then
+ GNU_LD_FLAGS="-Wl,--as-needed -Wl,--gc-sections -Wl,-z,relro -Wl,-z,now"
+ AC_SUBST(GNU_LD_FLAGS)
+fi
PKG_PROG_PKG_CONFIG()
PKG_CHECK_MODULES(CHECK, [check], [HAVE_CHECK="yes"], [HAVE_CHECK="no"])
diff --git a/libevdev/Makefile.am b/libevdev/Makefile.am
index 64adf58..851a5a0 100644
--- a/libevdev/Makefile.am
+++ b/libevdev/Makefile.am
@@ -15,10 +15,7 @@ libevdev_la_LDFLAGS = \
-version-info $(LIBEVDEV_LT_VERSION) \
-export-symbols-regex '^libevdev_' \
$(GCOV_LDFLAGS) \
- -Wl,--as-needed \
- -Wl,--gc-sections \
- -Wl,-z,relro \
- -Wl,-z,now
+ $(GNU_LD_FLAGS)
libevdevincludedir = $(includedir)/libevdev-1.0/libevdev
libevdevinclude_HEADERS = libevdev.h libevdev-uinput.h