[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make distcheck not finding custom code generation script

From: Ralf Wildenhues
Subject: Re: make distcheck not finding custom code generation script
Date: Sat, 13 May 2006 10:23:46 +0200
User-agent: Mutt/1.5.11+cvs20060403

Hi Andreas,

* Andreas Ntaflos wrote on Sat, May 13, 2006 at 08:59:12AM CEST:

> ../tools/ /path/to/foo2cpp
> In src/ there is a target that does just that:

> What doesn't work:
> The problem is that `make distcheck' fails right at the beginning of the 
> build process, after configuring.

The concept that is probably new to you is when source tree and build
tree are not the same.  You can achieve that yourself (without
distcheck) by something like this:
  mkdir build
  cd build
  ../source-tree/configure [OPTIONS]

(when you do above, make sure you haven't previously run configure
inside the source-tree; for example by calling `make distclean' there).
The Makefile rules that Automake generates usually work with this.
In your setup it needs a few simple adjustments.

A note why it is incredibly useful to be able to have separate source
and build trees: I often have one source tree, shared over NFS or
similar, and several build trees, one for each operating system I build
for.  Or one for each compiler I try out.  Or one debugging build
(CFLAGS=-g CXXFLAGS=-g) and one optimizing build.  I can keep all those
trees next to each other, and to update them, all I have to do is go in
there and type make (on the right host, of course).

> It complains about not finding the tools/ script:

> make[3]: Entering directory `/path/to/foo_project/foo-1.0/_build/src'
> ../tools/ /usr/bin/foo2cpp
> make[3]: ../tools/ Command not found

Try using $(srcdir) and $(top_srcdir) in strategic places, for
stuff that is distributed.  So, you can either use

> Which is correct, there is no script from where make 
> distcheck is looking (i.e. from 
> inside /path/to/foo_project/foo-1.0/_build/src). Also there are no 
> other files in foo-1.0/_build/src, so even if the script 
> could be found it would choke on not finding

Just use $(srcdir)/

> The script is in foo-1.0/tools where it belongs and where it 
> is found fine when building a readily distributed package of foo (make 
> dist). 

You may find out that you may need to adjust other places as well.  For
example, by default Automake adds `-I$(srcdir)' and `-I.' to the include
paths for C/C++ headers, but if you need include paths for
subdirectories, you will have to cater for $(srcdir) yourself.

Note that usually you don't need to add $(srcdir) to Automake-known
variables like EXTRA_DIST, or *_SOURCES or the like: Automake will take
care of this.  (I don't know of a good rule here; if in doubt, ask

BTW, what a well-written bug report!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]