Re: [PATCHES] [PATCH] Have configure complain about unknown options

2006-05-05 Thread Marko Kreen

On 5/4/06, Tom Lane [EMAIL PROTECTED] wrote:

Martijn van Oosterhout kleptog@svana.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

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [PATCHES] [PATCH] Have configure complain about unknown options

2006-05-05 Thread Martijn van Oosterhout
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@svana.org   http://svana.org/kleptog/
 From each according to his ability. To each according to his ability to 
 litigate.


signature.asc
Description: Digital signature


Re: [PATCHES] [PATCH] Have configure complain about unknown options

2006-05-05 Thread Dave Page
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Marko Kreen
 Sent: 05 May 2006 12:22
 To: Tom Lane
 Cc: Martijn van Oosterhout; pgsql-patches@postgresql.org
 Subject: Re: [PATCHES] [PATCH] Have configure complain about 
 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.
 

I'm not in a position to argue about why autoconf works this way, but I
can say that I'd like to see unsupported options rejected if there is a
sensible way to do it. I've been bitten more than once by mistakenly
using --enable-foo rather than --with-foo, or just plain mis-typing.

Regards, Dave.

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [PATCHES] [PATCH] Have configure complain about unknown options

2006-05-05 Thread Bruce Momjian

I am thinking we would need an option at the start like --strict that
would throw an error for any later invalid options.

---

Dave Page wrote:
  
 
  -Original Message-
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Marko Kreen
  Sent: 05 May 2006 12:22
  To: Tom Lane
  Cc: Martijn van Oosterhout; pgsql-patches@postgresql.org
  Subject: Re: [PATCHES] [PATCH] Have configure complain about 
  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.
  
 
 I'm not in a position to argue about why autoconf works this way, but I
 can say that I'd like to see unsupported options rejected if there is a
 sensible way to do it. I've been bitten more than once by mistakenly
 using --enable-foo rather than --with-foo, or just plain mis-typing.
 
 Regards, Dave.
 
 ---(end of broadcast)---
 TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
 

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [PATCHES] [PATCH] Have configure complain about unknown options

2006-05-05 Thread Martijn van Oosterhout
On Fri, May 05, 2006 at 08:34:36AM -0400, Bruce Momjian wrote:
 
 I am thinking we would need an option at the start like --strict that
 would throw an error for any later invalid options.

Well, --strict would be tricky, if it's possible. My reading of the
autoconf code doesn't indicate a means of doing adding abitrary
options. But something like --enable-strict-options would be fairly
straight forward. Problem being, if you mistype that option, it'll seem
to work even when it isn't :)

Maybe an evironment variable: PGAC_STRICT

Have a nice day,
-- 
Martijn van Oosterhout   kleptog@svana.org   http://svana.org/kleptog/
 From each according to his ability. To each according to his ability to 
 litigate.


signature.asc
Description: Digital signature


Re: [PATCHES] [PATCH] Have configure complain about unknown options

2006-05-04 Thread Tom Lane
Martijn van Oosterhout kleptog@svana.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

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [PATCHES] [PATCH] Have configure complain about unknown options

2006-05-04 Thread Martijn van Oosterhout
On Thu, May 04, 2006 at 12:51:34PM -0400, Tom Lane wrote:
 Martijn van Oosterhout kleptog@svana.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@svana.org   http://svana.org/kleptog/
 From each according to his ability. To each according to his ability to 
 litigate.


signature.asc
Description: Digital signature