[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
optional features and AC_ARG_WITH
From: |
Gregorio Guidi |
Subject: |
optional features and AC_ARG_WITH |
Date: |
Thu, 3 Feb 2005 18:07:56 +0100 |
User-agent: |
KMail/1.7.2 |
Hi,
being involved in the process of redristibuting software packages for the
Gentoo distribution, I'm often dealing with autoconf stuff, and I would like
to share a thuoght.
As you can imagine, a very common (if not the most common) use case for code
in configure.in/configure.ac is the following: run a check, see the result,
and decide if a specific feature of the software should be enabled or
disabled.
In an ideal world, this would be done in two steps:
- use AC_ARG_WITH or AC_ARG_ENABLE to provide a configure switch for the
feature.
- run the test, taking into account the will of the user as expressed in the
configure switch, and decide whether to enable or disable the feature.
Unfortunately, there's no standardized way to perform such action. Since
developers are usually lazy, they don't provide the --with or --enable switch
(and even when they provide it, there's no consistency: what to do if
--with-foo was given but the foo library is not installed? abort or disable
foo? What to do if --without-foo was given? Run the test for libfoo anyway or
not?).
This causes lots of problems for us (software packagers), for the following
reason:
it is very important when creating a package to know in advance what features
will be enabled in the software at the end of the process, without knowing
the details of the host where the package is building.
This is true in particular for source based distributions (Gentoo as well as
others), where the build process takes place on the user box; but also
applies to binary distributions (think doing 'rpmbuild --rebuild package'),
and the packager should not worry about his building host anyway.
So, it would be important to ease the addition of configure switches for all
available features, and to do it in a consistent way. Currently autoconf
lacks some tool to accomplish this goal.
So I'm asking: could it be a good idea as a long-term solution to advertise
among software developers the adoption of some standardized macro that could
make it easier to add configure switches, such as the macros that I'm
attaching below?
Please take a look at them and see if there are errors, and feel free to
comment on them. Does it makes sense to propose them to software developers?
ax_arg_check.m4
Description: Text document
- optional features and AC_ARG_WITH,
Gregorio Guidi <=
- Re: optional features and AC_ARG_WITH, Paul Eggert, 2005/02/03
- Re: optional features and AC_ARG_WITH, Braden McDaniel, 2005/02/03
- Re: optional features and AC_ARG_WITH, Dan Manthey, 2005/02/03
- Re: optional features and AC_ARG_WITH, Paul Eggert, 2005/02/04
- Re: optional features and AC_ARG_WITH, Gregorio Guidi, 2005/02/04
- Re: optional features and AC_ARG_WITH, Stepan Kasal, 2005/02/04
- Re: optional features and AC_ARG_WITH, Paul Eggert, 2005/02/04
- Re: optional features and AC_ARG_WITH, Gregorio Guidi, 2005/02/04
- Re: optional features and AC_ARG_WITH, Paul Eggert, 2005/02/04
- Re: optional features and AC_ARG_WITH, Stepan Kasal, 2005/02/09