help-gnu-utils
[Top][All Lists]
Advanced

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

Re: Autotools: compiling two C++ files with two compilers...


From: Kaz Kylheku
Subject: Re: Autotools: compiling two C++ files with two compilers...
Date: 17 Jan 2007 16:23:12 -0800
User-agent: G2/1.0

Federico Zenith wrote:
> Hi all,
> sorry if the question may be lame, but it's my first package with
> Autotools...
>
> In short, I have some C++ files that have to be compiled. One accepts g++,
> the others have to use mkoctfile, that is a wrapper used by GNU Octave to
> compile a dynamically-linked function that one can later use in Octave.
>
> I have tried redefining the CXX variable (as it is done in a configure.base
> file in Octave-Forge project: is that an old autoconf stuff?), and now I am
> pretty much trying to add a GNU-Make rule (without the various autotools
> magic). Yet, this really should not be this difficult: I want to compile a
> file with a compiler and another file with another compiler. I must be
> missing something big time!

Target-specific variable assignments can locally override the value of
a variable while particular targets is being updated. So that is one
possibility. Suppose that your target for this Octave function is
called correlationMatrix. Then you can do something like:

  correlationMatrix: CXX := mkoctfile

Now in the update rule for octfile.so, and all ancestor rules that
update the prerequisites of this target, that variable assignment will
be in effect, regardless of any global assignment to CXX.

> Can anyone point me to how I define my own build rules in a Makefile.am?

Automake is garbage, don't use it. In fact, don't use Auto-anything for
your projects if you value your users.

For the sake of consistency, it's good to have a ./configure script in
your project root which performs checks and sets things up to build
(and works even if run from a separate build directory, of course).
That script can be finely crafted by hand instead of being generated by
a warmed-over pile of shitty m4 macros.



reply via email to

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