summaryrefslogtreecommitdiffstats
path: root/config.m4
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-01-24 13:21:47 +0100
committerRemi Collet <remi@remirepo.net>2018-01-24 13:21:47 +0100
commit88e8bef6b42bbd1a831e5c8a37e0567251df83bb (patch)
tree04918715f782ef0312e92d21a99dd2096dec5969 /config.m4
initial work, only PoC for now
Diffstat (limited to 'config.m4')
-rw-r--r--config.m430
1 files changed, 30 insertions, 0 deletions
diff --git a/config.m4 b/config.m4
new file mode 100644
index 0000000..8d117a9
--- /dev/null
+++ b/config.m4
@@ -0,0 +1,30 @@
+dnl config.m4 for extension rpminfo
+
+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)
+
+ AC_MSG_CHECKING(for librpm)
+ if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists rpm; then
+ if $PKG_CONFIG rpm --atleast-version 4; 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)
+ else
+ AC_MSG_ERROR(system librpm is too old)
+ fi
+ else
+ AC_MSG_ERROR(pkg-config not found)
+ fi
+ PHP_EVAL_LIBLINE($LIBRPM_LIBDIR, RPMINFO_SHARED_LIBADD)
+ PHP_EVAL_INCLINE($LIBRPM_CFLAGS)
+
+ PHP_SUBST(RPMINFO_SHARED_LIBADD)
+
+ PHP_NEW_EXTENSION(rpminfo, rpminfo.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
+fi