[Slackbuilds-users] Modifying config.mk's CFLAGS variable

B. Watson urchlay at slackware.uk
Sun Apr 24 14:40:41 UTC 2022



On Fri, 22 Apr 2022, Brandon Pribula wrote:

> The solution I came up with is to change '=' to '+='
> 
> sed -i '/CFLAGS/s/=/+=/' config.mk
> 
> and remove the optimization flag -Os
> 
> sed -i '/CFLAGS/s/-Os//' config.mk
> 
> This works fine but I would like to know if there is a more preferable
> solution with a slackbuild.

That sounds like it should work fine. I might have sedded the
flags directly in:

sed -i "/CFLAGS/s,-Os,$SLKCFLAGS," config.mk

...but there's nothing wrong with the way you did it.


More information about the SlackBuilds-users mailing list