From cd996356594e145b15fb93c7db8255b10d2f0b09 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Thu, 21 Dec 2023 18:01:59 +0100
Subject: [PATCH 1/2] macOS-friendly check for readline

---
 gcl/configure    | 4 ++++
 gcl/configure.in | 4 ++++
 2 files changed, 8 insertions(+)

diff --git gcl/configure gcl/configure
index 4d38e9cca..8a6d4e725 100755
--- gcl/configure
+++ gcl/configure
@@ -9841,6 +9841,7 @@ printf %s "checking RL_COMPLETION_ENTRY_FUNCTION_TYPE_FUNCTION... " >&6; }
                                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+                                                  #include <stdio.h>
                                                   #include <readline/readline.h>
 						  extern Function *rl_completion_entry_function __attribute__((weak));
 
@@ -9867,6 +9868,7 @@ printf %s "checking RL_COMPLETION_ENTRY_FUNCTION_TYPE_RL_COMPENTRY_FUNC_T... " >
                                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+		                                          #include <stdio.h>
 		                                          #include <readline/readline.h>
 							  extern rl_compentry_func_t *rl_completion_entry_function __attribute__((weak));
 
@@ -9899,6 +9901,7 @@ printf %s "checking RL_READLINE_NAME_TYPE_CHAR... " >&6; }
                                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+		                                  #include <stdio.h>
 		                                  #include <readline/readline.h>
 		                                  extern char *rl_readline_name __attribute__((weak));
 
@@ -9925,6 +9928,7 @@ printf %s "checking RL_READLINE_NAME_TYPE_CONST_CHAR... " >&6; }
                                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+		                                          #include <stdio.h>
 		                                          #include <readline/readline.h>
 		                                          extern const char *rl_readline_name __attribute__((weak));
 
diff --git gcl/configure.in gcl/configure.in
index cfafd3983..eebbcb2d2 100644
--- gcl/configure.in
+++ gcl/configure.in
@@ -1895,6 +1895,7 @@ if test "$enable_readline" != "no" ; then
                                  AC_COMPILE_IFELSE(
                                         [AC_LANG_PROGRAM(
 	                                       [[
+                                                  #include <stdio.h>
                                                   #include <readline/readline.h>
 						  extern Function *rl_completion_entry_function __attribute__((weak));
 	    				       ]],
@@ -1906,6 +1907,7 @@ if test "$enable_readline" != "no" ; then
                                          AC_COMPILE_IFELSE(
                                                 [AC_LANG_PROGRAM(
 	                                               [[
+		                                          #include <stdio.h>
 		                                          #include <readline/readline.h>
 							  extern rl_compentry_func_t *rl_completion_entry_function __attribute__((weak));
 	                                               ]],
@@ -1919,6 +1921,7 @@ if test "$enable_readline" != "no" ; then
                                  AC_COMPILE_IFELSE(
                                         [AC_LANG_PROGRAM(
 	                                       [[
+		                                  #include <stdio.h>
 		                                  #include <readline/readline.h>
 		                                  extern char *rl_readline_name __attribute__((weak));
 	                                       ]],
@@ -1930,6 +1933,7 @@ if test "$enable_readline" != "no" ; then
                                          AC_COMPILE_IFELSE(
                                                 [AC_LANG_PROGRAM(
 	                                               [[
+		                                          #include <stdio.h>
 		                                          #include <readline/readline.h>
 		                                          extern const char *rl_readline_name __attribute__((weak));
 	                                               ]],
-- 
2.43.0

