Hi, Below is a message I posted earlier today, on the MinGW-users list at SourceForge. 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. Regards, Keith. ---------- Forwarded Message ---------- Subject: Re: [Mingw-users] MSYS_PREFIX_HACK Date: Tue, 29 Mar 2005 16:52:39 +0100 From: Keith MARSHALL <keith.marshall@xxxxxxxxx> To: mingw-users@xxxxxxxxxxxxxxxxxxxxx Cc: keith.d.marshall@xxxxxxxxxxxx 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' ... # MSYS_PREFIX_HACK # # 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. # AC_DEFUN([MSYS_PREFIX_HACK], [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 AC_MSG_RESULT([$prefix]) fi ]) I can then modify any package's `configure.ac', to invoke it after AC_INIT, e.g. using the `configure.ac' fragment ... AC_INIT AC_PREREQ(2.59) MSYS_PREFIX_HACK . . 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, Keith. ------------------------------------------------------- _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf