@@ -298,33 +298,29 @@ dnl
298298dnl Checks for -R, etc. switch.
299299dnl
300300AC_DEFUN ( [ PHP_RUNPATH_SWITCH] ,[
301- AC_MSG_CHECKING ( [ if compiler supports -Wl,-rpath,] )
302- AC_CACHE_VAL ( php_cv_cc_rpath ,[
301+ AC_CACHE_CHECK ( [ if compiler supports -Wl,-rpath,] , [ php_cv_cc_rpath] , [
303302 SAVE_LIBS=$LIBS
304303 LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS"
305- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] , [ ] ) ] ,[ php_cv_cc_rpath=yes ] , [ php_cv_cc_rpath=no ] )
306- LIBS=$SAVE_LIBS ] )
307- AC_MSG_RESULT ( [ $ php_cv_cc_rpath] )
308- if test $php_cv_cc_rpath = "yes"; then
309- ld_runpath_switch=-Wl,-rpath,
310- else
311- AC_MSG_CHECKING ( [ if compiler supports -R ] )
312- AC_CACHE_VAL ( php_cv_cc_dashr , [
304+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( ) ] ,
305+ [ php_cv_cc_rpath=yes ] ,
306+ [ php_cv_cc_rpath=no ] )
307+ LIBS=$SAVE_LIBS
308+ ] )
309+ AS_VAR_IF ( [ php_cv_cc_rpath ] , [ yes ] ,
310+ [ ld_runpath_switch=-Wl,-rpath, ] ,
311+ [ AC_CACHE_CHECK ( [ if compiler supports -R ] , [ php_cv_cc_dashr] , [
313312 SAVE_LIBS=$LIBS
314313 LIBS="-R /usr/$PHP_LIBDIR $LIBS"
315- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] , [ ] ) ] ,[ php_cv_cc_dashr=yes] ,[ php_cv_cc_dashr=no] )
316- LIBS=$SAVE_LIBS] )
317- AC_MSG_RESULT ( [ $php_cv_cc_dashr] )
318- if test $php_cv_cc_dashr = "yes"; then
319- ld_runpath_switch=-R
320- else
321- dnl Something innocuous.
322- ld_runpath_switch=-L
323- fi
324- fi
325- if test "$PHP_RPATH" = "no"; then
326- ld_runpath_switch=
327- fi
314+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( ) ] ,
315+ [ php_cv_cc_dashr=yes] ,
316+ [ php_cv_cc_dashr=no] )
317+ LIBS=$SAVE_LIBS
318+ ] )
319+ AS_VAR_IF ( [ php_cv_cc_dashr] , [ yes] ,
320+ [ ld_runpath_switch=-R] ,
321+ [ ld_runpath_switch=-L] )
322+ ] )
323+ AS_VAR_IF ( [ PHP_RPATH] , [ no] , [ ld_runpath_switch=] )
328324] )
329325
330326dnl
@@ -465,10 +461,10 @@ AC_DEFUN([PHP_UTILIZE_RPATHS],[
465461 NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i"
466462 done
467463
468- if test "$ PHP_RPATH" = "no"; then
464+ AS_VAR_IF ( [ PHP_RPATH] , [ no ] , [
469465 unset PHP_RPATHS
470466 unset NATIVE_RPATHS
471- fi
467+ ] )
472468] )
473469
474470dnl
0 commit comments