[Top][All Lists]

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

Re: linking source files from a different directory macro

From: Ralf Wildenhues
Subject: Re: linking source files from a different directory macro
Date: Mon, 21 Jan 2008 19:50:40 +0000 (UTC)
User-agent: Loom/3.14 (

Jason Roscoe <jason.roscoe <at>> writes:
> I'm new to the mailing list and only have a few days experience working 
> with Automake.  I am wondering if a macro already exists that will link 
> source files from a different directory into the current one.

You can use AC_CONFIG_LINKS from Autoconf:

or there is AC_PROG_LN_S, which allows you to use $(LN_S) in rules in

> For example, given the following directory trees:
> common/
> common/tester.c
> common/tester.h
> test/
> test/
> Is there a macro, e.g., AM_SOURCE_SYMLINK( ../common/tester.c ), that 
> will create symbolic link(s) to source files residing in a separate 
> directory?  Or, if I am looking at this the wrong way, can someone 
> suggest an alternate way of achieving this using the Autotools?

You can use AC_CONFIG_LINKS([common/tester.c], [test/tester.c])
but can also use out-of-directory sources:

  check_PROGRAMS = foo
  foo_SOURCES = ../common/tester.c ../common/tester.h

and avoid all the symlinks.  Depends on your needs; the latter doesn't work
well with VPATH builds and non-GNU make programs.


reply via email to

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