On 1/22/13, Kyle Guinn <ely...@gmail.com> wrote: > On 1/22/13, Larry Hajali <larryh...@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 _______________________________________________ SlackBuilds-users mailing list SlackBuilds-users@slackbuilds.org http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users Archives - http://lists.slackbuilds.org/pipermail/slackbuilds-users/ FAQ - http://slackbuilds.org/faq/