[Top][All Lists]

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

Re: Using Emacs with Autotools projects : separate source and binaries

From: fuhz . fr
Subject: Re: Using Emacs with Autotools projects : separate source and binaries directories
Date: Sun, 9 Nov 2008 15:43:20 -0800 (PST)
User-agent: G2/1.0

Thank you so much for such a complete answer :D

> I can see that you are using autoconf.  Are you also using automake?
> If so then you might post your question to the automake mailing list
> (as Ralf also suggested) because I don't think this is really an emacs
> issue.  I think this is just some quirk of how you are building your
> project.

Yes, I am using automake and autoconf. But, I am not convinced that
it is a automake issue.

In my opinion, Emacs and automake are quite mature piece of software.
The problem may be elsewhere.

> > Do you anderstand this behaviour ?
> Sorry but no I do not.  This is where I was suggesting that you try
> your test with an already

After reading your first answer, I try with bc gnu software and I
the same problem that I already had.

>   $ wget
>   $ tar xzvf hello-2.3.tar.gz
>   $ mkdir hello-2.3-mybuild
>   $ cd hello-2.3-mybuild
>   $ ../hello-2.3/configure
>   $ make

I type the commands in the order you wrote them.

Except for 'make', I run '/usr/bin/emacs -q' (to start Emacs with a
default configuration)
and I start 'M-x compile'
On the first compilation, there isn't any problem, hello-2.3 is
definitely awesome.

>   $ echo '#error forced error here' >> ../hello-2.3/src/hello.c
> Then compile inside emacs again.
>   M-x compile

When you are calling 'M-x compile' what is your working directory ?
When I do this, I am in hello-2.3-mybuild.

> When I do this I get the following output in the emacs *compilation*
> buffer:
>   Making all in src
>   make[2]: Entering directory `/var/tmp/hello-2.3-mybuild/src'
>   gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. 
> -I../../hello-2.3/src  -I../../hello-2.3/gnulib/lib -I../gnulib/lib   -g -O2 
> -MT hello.o -MD -MP -MF .deps/hello.Tpo -c -o hello.o 
> ../../hello-2.3/src/hello.c
>   ../../hello-2.3/src/hello.c:194:2: error: #error forced error here
>   make[2]: *** [hello.o] Error 1
>   make[2]: Leaving directory `/var/tmp/hello-2.3-mybuild/src'
>   make[1]: *** [all-recursive] Error 1
>   make[1]: Leaving directory `/var/tmp/hello-2.3-mybuild'
>   make: *** [all] Error 2
> In emacs running C-x ` takes me to the next error.

I have exactly the same output, but Emacs do not find the source code.
So, he asks me : "Where is your source directory ?"

The next message is shown, asking me for the location of the source
directory :
'Find this error in (default ../../hello-2.3/src/hello.c): ~/mailing/

And that's the point. The specified path '../../hello-2.3/src/hello.c'
is not correct.
Because it is relative to src directory.
It should be '../hello-2.3/src/hello.c'.

When I compile in src directory, the relative path is correctly set.
And there is not any problem to find the source.

I you are doing the same, it seems our Emacs have different behaviour.

> > Since Makefiles have moved, I am running 'make' in src directory.
> > Is it a good idea ?
> Huh?  There are no Makefiles in the source directory.

No, I mean, I  am running 'make' in the src directory of the build
So yes there are, depending of what src directory we are talking

What I was trying to say is that VPATH builds seems to be less

In fact, in the case of your binaries and source code are in the same
'M-x compile' will invoke 'make' in the file directory.
So, the compilation will be very fast, even on large source code
Because it don't have to recursively call 'make' for each sub-
directory of your project.
In this case, it will only call 'make' recursively on all the sub-
directories of the file directory.

In the case of VPATH build, if instead of 'make' in the file
directory, if you are
running 'make' in the top-level of your binary directory, it will be
less efficient.
I should be faster to run 'make' in the associated 'build' directory
of the current file.

Thank you in advance.

Best regards.

reply via email to

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