Re: [PATCHES] [PATCH] Have configure complain about unknown options
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 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
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
> -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
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 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
On 5/4/06, Tom Lane <[EMAIL PROTECTED]> wrote: Martijn van Oosterhout 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
On Thu, May 04, 2006 at 12:51:34PM -0400, Tom Lane wrote: > Martijn van Oosterhout 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 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
Martijn van Oosterhout 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
[PATCHES] [PATCH] Have configure complain about unknown options
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 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 http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. Index: configure.in === RCS file: /projects/cvsroot/pgsql/configure.in,v retrieving revision 1.460 diff -u -r1.460 configure.in --- configure.in22 Apr 2006 00:29:41 - 1.460 +++ configure.in4 May 2006 10:41:18 - @@ -516,6 +516,12 @@ AC_SUBST(with_zlib) # +# Check user hasn't passed any strange args +# + +PGAC_CHECK_ARGS + +# # Elf # Index: config/general.m4 === RCS file: /projects/cvsroot/pgsql/config/general.m4,v retrieving revision 1.3 diff -u -r1.3 general.m4 --- config/general.m4 29 Nov 2003 19:51:17 - 1.3 +++ config/general.m4 4 May 2006 10:41:18 - @@ -16,6 +16,9 @@ m4_define([pgac_arg_to_variable], [$1[]_[]patsubst($2, -, _)]) +# This is the divert which we store all declared 'with' and 'enable' +# arguments for use with PGAC_CHECK_ARGS +m4_define([_m4_divert(PGAC_ARGS)], 5432) # PGAC_ARG(TYPE, NAME, HELP-STRING, # [ACTION-IF-YES], [ACTION-IF-NO], [ACTION-IF-ARG], @@ -28,6 +31,7 @@ AC_DEFUN([PGAC_ARG], [ +m4_divert_text([PGAC_ARGS],[pgac_arg_to_variable([$1],[$2])) ;;]) m4_case([$1], enable, [ @@ -68,6 +72,24 @@ ) ])# PGAC_ARG +# PGAC_CHECK_ARGS() +# - +# Checks if the user passed any --with/without/enable/disable arguments that +# we don't recognise. This should be called shortly after the last PGAC_ARG* +# macro in configure.in + +AC_DEFUN([PGAC_CHECK_ARGS], +[ + for var in `set |sed -ne '/^\(with_\|enable\_\)/ s/=.*//p'` ; do + case $var in + m4_undivert([PGAC_ARGS]) + *) + echo "*** Unknown feature: $var ***" + exit + ;; + esac + done +])# PGAC_CHECK_ARGS # PGAC_ARG_BOOL(TYPE, NAME, DEFAULT, HELP-STRING, # [ACTION-IF-YES], [ACTION-IF-NO]) signature.asc Description: Digital signature