On Monday 24 April 2006 5:23 pm, Earnie Boyd wrote:
> >>>> The snap contains a modification to munge the ``prefix'' variable
> >>>> to a windows path. I would like comment on this.
> >>> I've never been particularly enamoured of this concept. IIRC, it
> >>> was introduced to ensure that `configure' scripts would identify
> >>> `prefix' as a native Win32 path; I favour a less invasive solution
> >>> to that, namely specifying the appropriate default in config.site:
> >>> ac_default_prefix=`cd /mingw; pwd -W`
> >> Which is why I wanted comment. Are their others who wish to
> >> comment? Should MSYS installation just deliver an /etc/config.site
> >> with the ac_default_prefix set instead?
> > I would prefer if ac_default_prefix was conditionally set depending
> > on MSYSTEM such as
> > `if [ x$MSYSTEM = xMINGW32 ] ; then cd /mingw && pwd -W; else echo -n
> > /usr/local; fi'
> *NOT* doable easily; so it won't be done. However, you do bring up a
> good point that causes be to doubt that setting /etc/config.site is a
> good suggestion.
On the contrary, I believe that would be *very* easy to do; just insert
case `uname -s` in
MINGW*) ac_default_prefix=`cd /mingw; pwd -W` ;;
in /usr/local/share/config.site, instead of the simple unconditional
ac_default_prefix=`cd /mingw; pwd -W`
and you *will* get Julien's desired effect; if the `uname -s' result
doesn't match the MINGW32 system name, then the case statement will fall
through, leaving `ac_default_prefix=/usr/local', because that's what
`configure' sets as default anyway, *before* sourcing `config.site'.
IMO, this mechanism is infinitely preferable to kludging the shell or the
MSYS runtime; it is a standard feature, supported by all autoconf
generated configure scripts, and it is readily customised to suit each
individual user's preferences.
BTW, it *isn't* `/etc/config.site'; autoconf generated configure scripts
don't look there automatically, (they will, only *if* the user explicitly
exports `CONFIG_SITE=/etc/config.site', but I *don't* advocate requiring
the user to do this). Here's how `configure' decides which `config.site'
files it *will* source:
- If the user exports `CONFIG_SITE', then only those files explicitly
defined therein, as a space separated list of absolute path names, will
be sourced; all specified files which exist, and are readable, will be
sourced, in the order specified.
- Otherwise, if the user specifies a `--prefix=...' option, then the two
files `$prefix/share/config.site' and `$prefix/etc/config.site', (where
`$prefix' represents the *verbatim* value specified in `--prefix=...'),
will be sourced in this order.
- Finally, if *neither* of the two preceding conditions applies, then the
files `/usr/local/share/config.site' and `/usr/local/etc/config.site'
will be sourced, again, in this order.
In all three of the above cases, if any of the appropriate `config.site'
files do not exist, or are not readable, `configure' silently skips its
attempt to source them.