From: Marat Radchenko Date: Mon, 21 Apr 2014 22:14:39 GMT Subject: [NOT_A_PATCH] A naive attempt to cross-build Linux->mingw64 Git Message-ID: <1398118479-7731-1-git-send-email-marat@slonopotamus.org> In-Reply-To: <535569e92cbcc_32c48493101f@nysa.notmuch> config.mak.uname: provide a way to explicitely request MinGW build. This is required to perform Linux->MinGW crosscompilation. --- > Personally I don't see why ideally I shouldn't be able to build upstream Git > for Windows with mingw without leaving my Linux system. One day you might be able, but as of today... 1. Obtain x86_64-w64-mingw32 compiler for your *nix distro * [Gentoo] emerge crossdev && crossdev -t x86_64-w64-mingw32 * [Debian/Ubuntu] apt-get install mingw-w64 2. Apply patch from this email to Git sources (git/git or msysgit/git - doesn't matter) 3. `make CC=x86_64-w64-mingw32-gcc MINGW=1` 4. Observe errors [1] I would be happy to find out I'm doing something wrong -- Johannes says building mingw64 Git is dirt-easy. [1]: In file included from /usr/x86_64-w64-mingw32/usr/include/windows.h:9:0, from /usr/x86_64-w64-mingw32/usr/include/winsock2.h:23, from git-compat-util.h:93, from cache.h:4, from credential-store.c:1: /usr/x86_64-w64-mingw32/usr/include/_mingw.h:456:2: error: #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64 #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64 ^ In file included from git-compat-util.h:134:0, from cache.h:4, from credential-store.c:1: compat/mingw.h:8:13: error: conflicting types for 'pid_t' typedef int pid_t; ^ In file included from /usr/x86_64-w64-mingw32/usr/include/process.h:12:0, from /usr/x86_64-w64-mingw32/usr/include/unistd.h:11, from git-compat-util.h:98, from cache.h:4, from credential-store.c:1: /usr/x86_64-w64-mingw32/usr/include/sys/types.h:68:16: note: previous declaration of 'pid_t' was here typedef _pid_t pid_t; ^ config.mak.uname | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.mak.uname b/config.mak.uname index 82b8dff..4f4d84f 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -13,6 +13,11 @@ ifdef MSVC uname_O := Windows endif +ifdef MINGW + uname_S := MINGW + uname_O := MINGW +endif + # We choose to avoid "if .. else if .. else .. endif endif" # because maintaining the nesting to match is a pain. If # we had "elif" things would have been much nicer... -- 1.8.3.2 -- -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en --- You received this message because you are subscribed to the Google Groups "msysGit" group. To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.