+ else
+ dnl On MacOS X 10.4 and Solaris 10 the return type is 'char *', not 'int'.
+ AC_CACHE_CHECK([whether ttyname_r is compatible with its POSIX signature],
+ [gl_cv_func_ttyname_r_posix],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ #include <unistd.h>]],
+ [[*ttyname_r (0, NULL, 0);]])
+ ],
+ [gl_cv_func_ttyname_r_posix=no],
+ [gl_cv_func_ttyname_r_posix=yes])
+ ])
+ if test $gl_cv_func_ttyname_r_posix = no; then
+ REPLACE_TTYNAME_R=1
+ fi
+ fi
+ if test $HAVE_TTYNAME_R = 0 || test $REPLACE_TTYNAME_R = 1; then