* configure.in: If getpwnam_r is available, determine its return type
authorKen Raeburn <raeburn@mit.edu>
Sun, 8 Aug 2004 21:10:46 +0000 (21:10 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sun, 8 Aug 2004 21:10:46 +0000 (21:10 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16647 dc483132-0cff-0310-8789-dd5450dbe970

src/include/ChangeLog
src/include/configure.in

index ed7a97f913ff2c4ea99e7cc1b8f07c510f6d9240..63e696a198baf8e17e71cd0bf2eaf3961b3883c0 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-08  Ken Raeburn  <raeburn@mit.edu>
+
+       * configure.in: If getpwnam_r is available, determine its return
+       type.
+
 2004-08-07  Ken Raeburn  <raeburn@mit.edu>
 
        * configure.in: Look for sched.h and sched_yield.
index ea81a880f8f7957706cea67604d6ac003938af00..8995d69d7efb602fa646b6dd793eb744cb1add7d 100644 (file)
@@ -50,6 +50,28 @@ fi
 ])
 dnl
 
+if test "$ac_cv_func_getpwnam_r" = yes; then
+  AC_MSG_CHECKING([return type of getpwnam_r])
+  AC_CACHE_VAL(krb5_cv_getpwnam_r_return_type,
+  [AC_TRY_COMPILE([#include <pwd.h>
+   extern int getpwnam_r();], [1;],
+   getpwnam_r_returns_int=yes,getpwnam_r_returns_int=no)
+   AC_TRY_COMPILE([#include <pwd.h>
+   extern struct pwd *getpwnam_r();], [1;],
+   getpwnam_r_returns_ptr=yes,getpwnam_r_returns_ptr=no)
+   case "$getpwnam_r_returns_int/$getpwnam_r_returns_ptr" in
+     yes/no) krb5_cv_getpwnam_r_return_type=int ;;
+     no/yes) krb5_cv_getpwnam_r_return_type=ptr ;;
+     *) krb5_cv_getpwnam_r_return_type=unknown ;;
+   esac])
+  AC_MSG_RESULT($krb5_cv_getpwnam_r_return_type)
+  if test $krb5_cv_getpwnam_r_return_type = int; then
+    AC_DEFINE(GETPWNAM_R_RETURNS_INT, 1, [Define if getpwnam_r returns an int])
+  elif test $krb5_cv_getpwnam_r_return_type = unknown; then
+    AC_MSG_WARN([Cannot determine getpwnam_r return type, disabling])
+    ac_cv_func_getpwnam_r=no
+  fi
+fi
 if test "$ac_cv_func_getpwnam_r" = yes; then
   AC_MSG_CHECKING([number of arguments to getpwnam_r])
   AC_CACHE_VAL(krb5_cv_getpwnam_r_args,