Skip to content

Commit 035b0c5

Browse files
authored
Autotools: Sync CS in PHP_EVAL_LIBLINE (#15737)
- AS_* macros used - arguments quoted - redundant quotation of variable-variable simplified from [$]$2 to $$2 (see Autoconf documentation)
1 parent 6cd0e50 commit 035b0c5

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

build/php.m4

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -375,25 +375,23 @@ AC_DEFUN([PHP_EVAL_LIBLINE],
375375
[m4_warn([syntax], [Missing 2nd argument when skipping extension check])],
376376
[_php_ext_shared_saved=$ext_shared; ext_shared=yes])])
377377
for ac_i in $1; do
378-
case $ac_i in
379-
-pthread[)]
380-
if test "$ext_shared" = "yes"; then
381-
$2="[$]$2 -pthread"
382-
else
383-
PHP_RUN_ONCE(EXTRA_LDFLAGS, [$ac_i], [EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i"])
384-
PHP_RUN_ONCE(EXTRA_LDFLAGS_PROGRAM, [$ac_i],
378+
AS_CASE([$ac_i],
379+
[-pthread], [
380+
AS_VAR_IF([ext_shared], [yes], [$2="$$2 -pthread"], [
381+
PHP_RUN_ONCE([EXTRA_LDFLAGS], [$ac_i],
382+
[EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i"])
383+
PHP_RUN_ONCE([EXTRA_LDFLAGS_PROGRAM], [$ac_i],
385384
[EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $ac_i"])
386-
fi
387-
;;
388-
-l*[)]
389-
ac_ii=$(echo $ac_i|cut -c 3-)
390-
PHP_ADD_LIBRARY($ac_ii,1,$2)
391-
;;
392-
-L*[)]
393-
ac_ii=$(echo $ac_i|cut -c 3-)
394-
PHP_ADD_LIBPATH($ac_ii,$2)
395-
;;
396-
esac
385+
])
386+
],
387+
[-l*], [
388+
ac_ii=$(echo $ac_i|cut -c 3-)
389+
PHP_ADD_LIBRARY([$ac_ii], [yes], [$2])
390+
],
391+
[-L*], [
392+
ac_ii=$(echo $ac_i|cut -c 3-)
393+
PHP_ADD_LIBPATH([$ac_ii], [$2])
394+
])
397395
done
398396
m4_ifnblank([$3], [m4_ifnblank([$2], [ext_shared=$_php_ext_shared_saved])])[]dnl
399397
])

0 commit comments

Comments
 (0)