Project

General

Profile

Actions

Bug #2925

closed

autotools cross build failure with lighttpd

Added by helmut over 5 years ago. Updated over 5 years ago.

Status:
Fixed
Priority:
Normal
Category:
build_autotools
Target version:
ASK QUESTIONS IN Forums:

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.


Files

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

Updated by gstrauss over 5 years 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.

Actions #2

Updated by gstrauss over 5 years ago

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

Updated by helmut over 5 years 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.

Actions #4

Updated by helmut over 5 years 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.

Actions #5

Updated by gstrauss over 5 years 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)

Actions #6

Updated by helmut over 5 years 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.

Actions

Also available in: Atom