automake: install omitting directory

I have personal project using autotools. I tried to build it since a long time and at make install time, patatra:

/usr/bin/install: omitting directory `./lib/myproject'

The build stops in failure. It used to work flawlessly.

I am not alone

After a quick google search, it happens to be a wide issue: install command line utility is used quite broadly along with autotools but also all sorts of make builds.

Looking for a culprit

Looking at the wine users post we could be headed to a change in /usr/bin/install from GNU coreutils package. But by chance I had another older computer that somehow was able to pass this make install step successfully (as mine used to). I had the same line "omitting directory" but make wouldn't stop, as if it was more of a warning than an error. I even checked the errorlevel of /usr/bin/install call and it was correctly set to "1" in both version.

I never noticed this message because the copy of this directory wasn't really important at this time, and I guess I never checked. So I did check this and it confirmed that this directory wasn't obviously copied.

So this seemed to be a automake related change.

Automake analysis

This is produced by WORKING version "1:1.10.1-2" of automake (on Ubuntu Hardy 8.04 for example):

...
install-dist_LibDATA: $(dist_Lib_DATA)
      @$(NORMAL_INSTALL)
      test -z "$(Libdir)" || $(MKDIR_P) "$(DESTDIR)$(Libdir)"
      @list='$(dist_Lib_DATA)'; for p in $$list; do \
        if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
        f=$(am__strip_dir) \
        echo " $(dist_LibDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(Libdir)/$$f'"; \
        $(dist_LibDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(Libdir)/$$f"; \
      done
 ...

This is produced by FAILING version "1:1.11.1-1" (on Ubuntu Lucid 10.04 for example):

...
install-dist_LibDATA: $(dist_Lib_DATA)
      @$(NORMAL_INSTALL)
      test -z "$(Libdir)" || $(MKDIR_P) "$(DESTDIR)$(Libdir)"
      @list='$(dist_Lib_DATA)'; test -n "$(Libdir)" || list=; \
      for p in $$list; do \
        if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
        echo "$$d$$p"; \
      done | $(am__base_list) | \
      while read files; do \
        echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(Libdir)'"; \
        $(INSTALL_DATA) $$files "$(DESTDIR)$(Libdir)" || exit $$?; \
      done
 ...

Notice the call to the install line that catches the errorlevel of /usr/bin/install command with ... || exit $$?. While in the older version, errorlevel is ignored.

It comes out that the latter is probably the saner. Before the directory was omitted silently by automake generated script. If we look at the number of results in google that are tied to a non-working make install related to this issue, it gives an idea of the number of directory that were omitted silently. While obviously this wasn't breaking nothing for all these package, the introduction of a stricter version of automake have broken a lot of these bogus install (as mine) by breaking on this error.

Conclusion

So finaly I'm the culprit. But how could we achieve the objective I wanted to reach ?

How to get a directory included in your distribution whatever it's content ?

This might be the subject of a next post. Note that I'm also not alone on this road (Matej Tyc and Lorenzo Bettini have the same needs).