libmariadb compat

Jordi Mallach <[email protected]>
Newsgroups gmane.comp.gnu.mailutils.bugs
Message-ID <[email protected]>
Hey,

During some routine Debian cleanups, I found that configure fails if
you enable mysql support but use libmariadb-dev, without MySQL
compatibility symlinks (eg libmysqlclient.so).

The attached patch makes configure try -lmysqlclient, and fallback to -
lmariadb if that fails.

Thanks,
Jordi

-- 
Jordi Mallach <[email protected]>
mysql-mariadb-fallback.patch (text/x-patch, 1.6 KB)
Author: Jordi Mallach <[email protected]>
Date:   Tue Aug 18 2026
Forwarded: not-yet

    Fall back to -lmariadb when -lmysqlclient is unavailable.

    Debian's libmariadb-dev package ships libmariadb.so/libmariadbclient.so,
    which export mysql_real_connect and the rest of the mysqlclient ABI,
    but not libmysqlclient.so itself; only the transitional
    libmariadb-dev-compat package provides that symlink. Since mailutils
    Build-Depends on libmariadb-dev, probe for -lmariadb too so --with-mysql
    keeps working without needing the compat package.

Index: mailutils/configure.ac
===================================================================
--- mailutils.orig/configure.ac
+++ mailutils/configure.ac
@@ -822,14 +822,21 @@ add_sql_module() {
 AC_SUBST(MYSQLLIBS)
 
 mysql_init() {
-  MU_CHECK_LIB(mysqlclient, 
-	       mysql_real_connect, 
+  MU_CHECK_LIB(mysqlclient,
+	       mysql_real_connect,
 	       [-lm],
                [ AC_DEFINE(USE_SQL)
                  AC_DEFINE(HAVE_MYSQL)
 	         MU_SQL_LDADD(MYSQLLIBS, $mu_cv_lib_mysqlclient)
                  status_mysql=yes ],
-	       [ AC_MSG_FAILURE([The requested library libmysqlclient is not found or is unusable])],
+	       [ MU_CHECK_LIB(mariadb,
+	                mysql_real_connect,
+	                [-lm],
+	                [ AC_DEFINE(USE_SQL)
+	                  AC_DEFINE(HAVE_MYSQL)
+	                  MU_SQL_LDADD(MYSQLLIBS, $mu_cv_lib_mariadb)
+	                  status_mysql=yes ],
+	                [ AC_MSG_FAILURE([The requested library libmysqlclient is not found or is unusable])]) ],
                [/usr/local/lib/mysql /usr/lib/mysql])
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.