autoconf
[Top][All Lists]
Advanced

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

Re: How to specify srcdir?


From: Matej Tyc
Subject: Re: How to specify srcdir?
Date: Thu, 4 Sep 2008 10:35:35 +0200

(I am sorry, I have accidentally sent the email when tapping TAB instead of
caps lock)


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.
> Each of those directories have their own Makefile.am
> I have learned that I should use this construction in those Makefiles.am:
> srcdir = @srcdir@ and that I should use the AC_CONFIG_SRCDIR in
> configure.ac
>
When I pass AC_CONFIG_SRCDIR([src/foo.c]) , it works, but srcdir is then
initialized to ".", which is not suitable.
I have the following entry in my /bin/Makefile.am:

...
foo_SOURCES = ../src/foo.c

If I write it like it is recommended in the manual, that is

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

it doesn't work. I need srcdir to be initialized as <path-to
-the-project-root>/src.
I have tried to pass AC_CONFIG_SRCDIR([foo.c]) hoping that autoconf will
find the source file, but I got an error message like "foo.c is not in . not
in .., so we give up".

Any suggestions regarding what am I doing wrong or what should I do to be
satisfied?
Matej


reply via email to

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