[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generating configuration files conditionnally?
From: |
Nick Bowler |
Subject: |
Re: Generating configuration files conditionnally? |
Date: |
Thu, 16 Jun 2022 14:02:37 -0400 |
On 2022-06-16, Sébastien Hinderer <Sebastien.Hinderer@inria.fr> wrote:
> Is it possible to have the META files produced from META.in files but
> only if the package they describe has been enabled?
There should be no problem using AC_CONFIG_FILES conditionally.
For example:
% cat >configure.ac <<'EOF'
AC_INIT([test], [0])
AC_ARG_ENABLE([foo])
AS_IF([test x"$enable_foo" = x"yes"], [AC_CONFIG_FILES([foo])])
AC_CONFIG_FILES([bar])
AC_OUTPUT
EOF
% autoconf
% ./configure --disable-foo
configure: creating ./config.status
config.status: creating bar
% ./configure --enable-foo
configure: creating ./config.status
config.status: creating foo
config.status: creating bar
Hope that helps,
Nick