ALL PREVIOUS ACKED
MINGW: git-compat-util.h: use inttypes.h for printf macros

All MinGW flavors have inttypes.h, so just include it.

However, we need to pass -D__USE_MINGW_ANSI_STDIO=0 to select
MSVCRT-compatible macro definitions on MinGW.

As a side-effect, Git no longer builds with MSVC < 2010 but that
hopefully is not a problem.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
MINGW: config.mak.uname: reorganize MINGW settings

HAVE_LIBCHARSET_H and NO_R_TO_GCC_LINKER are not specific to
msysGit, they're general MinGW settings.

Logic behind HAVE_LIBCHARSET_H: if user is on MinGW and has iconv,
we expect him to have libcharset.h. If user doesn't have iconv,
he has to explicitly say so via NO_ICONV=1.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
MINGW: fix main() signature in http-fetch.c and remote-curl.c

On MinGW, compat/mingw.h defines a 'mingw_main' wrapper function.
Fix `warning: passing argument 2 of 'mingw_main' from incompatible
pointer type` in http-fetch.c and remote-curl.c by dropping 'const'.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
Makefile: introduce CROSS_COMPILE variable

To ease cross-compilation process, introduce a single variable
with the prefix to all compiler-related executables.

Define CROSS_COMPILE=foo- if your compiler and binary utilities
are foo-cc, foo-ar, foo-strip, etc.  More specific variables
override this, so if you set CC=gcc CROSS_COMPILE=ia64-linux-gnu-
then the compiler will be 'gcc', not 'ia64-linux-gnu-gcc'.

STRIP is no longer accepted from environment unless `make -e` is used.
Previous behavior didn't match other compiler-related variables and
unlikely was a deliberate feature.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
ALL PREVIOUS REWORKED
MINGW: config.mak.uname: drop USE_NED_ALLOCATOR

nedalloc was initially added in f0ed82 to fix slowness of standard WinXP
memory allocator. Since WinXP is EOLed, this point is no longer valid.

The actual reason behind this commit is incompatibility of malloc.c.h
with MinGW-W64 headers. Alternative solution implies updating nedalloc
to something newer.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
MINGW: config.mak.uname: add explicit way to request MinGW-build

When crosscompiling, one cannot rely on `uname` from host system.
Thus, add an option to use `make MINGW=1` for building MinGW build
from non-MinGW host (Linux, for example).

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
MINGW: config.mak.uname: drop -DNOGDI

On MinGW-W64, MsgWaitForMultipleObjects is guarded with #ifndef NOGDI.

Unfortunately, including wingdi.h brings in #define ERROR 0 which
conflicts with several Git internal enums. So, #undef ERROR.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>