Packages that are built as part of the bootstrapping (before we have a working chroot) will be built incorrectly if they rely on pkg-config. Either failing, or producing the wrong result. The problem is that the only special setup we do during bootstrapping is to alter $PATH. That means that our gcc and binutils are used instead of the system's. For programs that test things via the compiler, this is sufficient. But programs that look for dependencies via pkg-config will use the system's pkg-config, and get the wrong results. E.g., if ncurses-devel is installed on the host, then util-linux will find that and fail: > /bin/sh ./libtool --tag=CC --mode=link i686-pc-linux-gnu-gcc -fsigned-char -fno-common -Wall -Werror=sequence-point -Wextra -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wno-missing-field-initializers -Wredundant-decls -Wsign-compare -Wtype-limits -Wuninitialized -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Wnested-externs -Wpointer-arith -Wstrict-prototypes -Wimplicit-function-declaration -O2 -g -g -o dmesg sys-utils/dmesg-dmesg.o lib/dmesg-monotonic.o libcommon.la libtcolors.la -lrt > libtool: link: i686-pc-linux-gnu-gcc -fsigned-char -fno-common -Wall -Werror=sequence-point -Wextra -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wno-missing-field-initializers -Wredundant-decls -Wsign-compare -Wtype-limits -Wuninitialized -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Wnested-externs -Wpointer-arith -Wstrict-prototypes -Wimplicit-function-declaration -O2 -g -g -o dmesg sys-utils/dmesg-dmesg.o lib/dmesg-monotonic.o ./.libs/libcommon.a ./.libs/libtcolors.a -ltinfo -lrt > /opt/cendio-build/arch/i386/usr/bootstrap/lib/gcc/i686-pc-linux-gnu/5.5.0/../../../../i686-pc-linux-gnu/bin/ld: cannot find -ltinfo > collect2: error: ld returned 1 exit status We need to provide some mechanism to redirect pkg-config to our stuff.
Our current approach to cross compiling with pkg-config is to build special variants of pkg-config with other default values. This doesn't fit well with the bootstrapping. Instead, let's use the wrapper script approach recommended by pkg-config: https://autotools.info/pkgconfig/cross-compiling.html This is clean enough that it will work well even during bootstrapping.
We need to fix up ncurses for bug 8361. Since that package is part of the current issue here, let's do a general cleanup of our ncurses packaging at the same time.
Done. Tested that both cenbuild and ThinLinc fully builds without issue after these changes.
Tester should primarily check that pkg-config gives the correct results in: * Bootstrapping * Cross-compilation in cenbuild * Non-cross-compilation in cenbuild