LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   slackbuild guidance needed (https://www.linuxquestions.org/questions/slackware-14/slackbuild-guidance-needed-641318/)

mcnalu 05-10-2008 02:52 PM

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?

Emerson 05-10-2008 03:03 PM

You know what ARCH you are building it for, right? Or you are building a generic build for using in multiple machines?

mcnalu 05-10-2008 03:12 PM

The latter - hopefully I won't be only the person to use it :)

dugan 05-10-2008 03:18 PM

I recommend asking this on the SlackBuilds.org mailing list.

Emerson 05-10-2008 03:54 PM

Use i486 and add warning it is not intended for i386 use.

shadowsnipes 05-10-2008 10:19 PM

Quote:

Originally Posted by dugan (Post 3149372)
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.

mcnalu 05-11-2008 03:21 AM

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 :)

titopoquito 05-11-2008 05:45 AM

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

Emerson 05-11-2008 08:44 AM

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.

jong357 05-11-2008 10:40 AM

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 05-11-2008 11:07 AM

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.


All times are GMT -5. The time now is 11:05 PM.