简体   繁体   中英

Cross Compiling Expect for ARM

I have downloaded expect5.4 . I'm trying to cross compile it for ARM(PandaBoard) running stripped down version of linux.

In the initial setup of configuring , I try

Shell$ ./configure --host=ARM
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking for correct TEA configuration... ok (TEA 3.9)
configure: configuring expect 5.45
checking for Tcl configuration... found /home/user1/scripts/tcl8.6.0/unix/tclConfig.sh
checking for existence of /home/user1/scripts/tcl8.6.0/unix/tclConfig.sh... loading
configure: --prefix defaulting to TCL_PREFIX /usr/local
configure: --exec-prefix defaulting to TCL_EXEC_PREFIX /usr/local
checking for ARM-gcc... /home/user1/toolchain/toolchain/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/user1/toolchain/toolchain/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc accepts -g... yes
checking for /home/user1/toolchain/toolchain/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... /home/user1/toolchain/toolchain/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for ARM-ranlib... no
checking for ranlib... ranlib
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
..
.. 
..
..
..
checking for openpty... no
checking for openpty in -lutil... yes
checking if running Sequent running SVR4... no
checking build system type... i686-pc-linux-gnu
checking host system type... Invalid configuration `ARM': machine `ARM' not recognized
configure: error: /bin/bash tclconfig/config.sub ARM failed

UPDATE: On compiling with ./configure --host=arm , It goes further the error i'm getting now is

checking for sysconf... yes
checking for strftime... yes
checking for strchr... yes
checking for timezone... yes
checking for siglongjmp... yes
checking for memcpy... yes
checking if WNOHANG requires _POSIX_SOURCE... configure: error: Expect can't be cross compiled

Its able to pick arm-gcc but it fails for some reason.

You will get a bit further with --host=arm (lowercase), but not much: expect just doesn't want to be cross-compiled. Overcoming this would require non-trivial modifications in configure.in . It could be rational to work on them if expect is the only thing you want to cross-compile, but if there are many others, you'd better setup some environment where you can run compiled binaries ( scratchbox or something like that).

Expect (Version = 5.45.4) is available in buildroot 2019.11 and it has support for the PandaBoard.

You could

  1. download `buildroot 2019.11' from the project .
  2. Extract it
  3. run make pandaboard_defconfig inside the buildroot-folder
  4. run make menuconfig and enable TCL (-> Target packages -> Interpreter languages and scripting) and then expect (-> Target packages -> Interpreter languages and scripting) because of the dependency

  5. run make to build the whole thing and get the executable from the output/build/expect folder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM