exec: fix race in symlink install
Brought to you by:
cminyard
Noticed missing target directory dependency as a build failure in
make --shuffle
mode (added in https://savannah.gnu.org/bugs/index.php?62100):
Making install in cmdlang
make[1]: Entering directory '/build/openipmi-code/cmdlang'
make[2]: Entering directory '/build/openipmi-code/cmdlang'
rm -f ...-OpenIPMI-2.0.32/bin/ipmish
ln -s openipmish ...-OpenIPMI-2.0.32/bin/ipmish
ln: failed to create symbolic link '...-OpenIPMI-2.0.32/bin/ipmish': No such file or directory
make[2]: *** [Makefile:931: install-data-local] Error 1 shuffle=1656740577
make[2]: Leaving directory '/build/openipmi-code/cmdlang'
make[1]: *** [Makefile:779: install-am] Error 2 shuffle=1656740577
make[1]: Leaving directory '/build/openipmi-code/cmdlang'
make: *** [Makefile:525: install-recursive] Error 1 shuffle=1656740577
The failure happens because before the change there was nothing
that guaranteed $(DESTDIR)$(bindir)
presence before install-data-local
starts execution.
The change uses install-exec-hook
to make sure executables already
landed into $(DESTDIR)$(bindir)
and thus the directory is already present.
Thanks, applied