Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 1 | # Platform specific Makefile tweaks based on uname detection |
| 2 | |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 3 | # Define NO_SAFESEH if you need MSVC/Visual Studio to ignore the lack of |
| 4 | # Microsoft's Safe Exception Handling in libraries (such as zlib). |
| 5 | # Typically required for VS2013+/32-bit compilation on Vista+ versions. |
| 6 | |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 7 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
| 8 | uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') |
| 9 | uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') |
| 10 | uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') |
| 11 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') |
| 12 | uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') |
| 13 | |
Carlo Marcelo Arenas Belón | ebd2e4a | 2021-09-28 20:19:40 -0700 | [diff] [blame] | 14 | ifneq ($(findstring MINGW,$(uname_S)),) |
| 15 | uname_S := MINGW |
| 16 | endif |
| 17 | |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 18 | ifdef MSVC |
| 19 | # avoid the MingW and Cygwin configuration sections |
| 20 | uname_S := Windows |
| 21 | uname_O := Windows |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 22 | |
| 23 | # Generate and include makefile variables that point to the |
| 24 | # currently installed set of MSVC command line tools. |
| 25 | compat/vcbuild/MSVC-DEFS-GEN: compat/vcbuild/find_vs_env.bat |
| 26 | @"$<" | tr '\\' / >"$@" |
| 27 | include compat/vcbuild/MSVC-DEFS-GEN |
| 28 | |
| 29 | # See if vcpkg and the vcpkg-build versions of the third-party |
| 30 | # libraries that we use are installed. We include the result |
| 31 | # to get $(vcpkg_*) variables defined for the Makefile. |
Johannes Schindelin | 976aaed | 2019-07-29 13:08:12 -0700 | [diff] [blame] | 32 | ifeq (,$(SKIP_VCPKG)) |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 33 | compat/vcbuild/VCPKG-DEFS: compat/vcbuild/vcpkg_install.bat |
| 34 | @"$<" |
| 35 | include compat/vcbuild/VCPKG-DEFS |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 36 | endif |
Johannes Schindelin | 976aaed | 2019-07-29 13:08:12 -0700 | [diff] [blame] | 37 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 38 | |
| 39 | # We choose to avoid "if .. else if .. else .. endif endif" |
| 40 | # because maintaining the nesting to match is a pain. If |
| 41 | # we had "elif" things would have been much nicer... |
| 42 | |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 43 | ifeq ($(uname_S),OSF1) |
| 44 | # Need this for u_short definitions et al |
| 45 | BASIC_CFLAGS += -D_OSF_SOURCE |
| 46 | SOCKLEN_T = int |
| 47 | NO_STRTOULL = YesPlease |
| 48 | NO_NSEC = YesPlease |
| 49 | endif |
| 50 | ifeq ($(uname_S),Linux) |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 51 | HAVE_ALLOCA_H = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 52 | NO_STRLCPY = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 53 | HAVE_PATHS_H = YesPlease |
| 54 | LIBC_CONTAINS_LIBINTL = YesPlease |
| 55 | HAVE_DEV_TTY = YesPlease |
Karsten Blees | 148d677 | 2014-07-12 02:05:42 +0200 | [diff] [blame] | 56 | HAVE_CLOCK_GETTIME = YesPlease |
Reuben Hawkins | a6c3c63 | 2015-01-08 12:00:56 -0800 | [diff] [blame] | 57 | HAVE_CLOCK_MONOTONIC = YesPlease |
Eric Wong | 52fcec7 | 2016-07-10 22:16:44 +0000 | [diff] [blame] | 58 | # -lrt is needed for clock_gettime on glibc <= 2.16 |
| 59 | NEEDS_LIBRT = YesPlease |
Neeraj Singh | abf38ab | 2022-03-10 22:43:20 +0000 | [diff] [blame] | 60 | HAVE_SYNC_FILE_RANGE = YesPlease |
Jeff King | 0cc30e0 | 2015-04-16 05:01:38 -0400 | [diff] [blame] | 61 | HAVE_GETDELIM = YesPlease |
Nguyễn Thái Ngọc Duy | e2d90fd | 2017-05-03 17:16:48 +0700 | [diff] [blame] | 62 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
Nguyễn Thái Ngọc Duy | 9806f5a | 2018-04-15 17:36:17 +0200 | [diff] [blame] | 63 | BASIC_CFLAGS += -DHAVE_SYSINFO |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 64 | PROCFS_EXECUTABLE_PATH = /proc/self/exe |
Emily Shaffer | 2f732bf | 2021-07-21 18:27:07 -0700 | [diff] [blame] | 65 | HAVE_PLATFORM_PROCINFO = YesPlease |
| 66 | COMPAT_OBJS += compat/linux/procinfo.o |
David Aguilar | ffb9f29 | 2022-01-15 18:05:20 -0800 | [diff] [blame] | 67 | # centos7/rhel7 provides gcc 4.8.5 and zlib 1.2.7. |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 68 | ifneq ($(findstring .el7.,$(uname_R)),) |
David Aguilar | ffb9f29 | 2022-01-15 18:05:20 -0800 | [diff] [blame] | 69 | BASIC_CFLAGS += -std=c99 |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 70 | endif |
Josh Steadmon | 8427b7e | 2024-04-24 11:14:42 -0700 | [diff] [blame] | 71 | LINK_FUZZ_PROGRAMS = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 72 | endif |
| 73 | ifeq ($(uname_S),GNU/kFreeBSD) |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 74 | HAVE_ALLOCA_H = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 75 | NO_STRLCPY = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 76 | HAVE_PATHS_H = YesPlease |
| 77 | DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease |
| 78 | LIBC_CONTAINS_LIBINTL = YesPlease |
Nguyễn Thái Ngọc Duy | e2d90fd | 2017-05-03 17:16:48 +0700 | [diff] [blame] | 79 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 80 | endif |
| 81 | ifeq ($(uname_S),UnixWare) |
| 82 | CC = cc |
| 83 | NEEDS_SOCKET = YesPlease |
| 84 | NEEDS_NSL = YesPlease |
| 85 | NEEDS_SSL_WITH_CRYPTO = YesPlease |
| 86 | NEEDS_LIBICONV = YesPlease |
| 87 | SHELL_PATH = /usr/local/bin/bash |
| 88 | NO_IPV6 = YesPlease |
| 89 | NO_HSTRERROR = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 90 | BASIC_CFLAGS += -Kthread |
| 91 | BASIC_CFLAGS += -I/usr/local/include |
| 92 | BASIC_LDFLAGS += -L/usr/local/lib |
| 93 | INSTALL = ginstall |
| 94 | TAR = gtar |
| 95 | NO_STRCASESTR = YesPlease |
| 96 | NO_MEMMEM = YesPlease |
| 97 | endif |
| 98 | ifeq ($(uname_S),SCO_SV) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 99 | ifeq ($(uname_R),3.2) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 100 | CFLAGS = -O2 |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 101 | endif |
| 102 | ifeq ($(uname_R),5) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 103 | CC = cc |
| 104 | BASIC_CFLAGS += -Kthread |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 105 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 106 | NEEDS_SOCKET = YesPlease |
| 107 | NEEDS_NSL = YesPlease |
| 108 | NEEDS_SSL_WITH_CRYPTO = YesPlease |
| 109 | NEEDS_LIBICONV = YesPlease |
| 110 | SHELL_PATH = /usr/bin/bash |
| 111 | NO_IPV6 = YesPlease |
| 112 | NO_HSTRERROR = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 113 | BASIC_CFLAGS += -I/usr/local/include |
| 114 | BASIC_LDFLAGS += -L/usr/local/lib |
| 115 | NO_STRCASESTR = YesPlease |
| 116 | NO_MEMMEM = YesPlease |
| 117 | INSTALL = ginstall |
| 118 | TAR = gtar |
| 119 | endif |
| 120 | ifeq ($(uname_S),Darwin) |
| 121 | NEEDS_CRYPTO_WITH_SSL = YesPlease |
| 122 | NEEDS_SSL_WITH_CRYPTO = YesPlease |
| 123 | NEEDS_LIBICONV = YesPlease |
Junio C Hamano | 9eeff2f | 2014-08-15 10:02:46 -0700 | [diff] [blame] | 124 | # Note: $(uname_R) gives us the underlying Darwin version. |
| 125 | # - MacOS 10.0.* and MacOS 10.1.0 = Darwin 1.* |
| 126 | # - MacOS 10.x.* = Darwin (x+4).* for (1 <= x) |
| 127 | # i.e. "begins with [15678] and a dot" means "10.4.* or older". |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 128 | ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 129 | OLD_ICONV = UnfortunatelyYes |
Kyle J. McKay | 9c7a0be | 2014-08-15 00:46:11 -0700 | [diff] [blame] | 130 | NO_APPLE_COMMON_CRYPTO = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 131 | endif |
| 132 | ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 133 | NO_STRLCPY = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 134 | endif |
| 135 | ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1) |
Eric Sunshine | 4e36878 | 2015-06-02 17:15:43 -0400 | [diff] [blame] | 136 | HAVE_GETDELIM = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 137 | endif |
| 138 | ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 20 && echo 1),1) |
Jeff King | bbabaad | 2021-03-01 04:29:47 -0500 | [diff] [blame] | 139 | OPEN_RETURNS_EINTR = UnfortunatelyYes |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 140 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 141 | NO_MEMMEM = YesPlease |
| 142 | USE_ST_TIMESPEC = YesPlease |
| 143 | HAVE_DEV_TTY = YesPlease |
| 144 | COMPAT_OBJS += compat/precompose_utf8.o |
| 145 | BASIC_CFLAGS += -DPRECOMPOSE_UNICODE |
Jeff King | a42643a | 2014-12-15 18:15:20 -0500 | [diff] [blame] | 146 | BASIC_CFLAGS += -DPROTECT_HFS_DEFAULT=1 |
Kyle J. McKay | 9529080 | 2015-03-07 23:14:36 -0800 | [diff] [blame] | 147 | HAVE_BSD_SYSCTL = YesPlease |
Junio C Hamano | 8e178ec | 2017-05-09 21:44:33 -0700 | [diff] [blame] | 148 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 149 | HAVE_NS_GET_EXECUTABLE_PATH = YesPlease |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 150 | CSPRNG_METHOD = arc4random |
René Scharfe | 54463d3 | 2023-01-08 01:42:04 +0100 | [diff] [blame] | 151 | USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS = YesPlease |
Johannes Schindelin | a0b3108 | 2020-04-26 22:09:32 +0200 | [diff] [blame] | 152 | |
| 153 | # Workaround for `gettext` being keg-only and not even being linked via |
| 154 | # `brew link --force gettext`, should be obsolete as of |
| 155 | # https://github.com/Homebrew/homebrew-core/pull/53489 |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 156 | ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y) |
Johannes Schindelin | a0b3108 | 2020-04-26 22:09:32 +0200 | [diff] [blame] | 157 | BASIC_CFLAGS += -I/usr/local/include -I/usr/local/opt/gettext/include |
| 158 | BASIC_LDFLAGS += -L/usr/local/lib -L/usr/local/opt/gettext/lib |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 159 | ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo y),y) |
Johannes Schindelin | a0b3108 | 2020-04-26 22:09:32 +0200 | [diff] [blame] | 160 | MSGFMT = /usr/local/opt/gettext/bin/msgfmt |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 161 | endif |
Patrick Steinhardt | d52b426 | 2024-01-18 11:22:49 +0100 | [diff] [blame] | 162 | # On newer ARM-based machines the default installation path has changed to |
| 163 | # /opt/homebrew. Include it in our search paths so that the user does not |
| 164 | # have to configure this manually. |
| 165 | # |
| 166 | # Note that we do not employ the same workaround as above where we manually |
| 167 | # add gettext. The issue was fixed more than three years ago by now, and at |
| 168 | # that point there haven't been any ARM-based Macs yet. |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 169 | else ifeq ($(shell test -d /opt/homebrew/ && echo y),y) |
Patrick Steinhardt | d52b426 | 2024-01-18 11:22:49 +0100 | [diff] [blame] | 170 | BASIC_CFLAGS += -I/opt/homebrew/include |
| 171 | BASIC_LDFLAGS += -L/opt/homebrew/lib |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 172 | ifeq ($(shell test -x /opt/homebrew/bin/msgfmt && echo y),y) |
Patrick Steinhardt | d52b426 | 2024-01-18 11:22:49 +0100 | [diff] [blame] | 173 | MSGFMT = /opt/homebrew/bin/msgfmt |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 174 | endif |
| 175 | endif |
Jeff Hostetler | f67df25 | 2022-03-25 18:02:52 +0000 | [diff] [blame] | 176 | |
| 177 | # The builtin FSMonitor on MacOS builds upon Simple-IPC. Both require |
| 178 | # Unix domain sockets and PThreads. |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 179 | ifndef NO_PTHREADS |
| 180 | ifndef NO_UNIX_SOCKETS |
Jeff Hostetler | f67df25 | 2022-03-25 18:02:52 +0000 | [diff] [blame] | 181 | FSMONITOR_DAEMON_BACKEND = darwin |
Jeff Hostetler | a85ad67 | 2022-05-26 21:47:01 +0000 | [diff] [blame] | 182 | FSMONITOR_OS_SETTINGS = darwin |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 183 | endif |
| 184 | endif |
Jeff Hostetler | f67df25 | 2022-03-25 18:02:52 +0000 | [diff] [blame] | 185 | |
| 186 | BASIC_LDFLAGS += -framework CoreServices |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 187 | endif |
| 188 | ifeq ($(uname_S),SunOS) |
| 189 | NEEDS_SOCKET = YesPlease |
| 190 | NEEDS_NSL = YesPlease |
| 191 | SHELL_PATH = /bin/bash |
| 192 | SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 193 | HAVE_ALLOCA_H = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 194 | NO_STRCASESTR = YesPlease |
| 195 | NO_MEMMEM = YesPlease |
| 196 | NO_MKDTEMP = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 197 | NO_REGEX = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 198 | NO_MSGFMT_EXTENDED_OPTIONS = YesPlease |
| 199 | HAVE_DEV_TTY = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 200 | ifeq ($(uname_R),5.6) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 201 | SOCKLEN_T = int |
| 202 | NO_HSTRERROR = YesPlease |
| 203 | NO_IPV6 = YesPlease |
| 204 | NO_SOCKADDR_STORAGE = YesPlease |
| 205 | NO_UNSETENV = YesPlease |
| 206 | NO_SETENV = YesPlease |
| 207 | NO_STRLCPY = YesPlease |
| 208 | NO_STRTOUMAX = YesPlease |
| 209 | GIT_TEST_CMP = cmp |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 210 | endif |
| 211 | ifeq ($(uname_R),5.7) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 212 | NEEDS_RESOLV = YesPlease |
| 213 | NO_IPV6 = YesPlease |
| 214 | NO_SOCKADDR_STORAGE = YesPlease |
| 215 | NO_UNSETENV = YesPlease |
| 216 | NO_SETENV = YesPlease |
| 217 | NO_STRLCPY = YesPlease |
| 218 | NO_STRTOUMAX = YesPlease |
| 219 | GIT_TEST_CMP = cmp |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 220 | endif |
| 221 | ifeq ($(uname_R),5.8) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 222 | NO_UNSETENV = YesPlease |
| 223 | NO_SETENV = YesPlease |
| 224 | NO_STRTOUMAX = YesPlease |
| 225 | GIT_TEST_CMP = cmp |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 226 | endif |
| 227 | ifeq ($(uname_R),5.9) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 228 | NO_UNSETENV = YesPlease |
| 229 | NO_SETENV = YesPlease |
| 230 | NO_STRTOUMAX = YesPlease |
| 231 | GIT_TEST_CMP = cmp |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 232 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 233 | INSTALL = /usr/ucb/install |
| 234 | TAR = gtar |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 235 | BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 236 | endif |
| 237 | ifeq ($(uname_O),Cygwin) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 238 | ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 239 | NO_D_TYPE_IN_DIRENT = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 240 | NO_STRCASESTR = YesPlease |
| 241 | NO_MEMMEM = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 242 | NO_SYMLINK_HEAD = YesPlease |
| 243 | NO_IPV6 = YesPlease |
| 244 | OLD_ICONV = UnfortunatelyYes |
Mark Levedahl | f593ef7 | 2013-07-19 19:08:30 -0400 | [diff] [blame] | 245 | # There are conflicting reports about this. |
| 246 | # On some boxes NO_MMAP is needed, and not so elsewhere. |
| 247 | # Try commenting this out if you suspect MMAP is more efficient |
| 248 | NO_MMAP = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 249 | else |
Mark Levedahl | 92f63d2 | 2013-07-19 19:08:28 -0400 | [diff] [blame] | 250 | NO_REGEX = UnfortunatelyYes |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 251 | endif |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 252 | HAVE_ALLOCA_H = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 253 | NEEDS_LIBICONV = YesPlease |
| 254 | NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 255 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 256 | X = .exe |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 257 | UNRELIABLE_FSTAT = UnfortunatelyYes |
Adam Dinwoodie | e53a64b | 2015-08-07 21:30:28 +0100 | [diff] [blame] | 258 | OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo |
Michael Haggerty | 5b63361 | 2017-09-25 10:00:10 +0200 | [diff] [blame] | 259 | MMAP_PREVENTS_DELETE = UnfortunatelyYes |
Torsten Bögershausen | 1cadad6 | 2018-12-15 05:33:30 +0100 | [diff] [blame] | 260 | COMPAT_OBJS += compat/win32/path-utils.o |
Ramsay Jones | a5956d6 | 2017-07-21 19:43:17 +0100 | [diff] [blame] | 261 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 262 | endif |
| 263 | ifeq ($(uname_S),FreeBSD) |
| 264 | NEEDS_LIBICONV = YesPlease |
Eric Sunshine | 6c6ce21 | 2018-08-31 04:33:42 -0400 | [diff] [blame] | 265 | # Versions up to 10.1 require OLD_ICONV; 10.2 and beyond don't. |
| 266 | # A typical version string looks like "10.2-RELEASE". |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 267 | ifeq ($(shell expr "$(uname_R)" : '[1-9]\.'),2) |
Eric Sunshine | 6c6ce21 | 2018-08-31 04:33:42 -0400 | [diff] [blame] | 268 | OLD_ICONV = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 269 | endif |
| 270 | ifeq ($(firstword $(subst -, ,$(uname_R))),10.0) |
Eric Sunshine | 6c6ce21 | 2018-08-31 04:33:42 -0400 | [diff] [blame] | 271 | OLD_ICONV = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 272 | endif |
| 273 | ifeq ($(firstword $(subst -, ,$(uname_R))),10.1) |
Eric Sunshine | 6c6ce21 | 2018-08-31 04:33:42 -0400 | [diff] [blame] | 274 | OLD_ICONV = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 275 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 276 | NO_MEMMEM = YesPlease |
| 277 | BASIC_CFLAGS += -I/usr/local/include |
| 278 | BASIC_LDFLAGS += -L/usr/local/lib |
| 279 | DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease |
| 280 | USE_ST_TIMESPEC = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 281 | ifeq ($(shell expr "$(uname_R)" : '4\.'),2) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 282 | PTHREAD_LIBS = -pthread |
| 283 | NO_UINTMAX_T = YesPlease |
| 284 | NO_STRTOUMAX = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 285 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 286 | PYTHON_PATH = /usr/local/bin/python |
Nguyễn Thái Ngọc Duy | 259f22a | 2016-07-25 18:21:25 +0200 | [diff] [blame] | 287 | PERL_PATH = /usr/local/bin/perl |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 288 | HAVE_PATHS_H = YesPlease |
Kyle J. McKay | 9529080 | 2015-03-07 23:14:36 -0800 | [diff] [blame] | 289 | HAVE_BSD_SYSCTL = YesPlease |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 290 | HAVE_BSD_KERN_PROC_SYSCTL = YesPlease |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 291 | CSPRNG_METHOD = arc4random |
Eric Wong | 995bc22 | 2016-08-04 11:40:25 +0000 | [diff] [blame] | 292 | PAGER_ENV = LESS=FRX LV=-c MORE=FRX |
Nguyễn Thái Ngọc Duy | e2d90fd | 2017-05-03 17:16:48 +0700 | [diff] [blame] | 293 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
Duy Nguyen | 18a4f6b | 2019-02-12 21:14:41 +0700 | [diff] [blame] | 294 | FILENO_IS_A_MACRO = UnfortunatelyYes |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 295 | endif |
| 296 | ifeq ($(uname_S),OpenBSD) |
| 297 | NO_STRCASESTR = YesPlease |
| 298 | NO_MEMMEM = YesPlease |
| 299 | USE_ST_TIMESPEC = YesPlease |
| 300 | NEEDS_LIBICONV = YesPlease |
| 301 | BASIC_CFLAGS += -I/usr/local/include |
| 302 | BASIC_LDFLAGS += -L/usr/local/lib |
| 303 | HAVE_PATHS_H = YesPlease |
Kyle J. McKay | 9529080 | 2015-03-07 23:14:36 -0800 | [diff] [blame] | 304 | HAVE_BSD_SYSCTL = YesPlease |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 305 | HAVE_BSD_KERN_PROC_SYSCTL = YesPlease |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 306 | CSPRNG_METHOD = arc4random |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 307 | PROCFS_EXECUTABLE_PATH = /proc/curproc/file |
Carlo Marcelo Arenas Belón | 4e3ecbd | 2018-12-01 18:43:20 -0800 | [diff] [blame] | 308 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
Duy Nguyen | 18a4f6b | 2019-02-12 21:14:41 +0700 | [diff] [blame] | 309 | FILENO_IS_A_MACRO = UnfortunatelyYes |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 310 | endif |
Benny Siegert | 92164af | 2013-12-31 14:36:45 +0000 | [diff] [blame] | 311 | ifeq ($(uname_S),MirBSD) |
| 312 | NO_STRCASESTR = YesPlease |
| 313 | NO_MEMMEM = YesPlease |
| 314 | USE_ST_TIMESPEC = YesPlease |
| 315 | NEEDS_LIBICONV = YesPlease |
| 316 | HAVE_PATHS_H = YesPlease |
Kyle J. McKay | 9529080 | 2015-03-07 23:14:36 -0800 | [diff] [blame] | 317 | HAVE_BSD_SYSCTL = YesPlease |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 318 | CSPRNG_METHOD = arc4random |
Benny Siegert | 92164af | 2013-12-31 14:36:45 +0000 | [diff] [blame] | 319 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 320 | ifeq ($(uname_S),NetBSD) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 321 | ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 322 | NEEDS_LIBICONV = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 323 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 324 | BASIC_CFLAGS += -I/usr/pkg/include |
| 325 | BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib |
| 326 | USE_ST_TIMESPEC = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 327 | HAVE_PATHS_H = YesPlease |
Kyle J. McKay | 9529080 | 2015-03-07 23:14:36 -0800 | [diff] [blame] | 328 | HAVE_BSD_SYSCTL = YesPlease |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 329 | HAVE_BSD_KERN_PROC_SYSCTL = YesPlease |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 330 | CSPRNG_METHOD = arc4random |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 331 | PROCFS_EXECUTABLE_PATH = /proc/curproc/exe |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 332 | endif |
| 333 | ifeq ($(uname_S),AIX) |
| 334 | DEFAULT_PAGER = more |
| 335 | NO_STRCASESTR = YesPlease |
| 336 | NO_MEMMEM = YesPlease |
| 337 | NO_MKDTEMP = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 338 | NO_STRLCPY = YesPlease |
| 339 | NO_NSEC = YesPlease |
Ævar Arnfjörð Bjarmason | 0e6d899 | 2017-05-03 13:54:30 +0000 | [diff] [blame] | 340 | NO_REGEX = NeedsStartEnd |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 341 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
| 342 | INTERNAL_QSORT = UnfortunatelyYes |
| 343 | NEEDS_LIBICONV = YesPlease |
| 344 | BASIC_CFLAGS += -D_LARGE_FILES |
Clément Chigot | ee662bf | 2019-04-18 08:55:09 +0000 | [diff] [blame] | 345 | FILENO_IS_A_MACRO = UnfortunatelyYes |
Clément Chigot | 400caaf | 2019-04-25 07:01:56 +0000 | [diff] [blame] | 346 | NEED_ACCESS_ROOT_HANDLER = UnfortunatelyYes |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 347 | ifeq ($(shell expr "$(uname_V)" : '[1234]'),1) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 348 | NO_PTHREADS = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 349 | else |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 350 | PTHREAD_LIBS = -lpthread |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 351 | endif |
| 352 | ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 353 | INLINE = '' |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 354 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 355 | GIT_TEST_CMP = cmp |
| 356 | endif |
| 357 | ifeq ($(uname_S),GNU) |
| 358 | # GNU/Hurd |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 359 | HAVE_ALLOCA_H = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 360 | NO_STRLCPY = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 361 | HAVE_PATHS_H = YesPlease |
| 362 | LIBC_CONTAINS_LIBINTL = YesPlease |
Jessica Clarke | 274a132 | 2020-04-22 16:33:47 +0100 | [diff] [blame] | 363 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 364 | endif |
| 365 | ifeq ($(uname_S),IRIX) |
| 366 | NO_SETENV = YesPlease |
| 367 | NO_UNSETENV = YesPlease |
| 368 | NO_STRCASESTR = YesPlease |
| 369 | NO_MEMMEM = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 370 | NO_MKDTEMP = YesPlease |
| 371 | # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads |
| 372 | # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set), |
| 373 | # git dies with a segmentation fault when trying to access the first |
| 374 | # entry of a reflog. The conservative choice is made to always set |
| 375 | # NO_MMAP. If you suspect that your compiler is not affected by this |
| 376 | # issue, comment out the NO_MMAP statement. |
| 377 | NO_MMAP = YesPlease |
| 378 | NO_REGEX = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 379 | SNPRINTF_RETURNS_BOGUS = YesPlease |
| 380 | SHELL_PATH = /usr/gnu/bin/bash |
| 381 | NEEDS_LIBGEN = YesPlease |
| 382 | endif |
| 383 | ifeq ($(uname_S),IRIX64) |
| 384 | NO_SETENV = YesPlease |
| 385 | NO_UNSETENV = YesPlease |
| 386 | NO_STRCASESTR = YesPlease |
| 387 | NO_MEMMEM = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 388 | NO_MKDTEMP = YesPlease |
| 389 | # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads |
| 390 | # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set), |
| 391 | # git dies with a segmentation fault when trying to access the first |
| 392 | # entry of a reflog. The conservative choice is made to always set |
| 393 | # NO_MMAP. If you suspect that your compiler is not affected by this |
| 394 | # issue, comment out the NO_MMAP statement. |
| 395 | NO_MMAP = YesPlease |
| 396 | NO_REGEX = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 397 | SNPRINTF_RETURNS_BOGUS = YesPlease |
| 398 | SHELL_PATH = /usr/gnu/bin/bash |
| 399 | NEEDS_LIBGEN = YesPlease |
| 400 | endif |
| 401 | ifeq ($(uname_S),HP-UX) |
| 402 | INLINE = __inline |
| 403 | NO_IPV6 = YesPlease |
| 404 | NO_SETENV = YesPlease |
| 405 | NO_STRCASESTR = YesPlease |
| 406 | NO_MEMMEM = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 407 | NO_STRLCPY = YesPlease |
| 408 | NO_MKDTEMP = YesPlease |
| 409 | NO_UNSETENV = YesPlease |
| 410 | NO_HSTRERROR = YesPlease |
| 411 | NO_SYS_SELECT_H = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 412 | SNPRINTF_RETURNS_BOGUS = YesPlease |
| 413 | NO_NSEC = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 414 | ifeq ($(uname_R),B.11.00) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 415 | NO_INET_NTOP = YesPlease |
| 416 | NO_INET_PTON = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 417 | endif |
| 418 | ifeq ($(uname_R),B.10.20) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 419 | # Override HP-UX 11.x setting: |
| 420 | INLINE = |
| 421 | SOCKLEN_T = size_t |
| 422 | NO_PREAD = YesPlease |
| 423 | NO_INET_NTOP = YesPlease |
| 424 | NO_INET_PTON = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 425 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 426 | GIT_TEST_CMP = cmp |
| 427 | endif |
| 428 | ifeq ($(uname_S),Windows) |
| 429 | GIT_VERSION := $(GIT_VERSION).MSVC |
| 430 | pathsep = ; |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 431 | # Assume that this is built in Git for Windows' SDK |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 432 | ifeq (MINGW32,$(MSYSTEM)) |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 433 | prefix = /mingw32 |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 434 | else |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 435 | prefix = /mingw64 |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 436 | endif |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 437 | # Prepend MSVC 64-bit tool-chain to PATH. |
| 438 | # |
| 439 | # A regular Git Bash *does not* have cl.exe in its $PATH. As there is a |
| 440 | # link.exe next to, and required by, cl.exe, we have to prepend this |
| 441 | # onto the existing $PATH. |
| 442 | # |
| 443 | SANE_TOOL_PATH ?= $(msvc_bin_dir_msys) |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 444 | HAVE_ALLOCA_H = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 445 | NO_PREAD = YesPlease |
| 446 | NEEDS_CRYPTO_WITH_SSL = YesPlease |
| 447 | NO_LIBGEN_H = YesPlease |
| 448 | NO_POLL = YesPlease |
| 449 | NO_SYMLINK_HEAD = YesPlease |
| 450 | NO_IPV6 = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 451 | NO_SETENV = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 452 | NO_STRCASESTR = YesPlease |
| 453 | NO_STRLCPY = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 454 | NO_MEMMEM = YesPlease |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 455 | NEEDS_LIBICONV = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 456 | NO_STRTOUMAX = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 457 | NO_MKDTEMP = YesPlease |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 458 | NO_INTTYPES_H = YesPlease |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 459 | CSPRNG_METHOD = rtlgenrandom |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 460 | # VS2015 with UCRT claims that snprintf and friends are C99 compliant, |
| 461 | # so we don't need this: |
| 462 | # |
| 463 | # SNPRINTF_RETURNS_BOGUS = YesPlease |
Jeff Hostetler | 62c7367 | 2022-03-25 18:02:51 +0000 | [diff] [blame] | 464 | |
| 465 | # The builtin FSMonitor requires Named Pipes and Threads on Windows. |
| 466 | # These are always available, so we do not have to conditionally |
| 467 | # support it. |
| 468 | FSMONITOR_DAEMON_BACKEND = win32 |
Jeff Hostetler | d33c804 | 2022-05-26 21:46:59 +0000 | [diff] [blame] | 469 | FSMONITOR_OS_SETTINGS = win32 |
| 470 | |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 471 | NO_SVN_TESTS = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 472 | RUNTIME_PREFIX = YesPlease |
Johannes Schindelin | 86e2545 | 2018-04-10 11:05:46 -0400 | [diff] [blame] | 473 | HAVE_WPGMPTR = YesWeDo |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 474 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease |
Jeff Hostetler | 59c7b88 | 2021-03-15 21:08:23 +0000 | [diff] [blame] | 475 | USE_WIN32_IPC = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 476 | USE_WIN32_MMAP = YesPlease |
Michael Haggerty | 5b63361 | 2017-09-25 10:00:10 +0200 | [diff] [blame] | 477 | MMAP_PREVENTS_DELETE = UnfortunatelyYes |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 478 | # USE_NED_ALLOCATOR = YesPlease |
| 479 | UNRELIABLE_FSTAT = UnfortunatelyYes |
| 480 | OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo |
| 481 | NO_REGEX = YesPlease |
Karsten Blees | bad866a | 2013-09-11 01:21:53 +0200 | [diff] [blame] | 482 | NO_GETTEXT = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 483 | NO_PYTHON = YesPlease |
Ramsay Jones | e0492c5 | 2013-01-31 18:33:57 +0000 | [diff] [blame] | 484 | ETAGS_TARGET = ETAGS |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 485 | NO_POSIX_GOODIES = UnfortunatelyYes |
| 486 | NATIVE_CRLF = YesPlease |
| 487 | DEFAULT_HELP_FORMAT = html |
Johannes Schindelin | fb5e337 | 2021-06-22 10:46:46 +0000 | [diff] [blame] | 488 | ifeq (/mingw64,$(subst 32,64,$(prefix))) |
| 489 | # Move system config into top-level /etc/ |
| 490 | ETC_GITCONFIG = ../etc/gitconfig |
| 491 | ETC_GITATTRIBUTES = ../etc/gitattributes |
| 492 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 493 | |
| 494 | CC = compat/vcbuild/scripts/clink.pl |
| 495 | AR = compat/vcbuild/scripts/lib.pl |
| 496 | CFLAGS = |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 497 | BASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 498 | COMPAT_OBJS = compat/msvc.o compat/winansi.o \ |
Neeraj Singh | abf38ab | 2022-03-10 22:43:20 +0000 | [diff] [blame] | 499 | compat/win32/flush.o \ |
Sven Strickroth | 22c3634 | 2019-04-08 13:26:16 +0200 | [diff] [blame] | 500 | compat/win32/path-utils.o \ |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 501 | compat/win32/pthread.o compat/win32/syslog.o \ |
Jeff Hostetler | 353d3d7 | 2019-02-22 14:25:02 -0800 | [diff] [blame] | 502 | compat/win32/trace2_win32_process_info.o \ |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 503 | compat/win32/dirent.o |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 504 | COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\" |
Johannes Schindelin | 396ff75 | 2019-06-19 14:05:59 -0700 | [diff] [blame] | 505 | BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -ENTRY:wmainCRTStartup -SUBSYSTEM:CONSOLE |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 506 | # invalidcontinue.obj allows Git's source code to close the same file |
| 507 | # handle twice, or to access the osfhandle of an already-closed stdout |
| 508 | # See https://msdn.microsoft.com/en-us/library/ms235330.aspx |
| 509 | EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj kernel32.lib ntdll.lib |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 510 | PTHREAD_LIBS = |
| 511 | lib = |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 512 | BASIC_CFLAGS += $(vcpkg_inc) $(sdk_includes) $(msvc_includes) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 513 | ifndef DEBUG |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 514 | BASIC_CFLAGS += $(vcpkg_rel_lib) |
| 515 | else |
| 516 | BASIC_CFLAGS += $(vcpkg_dbg_lib) |
| 517 | endif |
| 518 | BASIC_CFLAGS += $(sdk_libs) $(msvc_libs) |
| 519 | |
Jeff Hostetler | 556702f | 2019-06-25 07:49:40 -0700 | [diff] [blame] | 520 | ifneq ($(USE_MSVC_CRTDBG),) |
| 521 | # Optionally enable memory leak reporting. |
| 522 | BASIC_CFLAGS += -DUSE_MSVC_CRTDBG |
| 523 | endif |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 524 | # Always give "-Zi" to the compiler and "-debug" to linker (even in |
| 525 | # release mode) to force a PDB to be generated (like RelWithDebInfo). |
| 526 | BASIC_CFLAGS += -Zi |
| 527 | BASIC_LDFLAGS += -debug -Zf |
| 528 | |
| 529 | ifdef NO_SAFESEH |
| 530 | LDFLAGS += -SAFESEH:NO |
| 531 | endif |
| 532 | |
| 533 | ifndef DEBUG |
| 534 | BASIC_CFLAGS += -GL -Gy -O2 -Oy- -MD -DNDEBUG |
| 535 | BASIC_LDFLAGS += -release -LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:CV,FIXUP |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 536 | AR += -LTCG |
| 537 | else |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 538 | BASIC_CFLAGS += -MDd -DDEBUG -D_DEBUG |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 539 | endif |
| 540 | X = .exe |
Johannes Schindelin | 963e154 | 2019-06-19 14:06:00 -0700 | [diff] [blame] | 541 | |
Johannes Schindelin | 4b8a271 | 2023-08-09 16:54:46 +0000 | [diff] [blame] | 542 | EXTRA_PROGRAMS += headless-git$X |
| 543 | |
Johannes Schindelin | 963e154 | 2019-06-19 14:06:00 -0700 | [diff] [blame] | 544 | compat/msvc.o: compat/msvc.c compat/mingw.c GIT-CFLAGS |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 545 | endif |
| 546 | ifeq ($(uname_S),Interix) |
| 547 | NO_INITGROUPS = YesPlease |
| 548 | NO_IPV6 = YesPlease |
| 549 | NO_MEMMEM = YesPlease |
| 550 | NO_MKDTEMP = YesPlease |
| 551 | NO_STRTOUMAX = YesPlease |
| 552 | NO_NSEC = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 553 | ifeq ($(uname_R),3.5) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 554 | NO_INET_NTOP = YesPlease |
| 555 | NO_INET_PTON = YesPlease |
| 556 | NO_SOCKADDR_STORAGE = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 557 | endif |
| 558 | ifeq ($(uname_R),5.2) |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 559 | NO_INET_NTOP = YesPlease |
| 560 | NO_INET_PTON = YesPlease |
| 561 | NO_SOCKADDR_STORAGE = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 562 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 563 | endif |
| 564 | ifeq ($(uname_S),Minix) |
| 565 | NO_IPV6 = YesPlease |
| 566 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease |
| 567 | NO_NSEC = YesPlease |
| 568 | NEEDS_LIBGEN = |
| 569 | NEEDS_CRYPTO_WITH_SSL = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 570 | NEEDS_RESOLV = |
| 571 | NO_HSTRERROR = YesPlease |
| 572 | NO_MMAP = YesPlease |
| 573 | NO_CURL = |
| 574 | NO_EXPAT = |
| 575 | endif |
| 576 | ifeq ($(uname_S),NONSTOP_KERNEL) |
| 577 | # Needs some C99 features, "inline" is just one of them. |
| 578 | # INLINE='' would just replace one set of warnings with another and |
| 579 | # still not compile in c89 mode, due to non-const array initializations. |
| 580 | CC = cc -c99 |
Randall S. Becker | 71fb089 | 2019-01-03 16:03:49 -0500 | [diff] [blame] | 581 | # Build down-rev compatible objects that don't use our new getopt_long. |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 582 | ifeq ($(uname_R).$(uname_V),J06.21) |
Randall S. Becker | 71fb089 | 2019-01-03 16:03:49 -0500 | [diff] [blame] | 583 | CC += -WRVU=J06.20 |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 584 | endif |
| 585 | ifeq ($(uname_R).$(uname_V),L17.02) |
Randall S. Becker | 71fb089 | 2019-01-03 16:03:49 -0500 | [diff] [blame] | 586 | CC += -WRVU=L16.05 |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 587 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 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. |
Randall S. Becker | 71fb089 | 2019-01-03 16:03:49 -0500 | [diff] [blame] | 591 | CFLAGS = -g -O0 -Winline |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 592 | # We'd want it to be here. |
| 593 | prefix = /usr/local |
Randall S. Becker | 71fb089 | 2019-01-03 16:03:49 -0500 | [diff] [blame] | 594 | # perl and python must be in /usr/bin on NonStop - supplied by HPE |
| 595 | # with operating system in that managed directory. |
| 596 | PERL_PATH = /usr/bin/perl |
| 597 | PYTHON_PATH = /usr/bin/python |
| 598 | # The current /usr/coreutils/rm at lowest support level does not work |
| 599 | # with the git test structure. Long paths as in |
| 600 | # 'trash directory...' cause rm to terminate prematurely without fully |
| 601 | # removing the directory at OS releases J06.21 and L17.02. |
| 602 | # Default to the older rm until those two releases are deprecated. |
| 603 | RM = /bin/rm -f |
Randall S. Becker | 71fb089 | 2019-01-03 16:03:49 -0500 | [diff] [blame] | 604 | NEEDS_CRYPTO_WITH_SSL = YesPlease |
| 605 | HAVE_DEV_TTY = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 606 | HAVE_LIBCHARSET_H = YesPlease |
| 607 | HAVE_STRINGS_H = YesPlease |
| 608 | NEEDS_LIBICONV = YesPlease |
| 609 | NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease |
| 610 | NO_SYS_SELECT_H = UnfortunatelyYes |
| 611 | NO_D_TYPE_IN_DIRENT = YesPlease |
Randall S. Becker | 71fb089 | 2019-01-03 16:03:49 -0500 | [diff] [blame] | 612 | NO_GETTEXT = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 613 | NO_HSTRERROR = YesPlease |
| 614 | NO_STRCASESTR = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 615 | NO_MEMMEM = YesPlease |
| 616 | NO_STRLCPY = YesPlease |
| 617 | NO_SETENV = YesPlease |
| 618 | NO_UNSETENV = YesPlease |
| 619 | NO_MKDTEMP = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 620 | # Currently libiconv-1.9.1. |
| 621 | OLD_ICONV = UnfortunatelyYes |
Randall S. Becker | 71fb089 | 2019-01-03 16:03:49 -0500 | [diff] [blame] | 622 | NO_REGEX = NeedsStartEnd |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 623 | NO_PTHREADS = UnfortunatelyYes |
Randall S. Becker | 243a4c7 | 2019-02-09 19:20:16 -0500 | [diff] [blame] | 624 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 625 | |
| 626 | # Not detected (nor checked for) by './configure'. |
| 627 | # We don't have SA_RESTART on NonStop, unfortunalety. |
| 628 | COMPAT_CFLAGS += -DSA_RESTART=0 |
| 629 | # Apparently needed in compat/fnmatch/fnmatch.c. |
| 630 | COMPAT_CFLAGS += -DHAVE_STRING_H=1 |
| 631 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease |
| 632 | NO_NSEC = YesPlease |
| 633 | NO_PREAD = YesPlease |
| 634 | NO_MMAP = YesPlease |
| 635 | NO_POLL = YesPlease |
| 636 | NO_INTPTR_T = UnfortunatelyYes |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 637 | CSPRNG_METHOD = openssl |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 638 | SANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin |
Randall S. Becker | f0ec22b | 2019-02-09 12:26:11 -0500 | [diff] [blame] | 639 | SHELL_PATH = /usr/coreutils/bin/bash |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 640 | endif |
Haritha D | d254e65 | 2024-03-06 05:44:17 +0000 | [diff] [blame] | 641 | ifeq ($(uname_S),OS/390) |
| 642 | NO_SYS_POLL_H = YesPlease |
| 643 | NO_STRCASESTR = YesPlease |
| 644 | NO_REGEX = YesPlease |
| 645 | NO_MMAP = YesPlease |
| 646 | NO_NSEC = YesPlease |
| 647 | NO_STRLCPY = YesPlease |
| 648 | NO_MEMMEM = YesPlease |
| 649 | NO_GECOS_IN_PWENT = YesPlease |
| 650 | HAVE_STRINGS_H = YesPlease |
| 651 | NEEDS_MODE_TRANSLATION = YesPlease |
| 652 | endif |
Carlo Marcelo Arenas Belón | ebd2e4a | 2021-09-28 20:19:40 -0700 | [diff] [blame] | 653 | ifeq ($(uname_S),MINGW) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 654 | ifeq ($(shell expr "$(uname_R)" : '1\.'),2) |
Harshil-Jani | 2987407 | 2023-02-02 03:51:38 +0000 | [diff] [blame] | 655 | $(error "Building with MSys is no longer supported") |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 656 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 657 | pathsep = ; |
Kirill Smelkov | 22f4c27 | 2014-04-09 16:48:27 +0400 | [diff] [blame] | 658 | HAVE_ALLOCA_H = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 659 | NO_PREAD = YesPlease |
| 660 | NEEDS_CRYPTO_WITH_SSL = YesPlease |
| 661 | NO_LIBGEN_H = YesPlease |
| 662 | NO_POLL = YesPlease |
| 663 | NO_SYMLINK_HEAD = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 664 | NO_SETENV = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 665 | NO_STRCASESTR = YesPlease |
| 666 | NO_STRLCPY = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 667 | NO_MEMMEM = YesPlease |
| 668 | NEEDS_LIBICONV = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 669 | NO_STRTOUMAX = YesPlease |
| 670 | NO_MKDTEMP = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 671 | NO_SVN_TESTS = YesPlease |
Jeff Hostetler | 62c7367 | 2022-03-25 18:02:51 +0000 | [diff] [blame] | 672 | |
| 673 | # The builtin FSMonitor requires Named Pipes and Threads on Windows. |
| 674 | # These are always available, so we do not have to conditionally |
| 675 | # support it. |
| 676 | FSMONITOR_DAEMON_BACKEND = win32 |
Jeff Hostetler | d33c804 | 2022-05-26 21:46:59 +0000 | [diff] [blame] | 677 | FSMONITOR_OS_SETTINGS = win32 |
| 678 | |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 679 | RUNTIME_PREFIX = YesPlease |
Johannes Schindelin | 86e2545 | 2018-04-10 11:05:46 -0400 | [diff] [blame] | 680 | HAVE_WPGMPTR = YesWeDo |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 681 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease |
Jeff Hostetler | 59c7b88 | 2021-03-15 21:08:23 +0000 | [diff] [blame] | 682 | USE_WIN32_IPC = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 683 | USE_WIN32_MMAP = YesPlease |
Michael Haggerty | 5b63361 | 2017-09-25 10:00:10 +0200 | [diff] [blame] | 684 | MMAP_PREVENTS_DELETE = UnfortunatelyYes |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 685 | UNRELIABLE_FSTAT = UnfortunatelyYes |
| 686 | OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo |
| 687 | NO_REGEX = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 688 | ETAGS_TARGET = ETAGS |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 689 | NO_POSIX_GOODIES = UnfortunatelyYes |
Pat Thoyts | 65db044 | 2012-06-21 12:24:14 +0100 | [diff] [blame] | 690 | DEFAULT_HELP_FORMAT = html |
Emily Shaffer | b7e6a41 | 2021-07-21 18:27:06 -0700 | [diff] [blame] | 691 | HAVE_PLATFORM_PROCINFO = YesPlease |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 692 | CSPRNG_METHOD = rtlgenrandom |
Johannes Schindelin | 396ff75 | 2019-06-19 14:05:59 -0700 | [diff] [blame] | 693 | BASIC_LDFLAGS += -municode |
Johannes Schindelin | 7b40ae8 | 2016-01-13 14:31:01 +0100 | [diff] [blame] | 694 | COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32 |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 695 | COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\" |
| 696 | COMPAT_OBJS += compat/mingw.o compat/winansi.o \ |
Jeff Hostetler | 353d3d7 | 2019-02-22 14:25:02 -0800 | [diff] [blame] | 697 | compat/win32/trace2_win32_process_info.o \ |
Neeraj Singh | abf38ab | 2022-03-10 22:43:20 +0000 | [diff] [blame] | 698 | compat/win32/flush.o \ |
Torsten Bögershausen | 1cadad6 | 2018-12-15 05:33:30 +0100 | [diff] [blame] | 699 | compat/win32/path-utils.o \ |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 700 | compat/win32/pthread.o compat/win32/syslog.o \ |
| 701 | compat/win32/dirent.o |
Johannes Schindelin | 7c9fbda | 2019-12-04 22:27:04 +0100 | [diff] [blame] | 702 | BASIC_CFLAGS += -DWIN32 |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 703 | EXTLIBS += -lws2_32 |
Pat Thoyts | ce39c2e | 2012-05-24 00:56:24 +0100 | [diff] [blame] | 704 | GITLIBS += git.res |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 705 | PTHREAD_LIBS = |
Pat Thoyts | ce39c2e | 2012-05-24 00:56:24 +0100 | [diff] [blame] | 706 | RC = windres -O coff |
Jonathan Nieder | 95f31e9 | 2010-09-04 03:25:09 -0500 | [diff] [blame] | 707 | NATIVE_CRLF = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 708 | X = .exe |
Harshil-Jani | 2987407 | 2023-02-02 03:51:38 +0000 | [diff] [blame] | 709 | # MSys2 |
| 710 | prefix = /usr/ |
| 711 | # Enable DEP |
| 712 | BASIC_LDFLAGS += -Wl,--nxcompat |
| 713 | # Enable ASLR (unless debugging) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 714 | ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS)))) |
Harshil-Jani | 2987407 | 2023-02-02 03:51:38 +0000 | [diff] [blame] | 715 | BASIC_LDFLAGS += -Wl,--dynamicbase |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 716 | endif |
| 717 | ifeq (MINGW32,$(MSYSTEM)) |
Harshil-Jani | 2987407 | 2023-02-02 03:51:38 +0000 | [diff] [blame] | 718 | prefix = /mingw32 |
| 719 | HOST_CPU = i686 |
| 720 | BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 721 | endif |
| 722 | ifeq (MINGW64,$(MSYSTEM)) |
Harshil-Jani | 2987407 | 2023-02-02 03:51:38 +0000 | [diff] [blame] | 723 | prefix = /mingw64 |
| 724 | HOST_CPU = x86_64 |
| 725 | BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 726 | else |
Harshil-Jani | 2987407 | 2023-02-02 03:51:38 +0000 | [diff] [blame] | 727 | COMPAT_CFLAGS += -D_USE_32BIT_TIME_T |
| 728 | BASIC_LDFLAGS += -Wl,--large-address-aware |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 729 | endif |
Harshil-Jani | 2987407 | 2023-02-02 03:51:38 +0000 | [diff] [blame] | 730 | CC = gcc |
| 731 | COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \ |
| 732 | -fstack-protector-strong |
| 733 | EXTLIBS += -lntdll |
Johannes Schindelin | 4b8a271 | 2023-08-09 16:54:46 +0000 | [diff] [blame] | 734 | EXTRA_PROGRAMS += headless-git$X |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 735 | INSTALL = /bin/install |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 736 | INTERNAL_QSORT = YesPlease |
| 737 | HAVE_LIBCHARSET_H = YesPlease |
Harshil-Jani | 2987407 | 2023-02-02 03:51:38 +0000 | [diff] [blame] | 738 | USE_GETTEXT_SCHEME = fallthrough |
| 739 | USE_LIBPCRE = YesPlease |
| 740 | USE_NED_ALLOCATOR = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 741 | ifeq (/mingw64,$(subst 32,64,$(prefix))) |
Harshil-Jani | 2987407 | 2023-02-02 03:51:38 +0000 | [diff] [blame] | 742 | # Move system config into top-level /etc/ |
| 743 | ETC_GITCONFIG = ../etc/gitconfig |
| 744 | ETC_GITATTRIBUTES = ../etc/gitattributes |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 745 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 746 | endif |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 747 | ifeq ($(uname_S),QNX) |
| 748 | COMPAT_CFLAGS += -DSA_RESTART=0 |
Matt Kraai | 081fd8d | 2013-02-11 14:03:45 -0800 | [diff] [blame] | 749 | EXPAT_NEEDS_XMLPARSE_H = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 750 | HAVE_STRINGS_H = YesPlease |
| 751 | NEEDS_SOCKET = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 752 | NO_GETPAGESIZE = YesPlease |
| 753 | NO_ICONV = YesPlease |
| 754 | NO_MEMMEM = YesPlease |
| 755 | NO_MKDTEMP = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 756 | NO_NSEC = YesPlease |
| 757 | NO_PTHREADS = YesPlease |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 758 | NO_STRCASESTR = YesPlease |
| 759 | NO_STRLCPY = YesPlease |
| 760 | endif |
Johannes Schindelin | 976aaed | 2019-07-29 13:08:12 -0700 | [diff] [blame] | 761 | |
| 762 | vcxproj: |
| 763 | # Require clean work tree |
| 764 | git update-index -q --refresh && \ |
| 765 | git diff-files --quiet && \ |
| 766 | git diff-index --cached --quiet HEAD -- |
| 767 | |
| 768 | # Make .vcxproj files and add them |
Johannes Schindelin | 976aaed | 2019-07-29 13:08:12 -0700 | [diff] [blame] | 769 | perl contrib/buildsystems/generate -g Vcxproj |
| 770 | git add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj |
| 771 | |
Johannes Schindelin | 030a628 | 2019-10-04 08:09:31 -0700 | [diff] [blame] | 772 | # Generate the LinkOrCopyBuiltins.targets and LinkOrCopyRemoteHttp.targets file |
Johannes Schindelin | b18ae14 | 2019-07-29 13:08:13 -0700 | [diff] [blame] | 773 | (echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \ |
| 774 | echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \ |
| 775 | for name in $(BUILT_INS);\ |
| 776 | do \ |
| 777 | echo ' <Copy SourceFiles="$$(OutDir)\git.exe" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \ |
| 778 | done && \ |
Johannes Schindelin | 030a628 | 2019-10-04 08:09:31 -0700 | [diff] [blame] | 779 | echo ' </Target>' && \ |
| 780 | echo '</Project>') >git/LinkOrCopyBuiltins.targets |
| 781 | (echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \ |
| 782 | echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \ |
Johannes Schindelin | b18ae14 | 2019-07-29 13:08:13 -0700 | [diff] [blame] | 783 | for name in $(REMOTE_CURL_ALIASES); \ |
| 784 | do \ |
| 785 | echo ' <Copy SourceFiles="$$(OutDir)\'"$(REMOTE_CURL_PRIMARY)"'" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \ |
| 786 | done && \ |
| 787 | echo ' </Target>' && \ |
Johannes Schindelin | 030a628 | 2019-10-04 08:09:31 -0700 | [diff] [blame] | 788 | echo '</Project>') >git-remote-http/LinkOrCopyRemoteHttp.targets |
| 789 | git add -f git/LinkOrCopyBuiltins.targets git-remote-http/LinkOrCopyRemoteHttp.targets |
Johannes Schindelin | b18ae14 | 2019-07-29 13:08:13 -0700 | [diff] [blame] | 790 | |
Ævar Arnfjörð Bjarmason | 7c3c0a9 | 2021-09-23 12:29:57 +0200 | [diff] [blame] | 791 | # Add generated headers |
| 792 | $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(GENERATED_H) |
| 793 | git add -f $(GENERATED_H) |
Johannes Schindelin | 976aaed | 2019-07-29 13:08:12 -0700 | [diff] [blame] | 794 | |
| 795 | # Add scripts |
| 796 | rm -f perl/perl.mak |
Johannes Schindelin | 5d65ad1 | 2019-10-04 08:09:32 -0700 | [diff] [blame] | 797 | $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(SCRIPT_LIB) $(SCRIPTS) |
Johannes Schindelin | 976aaed | 2019-07-29 13:08:12 -0700 | [diff] [blame] | 798 | # Strip out the sane tool path, needed only for building |
| 799 | sed -i '/^git_broken_path_fix ".*/d' git-sh-setup |
Johannes Schindelin | 5d65ad1 | 2019-10-04 08:09:32 -0700 | [diff] [blame] | 800 | git add -f $(SCRIPT_LIB) $(SCRIPTS) |
Johannes Schindelin | 976aaed | 2019-07-29 13:08:12 -0700 | [diff] [blame] | 801 | |
| 802 | # Add Perl module |
| 803 | $(MAKE) $(LIB_PERL_GEN) |
| 804 | git add -f perl/build |
| 805 | |
| 806 | # Add bin-wrappers, for testing |
| 807 | rm -rf bin-wrappers/ |
| 808 | $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(test_bindir_programs) |
| 809 | # Ensure that the GIT_EXEC_PATH is a Unix-y one, and that the absolute |
| 810 | # path of the repository is not hard-coded (GIT_EXEC_PATH will be set |
| 811 | # by test-lib.sh according to the current setup) |
| 812 | sed -i -e 's/^\(GIT_EXEC_PATH\)=.*/test -n "$${\1##*:*}" ||\ |
| 813 | \1="$$(cygpath -u "$$\1")"/' \ |
| 814 | -e "s|'$$(pwd)|\"\$$GIT_EXEC_PATH\"'|g" bin-wrappers/* |
| 815 | # Ensure that test-* helpers find the .dll files copied to top-level |
| 816 | sed -i 's|^PATH=.*|&:"$$GIT_EXEC_PATH"|' bin-wrappers/test-* |
| 817 | # We do not want to force hard-linking builtins |
| 818 | sed -i 's|\(git\)-\([-a-z]*\)\.exe"|\1.exe" \2|g' \ |
| 819 | bin-wrappers/git-{receive-pack,upload-archive} |
| 820 | git add -f $(test_bindir_programs) |
| 821 | # remote-ext is a builtin, but invoked as if it were external |
| 822 | sed 's|receive-pack|remote-ext|g' \ |
| 823 | <bin-wrappers/git-receive-pack >bin-wrappers/git-remote-ext |
| 824 | git add -f bin-wrappers/git-remote-ext |
| 825 | |
| 826 | # Add templates |
| 827 | $(MAKE) -C templates |
| 828 | git add -f templates/boilerplates.made templates/blt/ |
| 829 | |
Johannes Schindelin | 5d65ad1 | 2019-10-04 08:09:32 -0700 | [diff] [blame] | 830 | # Add the translated messages |
| 831 | make MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(MOFILES) |
| 832 | git add -f $(MOFILES) |
| 833 | |
Johannes Schindelin | 976aaed | 2019-07-29 13:08:12 -0700 | [diff] [blame] | 834 | # Add build options |
| 835 | $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 GIT-BUILD-OPTIONS |
| 836 | git add -f GIT-BUILD-OPTIONS |
| 837 | |
| 838 | # Commit the whole shebang |
| 839 | git commit -m "Generate Visual Studio solution" \ |
| 840 | -m "Auto-generated by \`$(MAKE)$(MAKEFLAGS) $@\`" |