1

I'm on Ubuntu, and trying to build GNU screen for an old ARM device running Busybox. I have a custom cross-compilation toolchain installed in /usr/local/toolchain. I downloaded screen 4.3.1 (from 7 years ago, seemed appropriate considering my toolchain is from that era). screen's configure script assumes my host PC is the target and detecting all sorts of features which do not exist on Busybox, so I had to set some options to make it use the toolchain files instead of the host. My final command and its result is:

$ CC=/usr/local/toolchain/usr/bin/arm-linux-gcc ./configure --host=arm-linux-gnueabi --prefix=/usr/local/toolchain/usr 
this is screen version 4.3.1
checking for arm-linux-gnueabi-gcc... /usr/local/toolchain/usr/bin/arm-linux-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/local/toolchain/usr/bin/arm-linux-gcc accepts -g... yes
checking for /usr/local/toolchain/usr/bin/arm-linux-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/local/toolchain/usr/bin/arm-linux-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether /usr/local/toolchain/usr/bin/arm-linux-gcc needs -traditional... no
checking for library containing strerror... none required
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
configure: error: in `/home/user1/dev/playground/screen-v.4.3.1/src':
configure: error: cannot run test program while cross compiling
See `config.log' for more details

Relevant parts of config.log:

...
 292   │ configure:3633: checking whether it is safe to define __EXTENSIONS__
 293   │ configure:3651: /usr/local/toolchain/usr/bin/arm-linux-gcc -c -g -O2  conftest.c >&5
 294   │ configure:3651: $? = 0
 295   │ configure:3658: result: yes
 296   │ configure:3674: error: in `/home/user1/dev/playground/screen-v.4.3.1/src':
 297   │ configure:3676: error: cannot run test program while cross compiling
 298   │ See `config.log' for more details

A configure test called cross_compiling fails but it's not clear why. I found this question how to disable test programs in cross-compiling glib , which taught me how to use site files to disable a test, but when I disable cross_compiling it then fails with "C compiler cannot create executables", which is not a test I can disable.

I've definitely crosscompiled with this same compiler, so there's no issue there. screen's configuration just seems too complex for novice use and I'm stuck. Any advice?

1 Answer 1

0

As mentioned on Cannot run test program while cross compiling - cross compiling Firebird you could "improve" the configure.in file by removing all "AC_TRY_RUN"-function blocks. This kind of workaround could work.

Otherwise you could use a build-container and run everything inside of it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .