Page MenuHomeFreeBSD

Fix ncurses fallback.c build with a strict build shell
ClosedPublic

Authored by arichardson on Aug 23 2018, 2:14 PM.

Details

Summary

The script uses shift three times and when building with a strict /bin/sh
shifting without any arguments will cause the script to fail. In this case
the target will fail and we write an empty output file. When doing a
NO_CLEAN build after this will mean fallback.c is up to date and clang
will happily compile the empty input file which leads to strange build
errors later.

Fixed by passing three empty arguments to MkFallback.sh and only creating
fallback.c if MKfallback.sh succeeds.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

lib/ncurses/ncurses/Makefile
353 ↗(On Diff #47171)

I think you want to add fallback.c.tmp to CLEANFILES so it's removed by make clean if a failure occurs.

lib/ncurses/ncurses/Makefile
353 ↗(On Diff #47171)

It is removed by make clean. However, if the make rule fails there will be an empty (up-to-date) output file so it won't be rebuilt.

This revision is now accepted and ready to land.Aug 23 2018, 8:43 PM
This revision was automatically updated to reflect the committed changes.