Skip to content

Autotools: Quote AC_CHECK_LIB arguments #15116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ AC_DEFUN([PHP_CHECK_FRAMEWORK], [
dnl Supplying "c" to AC_CHECK_LIB is technically cheating, but rewriting
dnl AC_CHECK_LIB is overkill and this only affects the "checking.." output
dnl anyway.
AC_CHECK_LIB(c,[$2],[
AC_CHECK_LIB([c],[$2],[
LDFLAGS=$save_old_LDFLAGS
$3
],[
Expand Down
30 changes: 17 additions & 13 deletions ext/gettext/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,34 @@ if test "$PHP_GETTEXT" != "no"; then

O_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR"
AC_CHECK_LIB(intl, bindtextdomain, [
AC_CHECK_LIB([intl], [bindtextdomain], [
GETTEXT_LIBS=intl
GETTEXT_CHECK_IN_LIB=intl
],
[
AC_CHECK_LIB(c, bindtextdomain, [
[AC_CHECK_LIB([c], [bindtextdomain], [
GETTEXT_LIBS=
GETTEXT_CHECK_IN_LIB=c
],[
AC_MSG_ERROR([Unable to find required gettext library])
])
]
)
],
[AC_MSG_ERROR([Unable to find required gettext library])])])

AC_DEFINE(HAVE_LIBINTL,1,[ ])
AC_DEFINE([HAVE_LIBINTL], [1], [Define to 1 if you have the 'intl' library.])
PHP_NEW_EXTENSION(gettext, gettext.c, $ext_shared)
PHP_SUBST([GETTEXT_SHARED_LIBADD])

PHP_ADD_INCLUDE([$GETTEXT_INCDIR])

AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, ngettext, [AC_DEFINE(HAVE_NGETTEXT, 1, [ ])])
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dngettext, [AC_DEFINE(HAVE_DNGETTEXT, 1, [ ])])
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dcngettext, [AC_DEFINE(HAVE_DCNGETTEXT, 1, [ ])])
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, bind_textdomain_codeset, [AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [ ])])
AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB], [ngettext],
[AC_DEFINE([HAVE_NGETTEXT], [1],
[Define to 1 if you have the 'ngettext' function.])])
AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB], [dngettext],
[AC_DEFINE([HAVE_DNGETTEXT], [1],
[Define to 1 if you have the 'dngettext' function.])])
AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB], [dcngettext],
[AC_DEFINE([HAVE_DCNGETTEXT], [1],
[Define to 1 if you have the 'dcngettext' function.])])
AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB], [bind_textdomain_codeset],
[AC_DEFINE([HAVE_BIND_TEXTDOMAIN_CODESET], [1],
[Define to 1 if you have the 'bind_textdomain_codeset' function.])])
LDFLAGS=$O_LDFLAGS

if test -n "$GETTEXT_LIBS"; then
Expand Down
12 changes: 5 additions & 7 deletions ext/readline/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
PHP_ADD_INCLUDE([$READLINE_DIR/include])

PHP_READLINE_LIBS=""
AC_CHECK_LIB(ncurses, tgetent,
[
AC_CHECK_LIB([ncurses], [tgetent], [
PHP_ADD_LIBRARY([ncurses],, [READLINE_SHARED_LIBADD])
PHP_READLINE_LIBS="$PHP_READLINE_LIBS -lncurses"
],[
AC_CHECK_LIB(termcap, tgetent,
[
],
[AC_CHECK_LIB([termcap], [tgetent], [
PHP_ADD_LIBRARY([termcap],, [READLINE_SHARED_LIBADD])
PHP_READLINE_LIBS="$PHP_READLINE_LIBS -ltermcap"
])
Expand Down Expand Up @@ -101,9 +99,9 @@ elif test "$PHP_LIBEDIT" != "no"; then
PHP_EVAL_LIBLINE([$EDIT_LIBS], [READLINE_SHARED_LIBADD])
PHP_EVAL_INCLINE([$EDIT_CFLAGS])

AC_CHECK_LIB(ncurses, tgetent,
AC_CHECK_LIB([ncurses], [tgetent],
[PHP_ADD_LIBRARY([ncurses],, [READLINE_SHARED_LIBADD])],
[AC_CHECK_LIB(termcap, tgetent,
[AC_CHECK_LIB([termcap], [tgetent],
[PHP_ADD_LIBRARY([termcap],, [READLINE_SHARED_LIBADD])])])

PHP_CHECK_LIBRARY(edit, readline,
Expand Down
Loading