mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add fallback implementation for setenv()
This fixes the code compilation on Windows with MSVC and Kerberos, as a missing implementation of setenv() causes a compilation failure of the GSSAPI code. This was only reproducible when building the code with Kerberos, something that buildfarm animal hamerkop has fixed recently. This issue only happens on 12 and 13, as this code has been introduced inb0b39f7
. HEAD is already able to compile properly thanks to7ca37fb0
, and this commit is a minimal cherry-pick of it. Thanks to Tom Lane for the discussion. Discussion: https://postgr.es/m/YLDtm5WGjPxm6ua4@paquier.xyz Backpatch-through: 12
This commit is contained in:
19
configure
vendored
19
configure
vendored
@ -15858,12 +15858,29 @@ case $host_os in
|
||||
# Windows uses a specialised env handler
|
||||
mingw*)
|
||||
|
||||
$as_echo "#define HAVE_SETENV 1" >>confdefs.h
|
||||
|
||||
|
||||
$as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
|
||||
|
||||
ac_cv_func_setenv=yes
|
||||
ac_cv_func_unsetenv=yes
|
||||
;;
|
||||
*)
|
||||
ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
|
||||
ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv"
|
||||
if test "x$ac_cv_func_setenv" = xyes; then :
|
||||
$as_echo "#define HAVE_SETENV 1" >>confdefs.h
|
||||
|
||||
else
|
||||
case " $LIBOBJS " in
|
||||
*" setenv.$ac_objext "* ) ;;
|
||||
*) LIBOBJS="$LIBOBJS setenv.$ac_objext"
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
|
||||
if test "x$ac_cv_func_unsetenv" = xyes; then :
|
||||
$as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
|
||||
|
||||
|
Reference in New Issue
Block a user