--- src/xz/Makefile.am.orig	2015-09-29 12:57:36.000000000 +0200
+++ src/xz/Makefile.am	2016-11-02 17:43:30.000000000 +0100
@@ -5,7 +5,7 @@
 ## You can do whatever you want with this file.
 ##
 
-bin_PROGRAMS = xz
+bin_PROGRAMS = xz xz_r
 
 xz_SOURCES = \
 	args.c \
@@ -58,6 +58,11 @@
 # libgnu.a may need these libs, so this must be after libgnu.a.
 xz_LDADD += $(LTLIBINTL)
 
+xz_r_SOURCES = $(xz_SOURCES)
+xz_r_CPPFLAGS = $(xz_CPPFLAGS)
+xz_r_LDADD = $(xz_LDADD)
+xz_r_LDFLAGS = -static-libtool-libs
+
 
 # Windows resource compiler support
 .rc.o:
