From 2d4c2152c9eb3dbdf943de46ed8fc11285f1b90b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 13 Apr 2018 14:07:39 +0200 Subject: configure: keep LD_LIBRARY_PATH changes local ... only set it when we actually have to run tests to reduce its impact on for example build commands etc. Fixes #2490 Closes #2492 Reported-by: Dmitry Mikhirev --- m4/curl-functions.m4 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'm4') diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index dde7fe2ea..1bbde9ed5 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -7008,3 +7008,19 @@ AC_DEFUN([CURL_CHECK_FUNC_WRITEV], [ curl_cv_func_writev="no" fi ]) + +dnl CURL_RUN_IFELSE +dnl ------------------------------------------------- +dnl Wrapper macro to use instead of AC_RUN_IFELSE. It +dnl sets LD_LIBRARY_PATH locally for this run only, from the +dnl CURL_LIBRARY_PATH variable. It keeps the LD_LIBRARY_PATH +dnl changes contained within this macro. + +AC_DEFUN([CURL_RUN_IFELSE], [ + AC_REQUIRE([AC_RUN_IFELSE])dnl + + old=$LD_LIBRARY_PATH + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH + AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4) + LD_LIBRARY_PATH=$old # restore +]) -- cgit v1.2.3