From 577fd4a6b3c7cd36f8d3d5fced25c0780ceb2f24 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 2/5] macOS-friendly check for readline

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

diff --git a/gcl/configure b/gcl/configure
index 15573a0c6..fabaad897 100755
--- a/gcl/configure
+++ b/gcl/configure
@@ -9836,6 +9836,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));
 
@@ -9862,6 +9863,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));
 
@@ -9894,6 +9896,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));
 
@@ -9920,6 +9923,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 a/gcl/configure.in b/gcl/configure.in
index eabf55659..15a637f90 100644
--- a/gcl/configure.in
+++ b/gcl/configure.in
@@ -1892,6 +1892,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));
 	    				       ]],
@@ -1903,6 +1904,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));
 	                                               ]],
@@ -1916,6 +1918,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));
 	                                       ]],
@@ -1927,6 +1930,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

