ScummVM logo Forum Index - ScummVM website - Contact us - Buy Supported Games: GOG.com Rules - Search - Register - Login curved edge
Folder Forum Index > Other Ports > SCUMMVM ported to CYGWIN
SCUMMVM ported to CYGWIN
  Author    Thread Reply to topic
carlo_bramini



Joined: 08 Aug 2015
Posts: 9
SCUMMVM ported to CYGWIN 

I tried to compile SCUMMVM in CYGWIN and at first try the configure script said:

ERROR: Cygwin building is not supported by ScummVM anymore. Consider using MinGW.

Surprised by this message, I made few fixes in the configure:

code:
diff --git a/configure b/configure
index abc38fe..b9069cb 100755
--- a/configure
+++ b/configure
@@ -2217,8 +2217,9 @@ case $_host_os in
       _seq_midi=no
       ;;
    cygwin*)
-      echo ERROR: Cygwin building is not supported by ScummVM anymore. Consider using MinGW.
-      exit 1
+      # Cygwin has more strict set c++0x/c++11: the function
+      # vsnprintf is defined in the GNU variant (gnu++0x/gnu++11)
+      append_var CXXFLAGS "-std=gnu++0x"
       ;;
    darwin*)
       # Pass -mlongcall to gcc so that it emits long calls
@@ -3202,10 +3203,10 @@ esac
 #
 echo_n "Checking if host is POSIX compliant... "
 case $_host_os in
-   amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | ps3 | psp | wii | wince)
+   amigaos* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | ps3 | psp | wii | wince)
       _posix=no
       ;;
-   android | beos* | bsd* | darwin* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos)
+   android | beos* | bsd* | cygwin* | darwin* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos)
       _posix=yes
       ;;
    os2-emx*)
@@ -4173,7 +4174,7 @@ if test "$_have_x86" = yes ; then
             darwin*)
                append_var NASMFLAGS "-f macho"
             ;;
-            mingw*)
+            mingw* | cygwin*)
                append_var NASMFLAGS "-f win32"
             ;;
             os2-emx*)



and I got SCUMMVM compiled an working.
Optionally, I did these fixes in the sources for enabling optimized scalers compiled with NASM:

