Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

EXTERN.h missing when compiling on OpenWrt

by morgon (Priest)
on Dec 11, 2018 at 23:37 UTC ( [id://1227113]=perlquestion: print w/replies, xml ) Need Help??

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

Hi

I would like to run a bot on my OpenWrt-device where I do not have a full perl-installation (there is no working working CPAN-client).
I have copied over all pure-perl modules I need but for the xs-modules I had hoped that I could make do with what I can get via package-manager.

Alas there is one vital ingredient missing, and that is Net::SSLeay that is not available (as an aside - ssl modules for python are packaged...).
So I installed gcc and tried to compile it on the box, but it fails like this:

$ make Running Mkbootstrap for Net::SSLeay () chmod 644 SSLeay.bs mips-openwrt-linux-uclibc-gcc -c -D_REENTRANT -D_GNU_SOURCE -Os -pip +e -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour +-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -m +soft-float -I/data3/openwrt-cc-ar71xx/staging_dir/target-mips_34kc_uC +libc-0.9.33.2/usr/include -I/data3/openwrt-cc-ar71xx/staging_dir/targ +et-mips_34kc_uClibc-0.9.33.2/include -I/data3/openwrt-cc-ar71xx/stagi +ng_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include + -I/data3/openwrt-cc-ar71xx/staging_dir/toolchain-mips_34kc_gcc-4.8-l +inaro_uClibc-0.9.33.2/include -O2 -DVERSION=\"1.84\" -DXS_VERSION=\ +"1.84\" -fPIC "-I/usr/lib/perl5/5.20/CORE" SSLeay.c SSLeay.xs:140:20: fatal error: EXTERN.h: No such file or directory #include "EXTERN.h" ^ compilation terminated. make: *** [SSLeay.o] Error 1
Any ideas on how to proceed?

My system is an OpenWrt Chaos Calmer 15.05, the perl is a 5.20.2.

Many thanks!

Replies are listed 'Best First'.
Re: EXTERN.h missing when compiling on OpenWrt
by syphilis (Archbishop) on Dec 12, 2018 at 01:27 UTC
    EXTERN.h: No such file or directory

    Can the package manager install a perl-devel package that includes EXTERN.h and other (missing) crucial files ?

    Cheers,
    Rob
Re: EXTERN.h missing when compiling on OpenWrt
by marto (Cardinal) on Dec 12, 2018 at 06:25 UTC
      I can install perlbase-cpan and when I then add perlbase-unicore (the dependencies are not properly reflected in the packages) I do not have a cpan-script, but I can run
      perl -MCPAN -e shell
      However:
      CPAN.pm requires configuration, but most of it can be done automatical +ly. If you answer 'no' below, you will enter an interactive dialog for eac +h configuration option instead. Would you like to configure as much as possible automatically? [yes] y +es <install_help> Warning: You do not have write permission for Perl library directories +. To install modules, you need to configure a local Perl library directo +ry or escalate your privileges. CPAN can help you by bootstrapping the loca +l::lib module or by configuring itself to use 'sudo' (if available). You may + also resolve this problem manually if you need to customize your setup. What approach do you want? (Choose 'local::lib', 'sudo' or 'manual') [local::lib] Autoconfiguration complete. Attempting to bootstrap local::lib... Writing /home/mh/.cpan/CPAN/MyConfig.pm for bootstrap... commit: wrote '/home/mh/.cpan/CPAN/MyConfig.pm' Fetching with LWP: http://www.cpan.org/authors/01mailrc.txt.gz Reading '/home/mh/.cpan/sources/authors/01mailrc.txt.gz' ...................................................................... +......DONE Fetching with LWP: http://www.cpan.org/modules/02packages.details.txt.gz Reading '/home/mh/.cpan/sources/modules/02packages.details.txt.gz' Out of memory! Killed

        Re:

        Out of memory! Killed

        What's the RAM on that thing? (not flash). You can use:

        free

        and

        cat /proc/meminfo

        I am totally ignorant of these devices but my common sense says that if indeed this is a problem of running out of memory, you either install more RAM or make swap-space from disk space, including an inserted USB or other flash memories. If you want help with that let me know. You can check your disk-space (flash/hard disk/usb) like:

        df -h

        bw, bliako

Re: EXTERN.h missing when compiling on OpenWrt
by aitap (Curate) on Dec 12, 2018 at 11:07 UTC
    Perhaps a better choice would be to cross-compile the required package on a desktop machine? It might be harder to pass paths to proper headers (and, perhaps, library rpaths), but once you get it running, you would be able to compile anything you want, not subject to any limitations of the development environment on the router itself.
      Yes, the proper way to do would be to cross-compile your own firmware but at the moment I've not yet figured out how to do it.

      But eventually I'll do that.

      I had just hoped that I could find a workaround to install the one module I need...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1227113]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-28 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found