summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-10-22 14:52:01 +0100
committerSimon McVittie <smcv@collabora.com>2018-11-19 11:27:38 +0000
commite57120cb6535347bc538c00db1ad6cf7cf808878 (patch)
tree74fde30e505520eda8ca895b19e74ad5f7efb07e /configure.ac
parentc018e0b1b28107cac6d243295b7afa8939fdbdcd (diff)
downloaddbus-e57120cb6535347bc538c00db1ad6cf7cf808878.tar.gz
build: Drop support for non-POSIX getpwnam_r(), getgrnam_r()
Solaris 2.3 and 2.4 took their getpwnam_r() signature from draft 6 of the POSIX threads standard. Since Solaris 2.5 (1995), defining _POSIX_PTHREAD_SEMANTICS opts-in to the non-draft version of getpwnam_r(), and since Solaris 11.4 (2018), the non-draft version is the default. We already use AC_USE_SYSTEM_EXTENSIONS, which defines _POSIX_PTHREAD_SEMANTICS, among other useful macros. Thanks to Alan Coopersmith for assistance with Solaris history. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac47
1 files changed, 1 insertions, 46 deletions
diff --git a/configure.ac b/configure.ac
index 89337836..668d5539 100644
--- a/configure.ac
+++ b/configure.ac
@@ -701,52 +701,7 @@ case $host_os in
CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
esac
-# checking for a posix version of getpwnam_r
-# if we are cross compiling and can not run the test
-# assume getpwnam_r is the posix version
-# it is up to the person cross compiling to change
-# this behavior if desired
-AC_LANG_PUSH(C)
-AC_CACHE_CHECK([for posix getpwnam_r],
- ac_cv_func_posix_getpwnam_r,
- [AC_RUN_IFELSE([AC_LANG_PROGRAM(
-[[
-#include <errno.h>
-#include <pwd.h>
-]],
-[[
- char buffer[10000];
- struct passwd pwd, *pwptr = &pwd;
- int error;
- errno = 0;
- error = getpwnam_r ("", &pwd, buffer,
- sizeof (buffer), &pwptr);
- return (error < 0 && errno == ENOSYS)
- || error == ENOSYS;
-]])],
- [ac_cv_func_posix_getpwnam_r=yes],
- [ac_cv_func_posix_getpwnam_r=no],
- [ac_cv_func_posix_getpwnam_r=yes]
-)])
-AC_LANG_POP(C)
-
-if test "$ac_cv_func_posix_getpwnam_r" = yes; then
- AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
- [Have POSIX function getpwnam_r])
-else
- AC_CACHE_CHECK([for nonposix getpwnam_r],
- ac_cv_func_nonposix_getpwnam_r,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pwd.h>]], [[char buffer[10000];
- struct passwd pwd;
- getpwnam_r ("", &pwd, buffer,
- sizeof (buffer));]])],
- [ac_cv_func_nonposix_getpwnam_r=yes],
- [ac_cv_func_nonposix_getpwnam_r=no])])
- if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
- AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
- [Have non-POSIX function getpwnam_r])
- fi
-fi
+AC_CHECK_FUNCS_ONCE([getpwnam_r])
dnl check for socklen_t
AC_MSG_CHECKING(whether socklen_t is defined)