Project

General

Profile

Bug #2925

autotools cross build failure with lighttpd

Added by helmut 9 months ago. Updated 9 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
build_autotools
Target version:
Start date:
2019-01-14
Due date:
% Done:

100%

Estimated time:
Missing in 1.5.x:

Description

On Debian systems, mysql_config does not work with cross compilation. For using mysql_config in a cross build, we'd have to build one mysql_config for each combination of architectures. That's more than 100 mysql_configs. Infeasible.

I propose supporting pkg-config in addition to mysql_config. If no mysql_config is given, the build would check for mysqlclient.pc and mariadb.pc before trying mysql_config. Note that the meson build system exclusively works with mariadb.pc and does not support using mysql_config, so this change moves the two build tools closer.

cross.patch (3.42 KB) cross.patch autotools: try mysqlclient.pc and mariadb.pc helmut, 2019-01-14 08:17

Associated revisions

Revision 4608ddec (diff)
Added by gstrauss 9 months ago

[build] autotools: try mysqlclient.pc and mariadb.pc (fixes #2925)

(thx helmut)

x-ref:
"autotools cross build failure with lighttpd"
https://redmine.lighttpd.net/issues/2925

History

#1

Updated by gstrauss 9 months ago

  • Status changed from New to Patch Pending
  • Target version changed from 1.4.x to 1.4.53

helmut, thank you for the patch.

I replaced the AS_IF() for consistency with the rest of configure.ac

I chose to preserve the spelling change from MYSQL_INCLUDE to MYSQL_CONFIG, even though it adds non-required noise to the patch.

#2

Updated by gstrauss 9 months ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100
#3

Updated by helmut 9 months ago

Please don't replace AS_IF! That's broken. It's broken, because PKG_CHECK_MODULES uses AC_REQUIRE and AC_REQUIRE does not work inside a shell if. Consider the following Code

if something; then
AC_REQUIRE(FOO)
...
else
AC_REQUIRE(FOO) # boom because FOO is missing
fi

Using PKG_CHECK_MODULES inside shell if absolutely is a fatal bug.

#4

Updated by helmut 9 months ago

FYI, the change from MYSQL_INCLUDE to MYSQL_CFLAGS is not entirely non-required, because PKG_CHECK_MODULES populates MYSQL_CFLAGS and doesn't populate MYSQL_INCLUDE. If you wanted to preserve MYSQL_INCLUDE (which seems fair), you'd have to have two additional MYSQL_INCLUDE=$MYSQL_CFLAGS assignments in the positive PKG_CHECK_MODULES branches.

#5

Updated by gstrauss 9 months ago

On line 173 of configure.ac, lighttpd has:

PKG_PROG_PKG_CONFIG

That should be sufficient for later use of PKG_CHECK_MODULES() inside conditionals.
See the gory explanation at https://autotools.io/pkgconfig/pkg_check_modules.html

If that were not sufficient, then there are other places in lighttpd configure.ac that would also need to be converted to AS_IF()

(To your other comment, I did accept the use of MYSQL_CFLAGS in commit commmit:4608ddec, so no further changes are needed)

#6

Updated by helmut 9 months ago

Agreed. So not using AS_IF is not a bug here, but requires non-local consistency. I mainly added it because I did not load all of that context. So using AS_IF seemed safer to me. If you ensure that PKG_PROG_PKG_CONFIG is called explicitly, AS_IF is not needed.

Thanks again.

Also available in: Atom