* Use patches from upstream issue tracker that fix most compilation issues and the configure script; and * Modify `exp_win.c` and `pty_termios.c` to build properly on Darwin.
···11+diff -ur a/exp_win.c b/exp_win.c
22+--- a/exp_win.c 2018-02-02 14:15:52.000000000 -0500
33++++ b/exp_win.c 2023-10-10 07:47:33.082690432 -0400
44+@@ -39,7 +39,8 @@
55+ /* Sigh. On AIX 2.3, termios.h exists but does not define TIOCGWINSZ */
66+ /* Instead, it has to come from ioctl.h. However, As I said above, this */
77+ /* can't be cavalierly included on all machines, even when it exists. */
88+-#if defined(HAVE_TERMIOS) && !defined(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
99++/* Darwin also has termios.h, but it requires ioctl.h for `ioctl`. */
1010++#if defined(HAVE_TERMIOS) && (defined(__APPLE__) || !defined(HAVE_TIOCGWINSZ_IN_TERMIOS_H))
1111+ # include <sys/ioctl.h>
1212+ #endif
1313+1414+diff -ur d/pty_termios.c c/pty_termios.c
1515+--- d/pty_termios.c 2023-10-10 07:59:23.244452442 -0400
1616++++ c/pty_termios.c 2023-10-10 08:00:35.303231582 -0400
1717+@@ -7,7 +7,13 @@
1818+1919+ */
2020+2121+-#include <pty.h> /* openpty */
2222++/* openpty */
2323++#ifdef __APPLE__
2424++#include <util.h>
2525++#else /* pty.h is Linux-specific */
2626++#include <pty.h>
2727++#endif
2828++
2929+ #include <stdio.h>
3030+ #include <signal.h>
3131+