diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2011-02-24 16:51:17 +0200 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2011-02-24 16:51:17 +0200 |
commit | 23e6d4a5bed6ce5b14b60816ebd5bda2749c9af6 (patch) | |
tree | b6bfedfb8d2db2dd774d60a8096f1fcf3d2a6419 /libgfortran/configure.ac | |
parent | e3d590afea1e84a02f4f9a02929b2a9003fa764e (diff) | |
download | gcc-23e6d4a5bed6ce5b14b60816ebd5bda2749c9af6.zip gcc-23e6d4a5bed6ce5b14b60816ebd5bda2749c9af6.tar.gz gcc-23e6d4a5bed6ce5b14b60816ebd5bda2749c9af6.tar.bz2 |
PR 47802 Test for POSIX getpwuid_r
From-SVN: r170471
Diffstat (limited to 'libgfortran/configure.ac')
-rw-r--r-- | libgfortran/configure.ac | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index 8161659..d25a067 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 |