- CentOS 8, OpenWRT 17.07.3, Perl 5.28.1
- Directory: The default for most of the items below is the users "home" directory ( ~ )
- Perlbrew for matching the exact version of Perl on the router and controlling it easily: https://perlbrew.pl/
- Nice tutorial for Perlbrew basics: https://www.digitalocean.com/community/tutorials/how-to-install-perlbrew-and-manage-multiple-versions-of-perl-5-on-centos-7
- perlbrew list
- perlbrew list-modules
- perlbrew use NameOfVersion
- perl -v: Verify current version used
- Install a Perl Module: curl -L https://cpanmin.us | perl - Name::Name
- Download pre-requisites for a Cross Compile Build system: https://openwrt.org/docs/guide-developer/build-system/install-buildsystem
- EPEL repository needed for some: yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
- yum install binutils bzip2 gcc gcc-c++ gawk gettext flex ncurses-devel zlib-devel zlib-static make patch unzip perl-ExtUtils-MakeMaker glibc glibc-devel glibc-static ncurses-libs sed sdcc intltool sharutils bison wget git-core openssl-devel xz
- And of course some of the above (zlib-static, glibc-static, sdcc, shareutils) doesn't work and is also a bit ambivalent, so;
- yum install zlib glibc-common glibc-devel glibc-headers glibc-langpack-en (sdcc (compiler for 8501 microcontroller) and shareutils (for specific encoding for paid RedHat subscribers) are not readily available for CentOS 8)
- And of course some of the above (zlib-static, glibc-static, sdcc, shareutils) doesn't work and is also a bit ambivalent, so;
- If one wants to build firmware version of OpenWRT: Download OpenWRT Files (from https://openwrt.org/docs/guide-developer/build-system/install-buildsystem)
- git clone https://git.openwrt.org/openwrt/openwrt.git
- If one wants to build Perl and compile modules that include other libraries such as OpenSSL
- yum install openssl-devel
- Download the TAR package from CPAN
- perl Makefile.PL
- make
- make test
- make dist
- OpenSSL Cross Compiling (make sure the appropriate version of Perl is selected via perlbrew, above)
- Links;
- https://stackoverflow.com/questions/15539062/cross-compiling-of-openssl-for-linux-arm-v5te-linux-gnueabi-toolchain
- https://wiki.openssl.org/index.php/Compilation_and_Installation
- For ARM infor and --prefix and --openssldir info: https://stackoverflow.com/questions/15539062/cross-compiling-of-openssl-for-linux-arm-v5te-linux-gnueabi-toolchain
- https://centos.pkgs.org/7/epel-x86_64/binutils-arm-linux-gnu-2.27-9.el7.1.x86_64.rpm.html
- https://pkgs.org/search/?q=binutils-arm-linux-gnu
- wget OpenSSL URL ( https://www.openssl.org/source/ )
- ./Configure LIST ( linux-armv4 )
- ./Configure linux-armv4 ( ./config is equivalent to ./Configure x86_64 )
- --prefix=/WhatEverPathForCompiledFiles/
- --openssldir=/usr/ (that's where OpenWRT puts openssl, /usr/bin/ )
- make
- make depend
- make dist, err, make tar (for OpenSSL, but it doesn't work of course);
- Key piece of information for doing it manually: https://stackoverflow.com/questions/1506462/what-files-did-make-install-copy-and-where and https://stackoverflow.com/questions/11307465/destdir-and-prefix-of-make
- make install DESTDIR=
- Header files should be in /usr/include
- Links;
- Compiling
- file NameOfBinary: Shows information about binary file (opkg install file)
- Shared VS Non-Shared, Static VS Shared, .a VS .so ( using the shared switch, as in ./Configure XYZ shared
- Static: EVERYTHING in a single binary / executable file
- Shared: Dependencies located in other files
...quitting for now because the instructions at https://openwrt.org/docs/guide-developer/build-system/use-buildsystem#selecting_a_specific_major_revision are a pathetic joke. Go ahead, try them, see if it works. Nope....