Content-Type: multipart/alternative; boundary="------------020300050807070806090403" --------------020300050807070806090403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Robert, I see a some differences between the cross-configure target in the makefile and tools/win-cross-config: 1) win-cross-config sets an include path that cross-configure does not. This allows the hidsdi.h include to be found. > CFLAGS="-I$CHAIN/mingw/include/ddk" 2) cross-configure uses a configuration option that win-cross-config does not > --with-cet=all I am not sure what cet is about. 3) cross-configure uses a linker flag that win-cross-config does not > LDFLAGS="-s" 4) cross-configure and win-cross-config use different host options, i386-pc-mingw32 vs. i386-mingw3 5) cross-configure must find i386-mingw32-gcc on the path, while win-cross-config explicitly sets the path. After fooling with the paths to account for a different install location on my system, and merging these differences I have it working for me. > #!/bin/sh -x > # Script to configure cross build suitable for inclusion in Earth. > CHAIN=$HOME/local/mingw > > S=. > CFLAGS="-I$CHAIN/include/ddk" \ > LDFLAGS="-s" \ > CC=$CHAIN/bin/i386-mingw32-gcc \ > $S/configure --host=i386-pc-mingw32 \ > --with-cet=all \ > --with-expathdr=$S/mingw/include \ > --with-libexpat=$S/mingw/lib > By the way the hidsdi.h file in the latest w32api-3.15-1-mingw32-dev matches what is in gpsbabel/mingw/include/ddk, but they may diverge at some point. It would be nice to have configure set the include path to point to the mingw include ddk directory based on where it found i386-mingw32-gcc, but I am not sure how to make that happen. It may be easier to change Makefile.in to add a hard coded include path pointing to the gpsbabel version, ./mingw/include/ddk, for example see the patch attached. Please use your judgment before applying that patch example. It would be nicer to not ovewrite CFLAGS and use a configure option to set this path so we could add something like "--with-mingwddkhdr=@srcdir@/mingw/include/ddk" to Makefile.in. Again, I don't know how to make that happen. I guess that would involve changing configure.in. I am unclear to me if both the make target cross-configure and the win-cross-config file are both suppose to work, or if one is obsolete. Thanks, Steve On 10/31/10 8:04 AM, Robert Lipe wrote: > > > On Sun, Oct 31, 2010 at 8:57 AM, tsteven4 > wrote: > > I don't have much experience with cross compilation, but it > appears not > to work without some manual intervention. > > > I cross compile frequently. The less I have to use Windows, the less > grumpy I am > > Perhaps I am doing something > wrong, or perhaps the make is broken. If anyone could let me know > what > is going on I would appreciate it. > > > The Mingw DDK puts that file in a different path than the Windows SDK > does. We include a copy of it in our own mingw/include. See > tools/win-cross-config for inspiration on getting the build to use that. > > RJL --------------020300050807070806090403 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Robert,

I see a some differences between the cross-configure target in the makefile and tools/win-cross-config:

1) win-cross-config sets an include path that cross-configure does not.  This allows the hidsdi.h include to be found.
CFLAGS="-I$CHAIN/mingw/include/ddk"
2) cross-configure uses a configuration option that win-cross-config does not
--with-cet=all
I am not sure what cet is about.

3) cross-configure uses a linker flag that win-cross-config does not
LDFLAGS="-s"
4) cross-configure and win-cross-config use different host options, i386-pc-mingw32 vs. i386-mingw3

5) cross-configure must find i386-mingw32-gcc on the path, while win-cross-config explicitly sets the path.

After fooling with the paths to account for a different install location on my system, and merging these differences I have it working for me.

#!/bin/sh -x
# Script to configure cross build suitable for inclusion in Earth.
CHAIN=$HOME/local/mingw

S=.
CFLAGS="-I$CHAIN/include/ddk" \
LDFLAGS="-s" \
CC=$CHAIN/bin/i386-mingw32-gcc \
$S/configure  --host=i386-pc-mingw32  \
        --with-cet=all \
        --with-expathdr=$S/mingw/include \
        --with-libexpat=$S/mingw/lib

By the way the hidsdi.h file in the latest w32api-3.15-1-mingw32-dev matches what is in gpsbabel/mingw/include/ddk, but they may diverge at some point.

It would be nice to have configure set the include path to point to the mingw include ddk directory based on where it found i386-mingw32-gcc, but I am not sure how to make that happen.  It may be easier to change Makefile.in to add a hard coded include path pointing to the gpsbabel version, ./mingw/include/ddk, for example see the patch attached.  Please use your judgment before applying that patch example.  It would be nicer to not ovewrite CFLAGS and use a configure option to set this path so we could add something like "--with-mingwddkhdr=@srcdir@/mingw/include/ddk" to Makefile.in.  Again, I don't know how to make that happen.  I guess that would involve changing configure.in.

I am unclear to me if both the make target cross-configure and the win-cross-config file are both suppose to work, or if one is obsolete.

Thanks,
Steve



On 10/31/10 8:04 AM, Robert Lipe wrote:


On Sun, Oct 31, 2010 at 8:57 AM, tsteven4 <tsteven4@qwestoffice.net> wrote:
I don't have much experience with cross compilation, but it appears not
to work without some manual intervention.

I cross compile frequently.  The less I have to use Windows, the less grumpy I am
 
 Perhaps I am doing something
wrong, or perhaps the make is broken.  If anyone could let me know what
is going on I would appreciate it.

The Mingw DDK puts that file in a different path than the Windows SDK does.  We include a copy of it in our own mingw/include.  See tools/win-cross-config  for inspiration on getting the build to use that. 

RJL
--------------020300050807070806090403--