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: compat/bswap.h: include stdint.h

bswap.h uses uint32_t type which might not be defined.
This patch adds direct include so bswap.h can be safely included.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
MINGW: compat/mingw.h: do not attempt to redefine lseek on mingw-w64

mingw-w64 has lseek defined in io.h.

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.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
MINGW: git-compat-util.h: use inttypes.h for printf macros.

Also, pass -D__USE_MINGW_ANSI_STDIO=0 to select MSVCRT-compatible
macro definitions.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
MSVC: config.mak.uname: drop -D__USE_MINGW_ACCESS from compile definitions

-D__USE_MINGW_ACCESS only affects MinGW and does nothing when
MSVC is used.

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.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
MINGW: config.mak.uname allow using CURL for non-msysGit builds

Also, fix `warning: passing argument 2 of 'mingw_main' from
incompatible pointer type` in http-fetch.c and remote-curl.c.

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>
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: do not fail at redefining pid_t on MinGW-W64

pid_t is available in sys/types.h on both MinGW and MinGW-W64

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