LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-10-2008, 02:52 PM   #1
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware current
Posts: 423

Rep: Reputation: 73
slackbuild guidance needed


First off, thanks to the folks at slackbuilds.org for all their efforts, especially the HOWTOs, FAQ and other very clear docs.

I've succeeded in making a slackbuild for kphotoalbum but have come across conflicting advice.
http://www.slackbuilds.com/guidelines/ tells me to include these lines:
Code:
if [ "$ARCH" = "i486" ]; then
       SLKCFLAGS="-O2 -march=i486 -mtune=i686"
    elif [ "$ARCH" = "i686" ]; then
       SLKCFLAGS="-O2 -march=i686 -mtune=i686"
    elif [ "$ARCH" = "x86_64" ]; then
       SLKCFLAGS="-O2 -fPIC"
    fi
but the tutorial http://www.slackwiki.org/Writing_A_SlackBuild_Script says
Code:
if [ "$ARCH" = "i386" ]; then
  SLKCFLAGS="-O2 -march=i386 -mtune=i686"
 elif [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
 elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
fi
Which is preferred?
 
Old 05-10-2008, 03:03 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You know what ARCH you are building it for, right? Or you are building a generic build for using in multiple machines?
 
Old 05-10-2008, 03:12 PM   #3
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware current
Posts: 423

Original Poster
Rep: Reputation: 73
The latter - hopefully I won't be only the person to use it
 
Old 05-10-2008, 03:18 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,079

Rep: Reputation: 5260Reputation: 5260Reputation: 5260Reputation: 5260Reputation: 5260Reputation: 5260Reputation: 5260Reputation: 5260Reputation: 5260Reputation: 5260Reputation: 5260
I recommend asking this on the SlackBuilds.org mailing list.

Last edited by dugan; 05-10-2008 at 03:21 PM.
 
Old 05-10-2008, 03:54 PM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Use i486 and add warning it is not intended for i386 use.
 
Old 05-10-2008, 10:19 PM   #6
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
Quote:
Originally Posted by dugan View Post
I recommend asking this on the SlackBuilds.org mailing list.
Agreed. That is by far the best place for such a question.

But to answer your question (remember my answer isn't the official slackBuilds.org answer), the first code snippet is generally used. Just take a look at a lot of the other slackBuilds and you will see this.

All of them, as far as I know, either by default build for i486 or noarch (unless they repackage binaries). I typically choose i686 for my builds if applicable.
 
Old 05-11-2008, 03:21 AM   #7
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware current
Posts: 423

Original Poster
Rep: Reputation: 73
Thanks for the replies.

I did a quick survey of a few slackbuilds from slackbuilds.org and the first snippet is the most common, but of course, that doesn't mean it's the best choice.

I'll go explain to my inbox that I'm joining another mailing list
 
Old 05-11-2008, 05:45 AM   #8
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634

Rep: Reputation: 144Reputation: 144
EDIT: Forget what I posted before. I just read Carlos' answer on the mailing list. In short: The first one is preferred, the second makes no sense anymore for Slackware versions > 9.0.

http://lists.slackbuilds.org/piperma...ay/002620.html

Last edited by titopoquito; 05-11-2008 at 05:56 AM.
 
Old 05-11-2008, 08:44 AM   #9
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You can use your own, will work whatever ARCH is set. Something like this:

Code:
    if [ "$ARCH" = "i386" ]; then
       SLKCFLAGS="-O2 -march=i386"
    elif [ "$ARCH" = "i486" ]; then
       SLKCFLAGS="-O2 -march=i486"
    elif [ "$ARCH" = "i586" ]; then
       SLKCFLAGS="-O2 -march=pentium-mmx"
    elif [ "$ARCH" = "i686" ]; then
       SLKCFLAGS="-O2 -march=i686"
    elif [ "$ARCH" = "x86_64" ]; then
       SLKCFLAGS="-O2 -fPIC"
    fi
march option implies also mtune in recent GCC versions. With GCC-4.2 and newer you can omit it all and just use march=native.
 
Old 05-11-2008, 10:40 AM   #10
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Starting with glibc-2.6, i486 is the minimum supported arch so it really doesn't make a whole lot of sense to build anything else at i386...

I ussually don't even include CFLAGS in my build scripts. I set it globaly on my login shell and then forget about it. Reduces the clutter in your build scripts.
 
Old 05-11-2008, 11:07 AM   #11
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Also, putting -march=native would optimize for your machine only ( -mtune=native is implied). The use of mtune is still as applicable as it's ever been. -march=i486 -mtune=generic would be the better option IMO. If you just want to build for your machine then -march=native is fine.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a second linux. [Guidance needed] Zmyrgel Linux - Newbie 20 01-29-2006 07:49 AM
guidance needed please with java runtime ceborame Ubuntu 2 08-18-2005 01:49 PM
Guidance needed - submitting a new driver to Open Source blodwyn Linux - Networking 1 03-21-2005 06:18 PM
Guidance Needed! LinuxRam Linux - Certification 5 09-07-2004 10:06 PM
Guidance needed: running an application on startup. nyumedic2000 Linux - General 1 07-15-2004 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration