Description: Detect which version of elinks we're using.
Author: Paul Martin <pm@debian.org>
Bug-Debian: http://bugs.debian.org/306838

--- jargon-text-4.4.7.orig/Makefile
+++ jargon-text-4.4.7/Makefile
@@ -16,6 +16,16 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
 
+# Find out which version of ELinks we've got
+# This allows us to build correctly on both sarge and etch
+elinks_version = $(shell elinks --version|perl -ne 'if (/^ELinks\s+(\d+\.\d+)/i) {print "$$1\n";}')
+
+ifeq ($(elinks_version),0.9)
+elinks_opts = -dump -dump-width 79 -no-numbering 1
+else
+elinks_opts = -dump -dump-width 79 -no-numbering 1 -no-references 1
+endif
+
 all: jargon.txt
 .PHONY: all
 
@@ -46,8 +56,7 @@ jargon-web.html: jargon-web.xml
 
 jargon.txt: jargon-web.html
 	# Turn into plain text
-	elinks -dump -dump-width 79 -no-numbering 1 -no-references 1 \
-		jargon-web.html >jargon.txt
+	elinks $(elinks_opts) jargon-web.html >jargon.txt
 
 clean:
 	rm -f jargon-web.xml
