mingw - How to build MSYS-dependent program with gcc4? -
mingw comes gcc configured making windows programs. instance, not compile , link little program:
#include <unistd.h> int main(void) { uid_t u = getuid(); // no such function in microsoft library return 0; }
this program will compile , link msys compiler, since msys library has function. how, instance, gnu coreutils program id
can obtain , print user id, , how ls -l
in mingw prints user , group ids , on.
the problem is, msys compiler old: gcc 3.4.4.
is there nice, "canonical" way point mingw's gcc 4.5.2 right headers , libraries compiling msys-based programs?
or route not recommended @ all; better build msys gcc4 scratch, bootstrapped msys gcc3?
i'm afraid answer "you don't want this" (hence information scant). purpose of msys environment provide utilities building mingw programs. if given program isn't needed purpose, doesn't need build msys.
in other words, mingw provides cross-compiling toolchain, target system executable environment on windows based on microsoft's library. utilities in cross-compiling toolchain built on msys, msys not available cross-compiled programs.
applications need more of unix-like environment (like enjoyed utilities included in mingw) can use cygwin. msys fork of cygwin anyway. cygwin, msys provides own library. instance, not getuid
there, if call stat
on file, st_uid
, st_gid
fields filled in information in file security descriptor, whereas microsoft version of function used mingw programs leave these fields zero. msys must regarded separate target mingw, cygwin; converting program works mingw msys form of porting.
in case, program in question targets cygwin, there little point in supporting msys target unless msys project wanted pull in program part of mingw environment.
Comments
Post a Comment