[okl4-developer] hello_world on gumstix
Geoffrey Lee
glee at ok-labs.com
Wed Jul 16 11:45:36 EST 2008
On Tue, Jul 15, 2008 at 05:06:21PM -0700, Kevin Lloyd wrote:
> Hello all,
>
> I am a first time user of OKL4 & OK Linux and have been able to successfully compile the latest OK Linux & OKL4 to run on the gumstix environment (via skyeye). I am now trying to compile & run a program in addition to the default OK Linux setup (targeting the gumstix architecture). I have followed the steps in wiki article "Tutorial: Develop an OK Linux Application" (http://wiki.ok-labs.com/DevelopOKLinuxApp) with one change; my build command specified 'machine=gumstix'.
>
> Everything compiled okay however when I execute 'hello' I get the following error: /bin/hello: 1: Syntax error: "(" unexpected.
> Furthermore I have tried executing the compiled hello program on my laptop's native environment (Ubuntu 8.04 x86) and it actually worked. This leads me to think that the hello program is not being cross compiled and instead being compiled for my native system.
>
> I tried to figure out how to properly change the SConscript and/or Makefiles to support cross-compiling with the ARM toolchain however I could not.
>
> Anyone have any thoughts or hints?
>
env.scons_env["CC"] contains the value of the cross compiler. You can
use CC= to pass that into the Makefile.
> Thank you,
> Kevin
-gl
>
> Source of Make and SConscript:
>
> # cat Makefile
> all: hello
> install:
> install hello $(PREFIX)/bin
>
> #cat linux/apps/hello/SConscript
> Import("*")
> import os
> build_dir = Dir(env.builddir + "/hello").abspath
> inst_dir = Dir(env.builddir + "/install").abspath
> def b(file_name):
> return os.path.join(build_dir, file_name)
> def i(file_name):
> return os.path.join(inst_dir, file_name)
> env.scons_env["MAKE"] = "make"
> hello = env.Command(b("hello"),
> [] ,
> "PREFIX=%s ZLIB=no $MAKE -j %d -C linux/apps/hello"
> %(inst_dir, GetOption('num_jobs')))
> hello_install = env.Command(i("bin/hello"),
> hello,
> "PREFIX=%s $MAKE -C linux/apps/hello install"
> % (inst_dir))
> Return("hello_install")
>
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
--
More information about the Developer
mailing list