Debugging the distcheck target: Difference between revisions

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
Line 2: Line 2:


== A file or directory does not exist ==
== A file or directory does not exist ==
You run the build (e.g., ''make check'') and everything's fine, but ''distcheck'' fails because a file or directory was not present. In the code, look for places where you used the autotools variable '''@srcddir@''' (or @top_srcdir@ or @abs_srcdir@ or @sbd_top_Srcdir@) to refer a file or directory that is generated. In a regular build (e.g., ''check'') that will work fin since the src and build directories are one and the same. With ''distcheck'', not so much since the build (the generated file) are in a different directory from the source. To fix this, use '''@builddir@''' (or the obvious variant).
'''Symptom''': You run the build (e.g., ''make check'') and everything's fine, but ''make distcheck'' fails because a file or directory was not present.<br/>
'''Try''':  In the code, look for places where you used the autotools variable <tt>@srcddir@</tt> (or <tt>@top_srcdir@</tt> or <tt>@abs_srcdir@</tt> or <tt>@abs_top_srcdir@</tt>) to refer a file or directory that is generated. In a regular build (e.g., ''make check'') that will work fine since the <tt>src</tt> and <tt>build</tt> directories are one and the same. With ''make distcheck'', not so much since the build (the generated) files are in a different directory from the source. To fix this, use <tt>@builddir@</tt> (or the obvious variant).


== A directory with generated content is not cleaned ==
== A directory with generated content is not cleaned ==
When ''distcheck'' complains that a directory contains files after the various clean operations, add those files to the ''DISTCLEANFILES'' variable of the Makefile.am. Use a shell pattern to remove all of the files in a directory when the directory itself should not be removed. For example, ''DISTCLEANFILES = atconfig cache/*''
When ''distcheck'' complains that a directory contains files after the various clean operations, add those files to the ''DISTCLEANFILES'' variable of the Makefile.am. Use a shell pattern to remove all of the files in a directory when the directory itself should not be removed. For example, ''DISTCLEANFILES = atconfig cache/*''

Revision as of 17:01, 23 May 2017

Here are common issues that can arise when you first run make distcheck

A file or directory does not exist

Symptom: You run the build (e.g., make check) and everything's fine, but make distcheck fails because a file or directory was not present.
Try: In the code, look for places where you used the autotools variable @srcddir@ (or @top_srcdir@ or @abs_srcdir@ or @abs_top_srcdir@) to refer a file or directory that is generated. In a regular build (e.g., make check) that will work fine since the src and build directories are one and the same. With make distcheck, not so much since the build (the generated) files are in a different directory from the source. To fix this, use @builddir@ (or the obvious variant).

A directory with generated content is not cleaned

When distcheck complains that a directory contains files after the various clean operations, add those files to the DISTCLEANFILES variable of the Makefile.am. Use a shell pattern to remove all of the files in a directory when the directory itself should not be removed. For example, DISTCLEANFILES = atconfig cache/*