Rainer,

can you have a look at this?
I'd rather not ship this as a downstream patch.

@Helmut: Is that mysqlclient.pc file provided via a Debian specific patch?

$ apt-file search mysqlclient.pc
libmariadb-dev-compat: /usr/lib/x86_64-linux-gnu/pkgconfig/mysqlclient.pc
libmysqlclient-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/mysqlclient.pc


-------- Weitergeleitete Nachricht --------
Betreff: Bug#932068: rsyslog FTCBFS: uses mysql_config
Weitersenden-Datum: Sun, 14 Jul 2019 16:09:14 +0000
Weitersenden-Von: Helmut Grohne <[email protected]>
Weitersenden-An: [email protected]
Weitersenden-CC: Michael Biebl <[email protected]>
Datum: Sun, 14 Jul 2019 17:12:48 +0200
Von: Helmut Grohne <[email protected]>
Antwort an: Helmut Grohne <[email protected]>, [email protected]
An: Debian Bug Tracking System <[email protected]>

Source: rsyslog
Version: 8.1907.0-1
Tags: patch upstream

rsyslog fails to cross build from source, because it uses mysql_config
and mysql_config is unfixably broken for cross compilation. It would be
better to use pkg-config. The attached patch makes rsyslog try
pkg-config first and fall back to mysql_config. Please consider applying
it.

Helmut

--- rsyslog-8.1907.0.orig/configure.ac
+++ rsyslog-8.1907.0/configure.ac
@@ -759,24 +759,26 @@
          esac],
         [enable_mysql=no]
 )
-if test "x$enable_mysql" = "xyes"; then
-  AC_CHECK_PROG(
-    [MYSQL_CONFIG],
-    [mysql_config],
-    [mysql_config],
-    [no],,
-  )
-  if test "x${MYSQL_CONFIG}" = "xno"; then
-    AC_MSG_FAILURE([mysql_config not found - usually a package named mysql-dev, libmysql-dev or similar, is missing - install it to fix this issue])
-  fi
+AS_IF([test "x$enable_mysql" = "xyes"],[
+  PKG_CHECK_MODULES([MYSQL],[mysqlclient],,[
+    AC_CHECK_PROG(
+      [MYSQL_CONFIG],
+      [mysql_config],
+      [mysql_config],
+      [no],,
+    )
+    AS_IF([test "x${MYSQL_CONFIG}" = "xno"],[
+      AC_MSG_FAILURE([mysql_config not found - usually a package named mysql-dev, libmysql-dev or similar, is missing - install it to fix this issue])
+    ])
+    MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
+    MYSQL_LIBS=`$MYSQL_CONFIG --libs`
+  ])
   AC_CHECK_LIB(
     [mysqlclient],
     [mysql_init],
-    [MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
-     MYSQL_LIBS=`$MYSQL_CONFIG --libs`
-    ],
+    ,
     [AC_MSG_FAILURE([MySQL library is missing])],
-    [`$MYSQL_CONFIG --libs`]
+    [$MYSQL_LIBS]
   )
   AC_MSG_CHECKING(if we have mysql_library_init)
   save_CFLAGS="$CFLAGS"
@@ -791,7 +793,7 @@
     [have_mysql_library_init=no])
   CFLAGS="$save_CFLAGS"
   LIBS="$save_LIBS"
-fi
+])
 AM_CONDITIONAL(ENABLE_MYSQL, test x$enable_mysql = xyes)
 if test "$have_mysql_library_init" = "yes"; then
   AC_DEFINE([HAVE_MYSQL_LIBRARY_INIT], [1], [mysql_library_init available])

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to