From: sashan Date: Mon, 23 Jul 2018 12:56:15 +0000 (+0000) Subject: Use PTHREAD_CFLAGS when testing for getpwnam_r() X-Git-Tag: krb5-1.17-beta1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=013de5c54eafebf5aa3fae82821c21ca2072040d;p=thirdparty%2Fkrb5.git Use PTHREAD_CFLAGS when testing for getpwnam_r() 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) --- diff --git a/src/configure.in b/src/configure.in index bafacf832f..cfa26ebaa4 100644 --- a/src/configure.in +++ b/src/configure.in @@ -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