On Wed, Jul 29, 2009 at 2:25 AM, Chris Packham<judge.pack...@gmail.com> wrote: > On Wed, Jul 29, 2009 at 6:33 PM, Aaron Turner<synfina...@gmail.com> wrote: >> On Tue, Jul 28, 2009 at 11:06 PM, Chris Packham<judge.pack...@gmail.com> >> wrote: >>> Hi, >>> >>> Has anyone tried to cross compile tcpreplay? In my case I want to use >>> it on an embedded target as part of a larger test setup. >>> >>> I keep running into ./configure problems with the libpcap detection >>> [1] where it wants to run some test programs but can't run them on the >>> host (because they're not for that architecture). Most other autotools >>> based scripts figure this out print a warning and move on so I'm sure >>> there is a way around it I'm just not sure what it is. >>> >>> I assume that because the detection stuff can't work I need to tell >>> the configure script what version of libpcap I have. Again I've not >>> had enough experience with autotools to know quite how to do this. >>> >>> Any guidance would be much appreciated. >> >> You're the first person to ask about this, so you're sorta on >> uncharted territory. There are a number of tests which check your >> compiler/architecture (big vs. little endian and strict vs. >> non-strictly aligned architectures come to mind) which will cause >> problems for you. Then there's a bunch of tests which check what >> version of various libraries you have installed. >> >> This means if I skipped those tests you'd have to manually fix things >> so you'd get binaries which worked. >> >> Honestly, I have no cross-compiling experience and not 100% sure of >> how things work. What is your compile vs. target platform? How do >> you normally handle the situation when autotools skips these tests? > > The target I'm building for is powerpc running linux building on an > x86 linux host. I use buildroot (http://buildroot.net/) for > configuring various packages applying patches etc. > > Most parts of a configure script still run in this setup (i.e. > detecting header files and tools) just the bits that actually execute > code that get skipped. I'm used to configure testing for a valid > compiler by compiling a test program but when it figures out that its > in a cross compilation situation it skips the part of the test that > runs the program. > > In the case of tcpreplay the version of libpcap does need to be known > (as a hack I could remove the test). I think by manipulating the > autoconf cached variables configure could be tricked into not running > the tests (it looks like buildroot does this for a number of other > packages). > > I'll try some more tomorrow and post anything that looks promising.
Yeah, you're going to have some issues. I assume your headers do the right thing for byte-swapping, but you'll still need to make sure the #define WORDS_BIGENDIAN is set too. PPC is strictly aligned I believe and so FORCE_ALIGN needs to be set too. I build small programs against libpcap and others to test certain functionality... you'll have to set the defines appropriately I guess. Good luck! -- Aaron Turner http://synfin.net/ http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Tcpreplay-users mailing list Tcpreplay-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tcpreplay-users Support Information: http://tcpreplay.synfin.net/trac/wiki/Support