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])

Reply via email to