diff -Nurd -x'*~' units-1.85.orig/Makefile.in units-1.85/Makefile.in
--- units-1.85.orig/Makefile.in	2005-04-24 14:14:54.000000000 -0400
+++ units-1.85/Makefile.in	2006-05-04 10:48:00.000000000 -0400
@@ -45,20 +45,20 @@
 datadir = @datadir@
 DEFS = -DUNITSFILE=\"@UDAT@units.dat\" @DEFIS@ @DEFS@
 CFLAGS = @CFLAGS@
-OBJECTS = units.@OBJEXT@ parse.tab.@OBJEXT@ getopt.@OBJEXT@ getopt1.@OBJEXT@ @STRFUNC@
+OBJECTS = units.@OBJEXT@ parse.tab.@OBJEXT@ @STRFUNC@
 
 .SUFFIXES:
 .SUFFIXES: .c .@OBJEXT@
- 
+
 .c.@OBJEXT@:
-	$(CC) $(DEFS) $(CFLAGS) -I$(srcdir) -c $<
- 
+	$(CC) $(DEFS) $(CFLAGS) -I$(srcdir) $(CPPFLAGS) -c $<
+
 # %.@OBJEXT@: %.c
-#     $(CC) $(DEFS) $(CFLAGS) -I$(srcdir) -c %.c
+#     $(CC) $(DEFS) $(CFLAGS) -I$(srcdir) $(CPPFLAGS) -c %.c
 
 
-DISTFILES = README ChangeLog units.info units.doc getopt1.c units.dvi \
-   Makefile.in units.c getopt.c getopt.h units.dat units.man units.texinfo \
+DISTFILES = README ChangeLog units.info units.doc units.dvi \
+   Makefile.in units.c units.dat units.man units.texinfo \
    configure.ac configure strfunc.c COPYING Makefile.dos install-sh \
    mkinstalldirs NEWS texi2man INSTALL \
    parse.tab.c parse.y units.h Makefile.OS2 makeobjs.cmd README.OS2
@@ -199,8 +199,7 @@
 	echo units-`sed -n -e '/#.*VERSION/s/.*"\(.*\)"/\1/gp' \
 	    $(srcdir)/units.c` > distname
 	-rm -r `cat distname` `cat distname`.tar `cat distname`.tar.gz
-	tar cf `cat distname`.tar units.c units.h  parse.y  parse.tab.c\
-	   getopt1.c getopt.c getopt.h
+	tar cf `cat distname`.tar units.c units.h  parse.y  parse.tab.c
 	gzip `cat distname`.tar
 
 # Tell versions [3.59,3.63) of GNU make not to export all variables.
diff -Nurd -x'*~' units-1.85.orig/parse.y units-1.85/parse.y
--- units-1.85.orig/parse.y	2005-04-24 14:14:55.000000000 -0400
+++ units-1.85/parse.y	2006-05-04 12:13:19.000000000 -0400
@@ -22,6 +22,9 @@
 
 %{
 
+void
+yyerror(char *s){}
+
 #define YYPARSE_PARAM comm
 #define YYLEX_PARAM comm
 
@@ -30,7 +33,7 @@
 #include "units.h"
 
 
-int err;  /* value used by parser to store return values */
+static int err;  /* value used by parser to store return values */
 
 #define CHECK if (err) { COMM->errorcode=err; YYABORT; }
 
@@ -273,6 +276,7 @@
                  "**", EXPONENT, 
                  0, 0 };
 
+int
 yylex(YYSTYPE *lvalp, struct commtype *comm)
 {
   int length, count;
@@ -392,9 +396,6 @@
   return UNIT;
 }
 
-
-yyerror(char *s){}
-
 void
 freelist(int startunit)
 {
diff -Nurd -x'*~' units-1.85.orig/units.c units-1.85/units.c
--- units-1.85.orig/units.c	2005-05-20 15:16:58.000000000 -0400
+++ units-1.85/units.c	2006-05-04 10:58:42.000000000 -0400
@@ -28,6 +28,7 @@
 
 #ifdef READLINE
 #  include <readline/readline.h>
+#  include <readline/history.h>
 #  define RVERSTR "with readline"
 #else
 #  define RVERSTR "without readline"