Le 12/05/2015 17:01, Peter Korsgaard a écrit : > > Peter Korsgaard, le Tue 12 May 2015 16:09:55 +0200, a écrit : > >> Make install contains a race condition in utils/hwloc, as both > >> install-exec-hook (through intall-exec) and install-data trigger > >> install-man: > > > I'm surprised: isn't make supposed to handle this kind of dependency > > concurrency? > > Within the same make instance, yes - but install-exec fires up a new > make instance to handle install-exec-hook: > > install-exec-am: install-binPROGRAMS install-binSCRIPTS > @$(NORMAL_INSTALL) > $(MAKE) $(AM_MAKEFLAGS) install-exec-hook > > And this is in the Makefile.in code generated by automake, so I don't > think there's any way around that. >
For utils/lstopo, we really need the hook to run after install-man. I think we can use install-data-hook instead, it generates the following code: install-data: install-data-am install-data-am: install-dist_APPLICATIONSDATA install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook Looks like it's officially documented that install-data depends on install-man, so things should just work like this? (patch below) Brice diff --git a/utils/hwloc/Makefile.am b/utils/hwloc/Makefile.am index b7f78d3..f20e58c 100644 --- a/utils/hwloc/Makefile.am +++ b/utils/hwloc/Makefile.am @@ -106,7 +106,7 @@ endif HWLOC_HAVE_LINUX -e 's/#HWLOC_DATE#/@HWLOC_RELEASE_DATE@/g' \ > $@ < $< -install-exec-hook: install-man +install-exec-hook: $(SED) -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-compress-dir > $(DESTDIR)$(bindir)/hwloc-compress-dir.tmp && mv -f $(DESTDIR)$(bindir)/hwloc-compress-dir.tmp $(DESTDIR)$(bindir)/hwloc-compress-dir chmod +x $(DESTDIR)$(bindir)/hwloc-compress-dir if HWLOC_HAVE_LINUX diff --git a/utils/lstopo/Makefile.am b/utils/lstopo/Makefile.am index fd9f5e0..984e263 100644 --- a/utils/lstopo/Makefile.am +++ b/utils/lstopo/Makefile.am @@ -74,7 +74,7 @@ endif -e 's/#HWLOC_DATE#/@HWLOC_RELEASE_DATE@/g' \ > $@ < $< -install-exec-hook: install-man +install-exec-hook: rm -f $(DESTDIR)$(bindir)/hwloc-ls$(EXEEXT) cd $(DESTDIR)$(bindir) && $(LN_S) lstopo-no-graphics$(EXEEXT) hwloc-ls$(EXEEXT) if !HWLOC_HAVE_WINDOWS @@ -83,6 +83,8 @@ if !HWLOC_HAVE_CAIRO cd $(DESTDIR)$(bindir) && $(LN_S) lstopo-no-graphics$(EXEEXT) lstopo$(EXEEXT) || true endif endif + +install-data-hook: rm -f $(DESTDIR)$(man1dir)/hwloc-ls.1 cd $(DESTDIR)$(man1dir) && $(LN_S) lstopo-no-graphics.1 hwloc-ls.1 rm -f $(DESTDIR)$(man1dir)/lstopo.1