summaryrefslogtreecommitdiff
path: root/libgfortran/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/configure.ac')
-rw-r--r--libgfortran/configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 816165988ce..d25a067e127 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -513,6 +513,26 @@ AC_SUBST(FPU_HOST_HEADER)
IEEE_FLAGS="${ieee_flags}"
AC_SUBST(IEEE_FLAGS)
+
+# Check for POSIX getpwuid_r
+#
+# There are two versions of getpwuid_r, the POSIX one with 5
+# arguments, and another one with 4 arguments used by at least HP-UX
+# 10.2.
+if test "$ac_cv_func_getpwuid_r" = "yes"; then
+ AC_CACHE_CHECK([POSIX version of getpwuid_r with 5 arguments], libgfor_cv_posix_getpwuid_r, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([
+#include <stdio.h>
+#include <sys/types.h>
+#include <pwd.h>], [
+ getpwuid_r(0, NULL, NULL, 0, NULL);
+ ])], [libgfor_cv_posix_getpwuid_r="yes"], [libgfor_cv_posix_getpwuid_r="no"])])
+fi
+if test "$libgfor_cv_posix_getpwuid_r" = "yes"; then
+ AC_DEFINE([HAVE_POSIX_GETPWUID_R], [1], [Define to 1 if we have POSIX getpwuid_r which takes 5 arguments.])
+fi
+
+
# Check out attribute support.
LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY
LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT