65
HAVE_PLATFORM_PROCINFO = YesPlease
66
COMPAT_OBJS += compat/linux/procinfo.o
67
# centos7/rhel7 provides gcc 4.8.5 and zlib 1.2.7.
68
- ifneq ($(findstring .el7.,$(uname_R)),)
68
+ ifneq ($(findstring .el7.,$(uname_R)),)
69
BASIC_CFLAGS += -std=c99
70
- endif
70
+ endif
71
endif
72
ifeq ($(uname_S),GNU/kFreeBSD)
73
HAVE_ALLOCA_H = YesPlease
95
NO_MEMMEM = YesPlease
96
endif
97
ifeq ($(uname_S),SCO_SV)
98
- ifeq ($(uname_R),3.2)
98
+ ifeq ($(uname_R),3.2)
99
CFLAGS = -O2
100
- endif
101
- ifeq ($(uname_R),5)
100
+ endif
101
+ ifeq ($(uname_R),5)
102
CC = cc
103
BASIC_CFLAGS += -Kthread
104
- endif
104
+ endif
105
NEEDS_SOCKET = YesPlease
106
NEEDS_NSL = YesPlease
107
NEEDS_SSL_WITH_CRYPTO = YesPlease
124
# - MacOS 10.0.* and MacOS 10.1.0 = Darwin 1.*
125
# - MacOS 10.x.* = Darwin (x+4).* for (1 <= x)
126
# i.e. "begins with [15678] and a dot" means "10.4.* or older".
127
- ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
127
+ ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
128
OLD_ICONV = UnfortunatelyYes
129
NO_APPLE_COMMON_CRYPTO = YesPlease
130
- endif
131
- ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
130
+ endif
131
+ ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
132
NO_STRLCPY = YesPlease
133
- endif
134
- ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1)
133
+ endif
134
+ ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1)
135
HAVE_GETDELIM = YesPlease
136
- endif
137
- ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 20 && echo 1),1)
136
+ endif
137
+ ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 20 && echo 1),1)
138
OPEN_RETURNS_EINTR = UnfortunatelyYes
139
- endif
139
+ endif
140
NO_MEMMEM = YesPlease
141
USE_ST_TIMESPEC = YesPlease
142
HAVE_DEV_TTY = YesPlease
152
# Workaround for `gettext` being keg-only and not even being linked via
153
# `brew link --force gettext`, should be obsolete as of
154
# https://github.com/Homebrew/homebrew-core/pull/53489
155
- ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y)
155
+ ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y)
156
BASIC_CFLAGS += -I/usr/local/include -I/usr/local/opt/gettext/include
157
BASIC_LDFLAGS += -L/usr/local/lib -L/usr/local/opt/gettext/lib
158
- ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo y),y)
158
+ ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo y),y)
159
MSGFMT = /usr/local/opt/gettext/bin/msgfmt
160
- endif
160
+ endif
161
# On newer ARM-based machines the default installation path has changed to
162
# /opt/homebrew. Include it in our search paths so that the user does not
163
# have to configure this manually.
165
# Note that we do not employ the same workaround as above where we manually
166
# add gettext. The issue was fixed more than three years ago by now, and at
167
# that point there haven't been any ARM-based Macs yet.
168
- else ifeq ($(shell test -d /opt/homebrew/ && echo y),y)
168
+ else ifeq ($(shell test -d /opt/homebrew/ && echo y),y)
169
BASIC_CFLAGS += -I/opt/homebrew/include
170
BASIC_LDFLAGS += -L/opt/homebrew/lib
171
- ifeq ($(shell test -x /opt/homebrew/bin/msgfmt && echo y),y)
171
+ ifeq ($(shell test -x /opt/homebrew/bin/msgfmt && echo y),y)
172
MSGFMT = /opt/homebrew/bin/msgfmt
173
- endif
174
- endif
173
+ endif
174
+ endif
175
176
# The builtin FSMonitor on MacOS builds upon Simple-IPC. Both require
177
# Unix domain sockets and PThreads.
178
- ifndef NO_PTHREADS
179
- ifndef NO_UNIX_SOCKETS
178
+ ifndef NO_PTHREADS
179
+ ifndef NO_UNIX_SOCKETS
180
FSMONITOR_DAEMON_BACKEND = darwin
181
FSMONITOR_OS_SETTINGS = darwin
182
- endif
183
- endif
182
+ endif
183
+ endif
184
185
BASIC_LDFLAGS += -framework CoreServices
186
endif
196
NO_REGEX = YesPlease
197
NO_MSGFMT_EXTENDED_OPTIONS = YesPlease
198
HAVE_DEV_TTY = YesPlease
199
- ifeq ($(uname_R),5.6)
199
+ ifeq ($(uname_R),5.6)
200
SOCKLEN_T = int
201
NO_HSTRERROR = YesPlease
202
NO_IPV6 = YesPlease
206
NO_STRLCPY = YesPlease
207
NO_STRTOUMAX = YesPlease
208
GIT_TEST_CMP = cmp
209
- endif
210
- ifeq ($(uname_R),5.7)
209
+ endif
210
+ ifeq ($(uname_R),5.7)
211
NEEDS_RESOLV = YesPlease
212
NO_IPV6 = YesPlease
213
NO_SOCKADDR_STORAGE = YesPlease
216
NO_STRLCPY = YesPlease
217
NO_STRTOUMAX = YesPlease
218
GIT_TEST_CMP = cmp
219
- endif
220
- ifeq ($(uname_R),5.8)
219
+ endif
220
+ ifeq ($(uname_R),5.8)
221
NO_UNSETENV = YesPlease
222
NO_SETENV = YesPlease
223
NO_STRTOUMAX = YesPlease
224
GIT_TEST_CMP = cmp
225
- endif
226
- ifeq ($(uname_R),5.9)
225
+ endif
226
+ ifeq ($(uname_R),5.9)
227
NO_UNSETENV = YesPlease
228
NO_SETENV = YesPlease
229
NO_STRTOUMAX = YesPlease
230
GIT_TEST_CMP = cmp
231
- endif
231
+ endif
232
INSTALL = /usr/ucb/install
233
TAR = gtar
234
BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__
235
endif
236
ifeq ($(uname_O),Cygwin)
237
- ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
237
+ ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
238
NO_D_TYPE_IN_DIRENT = YesPlease
239
NO_STRCASESTR = YesPlease
240
NO_MEMMEM = YesPlease
245
# On some boxes NO_MMAP is needed, and not so elsewhere.
246
# Try commenting this out if you suspect MMAP is more efficient
247
NO_MMAP = YesPlease
248
- else
248
+ else
249
NO_REGEX = UnfortunatelyYes
250
- endif
250
+ endif
251
HAVE_ALLOCA_H = YesPlease
252
NEEDS_LIBICONV = YesPlease
253
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
263
NEEDS_LIBICONV = YesPlease
264
# Versions up to 10.1 require OLD_ICONV; 10.2 and beyond don't.
265
# A typical version string looks like "10.2-RELEASE".
266
- ifeq ($(shell expr "$(uname_R)" : '[1-9]\.'),2)
266
+ ifeq ($(shell expr "$(uname_R)" : '[1-9]\.'),2)
267
OLD_ICONV = YesPlease
268
- endif
269
- ifeq ($(firstword $(subst -, ,$(uname_R))),10.0)
268
+ endif
269
+ ifeq ($(firstword $(subst -, ,$(uname_R))),10.0)
270
OLD_ICONV = YesPlease
271
- endif
272
- ifeq ($(firstword $(subst -, ,$(uname_R))),10.1)
271
+ endif
272
+ ifeq ($(firstword $(subst -, ,$(uname_R))),10.1)
273
OLD_ICONV = YesPlease
274
- endif
274
+ endif
275
NO_MEMMEM = YesPlease
276
BASIC_CFLAGS += -I/usr/local/include
277
BASIC_LDFLAGS += -L/usr/local/lib
278
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
279
USE_ST_TIMESPEC = YesPlease
280
- ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
280
+ ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
281
PTHREAD_LIBS = -pthread
282
NO_UINTMAX_T = YesPlease
283
NO_STRTOUMAX = YesPlease
284
- endif
284
+ endif
285
PYTHON_PATH = /usr/local/bin/python
286
PERL_PATH = /usr/local/bin/perl
287
HAVE_PATHS_H = YesPlease
317
CSPRNG_METHOD = arc4random
318
endif
319
ifeq ($(uname_S),NetBSD)
320
- ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
320
+ ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
321
NEEDS_LIBICONV = YesPlease
322
- endif
322
+ endif
323
BASIC_CFLAGS += -I/usr/pkg/include
324
BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
325
USE_ST_TIMESPEC = YesPlease
343
BASIC_CFLAGS += -D_LARGE_FILES
344
FILENO_IS_A_MACRO = UnfortunatelyYes
345
NEED_ACCESS_ROOT_HANDLER = UnfortunatelyYes
346
- ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
346
+ ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
347
NO_PTHREADS = YesPlease
348
- else
348
+ else
349
PTHREAD_LIBS = -lpthread
350
- endif
351
- ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3)
350
+ endif
351
+ ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3)
352
INLINE = ''
353
- endif
353
+ endif
354
GIT_TEST_CMP = cmp
355
endif
356
ifeq ($(uname_S),GNU)
410
NO_SYS_SELECT_H = YesPlease
411
SNPRINTF_RETURNS_BOGUS = YesPlease
412
NO_NSEC = YesPlease
413
- ifeq ($(uname_R),B.11.00)
413
+ ifeq ($(uname_R),B.11.00)
414
NO_INET_NTOP = YesPlease
415
NO_INET_PTON = YesPlease
416
- endif
417
- ifeq ($(uname_R),B.10.20)
416
+ endif
417
+ ifeq ($(uname_R),B.10.20)
418
# Override HP-UX 11.x setting:
419
INLINE =
420
SOCKLEN_T = size_t
421
NO_PREAD = YesPlease
422
NO_INET_NTOP = YesPlease
423
NO_INET_PTON = YesPlease
424
- endif
424
+ endif
425
GIT_TEST_CMP = cmp
426
endif
427
ifeq ($(uname_S),Windows)
428
GIT_VERSION := $(GIT_VERSION).MSVC
429
pathsep = ;
430
# Assume that this is built in Git for Windows' SDK
431
- ifeq (MINGW32,$(MSYSTEM))
431
+ ifeq (MINGW32,$(MSYSTEM))
432
prefix = /mingw32
433
- else
433
+ else
434
prefix = /mingw64
435
- endif
435
+ endif
436
# Prepend MSVC 64-bit tool-chain to PATH.
437
#
438
# A regular Git Bash *does not* have cl.exe in its $PATH. As there is a
550
NO_MKDTEMP = YesPlease
551
NO_STRTOUMAX = YesPlease
552
NO_NSEC = YesPlease
553
- ifeq ($(uname_R),3.5)
553
+ ifeq ($(uname_R),3.5)
554
NO_INET_NTOP = YesPlease
555
NO_INET_PTON = YesPlease
556
NO_SOCKADDR_STORAGE = YesPlease
557
- endif
558
- ifeq ($(uname_R),5.2)
557
+ endif
558
+ ifeq ($(uname_R),5.2)
559
NO_INET_NTOP = YesPlease
560
NO_INET_PTON = YesPlease
561
NO_SOCKADDR_STORAGE = YesPlease
562
- endif
562
+ endif
563
endif
564
ifeq ($(uname_S),Minix)
565
NO_IPV6 = YesPlease
579
# still not compile in c89 mode, due to non-const array initializations.
580
CC = cc -c99
581
# Build down-rev compatible objects that don't use our new getopt_long.
582
- ifeq ($(uname_R).$(uname_V),J06.21)
582
+ ifeq ($(uname_R).$(uname_V),J06.21)
583
CC += -WRVU=J06.20
584
- endif
585
- ifeq ($(uname_R).$(uname_V),L17.02)
584
+ endif
585
+ ifeq ($(uname_R).$(uname_V),L17.02)
586
CC += -WRVU=L16.05
587
- endif
587
+ endif
588
# Disable all optimization, seems to result in bad code, with -O or -O2
589
# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects
590
# abends on "git push". Needs more investigation.
639
SHELL_PATH = /usr/coreutils/bin/bash
640
endif
641
ifeq ($(uname_S),MINGW)
642
- ifeq ($(shell expr "$(uname_R)" : '1\.'),2)
642
+ ifeq ($(shell expr "$(uname_R)" : '1\.'),2)
643
$(error "Building with MSys is no longer supported")
644
- endif
644
+ endif
645
pathsep = ;
646
HAVE_ALLOCA_H = YesPlease
647
NO_PREAD = YesPlease
700
# Enable DEP
701
BASIC_LDFLAGS += -Wl,--nxcompat
702
# Enable ASLR (unless debugging)
703
- ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
703
+ ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
704
BASIC_LDFLAGS += -Wl,--dynamicbase
705
- endif
706
- ifeq (MINGW32,$(MSYSTEM))
705
+ endif
706
+ ifeq (MINGW32,$(MSYSTEM))
707
prefix = /mingw32
708
HOST_CPU = i686
709
BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
710
- endif
711
- ifeq (MINGW64,$(MSYSTEM))
710
+ endif
711
+ ifeq (MINGW64,$(MSYSTEM))
712
prefix = /mingw64
713
HOST_CPU = x86_64
714
BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
715
- else
715
+ else
716
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
717
BASIC_LDFLAGS += -Wl,--large-address-aware
718
- endif
718
+ endif
719
CC = gcc
720
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
721
-fstack-protector-strong
727
USE_GETTEXT_SCHEME = fallthrough
728
USE_LIBPCRE = YesPlease
729
USE_NED_ALLOCATOR = YesPlease
730
- ifeq (/mingw64,$(subst 32,64,$(prefix)))
730
+ ifeq (/mingw64,$(subst 32,64,$(prefix)))
731
# Move system config into top-level /etc/
732
ETC_GITCONFIG = ../etc/gitconfig
733
ETC_GITATTRIBUTES = ../etc/gitattributes
734
- endif
734
+ endif
735
endif
736
ifeq ($(uname_S),QNX)
737
COMPAT_CFLAGS += -DSA_RESTART=0