What is the difference between Cygwin and Min.GW From the point of view of porting a C program, a good way to understand this is to take an example include lt sysstat.Hello, Worldn. If we change stat to stat, we can compile this program with Microsoft Visual C.We can also compile this program with Min.GW, and with Cygwin.Under Microsoft Visual C, the program will be linked to a MSVC redistributable run time library mxvcrtnn.CCSv4_GCC_DOS.JPG' alt='Gnu Make 3 81 Cygwin Install Software' title='Gnu Make 3 81 Cygwin Install Software' />Are there any user friendly tools out there to crosscompile from Windows to LinuxTo ship this program we will have to include that DLL.That DLL provides stat, system and printf.Under Min. GW, the program will be linked to msvcrt.Windows, and off limits to application use.That library is essentially a fork of the redistributable run time library from MS Visual C for use by Windows itself.Under both of these, the program will have similar behaviors the stat function will return very limited informationno useful permissions or inode number, for instance.We can also compile the program under Cygwin.Similarly to the redistributable run time used by MS Visual C, the Cygwin program will be linked to Cygwins run time libraries cygwin.Cygwin proper and cyggccs 1.GCC run time support.Since Cygwin is now under the LGPL, we can package with our program, even if it isnt GPL compatible free software, and ship the program.Under Cygwin, the library functions will behave differently the stat function has rich functionality, returning meaningful values in most of the fields.The colon is considered part of the name and somehow mangled into it.There is no concept of a relative path against a volume or drive in Cygwin, no currently logged drive concept, and no per drive current working directory.Cygwin will resolve the path according to the location of your executable, and expect a sh.Both Cygwin and Min.GW allow you to use Win.If you want to call Message.Box or Create. Process, you can do that.You can also easily build a program which doesnt require a console window, using gcc mwindows, under Min.GW and Cygwin. Cygwin is not strictly POSIX.IN addition to providing access to the Windows API, it also provides its own implementations of some Microsoft C functions stuff found in msvcrt.An example of this are the spawn family of functions like spawnvp.These are a good idea to use instead of fork and exec on Cygwin since they map better to the Windows process creation model which has no concept of fork.Thus Cygwin programs are no less native than MS Visual C programs on grounds of requiring the accompaniment of libraries.Programming language implementations on Windows are expected to provide their own run time, even C language implementations.There is no libc on Windows for public use.The fact that Min.GW requires no third party DLL is actually a disadvantage it is depending on an undocumented, Windows internal fork of the Visual C run time.Min. GW does this because the GPL system library exception applies to msvcrt.GPL ed programs can be compiled and redistributed with Min.GW. Due to its much broader and deeper support for POSIX compared to msvcrt.Cygwin is by far the superior environment for porting POSIX programs.Since it is now under the LGPL, it allows applications with all sorts of licenses, open or closed source, to be redistributed.Cygwin even contains VT1.Microsoft consoleA POSIX application that sets up raw mode with tcsetattr and uses VT1.As far as the end user is concerned, its a native console app making Win. Texas State Drivers License Offices there. However As a native Windows development tool, Cygwin has some quirks, like path handling that is foreign to Windows, dependence on some hard coded paths like binsh and other issues.These differences are what render Cygwin programs non native.If a program takes a path as an argument, or input from a dialog box, Windows users expect that path to work the same way as it does in other Windows programs.If it doesnt work that way, thats a problem.Plug Shortly after the LGPL announcement, I started the Cygnal Cygwin Native Application Library project to provide a fork of the Cygwin DLL which aims to fix these issues.Programs can be developed under Cygwin, and then deployed with the Cygnal version of cygwin.As this library improves, it will gradually eliminate the need for Min.GW. When Cygnal solves the path handling problem, it will be possible to develop a single executable which works with Windows paths when shipped as a Windows application with Cygnal, and seamlessly works with Cygwin paths when installed in your usrbin under Cygwin.Under Cygwin, the executable will transparently work with a path like cygdrivecUsersbob.In the native deployment where it is linking against the Cygnal version of cygwin.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |