@@ -298,33 +298,29 @@ dnl
298
298
dnl Checks for -R, etc. switch.
299
299
dnl
300
300
AC_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] , [
303
302
SAVE_LIBS=$LIBS
304
303
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] , [
313
312
SAVE_LIBS=$LIBS
314
313
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=] )
328
324
] )
329
325
330
326
dnl
@@ -465,10 +461,10 @@ AC_DEFUN([PHP_UTILIZE_RPATHS],[
465
461
NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i"
466
462
done
467
463
468
- if test "$ PHP_RPATH" = "no"; then
464
+ AS_VAR_IF ( [ PHP_RPATH] , [ no ] , [
469
465
unset PHP_RPATHS
470
466
unset NATIVE_RPATHS
471
- fi
467
+ ] )
472
468
] )
473
469
474
470
dnl
0 commit comments