curl-functions.m4: fix LIBRARY_PATH adjustment to avoid eval

$$ usage in a m4 file introduces the PID in linux.
Instead, just duplicate previous working code with a case switch.

Fixes #8229
Closes #8230
This commit is contained in:
Satadru Pramanik 2022-01-05 12:43:25 -05:00 committed by Daniel Stenberg
parent 801bd5138c
commit e39421cef3
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -6515,16 +6515,21 @@ dnl changes contained within this macro.
AC_DEFUN([CURL_RUN_IFELSE], [
case $host_os in
darwin*) library_path_var=DYLD_LIBRARY_PATH ;;
*) library_path_var=LD_LIBRARY_PATH ;;
darwin*)
old=$DYLD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old
export DYLD_LIBRARY_PATH
AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
DYLD_LIBRARY_PATH=$old # restore
;;
*)
old=$LD_LIBRARY_PATH
LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old
export LD_LIBRARY_PATH
AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
LD_LIBRARY_PATH=$old # restore
;;
esac
eval "old=$$library_path_var"
eval "$library_path_var=\$CURL_LIBRARY_PATH:\$old"
eval "export $library_path_var"
AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
eval "$library_path_var=\$old" # restore
])
dnl CURL_COVERAGE