LinuxQuestions.org
Have you heard the LinuxQuestions.org Podcast?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Thread Tools
Old 05-10-2008, 03:52 PM   #1
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.0
Posts: 217
Thanked: 3
slackbuild guidance needed


[Log in to get rid of this advertisement]
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?
mcnalu is offline     Reply With Quote
Old 05-10-2008, 04:03 PM   #2
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 2,632
Thanked: 2
You know what ARCH you are building it for, right? Or you are building a generic build for using in multiple machines?
Emerson is offline     Reply With Quote
Old 05-10-2008, 04:12 PM   #3
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.0
Posts: 217
Thanked: 3

Original Poster
The latter - hopefully I won't be only the person to use it
mcnalu is offline     Reply With Quote
Old 05-10-2008, 04:18 PM   #4
dugan
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 537
Thanked: 27
I recommend asking this on the SlackBuilds.org mailing list.

Last edited by dugan; 05-10-2008 at 04:21 PM..
dugan is offline     Reply With Quote
Old 05-10-2008, 04:54 PM   #5
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 2,632
Thanked: 2
Use i486 and add warning it is not intended for i386 use.
Emerson is offline     Reply With Quote
Old 05-10-2008, 11:19 PM   #6
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,375
Thanked: 46
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.
shadowsnipes is offline     Reply With Quote
Old 05-11-2008, 04:21 AM   #7
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.0
Posts: 217
Thanked: 3

Original Poster
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
mcnalu is offline     Reply With Quote
Old 05-11-2008, 06:45 AM   #8
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Ruhr Area, Germany
Distribution: Slackware 12.2
Posts: 1,350
Thanked: 19
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 06:56 AM..
titopoquito is offline     Reply With Quote
Old 05-11-2008, 09:44 AM   #9
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 2,632
Thanked: 2
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.
Emerson is offline     Reply With Quote
Old 05-11-2008, 11:40 AM   #10
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,872
Thanked: 4
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.
jong357 is offline     Reply With Quote
Old 05-11-2008, 12:07 PM   #11
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,872
Thanked: 4
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.
jong357 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 08:49 AM
guidance needed please with java runtime ceborame Ubuntu 2 08-18-2005 02:49 PM
Guidance needed - submitting a new driver to Open Source blodwyn Linux - Networking 1 03-21-2005 07:18 PM
Guidance Needed! akshatyadav Linux - Certification 5 09-07-2004 11:06 PM
Guidance needed: running an application on startup. nyumedic2000 Linux - General 1 07-15-2004 05:01 PM


All times are GMT -5. The time now is 12:46 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration