SmokeyB has asked for the wisdom of the Perl Monks concerning the following question:

Hey Monks,

I'm having some trouble that maybe you could help me with. I need to install the XML::Parser module on an embedded linux system, the only trouble is I cannot compile on that system. Is there some way I could compile what I need on another machine with the same environment and move the needed files over. If so, what would I need to move over?

Would anyone have some recommendations? Thanks in advance!
  • Comment on Installing XML::Parser on an embedded linux system.

Replies are listed 'Best First'.
Re: Installing XML::Parser on an embedded linux system.
by Roger (Parson) on Nov 13, 2003 at 01:31 UTC
    I don't think a straight forward binary copy will work in most embedded system programming. Embedded systems usually have different architectures and different machine codes to a normal PC (assumed to be your dev environment).

    You need a cross-compiler to compile the source code in your development environment (probably a PC), and then upload the binary to your embedded linux box.

    Your development environment should have a cross-compiler, an emulator, a debugger, and an uplink to your embedded system. Pretty much like doing Playstation 2 programming.

Re: Installing XML::Parser on an embedded linux system.
by simonm (Vicar) on Nov 13, 2003 at 01:17 UTC
    If you have a truly equivalent machine with a compiler, I believe you can copy over the contents of the blib/ directory that's built when you run perl Makefile.PL; make.
      Thanks simonm! I tried this out, but now when I run my code on a browser, once it hits a page that uses the XML::Parser, i now get a 502 Gateway error - Not CGI compliant. It works on all the other systems, just not this one. Is there something I might be missing?
        Check your web server's error log; I bet that XML::Parser isn't loading properly, and that failure is producing the 502 message you see.

        More generally, I suspect that your compilation host doesn't really have "the same environment" as the embedded Linux box. Just having another machine running Linux is not enough; it needs to be truly compatible at the hardware and library level. See Roger's comments below about cross-compilation techniques, or contact your embedded systems vendor for more information.