From a97f3836eb17a939f4192e5076644d1237f22b43 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 11 Sep 2026 10:13:13 +0200 Subject: [PATCH] report if libmaxminddb is bundled or system --- ext/config.m4 | 2 ++ ext/config.w32 | 2 ++ ext/maxminddb.c | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/config.m4 b/ext/config.m4 index e4357e6..18f9a49 100644 --- a/ext/config.m4 +++ b/ext/config.m4 @@ -77,6 +77,8 @@ if test $PHP_MAXMINDDB != "no"; then CFLAGS="$CFLAGS -fvisibility=hidden -UHAVE_CONFIG_H -DHAVE_CONFIG_H=0 -DMMDB_UINT128_USING_MODE=0 -DMMDB_UINT128_IS_BYTE_ARRAY=1" maxminddb_sources="$maxminddb_sources libmaxminddb/src/maxminddb.c libmaxminddb/src/data-pool.c" + + AC_DEFINE([HAVE_LIBMAXMINDDB_BUNDLED], [1], [Use bundled or system libmaxminddb]) else AC_PATH_PROG(PKG_CONFIG, pkg-config, no) diff --git a/ext/config.w32 b/ext/config.w32 index 29b4bc5..b405b11 100644 --- a/ext/config.w32 +++ b/ext/config.w32 @@ -82,6 +82,8 @@ if (PHP_MAXMINDDB == "yes") { * ask for it explicitly too, and the dependency is ours now. */ ADD_FLAG("LIBS_MAXMINDDB", "ws2_32.lib"); + AC_DEFINE("HAVE_LIBMAXMINDDB_BUNDLED", 1, "Use bundled or system libmaxminddb"); + EXTENSION("maxminddb", "maxminddb.c"); /* This has to come after EXTENSION, which is what makes CFLAGS_MAXMINDDB diff --git a/ext/maxminddb.c b/ext/maxminddb.c index 849b00e..32692a2 100644 --- a/ext/maxminddb.c +++ b/ext/maxminddb.c @@ -798,7 +798,12 @@ static PHP_MINFO_FUNCTION(maxminddb) { php_info_print_table_row( 2, "maxminddb extension version", PHP_MAXMINDDB_VERSION); php_info_print_table_row( - 2, "libmaxminddb library version", MMDB_lib_version()); + 3, "libmaxminddb library version", MMDB_lib_version(), +#ifdef HAVE_LIBMAXMINDDB_BUNDLED + "(bundled)"); +#else + "(system)"); +#endif php_info_print_table_end(); }