aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rwxr-xr-xconfigure34
-rw-r--r--m4/ChangeLog6
-rw-r--r--m4/readline.m423
4 files changed, 65 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 34554e22..8f4657a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-10-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure: Regenerated after fix to m4/readline.m4.
+
2014-10-29 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep. Again, again.
diff --git a/configure b/configure
index 44b420ba..d98aeb10 100755
--- a/configure
+++ b/configure
@@ -10439,7 +10439,39 @@ fi
$as_echo_n "checking whether readline via \"$_combo\" is present and sane... " >&6; }
if test "$cross_compiling" = yes; then :
- _found_readline=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+#include <readline/readline.h>
+#include <readline/history.h>
+int
+main ()
+{
+
+ int fd;
+ char *line;
+
+ close(0);
+ close(1);
+ fd = open("/dev/null", 2); /* should get fd 0 */
+ dup(fd);
+ line = readline("giveittome> ");
+
+ /* some printfs don't handle NULL for %s */
+ printf("got <%s>\n", line ? line : "(NULL)");
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ _found_readline=yes
+else
+ _found_readline=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 81fdcec0..17c482cb 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readline.m4: Enable cross compiling. Thanks to
+ Christer Solskogen <christer.solskogen@gmail.com> for
+ motivating and testing.
+
2014-04-08 Arnold D. Robbins <arnold@skeeve.com>
* 4.1.1: Release tar ball made.
diff --git a/m4/readline.m4 b/m4/readline.m4
index 77ed8b25..740b9c7b 100644
--- a/m4/readline.m4
+++ b/m4/readline.m4
@@ -62,7 +62,28 @@ dnl action if true:
dnl action if false:
[_found_readline=no],
dnl action if cross compiling:
- [_found_readline=no]
+ AC_TRY_LINK([#include <stdio.h>
+#include <readline/readline.h>
+#include <readline/history.h>], dnl includes
+ dnl function body
+ [
+ int fd;
+ char *line;
+
+ close(0);
+ close(1);
+ fd = open("/dev/null", 2); /* should get fd 0 */
+ dup(fd);
+ line = readline("giveittome> ");
+
+ /* some printfs don't handle NULL for %s */
+ printf("got <%s>\n", line ? line : "(NULL)");
+],
+dnl action if found:
+ [_found_readline=yes],
+dnl action if not found:
+ [_found_readline=no]
+ )
)
AC_MSG_RESULT([$_found_readline])