POSIX paths in #include directives don't work with MinGW

LRN lrn1986 at gmail.com
Sun Mar 24 09:46:59 CET 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

GMP version: 5.1.1 tarball

How to reproduce: run ./configure in MSYS on W32, using any W32-native
MinGW toolchain (doesn't matter which one)

What is wrong:
GMP_INCLUDE_GMP_H and GMP_FUNC_ALLOCA generate things like
#include "$srcdir/gmp-impl.h"
$srcdir is expanded to something like
"/tc/gmp-5.1.1-1/gmp-5.1.1/gmp-h.in", because the shell is POSIXly.
However, the compiler (MinGW) is a native W32 program, and does not
understand POSIX paths, fails to compile mp_limb_t test, and configure
script fails as a result.

What should happen instead:
w32-style PATHS should be used (i.e.
"F:/s24/tc/gmp-5.1.1-1/gmp-5.1.1/gmp-h.in")
My W32-only hack to get through ./configure successfully is to replace
all occurrences of
#include "$srcdir..."
with
#include "$(cd $srcdir; pwd -W)..."
(-W is a MSYS-only pwd argument that returns W32 version of working
directory)
Obviously, it's not portable.

$ gcc -v
Using built-in specs.
COLLECT_GCC=F:\s24\dl_tc\bin\gcc.exe
COLLECT_LTO_WRAPPER=f:/s24/dl_tc/bin/../libexec/gcc/i686-w64-mingw32/4.7.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../../build/gcc/src/configure
- --target=i686-w64-mingw32
- --prefix=/c/bb/vista64-mingw32/mingw-x86-x86/build/build/root
- --with-sysroot=/c/bb/vista64-mingw32/mingw-x86-x86/build/build/root
- --enable-languages=all,obj-c++ --enable-fully-dynamic-string
- --disable-multilib
Thread model: win32
gcc version 4.7.0 20111219 (experimental) (GCC)

$ uname -a
MINGW32_NT-6.1 CASTLE 1.0.17(0.48/3/2) 2011-04-24 23:39 i686 Msys

$ ./config.guess
coreisbr-pc-mingw32

$ ./configfsf.guess
i686-pc-mingw32

config.log is attached.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRTr2DAAoJEOs4Jb6SI2CwlWkH/AriobsXKTtOZGeNzJDalkwD
gFw6arpQZOekxJk2w+39EU5uRspDjn481xk8dNU8LzrSGsgtoMw9dhtzo5D6oQ2/
fjijp43Y9yv404AIqeKuo6WPn5GqiWzYvA6KiSdP/fhU9evUuz5C1dYpNGijAz3h
MLf03t3yPL7qZBoS/CFiGeRF2M8wgbADTNQ0lEohzGEzO5A8r6xAQGu7edzNfsz+
/BVqup6NkbP6rAiyLuua7xlpgxjaoAUws0Lxx1Qe7EClBsHFLnOIWBPptCRDyHuf
INX68M12M77t+RWShCl+LWs1xPJV4EeoQ5masAM/U4Z2q4jl2bVUgNGjy9IjP4w=
=9c4p
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.log.xz
Type: application/octet-stream
Size: 19384 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-bugs/attachments/20130324/2c25df3a/attachment-0001.obj>


More information about the gmp-bugs mailing list