automake
[Top][All Lists]
Advanced

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

Re: Setting environment variable for make dist


From: Nick Bowler
Subject: Re: Setting environment variable for make dist
Date: Thu, 14 May 2015 09:24:57 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

Hello,

On 2015-05-10 12:57 +0000, Bas Vodde wrote:
> I'm trying to change my projects configure.ac so that it sets the
> COPYFILE_DISABLE=1 environment variable to influence the make dist
> target.
> 
> Background: The COPYFILE_DISABLE=1 avoids having a second top-level
> directory in your package when packaging on MacOSX.
> 
> So far, my attempt was to set the variable in the configure.ac file
> and use AC_SUBST on it, but that didn't seem to work.

Right.  AC_SUBST([COPYFILE_DISABLE]) ordinarily does two things:

  - config.status will substitute @COPYFILE_DISABLE@ in output files
  - it causes Automake to put a line like this:

      COPYFILE_DISABLE = @COPYFILE_DISABLE@

    into the Makefile.in files it generates.

Unfortunately this alone is not sufficient, because make variables are
not generally exported into the environment (which is what you actually
want to happen).

But I think there is a solution: we can (ab)use the fact that 'make dist'
internally performs a recursive make invocation.  This gives us the chance
to add things to the make command line, using AM_MAKEFLAGS.  So putting

  AM_MAKEFLAGS = COPYFILE_DISABLE='$(COPYFILE_DISABLE)'

into Makefile.am should work I think (not tested), because variables
defined on the make command line *are* exported into the environment.
You will still need the AC_SUBST to define COPYFILE_DISABLE in the
first place.

Regards,
-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)



reply via email to

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