[Click] click cross-compiling question

Pravin Shankar spravin at gmail.com
Tue Mar 3 19:35:46 EST 2009


Thanks Eddie, Harald.
I finally got click to successfully crosscompile for OpenMoko.
I've attached some notes on the steps and the tweaks I had to do to get this
to work. Hope this is of use to someone.

The fun part should start now...

- Pravin

On Mon, Mar 2, 2009 at 5:57 PM, Eddie Kohler <kohler at cs.ucla.edu> wrote:

> This is not click's <click/algorithm.hh> file, but rather the standard C++
> <algorithm> header.
>
> Perhaps you did not compile or install target libstdc++ when you built your
> cross compiler?
>
> You can avoid this particular occurrence by not compiling the click tools
> for the target architecture.  Try passing --enable-tools=host to click's
> configure script.
>
> Eddie
>
>
> Pravin Shankar wrote:
>
>> Hi all
>> I am trying to cross-compile click for the Openmoko phone (
>> http://wiki.openmoko.org/wiki/OpenMoko ), and facing some issues.
>> Is there any pointers (FAQ or the like) on cross-compiling click?
>>
>> My compiler is arm-angstrom-linux-gnueabi-gcc ( gcc version 4.1.2 )
>> Based on instructions in this page:
>> http://read.cs.ucla.edu/click/faq#how-do-i-cross-compile-userlevel-click
>> I added the --host=arm-angstrom-linux-gnueabi argument to ./configure and
>> am
>> trying to build the click tools using make tools elementmap.xml
>> I get the following error:
>>
>> spravin at waltz:~/git/click$ make tools elementmap.xml
>>
>>> make[1]: Entering directory `/home/spravin/git/click/tools'
>>> make[2]: Entering directory `/home/spravin/git/click/tools/lib'
>>>  CXX landmarkt.cc
>>> landmarkt.cc:22:21: error: algorithm: No such file or directory
>>> landmarkt.cc: In member function ‘String
>>> LandmarkSetT::offset_to_string(unsigned int) const’:
>>> landmarkt.cc:71: error: ‘lower_bound’ is not a member of ‘std’
>>> landmarkt.cc: In member function ‘String
>>> LandmarkSetT::offset_to_decorated_string(unsigned int, unsigned int)
>>> const’:
>>> landmarkt.cc:90: error: ‘lower_bound’ is not a member of ‘std’
>>> make[2]: *** [landmarkt.o] Error 1
>>> make[2]: Leaving directory `/home/spravin/git/click/tools/lib'
>>> make[1]: *** [lib] Error 2
>>> make[1]: Leaving directory `/home/spravin/git/click/tools'
>>> make: *** [tools] Error 2
>>> spravin at waltz:~/git/click$
>>>
>>>
>> I'm guessing this means that the compiler is not able to find the
>> algorithm.h header file. I would need to supply the -I argument with the
>> include location somehow. Should I edit the Makefile? Or should I pass
>> some
>> other argument to ./configure?
>>
>> Any pointers would be appreciated.
>>
>> Regards
>> - Pravin
>> _______________________________________________
>> click mailing list
>> click at amsterdam.lcs.mit.edu
>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>
>
-------------- next part --------------
1) Generate the config file:
autoconf
./configure --disable-linuxmodule --host=arm-angstrom-linux-gnueabi --build=i386-bsd --enable-tools=mixed 

2) Add include paths to libstdc++ headers:
Edit the following two lines in these files
- tools/lib/Makefile
- tools/click-align/Makefile
- userlevel/Makefile
DEFS = -DHAVE_CONFIG_H -DHAVE_NEW_HDR
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
	-I$(srcdir) -I/usr/include/c++/4.2.4 -I/usr/include/c++/4.2.4/i486-linux-gnu

3) Build click tools (i386 binary)
make tools elementmap.xml

4) Create a click script called MY_CONFIG
eg.
FromDevice(eth0) -> Print(ok) -> Discard;

5) Build click (compiles only the elements used in MY_CONFIG):

./tools/click-mkmindriver/click-mkmindriver  -C . -u -A -d./userlevel --elements "Print" -p MY_PKG -f MY_CONFIG
make -C ./userlevel/ MINDRIVER=MY_PKG
arm-angstrom-linux-gnueabi-strip ./tools/click-align/click-align 
arm-angstrom-linux-gnueabi-strip  ./userlevel/MY_PKGclick


More information about the click mailing list