Autotools: Sync CS for PHP_RUNPATH_SWITCH (#15768)

- AS_VAR_IF macros used
- AC_CACHE_VAL and AC_MSG_CHECKING replaced with AC_CACHE_CHECK
- arguments quoted
This commit is contained in:
Peter Kokot 2024-09-06 08:41:09 +02:00 committed by GitHub
parent f17c220388
commit aebe63dd0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -298,33 +298,29 @@ dnl
dnl Checks for -R, etc. switch. dnl Checks for -R, etc. switch.
dnl dnl
AC_DEFUN([PHP_RUNPATH_SWITCH],[ AC_DEFUN([PHP_RUNPATH_SWITCH],[
AC_MSG_CHECKING([if compiler supports -Wl,-rpath,]) AC_CACHE_CHECK([if compiler supports -Wl,-rpath,], [php_cv_cc_rpath], [
AC_CACHE_VAL(php_cv_cc_rpath,[
SAVE_LIBS=$LIBS SAVE_LIBS=$LIBS
LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS" LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_rpath=yes],[php_cv_cc_rpath=no]) AC_LINK_IFELSE([AC_LANG_PROGRAM()],
LIBS=$SAVE_LIBS]) [php_cv_cc_rpath=yes],
AC_MSG_RESULT([$php_cv_cc_rpath]) [php_cv_cc_rpath=no])
if test $php_cv_cc_rpath = "yes"; then LIBS=$SAVE_LIBS
ld_runpath_switch=-Wl,-rpath, ])
else AS_VAR_IF([php_cv_cc_rpath], [yes],
AC_MSG_CHECKING([if compiler supports -R]) [ld_runpath_switch=-Wl,-rpath,],
AC_CACHE_VAL(php_cv_cc_dashr,[ [AC_CACHE_CHECK([if compiler supports -R], [php_cv_cc_dashr], [
SAVE_LIBS=$LIBS SAVE_LIBS=$LIBS
LIBS="-R /usr/$PHP_LIBDIR $LIBS" LIBS="-R /usr/$PHP_LIBDIR $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_dashr=yes],[php_cv_cc_dashr=no]) AC_LINK_IFELSE([AC_LANG_PROGRAM()],
LIBS=$SAVE_LIBS]) [php_cv_cc_dashr=yes],
AC_MSG_RESULT([$php_cv_cc_dashr]) [php_cv_cc_dashr=no])
if test $php_cv_cc_dashr = "yes"; then LIBS=$SAVE_LIBS
ld_runpath_switch=-R ])
else AS_VAR_IF([php_cv_cc_dashr], [yes],
dnl Something innocuous. [ld_runpath_switch=-R],
ld_runpath_switch=-L [ld_runpath_switch=-L])
fi ])
fi AS_VAR_IF([PHP_RPATH], [no], [ld_runpath_switch=])
if test "$PHP_RPATH" = "no"; then
ld_runpath_switch=
fi
]) ])
dnl dnl
@ -465,10 +461,10 @@ AC_DEFUN([PHP_UTILIZE_RPATHS],[
NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i" NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i"
done done
if test "$PHP_RPATH" = "no"; then AS_VAR_IF([PHP_RPATH], [no], [
unset PHP_RPATHS unset PHP_RPATHS
unset NATIVE_RPATHS unset NATIVE_RPATHS
fi ])
]) ])
dnl dnl