Possible cygport bug with cross compiles

Charles Wilson cygwin@cwilson.fastmail.fm
Tue Aug 31 21:34:00 GMT 2010


Originally posted in
	http://cygwin.com/ml/cygwin-apps/2010-08/msg00213.html
but I figure it needs its own thread.


When testing JonY's mingw64 compiler, I found that often the include 
files ended up in the wrong directory.  Also, JonY apparently did as 
well, since his cygport(5)'s included this bit in src_install():

mv ${D}${CROSS_PREFIX}/${CROSS_HOST}/* ${D}${CROSS_PREFIX}

Looking a little more closely, the config.status for includedir has this:
     S["includedir"]="${prefix}/include"
but other dirs are explicit:
     S["bindir"]="/usr/x86_64-w64-mingw32/sys-root/mingw/bin"

Looking at the configure command (from config.status):

'/usr/src/mingw64/headers/mingw64-x86_64-headers-svn3433-1/src/mingw-w64-headers/configure'
'--srcdir=/usr/src/mingw64/headers/mingw64-x86_64-headers-svn3433-1/src/mingw-w64-headers' 
'--prefix=/usr/x86_64-w64-mingw32/sys-root/mingw' 
'--exec-prefix=/usr/x86_64-w64-mingw32/sys-root/mingw' 
'--bindir=/usr/x86_64-w64-mingw32/sys-root/mingw/bin' 
'--sbindir=/usr/x86_64-w64-mingw32/sys-root/mingw/sbin' 
'--libexecdir=/usr/x86_64-w64-mingw32/sys-root/mingw/lib' 
'--datadir=/usr/x86_64-w64-mingw32/sys-root/mingw/share' 
'--localstatedir=/usr/x86_64-w64-mingw32/sys-root/mingw/var' 
'--sysconfdir=/usr/x86_64-w64-mingw32/sys-root/mingw/etc' 
'--datarootdir=/usr/x86_64-w64-mingw32/sys-root/mingw/share' 
'--docdir=/usr/x86_64-w64-mingw32/sys-root/mingw/share/doc/mingw64-x86_64-headers' 
'-C' '--build=i686-pc-cygwin' '--host=x86_64-w64-mingw32' 
'--target=x86_64-w64-mingw32' '--enable-sdk=all' 
'build_alias=i686-pc-cygwin' 'host_alias=x86_64-w64-mingw32' 
'target_alias=x86_64-w64-mingw32' $ac_configure_extra_args --no-create 
--no-recursion

I see that --includedir is missing.  I think that is an oversight in 
autotools.cygclass, and --includedir should be one of the elements 
specified in confargs:

confargs="--prefix=${prefix} --exec-prefix=${prefix} 
--bindir=${prefix}/bin \
--sbindir=${prefix}/sbin --libexecdir=${prefix}/lib \
--datadir=${prefix}/share --localstatedir=${prefix%/usr}/var \
--sysconfdir=${prefix%/usr}/etc"

I'm not real sure about the ${prefix%/...} manipulation, either, 
especially for cross. (The effect of this manipulation for a cross for 
$host=mingw is not apparent, since $prefix doesn't actually end in /usr 
in that case).  But...the current code seems to be incorrect, IMO.

In a related issue, I happened to notice there is a bug in cyginstall() 
when USE_DESTDIR=0, inherit cross, and $host is mingw: localstatedir 
(/var) and sysconfdir (/etc) aren't handled correctly.

-- 
Chuck



More information about the Cygwin-apps mailing list