diff mbox

ulogd: fix cross compilation errors with mysql_config

Message ID 1458312204-2874-1-git-send-email-helmut.schaa@googlemail.com
State Accepted
Delegated to: Eric Leblond
Headers show

Commit Message

Helmut Schaa March 18, 2016, 2:43 p.m. UTC
When cross-compiling ulogd, mysql_config and pg_config will return build host
configuration not build target configuration. This leads to build failures
if mysql_config is installed on the host system but mysql is not available
on the build target.

Fix this by not using mysql_config and pg_config for cross-compilation.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 acinclude.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Eric Leblond March 31, 2016, 6:52 a.m. UTC | #1
Hello Helmut,

On Fri, 2016-03-18 at 15:43 +0100, Helmut Schaa wrote:
> When cross-compiling ulogd, mysql_config and pg_config will return
> build host
> configuration not build target configuration. This leads to build
> failures
> if mysql_config is installed on the host system but mysql is not
> available
> on the build target.
> 
> Fix this by not using mysql_config and pg_config for cross-
> compilation.

Applied, thanks!

BR,

> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
> ---
>  acinclude.m4 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/acinclude.m4 b/acinclude.m4
> index 56d47b8..bd21255 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -35,7 +35,7 @@ if test "$pg_prefix" != "no"; then
>  AC_MSG_CHECKING([for PostgreSQL pg_config program])
>  for d in $pg_prefix/bin /usr/bin /usr/local/bin /usr/local/pgsql/bin
> /opt/pgsql/bin /opt/packages/pgsql/bin
>  do
> -	if test -x $d/pg_config
> +	if test -x $d/pg_config -a "$cross_compiling" = "no";
>  	then
>  		AC_MSG_RESULT(found pg_config in $d)
>  		PQINCPATH=`$d/pg_config --includedir`
> @@ -130,7 +130,7 @@ if test "$my_prefix" != "no"; then
>  AC_MSG_CHECKING([for MySQL mysql_config program])
>  for d in $my_prefix/bin /usr/bin /usr/local/bin /usr/local/mysql/bin
> /opt/mysql/bin /opt/packages/mysql/bin
>  do
> -	if test -x $d/mysql_config
> +	if test -x $d/mysql_config -a "$cross_compiling" = "no";
>  	then
>  		AC_MSG_RESULT(found mysql_config in $d)
>  		MYSQL_INC=`$d/mysql_config --include`
diff mbox

Patch

diff --git a/acinclude.m4 b/acinclude.m4
index 56d47b8..bd21255 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -35,7 +35,7 @@  if test "$pg_prefix" != "no"; then
 AC_MSG_CHECKING([for PostgreSQL pg_config program])
 for d in $pg_prefix/bin /usr/bin /usr/local/bin /usr/local/pgsql/bin /opt/pgsql/bin /opt/packages/pgsql/bin
 do
-	if test -x $d/pg_config
+	if test -x $d/pg_config -a "$cross_compiling" = "no";
 	then
 		AC_MSG_RESULT(found pg_config in $d)
 		PQINCPATH=`$d/pg_config --includedir`
@@ -130,7 +130,7 @@  if test "$my_prefix" != "no"; then
 AC_MSG_CHECKING([for MySQL mysql_config program])
 for d in $my_prefix/bin /usr/bin /usr/local/bin /usr/local/mysql/bin /opt/mysql/bin /opt/packages/mysql/bin
 do
-	if test -x $d/mysql_config
+	if test -x $d/mysql_config -a "$cross_compiling" = "no";
 	then
 		AC_MSG_RESULT(found mysql_config in $d)
 		MYSQL_INC=`$d/mysql_config --include`