]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Use PTHREAD_CFLAGS when testing for getpwnam_r() 817/head
authorsashan <anedvedicky@gmail.com>
Mon, 23 Jul 2018 12:56:15 +0000 (12:56 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sun, 5 Aug 2018 13:02:25 +0000 (09:02 -0400)
On Solaris, AX_PTHREAD can include -D_POSIX_PTHREAD_SEMANTICS in
PTHREAD_CFLAGS, which affects which variants of getpwnam_r() and
getpwuid_r() are declared by system headers.  In configure.in, use
PTHREAD_CFLAGS when testing for those functions to make sure that the
tests see the same variants as the build will.

[ghudson@mit.edu: rewrote commit message and comment]

ticket: 8723 (new)

src/configure.in

index bafacf832fb1adf6fbc67322f5664eb9e3dc5b93..cfa26ebaa4b693af34daca6c244fd79c5d8304e5 100644 (file)
@@ -576,6 +576,10 @@ fi
 ])
 
 
+# PTHREAD_CFLAGS changes which variant of these functions is declared
+# on Solaris 11, so use it for these tests.
+old_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 AC_CHECK_FUNC(getpwnam_r,ac_cv_func_getpwnam_r=yes,ac_cv_func_getpwnam_r=no)
 AC_CHECK_FUNC(getpwuid_r,ac_cv_func_getpwuid_r=yes,ac_cv_func_getpwuid_r=no)
 if test "$ac_cv_func_getpwnam_r" = yes; then
@@ -625,6 +629,7 @@ if test "$ac_cv_func_getpwnam_r" = yes; then
     fi
   fi
 fi
+CFLAGS=$old_CFLAGS
 
 if test "$ac_cv_func_getpwnam_r" = no && test "$ac_cv_func_getpwuid_r" = yes; then
   # Actually, we could do this check, and the corresponding checks