[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Re: [Mingw-users] Autoconf MSYS_PREFIX_HACK

From: Keith Marshall
Subject: Fwd: Re: [Mingw-users] Autoconf MSYS_PREFIX_HACK
Date: Tue, 29 Mar 2005 20:09:01 +0100


Below is a message I posted earlier today, on the MinGW-users list at 

The topic relates to getting autoconf generated configure scripts to provide 
an appropriate default ${prefix} value, for native Win32 builds of autoconf 
managed packages, when using MSYS/MinGW as the build environment.

IMO, this topic is equally deserving of discussion on an autoconf list.


----------  Forwarded Message  ----------

Subject: Re: [Mingw-users] MSYS_PREFIX_HACK
Date: Tue, 29 Mar 2005 16:52:39 +0100
From: Keith MARSHALL <address@hidden>
To: address@hidden
Cc: address@hidden

Earnie Boyd wrote:
> So, rather than --prefix being the key, what really needs
> to happen is the value of the variable prefix always needs
> to contain a windows path.  Perhaps others as well.  Then
> when the configure script creates the Makefile the correct
> values are in place.

Yes.  That's the way I see it.

When I configure a GNU package, I generally find that, if I specify 
--prefix=`cd /usr/local;pwd -W`, then everything falls into place.  If I 
forget the --prefix spec, then configure sets /usr/local as default, but then 
any paths which depend on ${prefix}, and are compiled into object files, get 
POSIX path semantics, where windows [MS-Win32] semantics are required.

The MSYS_PREFIX_HACK, which I proposed previously, addresses this.  By 
placing this definition in my `acsite.m4' ...

  # If the user didn't specify any explicit value for ${prefix},
  # AND the build system supports `pwd -W`, (i.e. is probably MSYS),
  # set the default autoconf ${prefix}, as a Win32 format path.
  # Has no effect, UNLESS the build system supports `pwd -W`,
  # AND '/usr/local' exists in the MSYS pseudo file system.
    [if test "$prefix" = "NONE"; then
       AC_MSG_CHECKING([MSYS build PREFIX mapping])
       prefix=`exec 2>/dev/null; cd /usr/local && pwd -W` || prefix=NONE
       test "$prefix" = "/usr/local" && prefix=NONE

I can then modify any package's `', to invoke it after AC_INIT, 
e.g. using the `' fragment ...


and run autoconf, to regenerate `configure'.  I then have a GNU package which 
builds according to GNU convention, under MSYS, with a default `${prefix}' 
correctly mapped to its native windows path.  (Of course, there may be, and 
usually will be, other porting issues to address, besides this).

If this test, or something like it, could be implemented as part of AC_INIT, 
or perhaps AC_OUTPUT, then *all* GNU packages which use autoconf would 
eventually support the correct mapping of ${prefix} for building with MinGW 
under MSYS.

Best regards,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]