set version to 8:0:0
[heimdal.git] / cf / check-getpwnam_r-posix.m4
blob82bcba630c64db080220736ff5e730bca04917a7
1 dnl $Id$
2 dnl
3 dnl check for getpwnam_r, and if it's posix or not
5 AC_DEFUN(AC_CHECK_GETPWNAM_R_POSIX,[
6 AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
7 if test "$ac_cv_func_getpwnam_r" = yes; then
8         AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
9         ac_libs="$LIBS"
10         LIBS="$LIBS $LIB_getpwnam_r"
11         AC_TRY_RUN([
12 #include <pwd.h>
13 int main()
15         struct passwd pw, *pwd;
16         return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
18 ],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
19 LIBS="$ac_libs")
20 if test "$ac_cv_func_getpwnam_r_posix" = yes; then
21         AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])