Source: collectd
Version: 5.8.1-1.3
Tags: patch upstream
User: helm...@debian.org
Usertags: rebootstrap

collectd fails to cross build from source for many reasons and I'm still
investigating some of them. I already fixed a bunch of reasons in other
packages.

There's one thing that's fairly obvious though. It fails finding the
mysql library. collectd's configure tries to use mysql_config, but
mysql_config does not work for cross compilation at all. Most projects
have moved to pkg-config files long time ago and both mariadb and mysql
do provide a mysqlclient.pc. The attached patch makes collectd try using
pkg-config before using mysql_config. It should be fully backwards
compatible and upstreamable. What do you think?

When applying it, please close this bug report even though collectd
won't cross build. There are at least two other issues. Its
Build-Depends are not cross satisfiable and it fails finding -ljvm. I'm
still figuring out how to fix those and will send separate bugs with
patches if I find reasonable solutions.

Helmut
--- collectd-5.8.1.orig/configure.ac
+++ collectd-5.8.1/configure.ac
@@ -3512,6 +3512,12 @@
   [with_libmysql="yes"]
 )
 
+mysqlclient_found=no
+AS_IF(
+  [test "x$with_libmysql" = xyes -a "x$with_mysql_config" = xmysql_config],
+  [PKG_CHECK_MODULES(BUILD_WITH_LIBMYSQL,[mysqlclient],[mysqlclient_found=yes],[])])
+
+if test "$mysqlclient_found" = no; then
 if test "x$with_libmysql" = "xyes"; then
   with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
   if test $? -ne 0; then
@@ -3565,6 +3571,7 @@
 
 AC_SUBST([BUILD_WITH_LIBMYSQL_CFLAGS])
 AC_SUBST([BUILD_WITH_LIBMYSQL_LIBS])
+fi
 # }}}
 
 # --with-libmnl {{{

Reply via email to