Source: openexr-viewers Version: 2.3.0-1 Tags: patch upstream User: debian-cr...@lists.debian.org Usertags: ftcbfs
openexr-viewers fails to cross build from source for issues related to its configure script. The first issue is that it uses AC_PATH_PROG to look up pkg-config. This is a common mistake as it yields the build architecture pkg-config rather than the intended host architecture one. Using AC_PATH_TOOL or better PKG_PROG_PKG_CONFIG fixes that. Next, the AM_COMPILELINKRUN macro is buggy. All of its invocations share their enable state via the common variable $enable_programtest. The last invocation of this macro "wins" the value for all of them. As such the configure option --disable-openexrctltest given in debian/rules is ignored. During native builds, the test is performed and yields the correct result. During cross builds, the test is skipped and the wrong result is guessed. Unsharing the enabled-variable between macro invocations fixes this. Please consider applying the attached patch to fix both of these. Helmut
--- openexr-viewers-2.3.0.orig/m4/path.pkgconfig.m4 +++ openexr-viewers-2.3.0/m4/path.pkgconfig.m4 @@ -51,7 +51,7 @@ echo "test_prefix = $test_prefix" AC_ARG_VAR(PKG_CONFIG, Path to pkg-config command) -AC_PATH_PROG(PKG_CONFIG, pkg-config, no) +AC_PATH_TOOL(PKG_CONFIG, pkg-config, no) AC_ARG_WITH(pkg-config,[ --with-pkg-config=PATH Specify which pkg-config to use (optional)], PKG_CONFIG="$withval",) --- openexr-viewers-2.3.0.orig/m4/compilelinkrun.m4 +++ openexr-viewers-2.3.0/m4/compilelinkrun.m4 @@ -45,13 +45,13 @@ dnl check arguments -AC_ARG_ENABLE(arg_disable, [ --disable-arg_disable Do not try to compile and run a test arg_pkg_name program],, enable_programtest=yes) +AC_ARG_ENABLE(arg_disable, [ --disable-arg_disable Do not try to compile and run a test arg_pkg_name program]) dnl dnl if the test hasn't been disabled, then compile, link and run test program dnl - if test "x$enable_programtest" = "xyes" ; then + if test "x$enable_[]arg_disable" != "xno"; then dnl basic preliminary checks AC_MSG_CHECKING(for arg_pkg_name)