automake
[Top][All Lists]
Advanced

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

Re: How do I *conditionally* add to INSTALL_DIRS ?


From: Ralf Wildenhues
Subject: Re: How do I *conditionally* add to INSTALL_DIRS ?
Date: Tue, 9 Jan 2007 20:01:21 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello atoz,

* atoz wrote on Tue, Jan 09, 2007 at 12:03:54PM CET:
> I have added some install options to configure, for example ...
> 
> --with-man-pages
> --with-readme
> 
> and some others

If you go by the GNU Coding Standards, you should use --enable for
these, as they don't specify interaction with external packages.
Anyway.

Instead of this:

> # man pages
> if test -n "${with_man_pages}"; then \
>       INSTALL_DIRS += $(foomandir) \
> fi
> 
> # documentation
> if test -n "${with_readme}" -o -n "${with_license}" -o -n "$ 
> {with_credits}" -o -n "${with_sgml_docs}"; then \
>       INSTALL_DIRS += $(foodocdir) \
> fi

you can do this for example:

# configure.ac snippet:
AM_CONDITIONAL([MAN_PAGES], [test -n "$with_man_pages"])
AM_CONDITIONAL([FOO_DOCS],
  [test -n "$with_readme$with_license$with_credits$with_sgml_docs"])

# Makefile.am snippet:
if MAN_PAGES
INSTALL_DIRS += $(foomandir)
endif
if FOO_DOCS
INSTALL_DIRS += $(foodocdir)
fi

Note that the -o argument to 'test' is not required to be supported by
POSIX (but by XSI), but anyway you don't need it for your test.  Just in
case you're interested in portability.

Hope that helps.

Cheers,
Ralf




reply via email to

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