SLKBUILD CFLAGS

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

SLKBUILD CFLAGS

Post 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.
User avatar
laprjns
Salix Warrior
Posts: 1113
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: SLKBUILD CFLAGS

Post 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.
“The past was erased, the erasure was forgotten, the lie became the truth.”
― George Orwell, 1984
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: SLKBUILD CFLAGS

Post 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.
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: SLKBUILD CFLAGS

Post 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
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: SLKBUILD CFLAGS

Post 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
Post Reply