[Developer] about wombat application

Hal Ashburner hala at ok-labs.com
Thu Apr 26 13:24:43 EST 2007


Àü·æ wrote:
> 
> hello , my name is Quan Long I'am from China, and now work in Korea. 

Hi Quan Long.

(I'm following this up on the developer at okl4.org list which is the one
that is being used now.)

> recently I start porting L4 to our smdk2410, and hypus255(pxa255) board. 
> 
> and I want to know, how can I make an application that running on wombat. 
> 
> someone says , all I have to do is make a directory on Linux_apps directory ,and  edit build.py & SConstruct File. 

Yes you need to make a directory in linux/apps/$name_of_your_app
Let's take as an example pciutils.
so we unpack the pciutils source tarball, then move and rename the
source tree
$ mv unpacked_pciuitls-version_source root_of_tree/linux/apps/pciutils

note that the name of the directory is significant, to build it later we
are going to add linux_apps=pciutils to the build command.

One way to get this done (which is probably not the best way, but is
reasonably straight forward) is to create a SConscript that wraps the
application's native build system (usually gnu make based)
This would go in the top level of pciutils, and might look something
like this:
--------------------------

Import("*")
import os
build_dir = Dir(env.builddir + "/pciutils").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"

pciutils = env.Command(b("pciutils"),
                     [] ,
                      "PREFIX=%s/usr ZLIB=no $MAKE -j %d -C
linux/apps/pciutils" %
                      (inst_dir, GetOption('num_jobs')))

pciutils_install = env.Command(i("bin/pciutils"),
                              pciutils,
                              "PREFIX=%s/usr $MAKE -C
linux/apps/pciutils install" % (inst_dir))
Return("pciutils_install")


--------------------------------


Those env.Command(...) lines have simply been adapted from the makefile.

And you're done.

You may of course prefer to replace the build system of new application
with a proper Scons based configuration.


Kind regards,
Hal Ashburner



More information about the Developer mailing list