LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Cross compiling under Slackware using mingw-w64 (https://www.linuxquestions.org/questions/slackware-14/cross-compiling-under-slackware-using-mingw-w64-4175581333/)

andrew.46 06-03-2016 02:09 AM

Cross compiling under Slackware using mingw-w64
 
I have been cross compiling for Windows using mingw-w64 under another Linux distro (which has a conveniently packaged mingw-w64 and all the associated utilities I need).

Has any Slackware user been using mingw-w64 and also has a slackbuild(s) for it?

Alien Bob 06-03-2016 06:22 AM

Perhaps you find what you need here: http://cgit.notk.org/gitolite/win-builds/mingw.git/

kjhambrick 06-03-2016 06:54 AM

Quote:

Originally Posted by andrew.46 (Post 5555023)
I have been cross compiling for Windows using mingw-w64 under another Linux distro (which has a conveniently packaged mingw-w64 and all the associated utilities I need).

Has any Slackware user been using mingw-w64 and also has a slackbuild(s) for it?

Andrew.46 --

I've not had to build a mingw environment for a few years now ( 2011 / 2012 ) .

We used to use msys + mingw to run our ( sh + sed + awk + perl + c ) Data Conversion Scripts for ALL of our Customers running our Payroll System on Windows.

Then we realized a few years ago that it more productive to provide a Plug-n-Play 'Linux Appliance' to do the task, especially after MS introduced the Windows 7+ security model.

The Data Conversions run 15-20 times faster on an Atom / Celeron box running Linux than they do on a Windows Box running the fastest Xeon ( Windows does not do processes very efficiently ).

And then we would occasionally suffer mysterious breakage the day after Patch Tuesday Windows Updates were applied ...

Anyhow ... there are still a few 'hold outs' who won't allow Linux on their LANs ... ???

I've still got a mingw cross-compiler environment on my old 13.37 laptop and I'll have to eventually get around to setting it up on my new laptop running 14.2 / current.

My mingw / msys build is old -- circa 2012 ...

And in 2012, I hadn't yet realized the value investing just a little more effort to build 'extra' software on my Slackware Boxes with SlackBuild scripts.

So the old environment was generated via good-ole ( configure ( prefix=/usr/local/ ) ; make ; make test ; make install ; ) sequences.

This time I will definitely take the time to either use existing SlackBuilds or I'll work on rolling my own SlackBuild Scripts.

Arch has a very complete mingw-64 set( it looks like the most complete set of all ).

http://mingw-w64.org/doku.php/download

And the Arch team usually provide a good starting place for building from source.

I won't get around to this until later this summer and if mingw-64 + msys2 Slackbuilds don't yet exist, I would be happy to work with other users on a system of mingw-64 / msys2 SlackBuilds and then donate whatever ( I / we ) come up with to the SBo Team ( if they want them ).

-- kjh

kjhambrick 06-03-2016 06:57 AM

Quote:

Originally Posted by Alien Bob (Post 5555099)
Perhaps you find what you need here: http://cgit.notk.org/gitolite/win-builds/mingw.git/

Thank you Alien Bob !

-- kjh

NoStressHQ 06-03-2016 11:15 AM

Quote:

Originally Posted by andrew.46 (Post 5555023)
I have been cross compiling for Windows using mingw-w64 under another Linux distro (which has a conveniently packaged mingw-w64 and all the associated utilities I need).

Has any Slackware user been using mingw-w64 and also has a slackbuild(s) for it?

Yes I compile all my frameworks for linux AND windows using MXE... It's the best mingw cross compilation system in my POV:

http://mxe.cc/

Simply clone the repo somewhere, make, wait some hours :)...

Seriously, you can just:

Code:

$ make gcc
$ make <library-you-want>

After that, just read the doc, but it's classical cross compilation...

andrew.46 06-03-2016 09:39 PM

Quote:

Originally Posted by Alien Bob (Post 5555099)
Perhaps you find what you need here: http://cgit.notk.org/gitolite/win-builds/mingw.git/

Thanks for the link, this certainly provides a start at least and plenty of work for a rainy day. I had no idea until I looked a little closer how complex it is to package a cross compiler...

andrew.46 06-03-2016 09:43 PM

Quote:

Originally Posted by NoStressHQ (Post 5555231)
Yes I compile all my frameworks for linux AND windows using MXE...

Giving this a try this morning, thanks :)

andrew.46 06-03-2016 11:23 PM

Another option that I am also looking at is a pretty amazing script written by the gentleman who produces FFmpeg builds for Windows. He has been good enough to put the licensed script for his mingw toolchain build online:

MinGW-w64 Build Script 3.6.7
https://ffmpeg.zeranoe.com/blog/?p=414

NoStressHQ 06-03-2016 11:59 PM

Quote:

Originally Posted by andrew.46 (Post 5555677)
Another option that I am also looking at is a pretty amazing script written by the gentleman who produces FFmpeg builds for Windows. He has been good enough to put the licensed script for his mingw toolchain build online:

MinGW-w64 Build Script 3.6.7
https://ffmpeg.zeranoe.com/blog/?p=414

I haven't tried(used) it myself but mxe have ffmpeg already: http://mxe.cc/#packages...

So you should just have to do in your 'mxe' local clone:

Code:

some/where/mingw-mxe $ make ffmpeg
That's it.

andrew.46 06-04-2016 02:22 AM

Quote:

Originally Posted by NoStressHQ (Post 5555685)
I haven't tried(used) it myself but mxe have ffmpeg already: http://mxe.cc/#packages...

Actually this script just builds mingw-w64 toolchain not FFmpeg itself, but I could not get it to complete with various errors on different versions of gcc, binutils and friends...

NoStressHQ 06-04-2016 02:32 AM

Quote:

Originally Posted by andrew.46 (Post 5555717)
Actually this script just builds mingw-w64 toolchain not FFmpeg itself, but I could not get it to complete with various errors on different versions of gcc, binutils and friends...

Sorry but which script are you talking about ? Mxe doesn't build "just" the toolchain, it compiles the whole stuff, toolchain + libraries + applications which are provided (so ffmpeg). MXE build all... And building something not in the provided packages is straight forward, and you got already the cross-compiler, and most common libraries.

And nothing else is required on Slackware (and I guess it's valid for "any" unix like system with gcc and gnu/make). Building ffmpeg is just a matter of:

Code:

some/where $ git clone https://github.com/mxe/mxe.git
some/where $ cd mxe
some/where/mxe $ make ffmpeg

And that's really all... Nothing more is required...

andrew.46 06-04-2016 02:44 AM

My apologies for a bad quote, the script I meant is:

MinGW-w64 Build Script 3.6.7
https://ffmpeg.zeranoe.com/blog/?p=414

which builds the mingw-w64 toolchain. I have downloaded mxe now and have been experimenting with a few builds, thanks for the steer towards this :)

NoStressHQ 06-04-2016 02:56 AM

You're welcome, let me know if you have any problem... (Although I go to sleep now :) ).

Cheers.


All times are GMT -5. The time now is 11:05 PM.