9102f958ee
Back in the DOS days, in the FAT file system, file names always
consisted of a base name of length 8 plus a file extension of length 3.
Shorter file names were simply padded with spaces to the full 8.3
format.
Later, the FAT file system was taught to support _also_ longer names,
with an 8.3 "short name" as primary file name. While at it, the same
facility allowed formerly illegal file names, such as `.git` (empty base
names were not allowed), which would have the "short name" `git~1`
associated with it.
For backwards-compatibility, NTFS supports alternative 8.3 short
filenames, too, even if starting with Windows Vista, they are only
generated on the system drive by default.
We addressed the problem that the `.git/` directory can _also_ be
accessed via `git~1/` (when short names are enabled) in 2b4c6efc82
(read-cache: optionally disallow NTFS .git variants, 2014-12-16), i.e.
since Git v1.9.5, by introducing the config setting `core.protectNTFS`
and enabling it by default on Windows.
In the meantime, Windows 10 introduced the "Windows Subsystem for Linux"
(short: WSL), i.e. a way to run Linux applications/distributions in a
thinly-isolated subsystem on Windows (giving rise to many a "2016 is the
Year of Linux on the Desktop" jokes). WSL is getting increasingly
popular, also due to the painless way Linux application can operate
directly ("natively") on files on Windows' file system: the Windows
drives are mounted automatically (e.g. `C:` as `/mnt/c/`).
Taken together, this means that we now have to enable the safe-guards of
Git v1.9.5 also in WSL: it is possible to access a `.git` directory
inside `/mnt/c/` via the 8.3 name `git~1` (unless short name generation
was disabled manually). Since regular Linux distributions run in WSL,
this means we have to enable `core.protectNTFS` at least on Linux, too.
To enable Services for Macintosh in Windows NT to store so-called
resource forks, NTFS introduced "Alternate Data Streams". Essentially,
these constitute additional metadata that are connected to (and copied
with) their associated files, and they are accessed via pseudo file
names of the form `filename:<stream-name>:<stream-type>`.
In a recent patch, we extended `core.protectNTFS` to also protect
against accesses via NTFS Alternate Data Streams, e.g. to prevent
contents of the `.git/` directory to be "tracked" via yet another
alternative file name.
While it is not possible (at least by default) to access files via NTFS
Alternate Data Streams from within WSL, the defaults on macOS when
mounting network shares via SMB _do_ allow accessing files and
directories in that way. Therefore, we need to enable `core.protectNTFS`
on macOS by default, too, and really, on any Operating System that can
mount network shares via SMB/CIFS.
A couple of approaches were considered for fixing this:
1. We could perform a dynamic NTFS check similar to the `core.symlinks`
check in `init`/`clone`: instead of trying to create a symbolic link
in the `.git/` directory, we could create a test file and try to
access `.git/config` via 8.3 name and/or Alternate Data Stream.
2. We could simply "flip the switch" on `core.protectNTFS`, to make it
"on by default".
The obvious downside of 1. is that it won't protect worktrees that were
clone with a vulnerable Git version already. We considered patching code
paths that check out files to check whether we're running on an NTFS
system dynamically and persist the result in the repository-local config
setting `core.protectNTFS`, but in the end decided that this solution
would be too fragile, and too involved.
The obvious downside of 2. is that everybody will have to "suffer" the
performance penalty incurred from calling `is_ntfs_dotgit()` on every
path, even in setups where.
After the recent work to accelerate `is_ntfs_dotgit()` in most cases,
it looks as if the time spent on validating ten million random
file names increases only negligibly (less than 20ms, well within the
standard deviation of ~50ms). Therefore the benefits outweigh the cost.
Another downside of this is that paths that might have been acceptable
previously now will be forbidden. Realistically, though, this is an
improvement because public Git hosters already would reject any `git
push` that contains such file names.
Note: There might be a similar problem mounting HFS+ on Linux. However,
this scenario has been considered unlikely and in light of the cost (in
the aforementioned benchmark, `core.protectHFS = true` increased the
time from ~440ms to ~610ms), it was decided _not_ to touch the default
of `core.protectHFS`.
This change addresses CVE-2019-1353.
Reported-by: Nicolas Joly <Nicolas.Joly@microsoft.com>
Helped-by: Garima Singh <garima.singh@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
582 lines
16 KiB
Plaintext
582 lines
16 KiB
Plaintext
# Platform specific Makefile tweaks based on uname detection
|
|
|
|
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
|
uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
|
|
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
|
|
uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
|
|
uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
|
|
uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
|
|
|
|
ifdef MSVC
|
|
# avoid the MingW and Cygwin configuration sections
|
|
uname_S := Windows
|
|
uname_O := Windows
|
|
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...
|
|
|
|
ifeq ($(uname_S),OSF1)
|
|
# Need this for u_short definitions et al
|
|
BASIC_CFLAGS += -D_OSF_SOURCE
|
|
SOCKLEN_T = int
|
|
NO_STRTOULL = YesPlease
|
|
NO_NSEC = YesPlease
|
|
endif
|
|
ifeq ($(uname_S),Linux)
|
|
HAVE_ALLOCA_H = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
HAVE_PATHS_H = YesPlease
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
|
HAVE_DEV_TTY = YesPlease
|
|
HAVE_CLOCK_GETTIME = YesPlease
|
|
HAVE_CLOCK_MONOTONIC = YesPlease
|
|
# -lrt is needed for clock_gettime on glibc <= 2.16
|
|
NEEDS_LIBRT = YesPlease
|
|
HAVE_GETDELIM = YesPlease
|
|
SANE_TEXT_GREP=-a
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
|
endif
|
|
ifeq ($(uname_S),GNU/kFreeBSD)
|
|
HAVE_ALLOCA_H = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
HAVE_PATHS_H = YesPlease
|
|
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
|
endif
|
|
ifeq ($(uname_S),UnixWare)
|
|
CC = cc
|
|
NEEDS_SOCKET = YesPlease
|
|
NEEDS_NSL = YesPlease
|
|
NEEDS_SSL_WITH_CRYPTO = YesPlease
|
|
NEEDS_LIBICONV = YesPlease
|
|
SHELL_PATH = /usr/local/bin/bash
|
|
NO_IPV6 = YesPlease
|
|
NO_HSTRERROR = YesPlease
|
|
BASIC_CFLAGS += -Kthread
|
|
BASIC_CFLAGS += -I/usr/local/include
|
|
BASIC_LDFLAGS += -L/usr/local/lib
|
|
INSTALL = ginstall
|
|
TAR = gtar
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
endif
|
|
ifeq ($(uname_S),SCO_SV)
|
|
ifeq ($(uname_R),3.2)
|
|
CFLAGS = -O2
|
|
endif
|
|
ifeq ($(uname_R),5)
|
|
CC = cc
|
|
BASIC_CFLAGS += -Kthread
|
|
endif
|
|
NEEDS_SOCKET = YesPlease
|
|
NEEDS_NSL = YesPlease
|
|
NEEDS_SSL_WITH_CRYPTO = YesPlease
|
|
NEEDS_LIBICONV = YesPlease
|
|
SHELL_PATH = /usr/bin/bash
|
|
NO_IPV6 = YesPlease
|
|
NO_HSTRERROR = YesPlease
|
|
BASIC_CFLAGS += -I/usr/local/include
|
|
BASIC_LDFLAGS += -L/usr/local/lib
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
INSTALL = ginstall
|
|
TAR = gtar
|
|
endif
|
|
ifeq ($(uname_S),Darwin)
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
NEEDS_SSL_WITH_CRYPTO = YesPlease
|
|
NEEDS_LIBICONV = YesPlease
|
|
# Note: $(uname_R) gives us the underlying Darwin version.
|
|
# - MacOS 10.0.* and MacOS 10.1.0 = Darwin 1.*
|
|
# - MacOS 10.x.* = Darwin (x+4).* for (1 <= x)
|
|
# i.e. "begins with [15678] and a dot" means "10.4.* or older".
|
|
ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
|
|
OLD_ICONV = UnfortunatelyYes
|
|
NO_APPLE_COMMON_CRYPTO = YesPlease
|
|
endif
|
|
ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
|
|
NO_STRLCPY = YesPlease
|
|
endif
|
|
ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1)
|
|
HAVE_GETDELIM = YesPlease
|
|
endif
|
|
NO_MEMMEM = YesPlease
|
|
USE_ST_TIMESPEC = YesPlease
|
|
HAVE_DEV_TTY = YesPlease
|
|
COMPAT_OBJS += compat/precompose_utf8.o
|
|
BASIC_CFLAGS += -DPRECOMPOSE_UNICODE
|
|
BASIC_CFLAGS += -DPROTECT_HFS_DEFAULT=1
|
|
HAVE_BSD_SYSCTL = YesPlease
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
|
endif
|
|
ifeq ($(uname_S),SunOS)
|
|
NEEDS_SOCKET = YesPlease
|
|
NEEDS_NSL = YesPlease
|
|
SHELL_PATH = /bin/bash
|
|
SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
|
|
HAVE_ALLOCA_H = YesPlease
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
NO_MKDTEMP = YesPlease
|
|
NO_REGEX = YesPlease
|
|
NO_MSGFMT_EXTENDED_OPTIONS = YesPlease
|
|
HAVE_DEV_TTY = YesPlease
|
|
ifeq ($(uname_R),5.6)
|
|
SOCKLEN_T = int
|
|
NO_HSTRERROR = YesPlease
|
|
NO_IPV6 = YesPlease
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
|
NO_UNSETENV = YesPlease
|
|
NO_SETENV = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
NO_STRTOUMAX = YesPlease
|
|
GIT_TEST_CMP = cmp
|
|
endif
|
|
ifeq ($(uname_R),5.7)
|
|
NEEDS_RESOLV = YesPlease
|
|
NO_IPV6 = YesPlease
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
|
NO_UNSETENV = YesPlease
|
|
NO_SETENV = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
NO_STRTOUMAX = YesPlease
|
|
GIT_TEST_CMP = cmp
|
|
endif
|
|
ifeq ($(uname_R),5.8)
|
|
NO_UNSETENV = YesPlease
|
|
NO_SETENV = YesPlease
|
|
NO_STRTOUMAX = YesPlease
|
|
GIT_TEST_CMP = cmp
|
|
endif
|
|
ifeq ($(uname_R),5.9)
|
|
NO_UNSETENV = YesPlease
|
|
NO_SETENV = YesPlease
|
|
NO_STRTOUMAX = YesPlease
|
|
GIT_TEST_CMP = cmp
|
|
endif
|
|
INSTALL = /usr/ucb/install
|
|
TAR = gtar
|
|
BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__
|
|
endif
|
|
ifeq ($(uname_O),Cygwin)
|
|
ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
|
|
NO_D_TYPE_IN_DIRENT = YesPlease
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
NO_SYMLINK_HEAD = YesPlease
|
|
NO_IPV6 = YesPlease
|
|
OLD_ICONV = UnfortunatelyYes
|
|
# There are conflicting reports about this.
|
|
# On some boxes NO_MMAP is needed, and not so elsewhere.
|
|
# Try commenting this out if you suspect MMAP is more efficient
|
|
NO_MMAP = YesPlease
|
|
else
|
|
NO_REGEX = UnfortunatelyYes
|
|
endif
|
|
HAVE_ALLOCA_H = YesPlease
|
|
NEEDS_LIBICONV = YesPlease
|
|
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
X = .exe
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
|
SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
|
|
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
|
COMPAT_OBJS += compat/cygwin.o
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
|
endif
|
|
ifeq ($(uname_S),FreeBSD)
|
|
NEEDS_LIBICONV = YesPlease
|
|
OLD_ICONV = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
BASIC_CFLAGS += -I/usr/local/include
|
|
BASIC_LDFLAGS += -L/usr/local/lib
|
|
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
|
|
USE_ST_TIMESPEC = YesPlease
|
|
ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
|
|
PTHREAD_LIBS = -pthread
|
|
NO_UINTMAX_T = YesPlease
|
|
NO_STRTOUMAX = YesPlease
|
|
endif
|
|
PYTHON_PATH = /usr/local/bin/python
|
|
PERL_PATH = /usr/local/bin/perl
|
|
HAVE_PATHS_H = YesPlease
|
|
GMTIME_UNRELIABLE_ERRORS = UnfortunatelyYes
|
|
HAVE_BSD_SYSCTL = YesPlease
|
|
PAGER_ENV = LESS=FRX LV=-c MORE=FRX
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
|
endif
|
|
ifeq ($(uname_S),OpenBSD)
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
USE_ST_TIMESPEC = YesPlease
|
|
NEEDS_LIBICONV = YesPlease
|
|
BASIC_CFLAGS += -I/usr/local/include
|
|
BASIC_LDFLAGS += -L/usr/local/lib
|
|
HAVE_PATHS_H = YesPlease
|
|
HAVE_BSD_SYSCTL = YesPlease
|
|
endif
|
|
ifeq ($(uname_S),MirBSD)
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
USE_ST_TIMESPEC = YesPlease
|
|
NEEDS_LIBICONV = YesPlease
|
|
HAVE_PATHS_H = YesPlease
|
|
HAVE_BSD_SYSCTL = YesPlease
|
|
endif
|
|
ifeq ($(uname_S),NetBSD)
|
|
ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
|
|
NEEDS_LIBICONV = YesPlease
|
|
endif
|
|
BASIC_CFLAGS += -I/usr/pkg/include
|
|
BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
|
|
USE_ST_TIMESPEC = YesPlease
|
|
HAVE_PATHS_H = YesPlease
|
|
HAVE_BSD_SYSCTL = YesPlease
|
|
endif
|
|
ifeq ($(uname_S),AIX)
|
|
DEFAULT_PAGER = more
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
NO_MKDTEMP = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
NO_NSEC = YesPlease
|
|
NO_REGEX = NeedsStartEnd
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
|
INTERNAL_QSORT = UnfortunatelyYes
|
|
NEEDS_LIBICONV = YesPlease
|
|
BASIC_CFLAGS += -D_LARGE_FILES
|
|
ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
|
|
NO_PTHREADS = YesPlease
|
|
else
|
|
PTHREAD_LIBS = -lpthread
|
|
endif
|
|
ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3)
|
|
INLINE = ''
|
|
endif
|
|
GIT_TEST_CMP = cmp
|
|
endif
|
|
ifeq ($(uname_S),GNU)
|
|
# GNU/Hurd
|
|
HAVE_ALLOCA_H = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
HAVE_PATHS_H = YesPlease
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
|
endif
|
|
ifeq ($(uname_S),IRIX)
|
|
NO_SETENV = YesPlease
|
|
NO_UNSETENV = YesPlease
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
NO_MKDTEMP = YesPlease
|
|
# When compiled with the MIPSpro 7.4.4m compiler, and without pthreads
|
|
# (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),
|
|
# git dies with a segmentation fault when trying to access the first
|
|
# entry of a reflog. The conservative choice is made to always set
|
|
# NO_MMAP. If you suspect that your compiler is not affected by this
|
|
# issue, comment out the NO_MMAP statement.
|
|
NO_MMAP = YesPlease
|
|
NO_REGEX = YesPlease
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
|
SHELL_PATH = /usr/gnu/bin/bash
|
|
NEEDS_LIBGEN = YesPlease
|
|
endif
|
|
ifeq ($(uname_S),IRIX64)
|
|
NO_SETENV = YesPlease
|
|
NO_UNSETENV = YesPlease
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
NO_MKDTEMP = YesPlease
|
|
# When compiled with the MIPSpro 7.4.4m compiler, and without pthreads
|
|
# (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),
|
|
# git dies with a segmentation fault when trying to access the first
|
|
# entry of a reflog. The conservative choice is made to always set
|
|
# NO_MMAP. If you suspect that your compiler is not affected by this
|
|
# issue, comment out the NO_MMAP statement.
|
|
NO_MMAP = YesPlease
|
|
NO_REGEX = YesPlease
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
|
SHELL_PATH = /usr/gnu/bin/bash
|
|
NEEDS_LIBGEN = YesPlease
|
|
endif
|
|
ifeq ($(uname_S),HP-UX)
|
|
INLINE = __inline
|
|
NO_IPV6 = YesPlease
|
|
NO_SETENV = YesPlease
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
NO_MKDTEMP = YesPlease
|
|
NO_UNSETENV = YesPlease
|
|
NO_HSTRERROR = YesPlease
|
|
NO_SYS_SELECT_H = YesPlease
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
|
NO_NSEC = YesPlease
|
|
ifeq ($(uname_R),B.11.00)
|
|
NO_INET_NTOP = YesPlease
|
|
NO_INET_PTON = YesPlease
|
|
endif
|
|
ifeq ($(uname_R),B.10.20)
|
|
# Override HP-UX 11.x setting:
|
|
INLINE =
|
|
SOCKLEN_T = size_t
|
|
NO_PREAD = YesPlease
|
|
NO_INET_NTOP = YesPlease
|
|
NO_INET_PTON = YesPlease
|
|
endif
|
|
GIT_TEST_CMP = cmp
|
|
endif
|
|
ifeq ($(uname_S),Windows)
|
|
GIT_VERSION := $(GIT_VERSION).MSVC
|
|
pathsep = ;
|
|
HAVE_ALLOCA_H = YesPlease
|
|
NO_PREAD = YesPlease
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
NO_LIBGEN_H = YesPlease
|
|
NO_POLL = YesPlease
|
|
NO_SYMLINK_HEAD = YesPlease
|
|
NO_IPV6 = YesPlease
|
|
NO_UNIX_SOCKETS = YesPlease
|
|
NO_SETENV = YesPlease
|
|
NO_STRCASESTR = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
# NEEDS_LIBICONV = YesPlease
|
|
NO_ICONV = YesPlease
|
|
NO_STRTOUMAX = YesPlease
|
|
NO_MKDTEMP = YesPlease
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
|
NO_SVN_TESTS = YesPlease
|
|
RUNTIME_PREFIX = YesPlease
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
NO_NSEC = YesPlease
|
|
USE_WIN32_MMAP = YesPlease
|
|
# USE_NED_ALLOCATOR = YesPlease
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
|
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
|
NO_REGEX = YesPlease
|
|
NO_GETTEXT = YesPlease
|
|
NO_PYTHON = YesPlease
|
|
BLK_SHA1 = YesPlease
|
|
ETAGS_TARGET = ETAGS
|
|
NO_INET_PTON = YesPlease
|
|
NO_INET_NTOP = YesPlease
|
|
NO_POSIX_GOODIES = UnfortunatelyYes
|
|
NATIVE_CRLF = YesPlease
|
|
DEFAULT_HELP_FORMAT = html
|
|
|
|
CC = compat/vcbuild/scripts/clink.pl
|
|
AR = compat/vcbuild/scripts/lib.pl
|
|
CFLAGS =
|
|
BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
|
|
COMPAT_OBJS = compat/msvc.o compat/winansi.o \
|
|
compat/win32/pthread.o compat/win32/syslog.o \
|
|
compat/win32/dirent.o
|
|
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
|
|
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE
|
|
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj
|
|
PTHREAD_LIBS =
|
|
lib =
|
|
ifndef DEBUG
|
|
BASIC_CFLAGS += -GL -Os -MD
|
|
BASIC_LDFLAGS += -LTCG
|
|
AR += -LTCG
|
|
else
|
|
BASIC_CFLAGS += -Zi -MDd
|
|
endif
|
|
X = .exe
|
|
endif
|
|
ifeq ($(uname_S),Interix)
|
|
NO_INITGROUPS = YesPlease
|
|
NO_IPV6 = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
NO_MKDTEMP = YesPlease
|
|
NO_STRTOUMAX = YesPlease
|
|
NO_NSEC = YesPlease
|
|
ifeq ($(uname_R),3.5)
|
|
NO_INET_NTOP = YesPlease
|
|
NO_INET_PTON = YesPlease
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
|
endif
|
|
ifeq ($(uname_R),5.2)
|
|
NO_INET_NTOP = YesPlease
|
|
NO_INET_PTON = YesPlease
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
|
endif
|
|
endif
|
|
ifeq ($(uname_S),Minix)
|
|
NO_IPV6 = YesPlease
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
NO_NSEC = YesPlease
|
|
NEEDS_LIBGEN =
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
NEEDS_IDN_WITH_CURL = YesPlease
|
|
NEEDS_SSL_WITH_CURL = YesPlease
|
|
NEEDS_RESOLV =
|
|
NO_HSTRERROR = YesPlease
|
|
NO_MMAP = YesPlease
|
|
NO_CURL =
|
|
NO_EXPAT =
|
|
endif
|
|
ifeq ($(uname_S),NONSTOP_KERNEL)
|
|
# Needs some C99 features, "inline" is just one of them.
|
|
# INLINE='' would just replace one set of warnings with another and
|
|
# still not compile in c89 mode, due to non-const array initializations.
|
|
CC = cc -c99
|
|
# Disable all optimization, seems to result in bad code, with -O or -O2
|
|
# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects
|
|
# abends on "git push". Needs more investigation.
|
|
CFLAGS = -g -O0
|
|
# We'd want it to be here.
|
|
prefix = /usr/local
|
|
# Our's are in ${prefix}/bin (perl might also be in /usr/bin/perl).
|
|
PERL_PATH = ${prefix}/bin/perl
|
|
PYTHON_PATH = ${prefix}/bin/python
|
|
|
|
# As detected by './configure'.
|
|
# Missdetected, hence commented out, see below.
|
|
#NO_CURL = YesPlease
|
|
# Added manually, see above.
|
|
NEEDS_SSL_WITH_CURL = YesPlease
|
|
HAVE_LIBCHARSET_H = YesPlease
|
|
HAVE_STRINGS_H = YesPlease
|
|
NEEDS_LIBICONV = YesPlease
|
|
NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
|
|
NO_SYS_SELECT_H = UnfortunatelyYes
|
|
NO_D_TYPE_IN_DIRENT = YesPlease
|
|
NO_HSTRERROR = YesPlease
|
|
NO_STRCASESTR = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
NO_SETENV = YesPlease
|
|
NO_UNSETENV = YesPlease
|
|
NO_MKDTEMP = YesPlease
|
|
# Currently libiconv-1.9.1.
|
|
OLD_ICONV = UnfortunatelyYes
|
|
NO_REGEX = YesPlease
|
|
NO_PTHREADS = UnfortunatelyYes
|
|
|
|
# Not detected (nor checked for) by './configure'.
|
|
# We don't have SA_RESTART on NonStop, unfortunalety.
|
|
COMPAT_CFLAGS += -DSA_RESTART=0
|
|
# Apparently needed in compat/fnmatch/fnmatch.c.
|
|
COMPAT_CFLAGS += -DHAVE_STRING_H=1
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
NO_NSEC = YesPlease
|
|
NO_PREAD = YesPlease
|
|
NO_MMAP = YesPlease
|
|
NO_POLL = YesPlease
|
|
NO_INTPTR_T = UnfortunatelyYes
|
|
# Bug report 10-120822-4477 submitted to HP NonStop development.
|
|
MKDIR_WO_TRAILING_SLASH = YesPlease
|
|
# RFE 10-120912-4693 submitted to HP NonStop development.
|
|
NO_SETITIMER = UnfortunatelyYes
|
|
SANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin
|
|
SHELL_PATH = /usr/local/bin/bash
|
|
# as of H06.25/J06.14, we might better use this
|
|
#SHELL_PATH = /usr/coreutils/bin/bash
|
|
endif
|
|
ifneq (,$(findstring MINGW,$(uname_S)))
|
|
pathsep = ;
|
|
HAVE_ALLOCA_H = YesPlease
|
|
NO_PREAD = YesPlease
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
NO_LIBGEN_H = YesPlease
|
|
NO_POLL = YesPlease
|
|
NO_SYMLINK_HEAD = YesPlease
|
|
NO_UNIX_SOCKETS = YesPlease
|
|
NO_SETENV = YesPlease
|
|
NO_STRCASESTR = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
NEEDS_LIBICONV = YesPlease
|
|
NO_STRTOUMAX = YesPlease
|
|
NO_MKDTEMP = YesPlease
|
|
NO_SVN_TESTS = YesPlease
|
|
NO_PERL_MAKEMAKER = YesPlease
|
|
RUNTIME_PREFIX = YesPlease
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
NO_NSEC = YesPlease
|
|
USE_WIN32_MMAP = YesPlease
|
|
USE_NED_ALLOCATOR = YesPlease
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
|
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
|
NO_REGEX = YesPlease
|
|
NO_PYTHON = YesPlease
|
|
ETAGS_TARGET = ETAGS
|
|
NO_INET_PTON = YesPlease
|
|
NO_INET_NTOP = YesPlease
|
|
NO_POSIX_GOODIES = UnfortunatelyYes
|
|
DEFAULT_HELP_FORMAT = html
|
|
COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
|
|
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
|
|
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
|
|
compat/win32/pthread.o compat/win32/syslog.o \
|
|
compat/win32/dirent.o
|
|
EXTLIBS += -lws2_32
|
|
GITLIBS += git.res
|
|
PTHREAD_LIBS =
|
|
RC = windres -O coff
|
|
NATIVE_CRLF = YesPlease
|
|
X = .exe
|
|
SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
|
|
ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
|
|
htmldir = doc/git/html/
|
|
prefix =
|
|
INSTALL = /bin/install
|
|
EXTLIBS += /mingw/lib/libz.a
|
|
NO_R_TO_GCC_LINKER = YesPlease
|
|
INTERNAL_QSORT = YesPlease
|
|
HAVE_LIBCHARSET_H = YesPlease
|
|
NO_GETTEXT = YesPlease
|
|
COMPAT_CLFAGS += -D__USE_MINGW_ACCESS
|
|
else
|
|
ifeq ($(shell expr "$(uname_R)" : '2\.'),2)
|
|
# MSys2
|
|
prefix = /usr/
|
|
ifeq (MINGW32,$(MSYSTEM))
|
|
prefix = /mingw32
|
|
endif
|
|
ifeq (MINGW64,$(MSYSTEM))
|
|
prefix = /mingw64
|
|
else
|
|
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
|
|
BASIC_LDFLAGS += -Wl,--large-address-aware
|
|
endif
|
|
CC = gcc
|
|
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY
|
|
EXTLIBS += -lntdll
|
|
INSTALL = /bin/install
|
|
NO_R_TO_GCC_LINKER = YesPlease
|
|
INTERNAL_QSORT = YesPlease
|
|
HAVE_LIBCHARSET_H = YesPlease
|
|
NO_GETTEXT =
|
|
USE_GETTEXT_SCHEME = fallthrough
|
|
USE_LIBPCRE= YesPlease
|
|
NO_LIBPCRE1_JIT = UnfortunatelyYes
|
|
NO_CURL =
|
|
USE_NED_ALLOCATOR = YesPlease
|
|
else
|
|
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO
|
|
NO_CURL = YesPlease
|
|
endif
|
|
endif
|
|
endif
|
|
ifeq ($(uname_S),QNX)
|
|
COMPAT_CFLAGS += -DSA_RESTART=0
|
|
EXPAT_NEEDS_XMLPARSE_H = YesPlease
|
|
HAVE_STRINGS_H = YesPlease
|
|
NEEDS_SOCKET = YesPlease
|
|
NO_GETPAGESIZE = YesPlease
|
|
NO_ICONV = YesPlease
|
|
NO_MEMMEM = YesPlease
|
|
NO_MKDTEMP = YesPlease
|
|
NO_NSEC = YesPlease
|
|
NO_PTHREADS = YesPlease
|
|
NO_R_TO_GCC_LINKER = YesPlease
|
|
NO_STRCASESTR = YesPlease
|
|
NO_STRLCPY = YesPlease
|
|
endif
|