[Solved] where do I set machine architecture and flags?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[Solved] where do I set machine architecture and flags?
Hi All,
I've been using slackware for about two days and I would like to compile some programs using sbopkg. Is there a global place that I can set machine architecture and flags that sbopkg will pick up? I've looked aroun but can't find anything.
The CFLAGS are plugged in from the SLKFLAGS and those are conditionally assigned due to the value of ARCH. ARCH can be exported from your ~/.bashrc or similar file or in the same command line as sbopkg (export ARCH=foo; sbopkg). However, this won't let you control specific CFLAGS - just which set of CFLAGS you get. For that, though I could be mistaken, I believe you'll have to edit the files individually (or sed them).
That said, your ARCH should be set correctly automatically and the compiler flags will either be the same as were used in compiling your base system or otherwise reasonably optimized. IOW, the defaults should be fine. I don't need to set my ARCH or mess with the flags.
So if you have an i686 and want to build packages that are optimized for i686 and won't run on anything else, export ARCH=i686 and otherwise, there shouldn't be much to do.
Is there anything specifically wrong with your ARCH or the CFLAGS that make you need to change things?
Thanks for that information. I'll be building several programs and I wanted them optimized for the intel 2.4 ghz quad core. This is a clean install and I don't have a ~/.bashrc at all.
sbopkg usually detects machine architecture automatically.
But if you want, you can either modify the SlackBuild script or pass parameters to it. The latter is called "customise build process" or so (I don't have it on the machine I am sitting in front of). It's both possible from within sbopkg. So you can, e. g., specify ARCH=x86_64 as a command line parameter.
Then there's also a menu entry for saving the build queue. With this, the above settings will be saved, too, as far as I know.
The other method, using .bashrc or similar, would work, and may be a good idea, if you don't have sbopkg, but it's not necessary.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.