~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to m4/readline.m4

  • Committer: Arnold D. Robbins
  • Date: 2015-04-05 08:20:41 UTC
  • mfrom: (408.12.66)
  • Revision ID: git-v1:4de12ef40f9ea9a0b715903cfe6da51b97eedb77
Merge branch 'master' into cmake

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
dnl action if false:
63
63
            [_found_readline=no],
64
64
dnl action if cross compiling:
65
 
            [_found_readline=no]
 
65
                AC_TRY_LINK([#include <stdio.h>
 
66
#include <readline/readline.h>
 
67
#include <readline/history.h>],         dnl includes
 
68
                        dnl function body
 
69
                        [
 
70
        int fd;
 
71
        char *line;
 
72
 
 
73
        close(0);
 
74
        close(1);
 
75
        fd = open("/dev/null", 2);      /* should get fd 0 */
 
76
        dup(fd);
 
77
        line = readline("giveittome> ");
 
78
 
 
79
        /* some printfs don't handle NULL for %s */
 
80
        printf("got <%s>\n", line ? line : "(NULL)");
 
81
],
 
82
dnl action if found:
 
83
                        [_found_readline=yes],
 
84
dnl action if not found:
 
85
                        [_found_readline=no]
 
86
                )
66
87
        )
67
88
 
68
89
        AC_MSG_RESULT([$_found_readline])