Hi all,
In a rather desperate attempt to get cross compiling working, I tried directly modifying AutotoolsPackage::flags_to_build_system_args() to modify the arguments passed to "./configure" for autotools packages being built with an architecture different to the build system's architecture.
This worked beautifully for some packages, e.g., tar, but was immediately stumped by ncurses. Upon closer inspection, ncurses's package.py overrides the AutotoolsPackage::configure() method instead of overriding configure_args(). As such, it doesn't call flags_to_build_system_args(). The motivation behind doing this is presumably that ncurses executes "./configure" in two different directories ("build_ncurses" and "build_ncursesw") to simultaneously produce two builds (one with "--enable-widec" and one with "--disable-widec"), functionality that I don't believe is possible without overriding configure().
It feels like this functionality is unusual and possibly something that should be handled through variants instead of assuming the user wants both options available. However, the fact that the popular ncurses package.py absolutely precludes any means of passing additional parameters to "./configure" makes me wonder if I'm approaching this from the wrong angle.
If I try to cross-compile without telling "./configure" via "--host", then "./configure" outright fails with:
>> 15 checking whether the C compiler works... configure: error: cannot run C compiled programs.
16 If you meant to cross compile, use `--host'.
But yet, spack offers the "arch" and "target" flags, surely with the goal of enabling cross-compilation, and so I feel I'm missing something.
Is there a way to cross-compile autotools packages without passing additional arguments to "./configure" (e.g., by cunning use of CFLAGS)?
As always, any pointers would be very gratefully received!
Many thanks,
Colin