EXTRA_DIST is not considered on VPATH Build

I have a project with the following directory structure (simplified):

configure.ac
Makefile.am
samples
src/Makefile.am
tests/openssh_keys
tests/Makefile.am

      

The top level Makefile.am has the following content:

EXTRA_DIST = $(srcdir)/tests/openssh_keys \
             $(srcdir)/samples
SUBDIRS = src . tests

      

The "openssh_keys" directory in "tests" contains the data needed for unit tests. When Im building a package with "make dist" all the files mentioned in EXTRA_DIST are properly included in the package. I am having problems using "make distcheck" as it creates a VPATH Build. Unfortunately, the files specified in EXTRA_DIST are not copied, which results in an error when running test cases.

Anyone have a correct solution for including the files mentioned in EXTRA_DIST even in the VPATH build?

+3


source to share


1 answer


I'm not sure what the error you are getting since you didn’t report it, but I found your repository and took it (I would suggest you take a look at what you are writing in configure.ac

because it might be oversimplified, but this is a different topic .)

From what I can see in the code, the problem is that you don't actually provide the file search path test binary, and instead it looks for it in CWD mode. But make distcheck

(and many distributions) use external assemblies that do $(srcdir)

not .

, and hence it fails.

EXTRA_DIST

won't help you: this means that automake copies files to the tarball, but not from $(srcdir)

. Instead, you must provide the test code itself with a way to find out where $(srcdir)

dir is. Since you are not using a test driver or script, the minimum suggestion I would have would be

pam_openssh_x509_check_CPPFLAGS = -DKEYSDIR="\"$(srcdir)/openssh_keys\""

      



and then change the test source to

    char *directory = KEYSDIR;
    char *oneliner = KEYSDIR "/ssh_rsa.txt";

      

to find them in a relative path ( ../../tests/openssh_keys

).

+4


source







All Articles