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: atoz
Subject: Re: How do I *conditionally* add to INSTALL_DIRS ?
Date: Wed, 10 Jan 2007 05:54:47 +0900

thank you for your reply

Ralf Wildenhues wrote:

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

fair enough, but it doesn't change the nature of my problem.

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"])

I already have the above in my configure.ac file

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

this doesn't make a difference though because automake copies this verbatim into Makefile.in where it does nothing useful because the vars EXTRA_DIST and INSTALL_DIRS need to be set BEFORE automake does its magic in order to generate the relevant code in Makefile.in accordingly.

Basically, I want to be able to let a user do this

./configure --with-man-pages=yes/no --with-readme=yes/no

(alternatively, --enable/disable-man-pages --enable/disable-readme)

and as a result get a Makefile.in with something like this

man-pages:
        # install man pages to $(foomandir) here
        ...

readme:
        # install README to $(foodocdir) here
        ...

IF and ONLY IF those options were set to "yes", otherwise ...

man-pages:
        # do nothing here

readme:
        # do nothing here

IF and ONLY IF those options were set to "no"

Furthermore, Makefile.in should also have the relevant instructions in the various clean targets to uninstall

thanks again for any feedback on how to do this.




reply via email to

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