OK, I admit I'm pretty clueless when it comes to the nitty-gritty of compiling things. Anything more complicated than ./configure, make, make install and I'm lost.
So here's my problem:
I'd like to make printf into a package - I've read PolarWolf's howto's and understand about a third of it due to my lack of experience doing this sort of thing.
I've found what appear to be a couple of nice, standalone implementations of printf that are optimised for embedded systems here:
http://mes.sourceforge.jp/h8/printf.html
and here:
http://www.menie.org/georges/embedded/
I've downloaded both files and can't compile either of them.
Here's some of the errors I'm seeing:
mipsel-linux-gcc -Wall -o printf printf-stdarg.c
/opt/brcm/hndtools-mipsel-linux/bin/../lib/gcc-lib/mipsel-linux/3.2.3/../../../../mipsel-linux/lib/crt1.o: In function `__start':
/opt/brcm/hndtools-mipsel-linux/bin/../lib/gcc-lib/mipsel-linux/3.2.3/../../../../mipsel-linux/lib/crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
and
mipsel-linux-gcc -Wall -o printf printf-20020909.c
printf-20020909.c:1: parse error before '.' token
In file included from /opt/brcm/hndtools-mipsel-linux/mipsel-linux/sys-include/bits/types.h:142,
from /opt/brcm/hndtools-mipsel-linux/mipsel-linux/sys-include/ctype.h:27,
from printf-20020909.c:2:
/opt/brcm/hndtools-mipsel-linux/mipsel-linux/sys-include/bits/pthreadtypes.h:48: parse error before "size_t"
/opt/brcm/hndtools-mipsel-linux/mipsel-linux/sys-include/bits/pthreadtypes.h:51: parse error before "__stacksize"
printf-20020909.c: In function `outstring':
printf-20020909.c:29: warning: implicit declaration of function `memcpy'
printf-20020909.c: In function `input_number':
printf-20020909.c:50: warning: implicit declaration of function `read_string'
printf-20020909.c:58: warning: implicit declaration of function `atodec'
printf-20020909.c:59: warning: implicit declaration of function `atohex'
printf-20020909.c: In function `hex':
printf-20020909.c:109: warning: unused variable `c'
printf-20020909.c: In function `vprintf':
printf-20020909.c:141: warning: implicit declaration of function `strlen'
These seem like fairly basic errors - maybe I don't have my linkers working correctly, but I'd appreciate some advice here...
In case you're wondering, I'd like to make printf a package so that it doesn't have to be compiled into busybox, and because Shorewall depends on it.
EDIT: OK, I realise now that the compilers I've been using are the broadcom-linksys ones and they probably don't work with OpenWRT. Is this correct?