LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Architectures in SlackBuild Scripts (https://www.linuxquestions.org/questions/slackware-14/architectures-in-slackbuild-scripts-4175550927/)

dclarion 08-16-2015 08:31 PM

Architectures in SlackBuild Scripts
 
I've been poring over the SlackBuild scripts in the source tree (14.0 specifically), and it appears that they are configured for native builds; do I see this correctly? What I'd like to do is set up a build environment for a Slackware-based distro for my stable of machines (four boxes with three architectures). Am I going to be modifying the build scripts for cross compilation? If so, not a problem; to me, this is a form of recreation. Yes, I'm weird.

foodown 08-16-2015 10:33 PM

They are designed for native builds, yes.

I've seen some on slackbuilds.org (can't remember what they were for) that had cross-compile options that could be set.

What three architectures?

dclarion 08-17-2015 01:07 AM

I have two x86-64 boxes, and two ancient machines: an i686 and an i586. From what I've seen, I could build for i486 to run on the ancient machines.

55020 08-17-2015 03:49 AM

The SlackBuilds.org templates allow you to set ARCH when you call the script:
Code:

ARCH=i686 ./gdal.SlackBuild
The newer Slackware scripts have similar blocks of code to handle ARCH. You will find more newer Slackware scripts in 14.1; to prefer the 14.0 scripts would seem perverse... anyway, to state what should be obvious, you can just run the other scripts through sed. Job done in less than a minute.

But that's not sufficient for a cross-compiling setup.

There are two ways of cross-compiling:

(1) Full cross-building, including configuring and linking. You will need to install a full set of Alien Bob's multilib packages on the x86_64 boxes and run his 32dev.sh script at the start of every cross-building session. Read all about it here: http://www.slackware.com/~alien/multilib/

(2) Do the configuring and linking natively on i686, and use distcc to forward the compilation to your x86_64 hosts for speed. This is much, much easier. You don't need to set up a complete cross-toolchain. You don't even need to install Alien Bob's multilib -- not a lot of people know this, but Slackware's standard x86_64 gcc packages can cross-compile i486/i686. To do it this way, see my sig.


All times are GMT -5. The time now is 09:13 AM.