Page 1 of 1

SLKBUILD CFLAGS

Posted: 10. Oct 2010, 18:02
by damNageHack
CXXFLAGS/CFLAGS - You can set these to override the default flags which are "-02 -march=$arch -mtune=i686" where $arch is the variable you set in SLKBUILD. Note that if you override it, you need to put all the flags. Like if you just want to change -02 to -03, you would need to put CFLAGS="-03 -march=$arch -mtune=i686" not just CFLAGS="-03"
How can I handle an individual CFLAGS setting independent from the arch / mtune on which is built like the arch= is optional now :?:
From slkbuild-0.7.0 onwards, this is not mandatory and will default to your system's architecture. You'll still need to use it for "noarch" packages.

Re: SLKBUILD CFLAGS

Posted: 10. Oct 2010, 19:02
by laprjns
Maybe this, a little further down in man SLKBUILD
CFLAGS / CXXFLAGS
The script already assigned appropriate flags for the project according the the specified architecture (see
"arch" above) If for some reason those aren't the ones that you want, you can override them using these vari-
ables.

Re: SLKBUILD CFLAGS

Posted: 10. Oct 2010, 19:09
by damNageHack
Yes, of course. That is the sense.
But I doubt that $arch is working in there, I tried and failed.
That means, if you have a SLKBUILD with special CFLAGS values, you probably need one for each desired architecture.

Re: SLKBUILD CFLAGS

Posted: 10. Oct 2010, 22:20
by thenktor
damNageHack wrote:Yes, of course. That is the sense.
But I doubt that $arch is working in there, I tried and failed.
That means, if you have a SLKBUILD with special CFLAGS values, you probably need one for each desired architecture.
No, just use if inside of your SLKBUILD. An example from my vlc SLKBUILD:

Code: Select all

        if [ "$arch" = "x86_64" ]; then
                TUNING=generic
        elif [ "$arch" = "arm" ]; then
                TUNING=armv4t
        else
                TUNING=$arch
        fi

Re: SLKBUILD CFLAGS

Posted: 11. Oct 2010, 05:23
by damNageHack
ARM... war ja klar :D
Thanks for the help ;)

EDIT:
How can I set special LDFLAGS? It seems not to work in SLKBUILD. I would like to add a -L option for the linker ld.
But no success so far, also with direct manipulating the Makefile after called configure.

EDIT2:
Forget about LDFLAGS. I've created a package request instead :P