diff --git a/Makefile.in b/Makefile.in
index c0a0f1c..fc09991 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -87,7 +87,7 @@ TERMCAP_LIB = @TERMCAP_LIB@
 # For libraries which include headers from other libraries.
 INCLUDES = -I. -I$(srcdir)
 
-XCCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES)
+XCCFLAGS = $(DEFS) $(LOCAL_DEFS) $(INCLUDES) $(CPPFLAGS)
 CCFLAGS = $(XCCFLAGS) $(LOCAL_CFLAGS) $(CFLAGS)
 
 # could add -Werror here
@@ -235,10 +235,8 @@ uninstall-headers:
 maybe-uninstall-headers: uninstall-headers
 
 install-static: installdirs $(STATIC_LIBS) install-headers install-doc install-examples
-	-$(MV) $(DESTDIR)$(libdir)/libreadline.a $(DESTDIR)$(libdir)/libreadline.old
 	$(INSTALL_DATA) libreadline.a $(DESTDIR)$(libdir)/libreadline.a
 	-test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libreadline.a
-	-$(MV) $(DESTDIR)$(libdir)/libhistory.a $(DESTDIR)$(libdir)/libhistory.old
 	$(INSTALL_DATA) libhistory.a $(DESTDIR)$(libdir)/libhistory.a
 	-test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libhistory.a
 
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 72b7985..60f32fd 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -218,14 +218,6 @@ install:	installdirs
 	else \
 		${INSTALL_DATA} $(srcdir)/history.info $(DESTDIR)$(infodir)/history.info; \
 	fi
-	-if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
-		install-info --dir-file=$(DESTDIR)$(infodir)/dir \
-			$(DESTDIR)$(infodir)/readline.info ; \
-		install-info --dir-file=$(DESTDIR)$(infodir)/dir \
-			$(DESTDIR)$(infodir)/history.info ; \
-		install-info --dir-file=$(DESTDIR)$(infodir)/dir \
-			$(DESTDIR)$(infodir)/rluserman.info ; \
-	else true; fi
 	-${INSTALL_DATA} $(srcdir)/readline.3 $(DESTDIR)$(man3dir)/readline$(man3ext)
 	-${INSTALL_DATA} $(srcdir)/history.3 $(DESTDIR)$(man3dir)/history$(man3ext)
 	-if test -n "${htmldir}" ; then \
diff --git a/examples/Makefile.in b/examples/Makefile.in
index 04399ce..16afee3 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -53,7 +53,7 @@ CPPFLAGS = @CPPFLAGS@
 
 INCLUDES = -I$(srcdir) -I$(top_srcdir) -I..
 
-CCFLAGS  = $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS)
+CCFLAGS  = $(DEFS) $(LOCAL_CFLAGS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LDFLAGS = -g -L.. @LDFLAGS@
 
 PURIFY = @PURIFY@
diff --git a/shlib/Makefile.in b/shlib/Makefile.in
index eb16211..ac0bba4 100644
--- a/shlib/Makefile.in
+++ b/shlib/Makefile.in
@@ -107,7 +107,7 @@ SHLIB_MINOR=		.@SHLIB_MINOR@
 # For libraries which include headers from other libraries.
 INCLUDES = -I. -I.. -I$(topdir)
 
-CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES) $(LOCAL_CFLAGS) $(CFLAGS)
+CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(INCLUDES) $(CPPFLAGS) $(LOCAL_CFLAGS) $(CFLAGS)
 
 .SUFFIXES:	.so
 
diff --git a/support/shobj-conf b/support/shobj-conf
index 1f64433..f924e27 100644
--- a/support/shobj-conf
+++ b/support/shobj-conf
@@ -189,7 +189,7 @@ darwin*)
 	darwin[1-7].*)
 		SHOBJ_STATUS=unsupported
 		SHOBJ_LDFLAGS='-dynamic'
-		SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+		SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch`'
 		;;
 	# Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4
 	*)
@@ -205,9 +205,12 @@ darwin*)
 			;;
 		 esac
 		 SHOBJ_LDFLAGS="-dynamiclib -dynamic -undefined dynamic_lookup ${SHOBJ_ARCHFLAGS}"
-		 SHLIB_XLDFLAGS="-dynamiclib ${SHOBJ_ARCHFLAGS}"' -install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+		 SHLIB_XLDFLAGS="-dynamiclib ${SHOBJ_ARCHFLAGS}"
 		;;
 	esac
+	SHLIB_XLDFLAGS="${SHLIB_XLDFLAGS}"' -install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF)'
+	SHLIB_XLDFLAGS="${SHLIB_XLDFLAGS}"' -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR)'
+	SHLIB_XLDFLAGS="${SHLIB_XLDFLAGS}"' -compatibility_version $(SHLIB_MAJOR)$(SHLIB_MINOR)'
 
 	SHLIB_LIBS='-lncurses'	# see if -lcurses works on MacOS X 10.1 
 	;;
diff -ruN readline-6.3-orig/config.h.in readline-6.3/config.h.in
--- readline-6.3-orig/config.h.in	2012-01-18 09:22:13.000000000 -0600
+++ readline-6.3/config.h.in	2020-10-31 03:49:04.000000000 -0500
@@ -174,6 +174,9 @@
 /* Define if you have the <sys/file.h> header file.  */
 #undef HAVE_SYS_FILE_H
 
+/* Define if you have the <sys/ioctl.h> header file.  */
+#undef HAVE_SYS_IOCTL_H
+
 /* Define if you have the <sys/ndir.h> header file.  */
 #undef HAVE_SYS_NDIR_H
 
diff -ruN readline-6.3-orig/configure readline-6.3/configure
--- readline-6.3-orig/configure	2013-03-13 09:14:53.000000000 -0500
+++ readline-6.3/configure	2020-10-31 03:49:54.000000000 -0500
@@ -4680,7 +4680,7 @@
 
 done
 
-for ac_header in sys/pte.h sys/stream.h sys/select.h sys/file.h
+for ac_header in sys/ioctl.h sys/pte.h sys/stream.h sys/select.h sys/file.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff -ruN readline-6.3-orig/rltty.c readline-6.3/rltty.c
--- readline-6.3-orig/rltty.c	2013-08-25 15:57:05.000000000 -0500
+++ readline-6.3/rltty.c	2020-10-30 20:47:54.000000000 -0500
@@ -37,11 +37,11 @@
 
 #include "rldefs.h"
 
-#if defined (GWINSZ_IN_SYS_IOCTL)
-#  include <sys/ioctl.h>
-#endif /* GWINSZ_IN_SYS_IOCTL */
-
 #include "rltty.h"
+#if defined (HAVE_SYS_IOCTL_H)
+#  include <sys/ioctl.h>		/* include for declaration of ioctl */
+#endif
+
 #include "readline.h"
 #include "rlprivate.h"
 
diff -ruN readline-6.3-orig/terminal.c readline-6.3/terminal.c
--- readline-6.3-orig/terminal.c	2013-09-18 08:12:01.000000000 -0500
+++ readline-6.3/terminal.c	2020-10-31 03:51:07.000000000 -0500
@@ -51,15 +51,14 @@
 /* System-specific feature definitions and include files. */
 #include "rldefs.h"
 
-#if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ)
-#  include <sys/ioctl.h>
-#endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */
-
 #ifdef __MSDOS__
 #  include <pc.h>
 #endif
 
 #include "rltty.h"
+#if defined (HAVE_SYS_IOCTL_H)
+#  include <sys/ioctl.h>		/* include for declaration of ioctl */
+#endif
 #include "tcap.h"
 
 /* Some standard library routines. */
