ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Most of us r aware of the "./configure" while building some apps from soure. While configure is running i observed that it buidls a 'sample code'
with the configuration found and tries to run it succesfully, before it goes for further configuration.
The problem is , if we r cross compiling, it may run the target code on the host(i686) and complains -"cannot run test program while crosscompiling".
I started off with - "./configure --host=arm-linux" and stuck here. By the way the package iam compiling is gstreamer.
Usually there's an option in configure for --disable-gtktest or similar which will disable compiling of test programms. Try ./configure --help to see what's available.
no, iam not talking of compilation of test programs of gstreamer.
configure generates a temparory file to check everything is ok with its assumptions. The stated problem is a generic one for any package which uses './configure' for build.
That's exactly what I mean, except it's not a generic autoconf feature. But many packages include such options for disabling tests.
If you would do as I suggested you'll see that the gstreamer sources have 2 of them --disable-tests and --disable-failing-tests ( an obvious clue that your problem is a common one). I mentioned --disbale-gtktest because it is very commonly seen in gtk-based apps. --disable-tests is also seen a lot, but it is not a standard autoconf thing.
'arm-linux' may not be the correct syntax for the host system. You may need to help configure by specifying the target as well.
configure: error: cannot run test program while cross compiling
i tried those disable flags. but still iget :
configure: error: cannot run test program while cross compiling
Iam pasting my complete log here for reference :
./configure --host=arm-linux --disable-tests --disable-failing-tests --disable-gtktest
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 build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking target system type... arm-unknown-linux-gnu
configure: configuring gstreamer for release
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking for arm-linux-strip... arm-linux-strip
checking for arm-linux-gcc... arm-linux-gcc
checking for C compiler default output... 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 arm-linux-gcc accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of arm-linux-gcc... gcc3
checking for strerror in -lcposix... no
checking for ld used by GCC... /home/bayyavs/tools-2.4.25/arm-linux-uclibc/bin/ld
checking if the linker (/home/bayyavs/tools-2.4.25/arm-linux-uclibc/bin/ld) is GNU ld... yes
checking for /home/bayyavs/tools-2.4.25/arm-linux-uclibc/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /home/bayyavs/tools-2.4.25/bin/arm-linux-nm -B
checking whether ln -s works... yes
checking how to recognise dependant libraries... file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )
checking command to parse /home/bayyavs/tools-2.4.25/bin/arm-linux-nm -B output... ok
checking how to run the C preprocessor... arm-linux-gcc -E
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 dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for arm-linux-file... no
checking for file... /usr/bin/file
checking for arm-linux-ranlib... arm-linux-ranlib
checking for arm-linux-strip... (cached) arm-linux-strip
checking for objdir... .libs
checking for arm-linux-gcc option to produce PIC... -fPIC
checking if arm-linux-gcc PIC flag -fPIC works... yes
checking if arm-linux-gcc static flag -static works... yes
checking if arm-linux-gcc supports -c -o file.o... yes
checking if arm-linux-gcc supports -c -o file.lo... yes
checking if arm-linux-gcc supports -fno-rtti -fno-exceptions... yes
checking whether the linker (/home/bayyavs/tools-2.4.25/arm-linux-uclibc/bin/ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether -lc should be explicitly linked in... no
creating libtool
checking for arm-linux-gcc option to accept ANSI C... none needed
checking for compiler flavour... configure: error: cannot run test program while cross compiling
So as u see from last line, i still cant stop it from testing.
You may have to modify the configure.ac or configure.in file and delete the check which is causing problems. Cross compiling with autoconf is pretty tricky and usually needs some tweaking of the config files or makefiles to work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.