re-mark 1.29b-2 as not yet uploaded (merge madness!)
[debian/tar] / m4 / ptsname.m4
1 # ptsname.m4 serial 3
2 dnl Copyright (C) 2010-2014 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 AC_DEFUN([gl_FUNC_PTSNAME],
8 [
9   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10
11   dnl Persuade glibc <stdlib.h> to declare ptsname().
12   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
13
14   AC_CHECK_FUNCS([ptsname])
15   if test $ac_cv_func_ptsname = no; then
16     HAVE_PTSNAME=0
17   else
18     AC_CACHE_CHECK([whether ptsname sets errno on failure],
19       [gl_cv_func_ptsname_sets_errno],
20       [AC_RUN_IFELSE(
21          [AC_LANG_PROGRAM([[#include <errno.h>
22       ]], [[
23       return ptsname (-1) || !errno;
24            ]])],
25          [gl_cv_func_ptsname_sets_errno=yes],
26          [gl_cv_func_ptsname_sets_errno=no],
27          [case "$host_os" in
28                     # Guess yes on glibc systems.
29             *-gnu*) gl_cv_func_ptsname_sets_errno="guessing yes" ;;
30                     # If we don't know, assume the worst.
31             *)      gl_cv_func_ptsname_sets_errno="guessing no" ;;
32           esac
33          ])])
34     case $gl_cv_func_ptsname_sets_errno in
35       *no) REPLACE_PTSNAME=1 ;;
36     esac
37   fi
38 ])
39
40 # Prerequisites of lib/ptsname.c.
41 AC_DEFUN([gl_PREREQ_PTSNAME], [
42   :
43 ])