automake
[Top][All Lists]
Advanced

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

Re: EXTRA_DIST respects Automake conditionals?


From: John Calcote
Subject: Re: EXTRA_DIST respects Automake conditionals?
Date: Thu, 30 Jul 2009 16:05:30 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2

Hi Ben,

The reason this works is because of the way AM Conditionals are implemented. If a conditional is true, then all contained statements are in effect. Otherwise, all contained conditions are commented out in the resulting makefile.

Regards,
John

On 7/29/2009 8:57 PM, Ben Pfaff wrote:
I was surprised today to discover that EXTRA_DIST respects
Automake conditionals.

In other words, if I have the following Makefile.am:

     AUTOMAKE_OPTIONS = foreign

     EXTRA_DIST =

     if COND
     bin_PROGRAMS = foo
     foo_SOURCES = foo.c
     EXTRA_DIST += EXTRA
     endif

and configure.ac:

     AC_INIT([mumble], [1.0])
     AC_CONFIG_SRCDIR([foo.c])
     AC_CONFIG_FILES([Makefile])
     AM_INIT_AUTOMAKE
     AC_PROG_CC
     AM_CONDITIONAL([COND], [false])
     AC_OUTPUT

then "make dist" will not put EXTRA into the generated tarball.
It will put foo.c into the tarball, though.

Is there an appropriate target to put files that should always be
distributed, regardless of conditionals?  noinst_HEADERS works,
but to me it feels like abuse to use it for this purpose.

For what it's worth, in the actual project where I encountered
this, the usage is more like this:

     if ENABLE_USERSPACE
     ...
     include lib/automake.mk
     include ofproto/automake.mk
     include utilities/automake.mk
     include tests/automake.mk
     include include/automake.mk
     include third-party/automake.mk
     include debian/automake.mk
     include vswitchd/automake.mk
     include xenserver/automake.mk
     if HAVE_CURSES
     if HAVE_PCRE
     include extras/ezio/automake.mk
     endif
     endif
     endif

In other words, I'm using a conditional to disable a great many
features, and it's convenient not to push that conditional down
into all the included files.

Here's the Makefile.am in question:
http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob;f=Makefile.am;h=dccb8cfdf92a3dd4dc9f3276e7533f68769587f8;hb=c2b070214097fa40dc78252882d96babe7fab4b4

Thanks,

Ben.





reply via email to

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