[olsr-dev] olsr for uclinux
Mohd Shakir bin Zakaria
(spam-protected)
Thu Oct 5 17:04:55 CEST 2006
Yup, using uclibc.
uclinux uses its toolchain to accomplish this, and adding olsr to uclinux
means i need to add olsr to the toolchain, which consist of manipulating
some Makefiles, which I fail at. This is from the uclinux's documentation on
how to add user app. I fail at the last step.
Adding User Applications to the uClinux Distribution
----------------------------------------------------
D. P. Siddons
9th Dec. 2001
This document gives simple instructions for adding a user-written
application to
the uClinux configuration system. Entries must be added to three files, and
an
apropriate Makefile must exist in the user application source directory,
which
must be put in user (all directory names here are given relative to the
uClinux
top directory. In my system this is /home/peter/uClinux-dist).
Files to edit:
user/Makefile
Add a line to the file like
dir_$(CONFIG_USER_FOO_FOO) += foo
This adds the directory 'foo' to the list of directories to be built. I
added
mine in alphabetical order. The order doesn't seem to matter.
config/Configure.help
This file contains the text which is presented on request during the
config.
Add a block like
CONFIG_USER_FOO_FOO
This program does fooey things to your bars.
The text must be indented two spaces, and there must be no empty lines.
Lines
should be <70 chars long.
config/config.in:
Add a line in the apropriate menu section (i.e. in the program group you
want
your app to show up in during 'make config'; I used 'misc'), like
bool 'foo' CONFIG_USER_FOO_FOO
The repetition of FOO allows for directories which contain multiple
executables. Thus, if the user directory 'foo' contained code to make
'foo'
and 'bar', each gets its own config line if an additional entry is made
like
bool 'bar' CONFIG_USER_FOO_BAR
Next, there needs to be a proper /user/foo/Makefile. The Makefile should
follow
the following template:
--------------------------------------------
EXEC = foo
OBJS = foo.o
all: $(EXEC)
$(EXEC): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
romfs:
$(ROMFSINST) /bin/$(EXEC)
clean:
-rm -f $(EXEC) *.elf *.gdb *.o
---------------------------------------------
If more than one executable is built in the foo directory, as above, then
the
Makefile should look like
------------------------------------------------------------
EXECS = foo bar
OBJS = foo.o bar.o
all: $(EXECS)
$(EXECS): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $@.o $(LDLIBS)
romfs:
$(ROMFSINST) -e CONFIG_USER_FOO_FOO /bin/foo
$(ROMFSINST) -e CONFIG_USER_FOO_BAR /bin/bar
--------------------------------------------------------------
More complex makefiles are of course possible. The reader is encouraged
to
browse the user tree for examples.
When all this is set up, doing the standard 'make xconfig; make dep;
make'
should build the app and install it in romfs and hence in the target
system
On 10/5/06, Bernd Petrovitsch <(spam-protected)> wrote:
>
> On Thu, 2006-10-05 at 14:25 +0000, Mohd Shakir bin Zakaria wrote:
> [....]
> > I'm into adding olsr to uclinux, and I wish to know if any of you has
>
> With a uClibc I suppose.
>
> > done that so that there'll be no redundancy on this. I'm still
> > unsuccessful at my attempt anyway, and so it'll be nice if someone can
> > guide / join me as well. Thanks.
>
> As a start you can post the error messages here (gcc output and the
> relevant lines of code) so you can get at least an opinion on how to fix
> it.
> Most probably lots of glibc-isms are crept in which are not necessary
> anyway.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20061005/55301d64/attachment.html>
More information about the Olsr-dev
mailing list