cross-compile DHCP to Android-x86

413 views
Skip to first unread message

linxiaobo

unread,
Mar 6, 2012, 10:28:05 PM3/6/12
to android-ndk
Hi,
I am new in cross-compile. I have read /docs/standalone-toolchian,
changed the CC="my corresponding directory", ./configure and make. It
can compile properly, but the generated binary file cannot work on
Android platform, am I wrong?

Thanks

David Turner

unread,
Mar 7, 2012, 11:27:28 AM3/7/12
to andro...@googlegroups.com
Which platform exactly? As far as I know, the "android-x86" project doesn't provide NDK-compatible system images at the moment.
 
Thanks

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


linxiaobo

unread,
Mar 8, 2012, 8:49:02 PM3/8/12
to android-ndk
Thank you for your reply!
Let me make an elaborate description of the scenario.

As we know, Android-x86 doesn't support dhcpv6 client, so my work is
to port dhcp-4.2.3(isc)'s client part to Android-x86-2.2. My system is
Ubuntu-10.10-ui. and independent NDK-r6b

First I followed the instruction of /NDK/docs/STANDALONE-
TOOLCHAIN.htmlI and made my own toolchain following the easy way for
invoking the compiler by the command "make-standalone-toolchain.sh --
platform=android-9(because the documentation says that only android-9
is supported for x86)", though I am not clear about the principle
behind. Under the toolchain directory, "bin, i686-android-linux,
include, lib, libexec, sysroot" are included.

Then I edited the .basrc file to export SYSROOT=/.../NDK/platforms/
android-9/arch-x86, export PATH=/../my_toolchain/bin:$PATH, export
CC=i686-android-linux-gcc.

Finally, I configured. The log is:
*********
user@dev-android-ui:~/dhcp-4.2.3-P2$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of
Makefiles... no
checking for gcc... i686-android-linux-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run
C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
***********

So I go to check the config.log where the error's detail is: is seems
PATH and CC presents properly, but sysroot is not there.
***********
gcc version 4.4.3 (GCC)
configure:2643: $? = 0
configure:2650: i686-android-linux-gcc -V >&5
i686-android-linux-gcc: '-V' option must have argument
configure:2653: $? = 1
configure:2676: checking for C compiler default output file name
configure:2703: i686-android-linux-gcc conftest.c >&5
configure:2706: $? = 0
configure:2744: result: a.out
configure:2761: checking whether the C compiler works
configure:2771: ./a.out
./configure: line 2772: ./a.out: No such file or directory
configure:2774: $? = 127
configure:2783: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
***************

So, I have no idea what to do next step. Could you give me any
helpful suggestion?



On 3月8日, 上午12时27分, David Turner <di...@android.com> wrote:
Reply all
Reply to author
Forward
0 new messages