diff --git a/configure b/configure index f9bf3b233c..aad8e30742 100755 --- a/configure +++ b/configure @@ -41353,6 +41353,7 @@ _ACEOF done + for wx_func in getpwuid_r do { echo "$as_me:$LINENO: checking for $wx_func" >&5 @@ -41369,8 +41370,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #define _REENTRANT - #include + + #define _REENTRANT + #include + $ac_includes_default int @@ -41381,6 +41384,10 @@ main () &$wx_func; #endif + struct passwd pw, *ppw; + char buf[1024]; + getpwuid_r(0, &pw, buf, sizeof(buf), &ppw) + ; return 0; @@ -41435,6 +41442,7 @@ _ACEOF done + for wx_func in getgrgid_r do { echo "$as_me:$LINENO: checking for $wx_func" >&5 @@ -41451,8 +41459,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #define _REENTRANT - #include + + #define _REENTRANT + #include + $ac_includes_default int @@ -41463,6 +41473,10 @@ main () &$wx_func; #endif + struct group grp, *pgrp; + char buf[1024]; + getgrgid_r(0, &grp, buf, sizeof(buf), &pgrp) + ; return 0; diff --git a/configure.in b/configure.in index e274a5edd2..21e6991a78 100644 --- a/configure.in +++ b/configure.in @@ -4640,10 +4640,28 @@ WX_CHECK_FUNCS(fdopen) if test "$wxUSE_TARSTREAM" = "yes"; then WX_CHECK_FUNCS(sysconf) - WX_CHECK_FUNCS(getpwuid_r, [], [], [#define _REENTRANT - #include ]) - WX_CHECK_FUNCS(getgrgid_r, [], [], [#define _REENTRANT - #include ]) + + WX_CHECK_FUNCS(getpwuid_r, [], [], + [ + #define _REENTRANT + #include + ], + [[ + struct passwd pw, *ppw; + char buf[1024]; + getpwuid_r(0, &pw, buf, sizeof(buf), &ppw) + ]]) + + WX_CHECK_FUNCS(getgrgid_r, [], [], + [ + #define _REENTRANT + #include + ], + [[ + struct group grp, *pgrp; + char buf[1024]; + getgrgid_r(0, &grp, buf, sizeof(buf), &pgrp) + ]]) fi fi