Hi Marat, On Thu, 9 Oct 2014, Marat Radchenko wrote: > On Wed, Oct 08, 2014 at 12:26:52PM -0700, Junio C Hamano wrote: > > Marat Radchenko <marat@xxxxxxxxxxxxxxxx> writes: > > > > > When crosscompiling, one cannot rely on `uname` from host system. > > > > That may well be true, but is that limited to cross-compiling to > > mingw? Would it be generally true for any cross compilation, > > wouldn't it? > > > > What I am wondering is if it is a better solution to make it easier > > to allow somebody who is cross compiling to express "Mr. Makefile, > > we know better than you and want you to do a MINGW build for us > > without checking with `uname -?` yourself", i.e. > > > > $ make uname_O=MINGW uname_S=MINGW > > > > which would hopefully allow cross-compilation into other > > environments, not just MINGW. > > So, do you really want this patch to be changed from 5-liner into > a full-blow system detection rewrite based on `cc -dumpmachine` > instead of `uname`? Junio's responsibility as a maintainer is to keep this project afloat for a broader audience than this patch series tries to reach. Keeping that in mind, a patch that fixes a broad issue (in this case, cross-compiling) *just* for one small use case (in this case, cross-compiling for Windows using MinGW) might need a very good argument to convince the maintainer that a broader solution is either not achievable or so much more complicated that it is completely outside of the scope of this patch series. FWIW this is *exactly* what I pointed out here: https://github.com/dscho/git/commit/e31124d4e8ba4e48181306198648cdfe73ff9c30#comments Hmm. This is a very narrow solution to the underlying problem. Just think about cross-compiling for e.g. MacOSX. The solution presented in this commit works for MinGW, only for MinGW, and for MinGW alone. The commit message needs to do a much better job to make that clear. And Junio actually pointed out that a broader solution is neither impossible nor complex: Junio hinted at the use of the conditional assignment "FOO ?= bar": https://www.gnu.org/software/make/manual/make.html#index-_003f_003d IMHO it would make tons of sense to replace the := assignments in https://github.com/dscho/git/blob/e31124d4e8ba4e48181306198648cdfe73ff9c30/config.mak.uname#L3-L8 by ?= assignments. Of course it is very obvious where the idea for the patch we are discussing here comes from: the current config.mak.uname has this: ifdef MSVC # avoid the MingW and Cygwin configuration sections uname_S := Windows uname_O := Windows endif This could be cleaned up in the same run: to be assigned *before* the conditional assignments of uname_S. Likewise, the MINGW-specific part should be done by searching for "mingw" in CROSS_COMPILE, also before the block of the uname_* variable assignments. Ciao, Johannes -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html