[Slackbuilds-users] Desmume on 64-bit - optimization flag
Kyle Guinn
elyk03 at gmail.com
Wed Jan 23 05:16:45 UTC 2013
On 1/22/13, Kyle Guinn <elyk03 at gmail.com> wrote:
> On 1/22/13, Larry Hajali <larryhaja at gmail.com> wrote:
>> Could just add an if statement that will add it to the SLKCFLAGS if it is
>> detected on the computer.
>>
>> if grep [^s]sse3 /proc/cpuinfo 2>/dev/null; then
>> SLKCFLAGS="$SLKCFLAGS -msse3"
>> fi
>>
>> Not sure if this leads to undesirable results. I don't have an sse3
>> capable processor, so I can't test.
>
> Well, one problem is that you have a package that advertises itself as
> working on $ARCH (by having $ARCH in the package filename) but it may
> not actually work on every CPU with that $ARCH so you can't safely
> distribute it.
>
> If you're going to go that route, why not just use -march=native?
> Maybe also set $ARCH to "native" for lack of anything better to use,
> and then it should be clear that you shouldn't redistribute the
> resulting package. I'm sure there's a way to work that into the 'if [
> "$ARCH" = "i486" ] ...' stanza if you can find a way to add -fPIC and
> set $LIBDIRSUFFIX appropriately on 64-bit machines.
Here's my first attempt at $ARCH=native:
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
if [ "$ARCH" = "x86_64" -o \( "$ARCH" = "native" -a "$(uname -m)" =
"x86_64" \) ]; then
SLKCFLAGS="$SLKCFLAGS -fPIC"
LIBDIRSUFFIX="64"
fi
if [ "$ARCH" = "native" ]; then
SLKCFLAGS="$SLKCFLAGS -march=native"
elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="$SLKCFLAGS -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="$SLKCFLAGS -march=i686 -mtune=i686"
fi
-Kyle
More information about the SlackBuilds-users
mailing list