[Fwd: [OLSR-users] httpinfo compiled for WRT54G - Webinterface looks different]
Paul Wouters
(spam-protected)
Tue Feb 8 13:33:03 CET 2005
On Sun, 6 Feb 2005, Aldert J.B.P. Hazenberg wrote:
Hi Andreas and Aldert, and others,
I am currently packaging a new version of olsrd for Aldert.
I noticed a few things while using the olsrd-current cvs repository.
But first let me give you kudos for creating something that compiles
on 64bit CPU's as well as MIPS CPU's! Good job!
First a test run on my x86_64 (amd64) fedora core 3 distribution:
[(spam-protected) olsrd-current]# cvs -q upd -d -P
[(spam-protected) olsrd-current]# make OS=linux
[...]
oscan.lex: In function `get_conf_token':
oscan.lex:83: warning: int format, different type arg (arg 3)
oscan.c: At top level:
oscan.c:1008: warning: no previous prototype for 'yylex'
[...]
src/net.c: In function `net_output':
src/net.c:390: warning: int format, different type arg (arg 4)
[...]
src/parser.c: In function `olsr_input':
src/parser.c:171: warning: passing arg 6 of `recvfrom' from incompatible pointer type
You further use #warning to tell people about certain API changes. I would personally
do this in an INSTALL or README file. If the changes breaks compatibility, signify it
with a major number version change.
Using #warning will break the compile when using -Wall (which you should use :)
So it builds. Just a sanity check:
[(spam-protected) olsrd-current]# make clean
[(spam-protected) olsrd-current]# cvs -q upd -d -P
? .depend
? src/cfgparser/.depend
? src/cfgparser/oparse.c
? src/cfgparser/oparse.h
? src/cfgparser/oscan.c
these files are apparently created by the build, but not removed with make
clean. so cvs complains about these files. Ofcourse, this also potentially
breaks compiling for two different architectures using the same source tree.
If you don't want make clean to wipe these, wipe them in a make distclean target.
Now let's cross compile :)
[(spam-protected) olsrd-current]# rm .depend src/cfgparser/.depend src/cfgparser/oparse.c src/cfgparser/oparse.h src/cfgparser/oscan.c
[(spam-protected) olsrd-current]# export CC=/usr/local/movies/openwrt/buildroot/build_mipsel/staging_dir/mipsel-linux-uclibc/bin/gcc
[(spam-protected) olsrd-current]# export LD=/usr/local/movies/openwrt/buildroot/build_mipsel/staging_dir/mipsel-linux-uclibc/bin/ld
[(spam-protected) olsrd-current]# export RANLIB=/usr/local/movies/openwrt/buildroot/build_mipsel/staging_dir/mipsel-linux-uclibc/bin/ranlib
[(spam-protected) olsrd-current]# export AR=/usr/local/movies/openwrt/buildroot/build_mipsel/staging_dir/mipsel-linux-uclibc/bin/ar
[(spam-protected) olsrd-current]# export STRIP=/usr/local/movies/openwrt/buildroot/build_mipsel/staging_dir/mipsel-linux-uclibc/bin/strip
[(spam-protected) olsrd-current]# export STRIP=/usr/local/movies/openwrt/buildroot/build_mipsel/staging_dir/mipsel-linux-uclibc/bin/
[(spam-protected) olsrd-current]# export PATH=$PATH:/usr/local/movies/openwrt/buildroot/build_mipsel/staging_dir/mipsel-linux-uclibc/bin/
[(spam-protected) olsrd-current]# export ARCH=mips
[(spam-protected) olsrd-current]# make OS=linux
[...]
oscan.c:1008: warning: no previous prototype for `yylex'
/usr/local/movies/openwrt/buildroot/build_mipsel/staging_dir/mipsel-linux-uclibc/bin/gcc -o olsrd src/build_msg.o src/duplicate_set.o src/generate_msg.o src/hashing.o src/hna_set.o src/hysteresis.o src/interfaces.o src/ipc_frontend.o src/link_set.o src/local_hna_set.o src/lq_avl.o src/lq_list.o src/lq_mpr.o src/lq_packet.o src/lq_route.o src/main.o src/mantissa.o src/mid_set.o src/mpr.o src/mpr_selector_set.o src/neighbor_table.o src/net.o src/olsr.o src/packet.o src/parser.o src/plugin.o src/plugin_loader.o src/process_package.o src/process_routes.o src/rebuild_packet.o src/routing_table.o src/scheduler.o src/socket_parser.o src/tc_set.o src/two_hop_neighbor_table.o src/linux/apm.o src/linux/kernel_routes.o src/linux/link_layer.o src/linux/net.o src/unix/ifnet.o src/unix/log.o src/unix/misc.o src/cfgparser/oscan.o src/cfgparser/oparse.o src/cfgparser/olsrd_conf.o -lm -ldl
/usr/local/movies/openwrt/buildroot/build_mipsel/staging_dir/lib/gcc-lib/mipsel-linux-uclibc/3.3.3/../../../../mipsel-linux-uclibc/bin/ld: src/linux/apm.o: Relocations in generic ELF (EM: 62)
src/linux/apm.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [olsrd] Error 1
Hmm, how did that happen?
[(spam-protected) olsrd-current]# make clean
rm -f src/build_msg.o src/duplicate_set.o src/generate_msg.o src/hashing.o src/hna_set.o src/hysteresis.o src/interfaces.o src/ipc_frontend.o src/link_set.o src/local_hna_set.o src/lq_avl.o src/lq_list.o src/lq_mpr.o src/lq_packet.o src/lq_route.o src/main.o src/mantissa.o src/mid_set.o src/mpr.o src/mpr_selector_set.o src/neighbor_table.o src/net.o src/olsr.o src/packet.o src/parser.o src/plugin.o src/plugin_loader.o src/process_package.o src/process_routes.o src/rebuild_packet.o src/routing_table.o src/scheduler.o src/socket_parser.o src/tc_set.o src/two_hop_neighbor_table.o olsrd olsrd.exe
make -C src/cfgparser clean
make[1]: Entering directory `/usr/src/olsrd-current/src/cfgparser'
rm -f *.o
rm -f olsrd_cfgparser.so.0.1
rm -f olsrd_cfgparser
make[1]: Leaving directory `/usr/src/olsrd-current/src/cfgparser'
[(spam-protected) olsrd-current]# ls -l src/linux/apm.o
-rw-r--r-- 1 root root 15400 Feb 8 13:12 src/linux/apm.o
Hmm, more files not properly cleaned? I wonder why cvs didn't complain. They
don't seem to have ben acidentilly been included in the cvs. perhaps cvs
ignores .o files?
[(spam-protected) olsrd-current]# rm ./src/linux/net.o ./src/linux/kernel_routes.o ./src/linux/link_layer.o ./src/unix/ifnet.o ./src/unix/log.o ./src/unix/misc.o
[(spam-protected) olsrd-current]# make OS=linux
Ok, then the build finishes
[(spam-protected) olsrd-current]# file olsrd
olsrd: ELF 32-bit LSB MIPS-II executable, MIPS, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
[(spam-protected) olsrd-current]# $STRIP olsrd
[(spam-protected) olsrd-current]# ls -l olsrd
-rwxr-xr-x 1 root root 228376 Feb 8 13:30 olsrd
Next the httpinfo:
[(spam-protected) httpinfo]# cd httpinfo/
[(spam-protected) httpinfo]# make OS=linux
[...]
Works :)
[(spam-protected) httpinfo]# $STRIP olsrd_httpinfo.so.0.1
The rest is packaging details which I won't bore you with :)
Aldert: Packages should appear soon on the same location
Paul
More information about the Olsr-users
mailing list