Cross-compiling for Windows.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TricksterWolf
    Scout
    • Sep 2012
    • 43

    Cross-compiling for Windows.

    I'm starting a separate thread since I've hit a soft wall and I now know what the problem is.

    I have angband compiling and running, but it currently runs through Cygwin. Looking at Makefile.win, it should have been created as a native Windows executable, and this is what I want (I don't need Posix emulation, etc.).

    What do I need to modify in Makefile.win for this to compile as a Windows executable? Currently I'm calling Makefile.win with MINGW=yes as an option, but the cross-compiler isn't producing a Windows executable--it's producing a Cygwin executable.

    I'm a bit lost at this point because the makefile is a bit complicated so I'd rather not use trial-and-error if there's a simple solution.

    Thanks as always. I'll get this thing to work even if it kills me.
  • TricksterWolf
    Scout
    • Sep 2012
    • 43

    #2
    Success!!!

    The problem was discussed here:


    Apparently adding CROSS=i686-pc-mingw32- will fix the issue for Cygwin cross-compile. In the thread above, it failed to work, but this was a fault of an older Makefile.win.

    I also had to undo the changes to z-file.c, not surprisingly. I had thought that was the issue there!

    In summary, if you want to compile a Windows executable, the proper commands for clean and build are:

    ${MAKE} MINGW=yes -f Makefile.win clean

    ${MAKE} MINGW=yes CROSS=i686-pc-mingw32- -f Makefile.win

    Good Luna this has been a misadventure. Happily able to start work on my variant, however, so no complaints here.

    Comment

    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