autoconf
[Top][All Lists]
Advanced

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

Re: How to specify srcdir?


From: Ralf Wildenhues
Subject: Re: How to specify srcdir?
Date: Thu, 4 Sep 2008 20:52:22 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Matej,

* Matej Tyc wrote on Thu, Sep 04, 2008 at 10:35:35AM CEST:
> I have the following project directory structure:
> The root, where configure.ac is located
> 
> > /src, where the source code resides
> > /lib, where the library is built
> > /bin, where the frontend is built.

When you use Automake, you *need* to keep in mind that conceptually, you
have a source tree, a build tree, and an install tree.

Source tree is where your sources are.  configure.ac, configure,
Makefile.am, Makefile.in files are also here.

Build tree is the directory in which you type
   $path_to/configure [OPTIONS...]

This is where the Makefile files live, config.status lives here, also
all your objects, libraries, programs you just built with 'make'.

This tree can be identical to the source tree, in which case $path_to is
just '.', or it can be separate from the source tree.  This helps to
have many many build trees, one for AIX, one for GNU/Linux, one for
debugging, and one for super-duper-optimized.

The install tree is, by default, below /usr/local, and you can change
that by passing --prefix=... to configure.

Now, the layout between the source and the build tree is obviously
parallel.

You should not, in general specify $(srcdir) for source files.

So this is not needed when using Automake:

> srcdir = @srcdir@
> ...
> foo_SOURCES = $(srcdir)/foo.c

Just write
  foo_SOURCES = foo.c

* Matej Tyc wrote on Thu, Sep 04, 2008 at 11:11:58AM CEST:
> 2008/9/4 Harlan Stenn <address@hidden>
> > In bin/Makefile.am you want:
> >
> >  foo_SOURCES = foo.c
> >
> > H
> This contradicts with the autoconf manual (see the page 28, chapter 4.8.4,
> "Build Directories")

No it doesn't.  The Autoconf manual, however, doesn't in all places
assume that you use Automake in conjunction with Autoconf.

Hope that helps.  And please, pretty please stop top-posting, otherwise
you will soon have at least one less reader.

Cheers,
Ralf




reply via email to

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