diff options
author | Remi Collet <remi@remirepo.net> | 2023-11-10 09:16:03 +0100 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2023-11-10 09:16:03 +0100 |
commit | 09f16e5a8944ec0f741cecac37ff75b9067827ea (patch) | |
tree | 832ebe1f9bf4ae1f59db35470a5e3051f9b3a9c1 | |
parent | 0a9b035bee3515e9e395e0df9b624503781068e6 (diff) |
simplify config using PKG_CHECK_MODULES
-rw-r--r-- | config.m4 | 29 |
1 files changed, 9 insertions, 20 deletions
@@ -4,30 +4,19 @@ PHP_ARG_ENABLE(rpminfo, whether to enable rpminfo support, [ --enable-rpminfo Enable rpminfo support]) if test "$PHP_RPMINFO" != "no"; then - dnl Write more examples of tests here... - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + PKG_CHECK_MODULES([LIBRPM], [rpm >= 4.11.3]) - AC_MSG_CHECKING(for librpm) - if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists rpm; then - if $PKG_CONFIG rpm --atleast-version 4.11.3; then - LIBRPM_CFLAGS=`$PKG_CONFIG rpm --cflags` - LIBRPM_LIBDIR=`$PKG_CONFIG rpm --libs` - LIBRPM_VERSON=`$PKG_CONFIG rpm --modversion` - AC_MSG_RESULT(from pkgconfig: version $LIBRPM_VERSON) - if $PKG_CONFIG rpm --atleast-version 4.13; then - AC_DEFINE(HAVE_ARCHIVE, 1, [ Archive reader since RPM 4.13 ]) - AC_DEFINE(HAVE_WEAKDEP, 1, [ Indexes on weak dependency field since RPM 4.13 ]) - fi - else - AC_MSG_ERROR(system librpm is too old: version 4.11.3 required) - fi - else - AC_MSG_ERROR(pkg-config not found) - fi - PHP_EVAL_LIBLINE($LIBRPM_LIBDIR, RPMINFO_SHARED_LIBADD) + PHP_EVAL_LIBLINE($LIBRPM_LIBS, RPMINFO_SHARED_LIBADD) PHP_EVAL_INCLINE($LIBRPM_CFLAGS) + AC_MSG_CHECKING(for rpm >= 4.13) + PKG_CHECK_EXISTS([rpm >= 4.13], + AC_DEFINE(HAVE_ARCHIVE, 1, [ Archive reader since RPM 4.13 ]) + AC_DEFINE(HAVE_WEAKDEP, 1, [ Indexes on weak dependency field since RPM 4.13 ]) + AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]) + ) + PHP_SUBST(RPMINFO_SHARED_LIBADD) PHP_NEW_EXTENSION(rpminfo, rpminfo.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) |