25 lines
791 B
Plaintext
25 lines
791 B
Plaintext
dnl $Heimdal: check-getpwnam_r-posix.m4,v 1.2.34.1 2004/04/01 07:27:32 joda Exp $
|
|
dnl $NetBSD: check-getpwnam_r-posix.m4,v 1.1.1.4 2004/04/02 14:48:06 lha Exp $
|
|
dnl
|
|
dnl check for getpwnam_r, and if it's posix or not
|
|
|
|
AC_DEFUN([AC_CHECK_GETPWNAM_R_POSIX],[
|
|
AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
|
|
if test "$ac_cv_func_getpwnam_r" = yes; then
|
|
AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
|
|
ac_libs="$LIBS"
|
|
LIBS="$LIBS $LIB_getpwnam_r"
|
|
AC_TRY_RUN([
|
|
#include <pwd.h>
|
|
int main()
|
|
{
|
|
struct passwd pw, *pwd;
|
|
return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
|
|
}
|
|
],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
|
|
LIBS="$ac_libs")
|
|
if test "$ac_cv_func_getpwnam_r_posix" = yes; then
|
|
AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])
|
|
fi
|
|
fi
|
|
]) |