Skip to content

Commit c53b272

Browse files
authored
Autotools: Quote AC_CHECK_LIB arguments (#15116)
This syncs CS for AC_CHECK_LIB where possible, and adds minor help texts to gettext extension AC_DEFINE symbols, including the HAVE_LIBINTL.
1 parent a7f0fe1 commit c53b272

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

build/php.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ AC_DEFUN([PHP_CHECK_FRAMEWORK], [
14041404
dnl Supplying "c" to AC_CHECK_LIB is technically cheating, but rewriting
14051405
dnl AC_CHECK_LIB is overkill and this only affects the "checking.." output
14061406
dnl anyway.
1407-
AC_CHECK_LIB(c,[$2],[
1407+
AC_CHECK_LIB([c],[$2],[
14081408
LDFLAGS=$save_old_LDFLAGS
14091409
$3
14101410
],[

ext/gettext/config.m4

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,34 @@ if test "$PHP_GETTEXT" != "no"; then
1717

1818
O_LDFLAGS=$LDFLAGS
1919
LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR"
20-
AC_CHECK_LIB(intl, bindtextdomain, [
20+
AC_CHECK_LIB([intl], [bindtextdomain], [
2121
GETTEXT_LIBS=intl
2222
GETTEXT_CHECK_IN_LIB=intl
2323
],
24-
[
25-
AC_CHECK_LIB(c, bindtextdomain, [
24+
[AC_CHECK_LIB([c], [bindtextdomain], [
2625
GETTEXT_LIBS=
2726
GETTEXT_CHECK_IN_LIB=c
28-
],[
29-
AC_MSG_ERROR([Unable to find required gettext library])
30-
])
31-
]
32-
)
27+
],
28+
[AC_MSG_ERROR([Unable to find required gettext library])])])
3329

34-
AC_DEFINE(HAVE_LIBINTL,1,[ ])
30+
AC_DEFINE([HAVE_LIBINTL], [1], [Define to 1 if you have the 'intl' library.])
3531
PHP_NEW_EXTENSION(gettext, gettext.c, $ext_shared)
3632
PHP_SUBST([GETTEXT_SHARED_LIBADD])
3733

3834
PHP_ADD_INCLUDE([$GETTEXT_INCDIR])
3935

40-
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, ngettext, [AC_DEFINE(HAVE_NGETTEXT, 1, [ ])])
41-
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dngettext, [AC_DEFINE(HAVE_DNGETTEXT, 1, [ ])])
42-
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dcngettext, [AC_DEFINE(HAVE_DCNGETTEXT, 1, [ ])])
43-
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, bind_textdomain_codeset, [AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [ ])])
36+
AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB], [ngettext],
37+
[AC_DEFINE([HAVE_NGETTEXT], [1],
38+
[Define to 1 if you have the 'ngettext' function.])])
39+
AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB], [dngettext],
40+
[AC_DEFINE([HAVE_DNGETTEXT], [1],
41+
[Define to 1 if you have the 'dngettext' function.])])
42+
AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB], [dcngettext],
43+
[AC_DEFINE([HAVE_DCNGETTEXT], [1],
44+
[Define to 1 if you have the 'dcngettext' function.])])
45+
AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB], [bind_textdomain_codeset],
46+
[AC_DEFINE([HAVE_BIND_TEXTDOMAIN_CODESET], [1],
47+
[Define to 1 if you have the 'bind_textdomain_codeset' function.])])
4448
LDFLAGS=$O_LDFLAGS
4549

4650
if test -n "$GETTEXT_LIBS"; then

ext/readline/config.m4

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
2929
PHP_ADD_INCLUDE([$READLINE_DIR/include])
3030

3131
PHP_READLINE_LIBS=""
32-
AC_CHECK_LIB(ncurses, tgetent,
33-
[
32+
AC_CHECK_LIB([ncurses], [tgetent], [
3433
PHP_ADD_LIBRARY([ncurses],, [READLINE_SHARED_LIBADD])
3534
PHP_READLINE_LIBS="$PHP_READLINE_LIBS -lncurses"
36-
],[
37-
AC_CHECK_LIB(termcap, tgetent,
38-
[
35+
],
36+
[AC_CHECK_LIB([termcap], [tgetent], [
3937
PHP_ADD_LIBRARY([termcap],, [READLINE_SHARED_LIBADD])
4038
PHP_READLINE_LIBS="$PHP_READLINE_LIBS -ltermcap"
4139
])
@@ -101,9 +99,9 @@ elif test "$PHP_LIBEDIT" != "no"; then
10199
PHP_EVAL_LIBLINE([$EDIT_LIBS], [READLINE_SHARED_LIBADD])
102100
PHP_EVAL_INCLINE([$EDIT_CFLAGS])
103101

104-
AC_CHECK_LIB(ncurses, tgetent,
102+
AC_CHECK_LIB([ncurses], [tgetent],
105103
[PHP_ADD_LIBRARY([ncurses],, [READLINE_SHARED_LIBADD])],
106-
[AC_CHECK_LIB(termcap, tgetent,
104+
[AC_CHECK_LIB([termcap], [tgetent],
107105
[PHP_ADD_LIBRARY([termcap],, [READLINE_SHARED_LIBADD])])])
108106

109107
PHP_CHECK_LIBRARY(edit, readline,

0 commit comments

Comments
 (0)