code:
diff --git a/graphics/scaler.cpp b/graphics/scaler.cpp
index 745988c..6bb9b7b 100644
--- a/graphics/scaler.cpp
+++ b/graphics/scaler.cpp
@@ -36,7 +36,7 @@ extern "C" {
 // NOTE: if your compiler uses different mangled names, add another
 //       condition here
 
-#if !defined(_WIN32) && !defined(MACOSX) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(MACOSX) && !defined(__OS2__) && !defined(__CYGWIN__)
 #define RGBtoYUV _RGBtoYUV
 #define hqx_highbits _hqx_highbits
 #define hqx_lowbits _hqx_lowbits
diff --git a/graphics/scaler/hq2x.cpp b/graphics/scaler/hq2x.cpp
index 74ceebd..03e1d2f 100644
--- a/graphics/scaler/hq2x.cpp
+++ b/graphics/scaler/hq2x.cpp
@@ -27,7 +27,7 @@
 
 extern "C" {
 
-#if !defined(_WIN32) && !defined(MACOSX) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(MACOSX) && !defined(__OS2__) && !defined(__CYGWIN__)
 #define hq2x_16 _hq2x_16
 #endif
 
diff --git a/graphics/scaler/hq3x.cpp b/graphics/scaler/hq3x.cpp
index f6c86b3..3d0592d 100644
--- a/graphics/scaler/hq3x.cpp
+++ b/graphics/scaler/hq3x.cpp
@@ -27,7 +27,7 @@
 
 extern "C" {
 
-#if !defined(_WIN32) && !defined(MACOSX) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(MACOSX) && !defined(__OS2__) && !defined(__CYGWIN__)
 #define hq3x_16 _hq3x_16
 #endif




and nothing else is required.
I'm wondering if the above fixes could be imported in the main sources
I did two screenshots of this build in action.




Sincerely,

Carlo Bramini.
 Reply with quote  
Post Sun Jan 03, 2016 4:38 pm 
 View user's profile Send private message
md5
ScummVM Developer


Joined: 03 Nov 2005
Posts: 2256
Location: Athens, Greece
 

Good question

Support for Cygwin was dropped 6 years ago (in 2009), in this commit:

https://github.com/scummvm/scummvm/commit/5ef85a20ed3cf419f527ab064853da3ce4c12035

The rationale was that the -mno-cygwin switch has been removed, so the resulting executables will need the cygwin DLL to work.

If the changes are this minimal, it would be trivial to add support for Cygwin builds once more. Please, add a pull request.

 Reply with quote  
Post Sun Jan 03, 2016 7:23 pm 
 View user's profile Send private message
Kirben
ScummVM Developer


Joined: 21 Sep 2005
Posts: 411
Location: Melbourne, Victoria, Australia
 

Cygwin support was dropped, when the option for a mingw cross build was no longer available.

A native Cygwin build will never be officially supported, as that would be a unix build through emulation under Windows.

 Reply with quote  
Post Sun Jan 03, 2016 11:11 pm 
 View user's profile Send private message
carlo_bramini



Joined: 08 Aug 2015
Posts: 9
 

quote:
Originally posted by md5
Good question

Support for Cygwin was dropped 6 years ago (in 2009), in this commit:

https://github.com/scummvm/scummvm/commit/5ef85a20ed3cf419f527ab064853da3ce4c12035

The rationale was that the -mno-cygwin switch has been removed, so the resulting executables will need the cygwin DLL to work.
quote:
Originally posted by Kirben
Cygwin support was dropped, when the option for a mingw cross build was no longer available.

I was imaging something similar... hopefully, since then, CYGWIN is evolved a lot and nowadays the "-mno-cygwin" is like a distant memory.
quote:
Originally posted by md5
If the changes are this minimal, it would be trivial to add support for Cygwin builds once more. Please, add a pull request.

I followed your suggestion and I posted the above patch in the patch tracker:
https://sourceforge.net/p/scummvm/patches/1619/

quote:
Originally posted by Kirben
A native Cygwin build will never be officially supported, as that would be a unix build through emulation under Windows.

Well... It is not my intention to ask to release a CYGWIN build of SCUMMVM near all official builds but, if we are able to compile it with CYGWIN, this will open the road to someone else to compile and make available SCUMMVM as a package in future.
As I wrote, CYGWIN is evolved a lot in these years, much stuff has been made available as you can see by looking the list of available software, you are even able to run a full desktop environment and it's available for 32bit and 64bit platforms. Since SCUMMVM can be already compiled for POSIX compliant systems, adding support for CYGWIN requires very few changes, as you can see. So, the few fixes in my patch have a different target, for Windows users the native MINGW build is what they need.
I hope you will find this useful.

Sincerely,

Carlo Bramini.
 Reply with quote  
Post Mon Jan 04, 2016 11:46 am 
 View user's profile Send private message
Kirben
ScummVM Developer


Joined: 21 Sep 2005
Posts: 411
Location: Melbourne, Victoria, Australia
 

Cygwin is meant for programs without Windows native code, and only offers the disadvantage of an addition emulation layer for ScummVM under Windows.

I definitely don't want to see a ScummVM package for Cygwin, as we would end up with any support requests, when the unexpected happens. That fact that ScummVM compiles under Cygwin, doesn't mean there aren't any issues, especially when relying on an emulation layer for unix support.

 Reply with quote  
Post Mon Jan 04, 2016 12:00 pm 
 View user's profile Send private message
carlo_bramini



Joined: 08 Aug 2015
Posts: 9
 

I see. No problem.

If I could say my opinion about the "don't want to see a ScummVM package for Cygwin", probably nobody could stop such thing, as long as the terms of the GPL license are respected... so, at the end, even if those lines would be added or not, this build would follow the same fate of the various abandoned ports or unofficial builds, so I do not see a big problem about what to do with the support requests (but I doubt there will be any) but, as I wrote, it's just my opinion.

Thank you very much for your time. Wink

 Reply with quote  
Post Mon Jan 04, 2016 1:29 pm 
 View user's profile Send private message
  Display posts from previous:      
Reply to topic

Forum Jump:
 



Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Powered by phpBB © 2001, 2006 phpBB Group
Forum design by ScummVM team, icons by raina
curved edge   curved edge