[Top][All Lists]

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

Re: Problem installing headers in proper subdirectories

From: Nick Bowler
Subject: Re: Problem installing headers in proper subdirectories
Date: Thu, 20 Mar 2014 13:36:55 -0400
User-agent: Mutt/1.5.22 (2013-10-16)

On 2014-03-20 14:12 +0200, Aurélien Vallée wrote:
[snip exposition]
> libfoo_la_SOURCES = \
>   $(top_srcdir)/foo-lib/src/file1.cpp
> pkginclude_HEADERS = \
>   $(top_srcdir)/foo-lib/include/foo/header1.h \
>   $(top_srcdir)/foo-lib/include/foo/subdir/header2.h
> Now the problem: when installing these headers, they end up being flattened!
> That is, I end up with:
> $prefix/include/foo/header1.h
> $prefix/include/foo/header2.h

Yes, this is the documented behaviour.

> While I was expecting:
> $prefix/include/foo/header1.h
> $prefix/include/foo/subdir/header2.h


> So I assume that is what nobase_ is supposed to achieve, but since the path
> I use are not relative to the, but to $top_srcdir, I end up
> with the whole $top_srcdir path being copied:
> $prefix/include/foo-lib/include/foo/header1.h
> $prefix/include/foo-lib/include/foo/subdir/header2.h

Sortof.  The nobase_ option replicates the hierarchy in your source
tree, which IMO is pretty useless but that's what it does.

> which is clearly not what is expected.

You need a directory variable for each directory you wish to install
files into.  See the Automake manual for details, start with §3.3 The
Uniform Naming Scheme[1].

Something like this (untested):

  foosubdir = $(pkgincludedir)/subdir
  pkginclude_HEADERS = path/to/header1.h
  foosub_HEADERS = path/to/header2.h


Nick Bowler, Elliptic Technologies (

reply via email to

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