Source: pmacct
Version: 1.7.6-2
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

pmacct fails to cross build from source, because it uses mysql_config
and mysql_config fundamentally cannot be made to work during cross
builds. A better solution is pkg-config and that actually works. Please
consider applying the attached patch to try pkg-config before
mysql_config. Doing so makes pmacct cross buildable.

Helmut
--- pmacct-1.7.6.orig/configure.ac
+++ pmacct-1.7.6/configure.ac
@@ -374,18 +374,19 @@
 AC_MSG_CHECKING(whether to enable MySQL support)
 AC_ARG_ENABLE(mysql,
   [  --enable-mysql                   Enable MySQL support (default: no)],
-  [ case "$enableval" in
-  yes)
+  [ AS_CASE(["$enableval"],
+  [yes],[
     AC_MSG_RESULT(yes)
 
-    dnl no pkg-config support for MySQL
-    AC_CHECK_PROG([MYSQL_CONFIG], [mysql_config], [mysql_config], [no])
-    if test "x${MYSQL_CONFIG}" = "xno"; then
-      AC_MSG_ERROR([ERROR: missing mysql_config program])
-    fi
+    PKG_CHECK_MODULES([MYSQL],[mysqlclient],,[
+      AC_CHECK_PROG([MYSQL_CONFIG], [mysql_config], [mysql_config], [no])
+      if test "x${MYSQL_CONFIG}" = "xno"; then
+        AC_MSG_ERROR([ERROR: missing mysql_config program])
+      fi
 
-    MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
-    MYSQL_LIBS=`$MYSQL_CONFIG --libs`
+      MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
+      MYSQL_LIBS=`$MYSQL_CONFIG --libs`
+    ])
 
     dnl version check not enforced with a AC_MSG_ERROR for now
     AX_LIB_MYSQL(5.6.3)
@@ -410,11 +411,10 @@
     AC_CHECK_LIB([numa], [numa_bind], [], [AC_MSG_ERROR([
       ERROR: missing libnuma. Requirement for building MySQL.
     ])])
-    ;;
-  no)
+  ],
+  [no],[
     AC_MSG_RESULT(no)
-    ;;
-  esac ],
+  ])],
   [
     AC_MSG_RESULT(no)
   ]

Reply via email to