automake
[Top][All Lists]
Advanced

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

Re: $srcdir


From: Dr. David Kirkby
Subject: Re: $srcdir
Date: Wed, 05 Mar 2003 22:44:49 +0000

Philip Willoughby wrote:

> $srcdir refers to the directory containing the input Makefile the Makefile
> you're looking at it from was generated from.  Let me try explaining that
> again....
> 
> If you have the following structure:
> 
> .
> ./Makefile.in
> ./src/Makefile.in
> .
> .
> .
> 
> and then you make a build dir and run configure in it you'll have:
> 
> .
> .
> .
> ./Makefile
> ./src/Makefile
> ../Makefile.in
> ../src/Makefile.in
> .
> .
> .
> 
> In which case at the top level $srcdir will be set to ../ and in the src
> dir it will be set to ../../src/
> 
> Of course, most people don't use separate build directories, and thus
> $srcdir is left empty - you don't need to see files in a separate
> directory in this case.
> 
> Anyway, you probably want to use $top_srcdir, which is the root of the
> original package - thus if you need to refer to the src directory in the
> source area you should use $top_srcdir/src/.  Think carefully though - if
> you want to refer to a built component you should use $top_builddir instead
> of $top_srcdir, or everyone who uses separate build directories as standard
> (in other words, me ;-)) will be very annoyed...

But if I echo either $top_srcdir or $top_builddir, in the file
tests/foo.test, they are both null, so I can't seem to find a way of
referring to any files. 

I've also tried building in /tmp, where there top directory is in
/export/home/davek/atlc, but even then, when running 'make check',
with a test that is supposed to echo $top_srcdir or $top_builddir, are
both null, so naturally they don't function as intended if I try to
use them. 

Is there anything that needs to be added to configure.in or
Makefile.am in order that these are exported to the tests properly ??

I'm using autoconf 2.53 and automake 1.6.1


-- 
Dr. David Kirkby,
Senior Research Fellow,
Department of Medical Physics,
University College London,
11-20 Capper St, London, WC1E 6JA.
Tel: 020 7679 6408 Fax: 020 7679 6269
Internal telephone: ext 46408
e-mail address@hidden




reply via email to

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