diff m4/posix_openpt.m4 @ 15961:27cc5b08d442

posix_openpt: new module * modules/posix_openpt: New module. * m4/posix_openpt.m4: New file. * lib/posix_openpt.c: Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H): Check for decl. (gl_STDLIB_H_DEFAULTS): Set defaults. * modules/stdlib (Makefile.am): Substitute macros. * lib/stdlib.in.h (posix_openpt): Declare. * MODULES.html.sh (systems lacking POSIX:2008): Document it. * doc/posix-functions/posix_openpt.texi (posix_openpt): Likewise. * modules/posix_openpt-tests: New test module. * tests/test-posix_openpt.c: New test.
author Eric Blake <eblake@redhat.com>
date Mon, 17 Oct 2011 17:19:41 -0600
parents
children 91896bd60e8b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m4/posix_openpt.m4	Mon Oct 17 17:19:41 2011 -0600
@@ -0,0 +1,21 @@
+# posix_openpt.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_POSIX_OPENPT],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+  dnl Persuade Solaris <stdlib.h> to declare posix_openpt().
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  AC_CHECK_FUNCS_ONCE([posix_openpt])
+  if test $ac_cv_have_posix_openpt != yes; then
+    dnl The system does not have posix_openpt.
+    HAVE_POSIX_OPENPT=0
+    dnl Prerequisites of lib/posix_openpt.c in this case.
+    AC_CHECK_FUNCS([_getpty])
+  fi
+])