[okl4-developer] adding a new library in okl4 fails, build script ignores it

Frank Kaiser frank.kaiser at opensynergy.com
Thu Nov 6 04:33:00 EST 2008


Hello, Gabi

 

I think the the problem is that the command is missing which effectively
builds your new library. In the 'Iguana' section of the SConstruct file
your are invoking you have to add a line

ig_env.Package("libs/...")

The parameter has to be the directory in which the SConscript file is
located which describes the new library ("libs/m", if I got it right).
Referencing a library in another SConscript file does not autimatically
build it.

 

I hope that helps

Frank

From: developer-bounces at okl4.org [mailto:developer-bounces at okl4.org] On
Behalf Of Gabi Voiculescu
Sent: Wednesday, November 05, 2008 5:47 PM
To: developer at okl4.org
Subject: [okl4-developer] adding a new library in okl4 fails,build
script ignores it

 

Hello.

I'm trying to add libm support in okl4-2.1.0. The libm source was the
newlib package.

My problem is that even if I have:
* libs/m's SConscript pointing correctly to sources and includes, 
* "m" added in the iguana app's list of libraries, 
the libm.a is not to be found in the build folder and I don't see any
error mesages in the build output regarding problems in creating libm.a.


I have stated below the steps I took to add libm in okl4-2.1.0, so far.

Can you tell me why is my lib/m ignored by the build system?

Thank you,
Gabi Voiculescu

________________________________

Following your suggestions I started with newlib's libm.

I have rearanged the files in the downloaded newlib/libm to have the
following in OKL4 root directory:
newlib/libm/src/common/*.c   -> libs/m/src/common/*.c
newlib/libm/src/math/*.c        -> libs/m/src/math/*.c
newlib/libm/src/mathfp/*.c     -> libs/m/src/mathfp/*.c

newlib/libm/common/fdlibm.h -> libs/m/include/fdlibm.h
newlib/libm/mathfp/fdlibm.h   -> libs/m/include/zmath.h

________________________________


I also added a libs/m/include/configure.h to define some of the macros
I'm interested in having defined in libm (like __IEEE_LITTLE_ENDIAN,
__STDC__, and others).

________________________________


Then I created: 
libs/m/SConscript 
with the following output:

Import("env", "args", "conf")
import os


# Get SRC directory
src_root = Dir('#').srcnode().abspath

# Check architecture exists
arch = env.machine.arch
arch_path = os.path.join('arch', arch, args['package'])

# Use customer forked version of the arch package, if it exists
possible_arch_path = os.path.join("cust", args["cust"], "arch", arch,
args["package"]) 
if os.path.exists(os.path.join(src_root, possible_arch_path)):
    arch_path = possible_arch_path

# I don't see why there is a need for arch specific since the goal is to
use soft-float aka C sources -gabi
#
#if not os.path.exists(os.path.join(src_root, arch_path)):
#    print "architecture %s is not yet supported by libm." % (arch)

arch_path = "#" + arch_path

# Setup library

if args["system"] == "l4_rootserver" or args["system"] ==
"iguana_server":
    filesystem = args.get("filesystem", "null")
else:
    filesystem = args.get("filesystem", "static")


#arch paths first so architecture specific optimized functions can be
provided
source = [
          "src/common/*.c" ,
          "src/math/*.c" ,
          "src/mathfp/*.c" ,
          "src/*.c"
         ]
public_headers = [
                  ("include/", "include/%(name)s/"),
                  ("include/",   "include/")                  
                 ]
#if env.test_libs:
#    if "m" in env.test_libs:
#        source.append("test/*.c")
#        public_headers.append(("test/", "include/%(name)s/"))

#if args["system"] == "l4_rootserver":
#    libs=["c", "l4", "iguana"]
#else:
    libs=["c", "l4", "iguana"]
lib = env.KengeLibrary("m", source=source, LIBS=libs,
                 public_headers=public_headers)
Return("lib")

________________________________


and added in my example "m" in the libs line:

Import("*")
obj = env.KengeProgram("floatex2_example",
                       weaver = env.WeaverIguanaProgram(),
                       LIBS=["atomic_ops", "c", "range_fl",
"circular_buffer", "iguana", "l4", "ll", "l4e", "mutex", "m"])


env.expect_test_data = [("Float Example with <fdlibm.h> extension
works!", None)]

Return("obj")

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20081105/acd0cef1/attachment-0001.htm 


More information about the Developer mailing list