Re: [PATCH] Have configure complain about unknown options

Lists: pgsql-patches
From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: [PATCH] Have configure complain about unknown options
Date: 2006-05-04 10:43:47
Message-ID: 20060504104347.GH4752@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Currently, configure ignores unknown --enable/disable/with/without
options. Personally I find this behaviour annoying, so here is a patch
that fixes it. Example:

$ ./configure --enable-depends
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
<snip>
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... no
*** Unknown feature: enable_depends ***
$

Now, while the error message could do with some help (feedback welcome)
I personally find this to be quite useful.

This patch will detect any argument that isn't declared using one of
the PGAC_ARG macros. This means that if there are any other
--enable/with arguments we accept but don't declare, this will barf on
them too. Do we have any of those? If so, we should document them
somewhere, if necessary creating a PGAC_ARG_HIDDEN so they can pass
this test.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment Content-Type Size
configureargs.patch text/plain 1.8 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Have configure complain about unknown options
Date: 2006-05-04 16:51:34
Message-ID: 11046.1146761494@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> Currently, configure ignores unknown --enable/disable/with/without
> options.

The autoconf people consider that a feature, not a bug. I'm
disinclined to second-guess the designers of the tool, especially
with a patch like this that mucks with the internals to the extent that
it'll probably break in every future autoconf revision.

Feel free to try to convince them to change it though ...

regards, tom lane


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Have configure complain about unknown options
Date: 2006-05-04 18:46:24
Message-ID: 20060504184624.GM4752@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Thu, May 04, 2006 at 12:51:34PM -0400, Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > Currently, configure ignores unknown --enable/disable/with/without
> > options.
>
> The autoconf people consider that a feature, not a bug. I'm
> disinclined to second-guess the designers of the tool, especially
> with a patch like this that mucks with the internals to the extent that
> it'll probably break in every future autoconf revision.

Fair enough. It should work on any version since 2000 since this is the
way you build up strings. Diversions are a feature of m4 not of
autoconf so it's not like they're going away...

> Feel free to try to convince them to change it though ...

Not me, I'll keep it in my local repository then. I'm always
misspelling --enable-depends and this catches it...

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Have configure complain about unknown options
Date: 2006-05-05 11:22:25
Message-ID: e51f66da0605050422v17ed8fb0qf81fe682ec5de762@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On 5/4/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > Currently, configure ignores unknown --enable/disable/with/without
> > options.
>
> The autoconf people consider that a feature, not a bug. I'm
> disinclined to second-guess the designers of the tool, especially
> with a patch like this that mucks with the internals to the extent that
> it'll probably break in every future autoconf revision.
>
> Feel free to try to convince them to change it though ...

AFAIK that 'feature' is there to support configuring a 'tree'
of projects (like gcc), where subprojects have their own configure
scripts with different options. That way you can give all options
to top-level configure script which passes them to other scripts and
each picks only whats needed. In such setting all scripts need to
ignore unknown options.

As PostgreSQL tree is not set up that way, I think for clarity sake
it would be better to give explicit errors for unknown options.

--
marko


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Marko Kreen <markokr(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Have configure complain about unknown options
Date: 2006-05-05 11:39:46
Message-ID: 20060505113946.GB23972@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Fri, May 05, 2006 at 02:22:25PM +0300, Marko Kreen wrote:
> AFAIK that 'feature' is there to support configuring a 'tree'
> of projects (like gcc), where subprojects have their own configure
> scripts with different options. That way you can give all options
> to top-level configure script which passes them to other scripts and
> each picks only whats needed. In such setting all scripts need to
> ignore unknown options.

I was wondering about that. I think it's also because there are
possibly a number of tools working together (autoheader/automake/etc)
and autoconf is not in the position to know all possible options.
You're not required to declare all the options you understand in
configure.in because they may be used elsewhere.

> As PostgreSQL tree is not set up that way, I think for clarity sake
> it would be better to give explicit errors for unknown options.

Someone in the past has gone to some effort to create a bunch of macros
for postgres that declares all the options our configure script
understands and simultaneously create help for them (this is also why
the patch is so small, the hard work of identifying the options was
done long ago). So we are in a position to know what is allowed and
what isn't.

One thing I've noticed so far is that the Debian package scripts use
--enable-maintainer-mode. No idea why, that affects automake, which we
don't use. It is however an excellent example of why complaining about
unknown options can't be done in the general case.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.