bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] Problem in installing gawk on OS X 10.8.4 (Mountain Lion)


From: arnold
Subject: Re: [bug-gawk] Problem in installing gawk on OS X 10.8.4 (Mountain Lion)
Date: Sun, 25 Aug 2013 03:14:44 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Hello.

You did not specify the system you're using but I'm guessing it
is Mac OS X since I had a similar problem report.

Muhammad Hussein Nasrollahpour <address@hidden> wrote:

> Hi,
>
> The gawk-4.0.2 installed fine but gawk-4.1.0 doesn't install. Both 
> installation is on the same OS.
> First I tried to install the gawk-4.1.0 but it didn't install and then I 
> tried installing gawk-4.0.2 which installed correctly and works fine.
>

I think this patch will do the trick. You should should do 'make
distclean', then apply the patch.  Then touch configh.in and configure
after applying it in the hope that the auto* machinery won't kick in. Then
run configure and rebuild.

Please let me know if this works.

Thanks,

Arnold
--------------------

diff --git a/configh.in b/configh.in
index f6540a4..a535fd4 100644
--- a/configh.in
+++ b/configh.in
@@ -66,6 +66,9 @@
 /* Define to 1 if you have the `grantpt' function. */
 #undef HAVE_GRANTPT
 
+/* Do we have history_list? */
+#undef HAVE_HISTORY_LIST
+
 /* Define if you have the iconv() function and it works. */
 #undef HAVE_ICONV
 
diff --git a/configure b/configure
index 0e5a930..03e0838 100755
--- a/configure
+++ b/configure
@@ -10462,6 +10462,50 @@ $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
 
            LIBREADLINE=$_combo
 
+
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for history_list 
in -lreadline" >&5
+$as_echo_n "checking for history_list in -lreadline... " >&6; }
+if ${ac_cv_lib_readline_history_list+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lreadline $_combo $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char history_list ();
+int
+main ()
+{
+return history_list ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_readline_history_list=yes
+else
+  ac_cv_lib_readline_history_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 
$ac_cv_lib_readline_history_list" >&5
+$as_echo "$ac_cv_lib_readline_history_list" >&6; }
+if test "x$ac_cv_lib_readline_history_list" = xyes; then :
+
+$as_echo "#define HAVE_HISTORY_LIST 1" >>confdefs.h
+
+fi
+
+
            break
         fi
      done
diff --git a/debug.c b/debug.c
index 29500f2..d08b045 100644
--- a/debug.c
+++ b/debug.c
@@ -108,6 +108,12 @@ static BREAKPOINT breakpoints = { &breakpoints, 
&breakpoints, 0 };
 static int sess_history_base = 0;
 #endif
 
+#ifndef HAVE_HISTORY_LIST
+#define HIST_ENTRY void
+#define history_list() NULL
+#endif
+
+
 /* 'list' command */
 static int last_printed_line = 0;
 static int last_print_count;   /* # of lines printed */
@@ -4282,11 +4288,6 @@ serialize_subscript(char *buf, int buflen, struct 
list_item *item)
 static void
 serialize(int type)
 {
-#ifndef HAVE_LIBREADLINE
-#define HIST_ENTRY void
-#define history_list() NULL
-#endif
-
        static char *buf = NULL;
        static int buflen = 0;
        int bl;
diff --git a/m4/readline.m4 b/m4/readline.m4
index 76605af..f24e95b 100644
--- a/m4/readline.m4
+++ b/m4/readline.m4
@@ -72,6 +72,12 @@ dnl action if cross compiling:
            AC_DEFINE(HAVE_LIBREADLINE,1,
              [Define to 1 if you have a fully functional readline library.])
            AC_SUBST(LIBREADLINE,$_combo)
+
+          AC_CHECK_LIB(readline, history_list,
+               [AC_DEFINE(HAVE_HISTORY_LIST, 1, [Do we have history_list?])],
+               [],
+               [$_combo])
+
            break
         fi
      done




reply via email to

[Prev in Thread] Current Thread [Next in Thread]