LinuxQuestions.org
Visit Jeremy's Blog.
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
 
LinkBack Search this Thread
Old 05-10-2008, 03:52 PM   #1
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 365

Rep: Reputation: 44
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, 04:03 PM   #2
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 2,635

Rep: Reputation: 47
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, 04:12 PM   #3
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 365

Original Poster
Rep: Reputation: 44
The latter - hopefully I won't be only the person to use it
 
Old 05-10-2008, 04:18 PM   #4
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 2,436

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

Last edited by dugan; 05-10-2008 at 04:21 PM.
 
Old 05-10-2008, 04:54 PM   #5
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 2,635

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

Rep: Reputation: 65
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, 04:21 AM   #7
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 365

Original Poster
Rep: Reputation: 44
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, 06:45 AM   #8
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Ruhr Area, Germany
Distribution: Slackware 13.1
Posts: 1,440

Rep: Reputation: 74
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.
 
Old 05-11-2008, 09:44 AM   #9
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 2,635

Rep: Reputation: 47
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, 11:40 AM   #10
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 50
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, 12:07 PM   #11
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 50
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
Trackbacks are Off
Pingbacks are On
Refbacks are 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! LinuxRam 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 01:16 PM.

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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration