Cross-compile from Linux to Windows

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cross-compile from Linux to Windows

Ranguvar
I'm trying to cross-compile x264 to Windows from Arch x86_64 Linux. I can successfully build for Linux, and I used to build with MinGW on Windows before I switched to Linux.

Right now, I'm doing ./configure --host=i486-mingw32

When I 'make', though it fails because it can't find windows.h.

I do have all mingw32 packages installed from Arch's repositories. windows.h is in /usr/i486-mingw32/include. I've tried nearly everything - adding that folder to my PATH, includedirs, etc.

Can someone please explain how to point it to my MinGW installation?

Thanks very much.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross-compile from Linux to Windows

Erik de Castro Lopo-31
Ranguvar wrote:

>
> I'm trying to cross-compile x264 to Windows from Arch x86_64 Linux. I can
> successfully build for Linux, and I used to build with MinGW on Windows
> before I switched to Linux.
>
> Right now, I'm doing ./configure --host=i486-mingw32

I use

   ./configure --host=i586-mingw32msvc --target=i586-mingw32msvc --build=i586-linux

on both Ubuntu and Debian systems and it JustWorks (tm).

Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Men who use terrorism as a means to power, rule by terror
once they are in power."
-- Helen Macinnes

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross-compile from Linux to Windows

Ranguvar

Erik de Castro Lopo-31 wrote
I use

   ./configure --host=i586-mingw32msvc --target=i586-mingw32msvc --build=i586-linux

on both Ubuntu and Debian systems and it JustWorks (tm).
Sorry, doesn't work. It says "unknown option" to both target and build, even if I drop the msvc or change to i486, and make still can't find windows.h.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross-compile from Linux to Windows

Erik de Castro Lopo-31
Ranguvar wrote:

> Sorry, doesn't work. It says "unknown option" to both target and build,

A couple of possibilities:

  a) Your environment isn't set up correctly.
  b) Your configure script was generated by an old or out-of-date
     version of autoconf and needs to be regenerated.

> even
> if I drop the msvc or change to i486, and make still can't find windows.h.

On my machine its located at /usr/i586-mingw32msvc/include/windows.h
and was installed as part of the mingw32-runtime package.

Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"If trees could scream, would we be so cavalier about cutting them
down? We might, if they screamed all the time, for no good reason."
-- Jack Handey

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross-compile from Linux to Windows

Ranguvar
I'm using the latest version of autoconf, but I'm pretty sure x264 doesn't/didn't use autoconf anyways. On my machine, windows.h is in /usr/i486-mingw32/include. I have the mingw32-runtime package, and the win32api package, etc. All latest versions in the Arch repos.

How do I need to set up my environment?

Thanks!

On Sun, Sep 21, 2008 at 11:24 PM, Erik de Castro Lopo <[hidden email]> wrote:
Ranguvar wrote:

> Sorry, doesn't work. It says "unknown option" to both target and build,

A couple of possibilities:

 a) Your environment isn't set up correctly.
 b) Your configure script was generated by an old or out-of-date
    version of autoconf and needs to be regenerated.

> even
> if I drop the msvc or change to i486, and make still can't find windows.h.

On my machine its located at /usr/i586-mingw32msvc/include/windows.h
and was installed as part of the mingw32-runtime package.

Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"If trees could scream, would we be so cavalier about cutting them
down? We might, if they screamed all the time, for no good reason."
-- Jack Handey

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users



--
Ranguvar Foeseeker
LLP Insanity FAEAA

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross-compile from Linux to Windows

Erik de Castro Lopo-31
Ranguvar Foeseeker wrote:

> I'm using the latest version of autoconf, but I'm pretty sure x264
> doesn't/didn't use autoconf anyways.

If x264 doesn't use autoconf it may not support cross compiling.
Autoconf basically gives same cross-compiling for very little
extra effort.

Probably worth asking the upstream authors if cross compiling
is supposed to work and it so how.

HTH,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
Good advice for everyone : stay away from churches, mosques and
synagogues.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross-compile from Linux to Windows

Vincent Torri-2


On Mon, 22 Sep 2008, Erik de Castro Lopo wrote:

> Ranguvar Foeseeker wrote:
>
>> I'm using the latest version of autoconf, but I'm pretty sure x264
>> doesn't/didn't use autoconf anyways.
>
> If x264 doesn't use autoconf it may not support cross compiling.
> Autoconf basically gives same cross-compiling for very little
> extra effort.
>
> Probably worth asking the upstream authors if cross compiling
> is supposed to work and it so how.

It's just a hand-written configure script. Though I don't see the interest
of cross compiling x264. There are already on Windows very good builds.

Vincent Torri

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross-compile from Linux to Windows

Brian Dessent
In reply to this post by Ranguvar
Ranguvar wrote:

> Right now, I'm doing ./configure --host=i486-mingw32
>
> When I 'make', though it fails because it can't find windows.h.

So, it's been determined already that this package is nonstandard and
doesn't use autoconf and it's using the host compiler instead of the
cross compiler, which is why it can't find any windows.h.  You might be
able to work around this by overriding variables, e.g. "make
CC=i486-mingw32-gcc CXX=i486-mingw32-g++".  It will depend on how the
Makefile and configure script are designed.

Brian

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross-compile from Linux to Windows

Roumen Petrov-3
In reply to this post by Ranguvar
Ranguvar wrote:

> I'm trying to cross-compile x264 to Windows from Arch x86_64 Linux. I can
> successfully build for Linux, and I used to build with MinGW on Windows
> before I switched to Linux.
>
> Right now, I'm doing ./configure --host=i486-mingw32
>
> When I 'make', though it fails because it can't find windows.h.
>
> I do have all mingw32 packages installed from Arch's repositories. windows.h
> is in /usr/i486-mingw32/include. I've tried nearly everything - adding that
> folder to my PATH, includedirs, etc.
>
> Can someone please explain how to point it to my MinGW installation?
>
> Thanks very much.

First find default compiler #include search path.
Since you specify --host=i486-mingw32 the expected cross-compiler name
is i486-mingw32-gcc and in that case command "i486-mingw32-gcc -v -E -x
c /dev/null" show paths.
In addition you my set CPPFLAGS. For details set ./configure --help.

Roumen


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross-compile from Linux to Windows

Ranguvar
In reply to this post by Vincent Torri-2
@Erik: Okay, I'll talk to DS and pengvado. Thanks.
@Vincent: I'm one of the people who regularly compile builds. x264 is updated at a blazing pace, and I patch builds with recent experimental patches and release them on Doom9, along with skystrife, Komisar, b0bor/jarod, Techouse, and a few other people. We often all offer builds with different patches. Not so much right now, but there's often a ton of x264 patches not committed yet that work very well (examples being VAQ, Psy RDO, and the new b-frame decision algo, though they all have been committed now).

Thanks to everyone else too =]
Loading...