0

I am trying to cross-compile a simple application for the Pandaboard running Linaro Android Linux, v13.04.

I am using the Linaro tool-chain in a Ubuntu 12.04 virtual machine. I can modify and cross-compile the kernel successfully, and compile working driver modules, but I cannot figure out where to get the libraries, etc. I need to build user-space applications (NOT Android, I want stuff to run in a console).

Any hints and/or examples? Sorry for the generic plea for help rather than a specific question, but I am desperately trying to create a command line tool to test my driver. I have a very limited amount of time to get this running and have already searched the web for hours. Eventually, I want to cross-compile the HIDAPI library, but just getting a user space application to work would be a great start!

I do not have (or don't know where to find) the stdio/stdlib libraries for user space programs. What I am hoping for is a simple command line (or makefile) example that would allow me to cross-compile on my Ubuntu system and create an executable that will run in a Linux shell on the Pandaboard Linaro Android build (13.04).

Again, I realize it is very basic, but I'm not able to do it, and would appreciate and example to jump start me.

Thanks, Lee

Digilee
  • 191
  • 1
  • 2
  • 11
  • can u elaborate on which kind of library u need..? – vinay hunachyal Dec 01 '13 at 06:17
  • Edited the question to add more details. – Digilee Dec 01 '13 at 06:23
  • If you have Linaro **Android** build, you'll need NDK toolchain. If you just want to have a minimum Linux distro with a shell to test your driver, I would recommend you to try [Buildroot](http://buildroot.uclibc.org/). It even has Pandaboard as a target. – yegorich Dec 01 '13 at 09:50
  • @yegorich: Thanks for your input. The driver I am building targets Android, so I am using the Linaro Android build. The test program I want to write would not have anything to do with Google's Java interface. Is the NDK the only toolchain that can be used in this environment? I'll check out the Buildroot site. – Digilee Dec 01 '13 at 21:30
  • might helpful http://stackoverflow.com/questions/17785208/when-we-build-a-kernel-and-busy-box-we-need-toolchain-only-for-busybox-not-for/17787633#17787633 – vinay hunachyal Dec 02 '13 at 04:27

1 Answers1

1

To build a console application for Android, you'll need NDK. Android has its special libc version called bionic, that's why you need NDK anyway.

After downloading and extracting NDK, you'll find a samples folder there. Take a look at hello-jni example and create your own. Below an example for Android.mk file:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := hello-jni
LOCAL_SRC_FILES := hello-jni.c

include $(BUILD_SHARED_LIBRARY) 
yegorich
  • 4,653
  • 3
  • 31
  • 37
  • Thanks, yegorich. I haven't tried it yet, but it is clear that this is the main-stream solution to the question I asked. Other solutions (cross-compiling a tool-chain and a clib such as eglibc), would be a lot of work for maybe not much gain. – Digilee Dec 03 '13 at 08:53
  • @Digilee if you really just want to test a driver and simple X11 or even Qt Embedded is sufficient for your needs, I'll suggest, that you take a look at Buildroot. It manages almost everything for you (cross-compilation, toolchain build, rootfs image creation etc.). You need to invest your time once and then you have an instrument, that will help you to solve many embedded related tasks. See this [article](http://free-electrons.com/blog/buildroot-2011-11/) for some useful Buildroot features. – yegorich Dec 03 '13 at 11:47