From de36fe2075662ab3c37cc000d217be16d8de9016 Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca>
Date: Fri, 4 Jul 2014 13:52:55 +0300
Subject: [PATCH] nah. no ln --relative

It is unclear that systemd now requires very recent coreutils
in order to compile.

I will not upgrade my debian wheezy machines to jessie,
nor I will switch to fedora for no good reason. We are not going
to tell our users to do so just to be able to build OpenELEC.
---
 Makefile.am  |   12 ++++++------
 configure.ac |    2 --
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fe8f8d7..8fa0896 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -219,8 +219,8 @@ define move-to-rootlibdir
 	if test "$(libdir)" != "$(rootlibdir)"; then \
 		$(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
 		so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
-		rm -f $(DESTDIR)$(libdir)/$$libname && \
-		$(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
+		so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
+		$(LN_S) -f $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
 		mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
 	fi
 endef
@@ -279,9 +279,9 @@ install-aliases-hook:
 	set -- $(SYSTEM_UNIT_ALIASES) && \
 		dir=$(systemunitdir) && $(install-aliases)
 	set -- $(USER_UNIT_ALIASES) && \
-		dir=$(userunitdir) && $(install-relative-aliases)
+		dir=$(userunitdir) && $(install-aliases)
 	set -- $(GENERAL_ALIASES) && \
-		dir= && $(install-relative-aliases)
+		dir= && $(install-aliases)
 
 define install-aliases
 	while [ -n "$$1" ]; do \
@@ -2034,7 +2034,7 @@ systemd_dbus1_generator_LDADD = \
 dbus1-generator-install-hook:
 	$(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
 	$(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
-	$(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
+	$(AM_V_LN)$(LN_S) -f $(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
 
 dbus1-generator-uninstall-hook:
 	rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
@@ -2188,7 +2188,7 @@ systemd_bus_proxyd_LDADD = \
 bus-proxyd-install-hook:
 	$(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
 	$(AM_V_RM)rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
-	$(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
+	$(AM_V_LN)$(LN_S) -f $(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
 
 bus-proxyd-uninstall-hook:
 	rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
diff --git a/configure.ac b/configure.ac
index ae88382..ec220af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,8 +96,6 @@ AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin])
 
 AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
 
-AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
-
 M4_DEFINES=
 
 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
-- 
1.7.2.5

