Skip to content

Correctly check for pkg-config #1885

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

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2318,11 +2318,11 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[

dnl First try to find pkg-config
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_PATH_TOOL(PKG_CONFIG, pkg-config)
fi

dnl If pkg-config is found try using it
if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
if test "$PHP_OPENSSL_DIR" = "yes" && test -n "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
if $PKG_CONFIG --atleast-version=1.0.1 openssl; then
found_openssl=yes
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
Expand Down
4 changes: 2 additions & 2 deletions ext/odbc/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,9 @@ PHP_ARG_WITH(iodbc,,
AC_MSG_CHECKING(for iODBC support)
if test "$PHP_IODBC" != "no"; then
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_PATH_TOOL(PKG_CONFIG, pkg-config)
fi
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libiodbc ; then
if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists libiodbc ; then
PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
ODBC_TYPE=iodbc
ODBC_INCLUDE=`$PKG_CONFIG --cflags-only-I libiodbc`
Expand Down
4 changes: 2 additions & 2 deletions ext/pdo_pgsql/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ if test "$PHP_PDO_PGSQL" != "no"; then
if test $? -eq 0 ; then
AC_MSG_RESULT([yes])
dnl First try to find pkg-config
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
AC_PATH_TOOL(PKG_CONFIG, pkg-config)
if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
PDO_PGSQL_CFLAGS=`$PKG_CONFIG openssl --cflags`
fi
else
Expand Down
4 changes: 2 additions & 2 deletions ext/zip/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if test "$PHP_ZIP" != "no"; then

if test "$PHP_LIBZIP" != "no"; then

AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_PATH_TOOL(PKG_CONFIG, pkg-config)

dnl system libzip, depends on libzip
AC_MSG_CHECKING(for libzip)
Expand All @@ -62,7 +62,7 @@ if test "$PHP_ZIP" != "no"; then
LIBZIP_LIBDIR="$PHP_LIBZIP/$PHP_LIBDIR"
AC_MSG_RESULT(from option: found in $PHP_LIBZIP)

elif test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libzip; then
elif test -n "$PKG_CONFIG" && $PKG_CONFIG --exists libzip; then
if $PKG_CONFIG libzip --atleast-version 0.11; then
LIBZIP_CFLAGS=`$PKG_CONFIG libzip --cflags`
LIBZIP_LIBDIR=`$PKG_CONFIG libzip --variable=libdir`
Expand Down
6 changes: 3 additions & 3 deletions sapi/fpm/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -588,20 +588,20 @@ if test "$PHP_FPM" != "no"; then

if test "$PHP_FPM_SYSTEMD" != "no" ; then
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_PATH_TOOL(PKG_CONFIG, pkg-config)
fi
unset SYSTEMD_LIBS
unset SYSTEMD_INCS

if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd; then
if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd; then
dnl systemd version >= 209 provides libsystemd
AC_MSG_CHECKING([for libsystemd])
SYSTEMD_LIBS=`$PKG_CONFIG --libs libsystemd`
SYSTEMD_INCS=`$PKG_CONFIG --cflags-only-I libsystemd`
SYSTEMD_VERS=`$PKG_CONFIG --modversion libsystemd`
AC_MSG_RESULT([version $SYSTEMD_VERS])

elif test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd-daemon; then
elif test -n "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd-daemon; then
dnl systemd version < 209 provides libsystemd-daemon
AC_MSG_CHECKING([for libsystemd-daemon])
SYSTEMD_LIBS=`$PKG_CONFIG --libs libsystemd-daemon`
Expand Down