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

Brandon Pribula b.pribs11 at gmail.com
Sun Apr 24 07:04:28 UTC 2022


On Sat, Apr 23, 2022, 3:04 AM Tim Dickson via SlackBuilds-users, <
slackbuilds-users at slackbuilds.org> wrote:

> for longer term solution submit a patch upstream. you might want to check
> the optimization flag because some applications don't run well/have runtime
> issues with some flags. In those cases you don't want to override them. (I
> have at least one package with that issue.)
> Regards Tim
>
> On 23/04/2022 05:53, Brandon Pribula wrote:
>
> Hi,
>
> I have a situation with an application I'm packaging. The CFLAGS variable,
> et al in config.mk can't be prepended.
>
> CFLAGS = -std=c99 ...
>
> instead of
>
> CFLAGS += -std=c99 ...
>
> so as is I can't prepend $SLKFLAGS to $CFLAGS. It also contains an
> optimization flag: -Os which conflicts with Slackware's.
>
> 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.
>
> Thanks
>
> _______________________________________________
> SlackBuilds-users mailing listSlackBuilds-users at slackbuilds.orghttps://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - https://slackbuilds.org/faq/
>
>
>
>
> ------------------------------
> [image: AVG logo] <https://www.avg.com/internet-security>
>
> This email has been checked for viruses by AVG antivirus software.
> www.avg.com <https://www.avg.com/internet-security>
>
> <#m_9096267948796403190_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> _______________________________________________
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - https://slackbuilds.org/faq/


Thanks for the reply, Tim.

The optimization it uses is -Os, which is optimize for size. I will test
more tomorrow with and without that flag but I will probably just keep it
as upstream intended.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20220424/fc889491/attachment.htm>


More information about the SlackBuilds-users mailing list