make distcheck failing with included file from another directory.
One of my test programs (which is in a test directory) relies on a header from another directory (the src directory). During distcheck (it works without distcheck, I am probably running into VPATH problems) it cannot find the headers. I thought I had taken care of this with adding the srcdir into my include path, but this doesn't seem to be doing the trick. An excerpt from my Makefile.am is here INCLUDES = -I$(top_builddir) -I$(top_srcdir) check_PROGRAMS = test001 test002 test003 test004 test005 test006 test007 test008 \ test009 test010 test011 test012 test013 test014 test015 test016 test001_CPPFLAGS = -Da_p=a_confirm test001_SOURCES = test001.csp test001procs.cc nodist_test001_SOURCES = test001.cc test001_LDADD = $(top_builddir)/src/libcspxx.a $(SOCKETLIBS) The error I get during compilation is here. make[3]: Entering directory `/home/chatgris/code/university/USRA/S05/csp++/trunk/csp++-4.1/_build/tests/csp' if g++ -DHAVE_CONFIG_H -I. -I../../../tests/csp -I../../src -I../.. -I../../.. -Da_p=a_confirm -I/usr/include -g -O2 -MT test001-test001procs.o -MD -MP -MF .deps/test001-test001procs.Tpo -c -o test001-test001procs.o `test -f 'test001procs.cc' || echo '../../../tests/csp/'`test001procs.cc; \ then mv -f .deps/test001-test001procs.Tpo .deps/test001-test001procs.Po; else rm -f .deps/test001-test001procs.Tpo; exit 1; fi ../../../tests/csp/test001procs.cc:2:20: Action.h: No such file or directory ../../../tests/csp/test001procs.cc:3:17: Lit.h: No such file or directory I am guessing that I don't know the right way to include files from other directories in my project. What is the right way to? Thanks, Joshua Moore-Oliva
Re: Files used in EXTRA_DIST not working with distcheck
It would be easier to say what's happening if you showed a bit more of your build setup, for example the rules that use cspm*. This is the entire relevant Makefile.am EXTRA_DIST = cspm.lex cspm.y if DO_CSPT bin_PROGRAMS = cspt cspt_CXXFLAGS = -Wno-deprecated -DYYDEBUG=1 -include iostream.h cspt_SOURCES = ParseNode.cc ParseNode.h ParseNodes.cc ParseNodes.h \ Symbols.cc Symbols.h TranContext.cc TranContext.h nodist_cspt_SOURCES = lex.yy.cc cspm.tab.cc BUILT_SOURCES = lex.yy.cc cspm.tab.cc cspt_LDADD = $(LEXLIB) lex.yy.cc: cspm.lex cspm.tab.cc ParseNode.h $(LEX) -+ -o$@ cspm.lex grep -v class istream lex.yy.cc lex.yy.tmp # get rid of class istream /bin/rm lex.yy.cc /bin/mv lex.yy.tmp lex.yy.cc cspm.tab.cc: cspm.y ParseNodes.h Symbols.h bison -v -d cspm.y mv cspm.tab.c cspm.tab.cc CLEANFILES = lex.yy.cc cspm.output cspm.tab.cc cspm.tab.h endif Without that information, I can only guess: Your package is broken with respect to VPATH builds, i.e., srcdir != builddir. make distcheck tests this. Try this: generate your tarball. In an empty directory, do: gzip -dc $PACKAGE.tar.gz | tar xvf - mkdir build cd build ../$PACKAGE/configure [OPTIONS] make make check If this fails, you may need to add a few $(srcdir) and/or $(builddir) prefixes to your rules (Automake mostly does this for you in its generated stuff). This does fail. Could you please give more detail on the solution? I am not sure what rules you are talking about, nor exactly what you mean by a prefix. I am new to automake so excuse my scant automake vocabulary. Don't hesitate to show the rules; even if it seems to work on your system, they can be tricky to get right so they work for any make implementation. They are shown above. Thanks for you help! Joshua Moore-Oliva
Files used in EXTRA_DIST not working with distcheck
I have two files, cspm.lex and cspm.y that due to circumstances out of my control need special processing. The only way I could get them into the package without automake automatically processing them was by using the EXTRA_DIST variable, as follows EXTRA_DIST = cspm.lex cspm.y I can make dist, and the package works fine. However, make distcheck always fails with the following error bison -v -d cspm.y bison: cannot open file `cspm.y': No such file or directory It appears as if distcheck is not including the EXTRA_DIST files in its check. Is there any way I can force distcheck to include EXTRA_DIST files during checking? Thanks, Joshua Moore-Oliva