automake
[Top][All Lists]
Advanced

[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:
> 
*snip*

> ../tools/wrapper.sh /path/to/foo2cpp foo.ice
> 
> In src/Makefile.am there is a target that does just that:
*snip*

> 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]
  make

(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/wrapper.sh script:

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

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

> Which is correct, there is no wrapper.sh 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 wrapper.sh script 
> could be found it would choke on not finding foo.ice.

Just use $(srcdir)/foo.ice.

> The wrapper.sh 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
again.)

BTW, what a well-written bug report!

Cheers,
Ralf




reply via email to

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