Re: mingw cross compilation

"Frediano Ziglio" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
2009/1/9 Thomas Stover <[email protected]>:
> Date: Fri, 9 Jan 2009 12:05:44 +0100
>> From: "Frediano Ziglio" <[email protected]>
>> Subject: Re: [freetds] mingw cross compilation
>> To: "FreeTDS Development Group" <[email protected]>
>>
>> 2009/1/8 Thomas Stover <[email protected]>:
>>
>>> Anyone ever figure out how to target win32 from a linux host via mingw?
>>> I found a few comments in the archives, but it seems I missed allot or
>>> something. Better yet, how about targeting win64?
>>>
>>
>> Either win32 and win64 compile and works (tested win32). Just use
>> --host options during configure.
>>
>> freddy77
>>
>
> Awesome! I'm still looking for that magic touch though. Autoconf is
> always a nebulous area of pain for me...
>

For you?? To develop with is a nigthmare :)

>
> $CC=/opt/crosscompilers/win32/bin/i686-mingw32-gcc ./configure --host win32
> ...
> checking build system type... x86_64-unknown-linux-gnu
> checking host system type... Invalid configuration `win32': machine
> `win32' not recognized
> configure: error: /bin/bash ./config.sub win32 failed
>
>
> $CC=/opt/crosscompilers/win32/bin/i686-mingw32-gcc ./configure --host
> i686-mingw32
> configure: WARNING: If you wanted to set the --build type, don't use --host.
>    If a cross compiler is detected then cross compile mode will be used.
> ...
> configure: error: No 16-bit int found.
>
>
> $CC=/opt/crosscompilers/win32/bin/i686-mingw32-gcc ./configure --build
> i686-mingw32
> ...
> configure: error: No 16-bit int found.
>
>
> Win64 is looking much smoother however...
>
> $make clean
> $CC=/opt/crosscompilers/win64/bin/x86_64-pc-mingw32-gcc ./configure
> --host=x86_64-pc-mingw32
> --prefix=/opt/crosscompilers/win64/x86_64-pc-mingw32/ --disable-server
> --enable-msdblib
> --includedir=/opt/crosscompilers/win64/x86_64-pc-mingw32/include/freetds
> $make
> ...
> no -i ../../win32/setup.rc --input-format=rc -o ../../win32/setup.res -O
> coff
> /bin/bash: no: command not found
>
> Any insights? I've been looking for some program called 'no', but that's
> a hard word to search for :)
>

What a confusion...

--prefix is FreeTDS installation directory so it's wrong
--includedir is FreeTDS include installation directory so it's wrong
You don't have to define CC but tell configure script where to find
proper compiler so you have to add to PATH path to your cross compiler
and use just

$ ./configure --host=i686-mingw32

configure search for executable like i686-mingw32-gcc (gcc, ld, g++,
nm, objdump, windres in this case and so on). So defining only CC
can't work. The no that is called is caused by not finding
i686-mingw32-windres (or just a windres).

freddy77
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.