+AC_CACHE_CHECK([for getline], [dx_cv_have_getline],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>
+], [ssize_t (*x)() = getline;
+char *p = 0;
+size_t n = 0;
+return getline(&p, &n, stdin);
+])], [dx_cv_have_getline=yes], [dx_cv_have_getline=no])])
+AS_CASE([$dx_cv_have_getline], [yes],
+ [AC_DEFINE([HAVE_GETLINE], [1],
+ [Define to 1 if the getline function is available.])])
+