Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
# Platform specific Makefile tweaks based on uname detection
|
|
|
|
|
2019-06-25 16:49:39 +02:00
|
|
|
# Define NO_SAFESEH if you need MSVC/Visual Studio to ignore the lack of
|
|
|
|
# Microsoft's Safe Exception Handling in libraries (such as zlib).
|
|
|
|
# Typically required for VS2013+/32-bit compilation on Vista+ versions.
|
|
|
|
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
|
|
|
|
|
2021-09-29 05:19:40 +02:00
|
|
|
ifneq ($(findstring MINGW,$(uname_S)),)
|
|
|
|
uname_S := MINGW
|
|
|
|
endif
|
|
|
|
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
ifdef MSVC
|
|
|
|
# avoid the MingW and Cygwin configuration sections
|
|
|
|
uname_S := Windows
|
|
|
|
uname_O := Windows
|
2019-06-25 16:49:39 +02:00
|
|
|
|
|
|
|
# Generate and include makefile variables that point to the
|
|
|
|
# currently installed set of MSVC command line tools.
|
|
|
|
compat/vcbuild/MSVC-DEFS-GEN: compat/vcbuild/find_vs_env.bat
|
|
|
|
@"$<" | tr '\\' / >"$@"
|
|
|
|
include compat/vcbuild/MSVC-DEFS-GEN
|
|
|
|
|
|
|
|
# See if vcpkg and the vcpkg-build versions of the third-party
|
|
|
|
# libraries that we use are installed. We include the result
|
|
|
|
# to get $(vcpkg_*) variables defined for the Makefile.
|
2019-07-29 22:08:12 +02:00
|
|
|
ifeq (,$(SKIP_VCPKG))
|
2019-06-25 16:49:39 +02:00
|
|
|
compat/vcbuild/VCPKG-DEFS: compat/vcbuild/vcpkg_install.bat
|
|
|
|
@"$<"
|
|
|
|
include compat/vcbuild/VCPKG-DEFS
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
2019-07-29 22:08:12 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
|
|
|
|
# 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)
|
Portable alloca for Git
In the next patch we'll have to use alloca() for performance reasons,
but since alloca is non-standardized and is not portable, let's have a
trick with compatibility wrappers:
1. at configure time, determine, do we have working alloca() through
alloca.h, and define
#define HAVE_ALLOCA_H
if yes.
2. in code
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# define xalloca(size) (alloca(size))
# define xalloca_free(p) do {} while(0)
#else
# define xalloca(size) (xmalloc(size))
# define xalloca_free(p) (free(p))
#endif
and use it like
func() {
p = xalloca(size);
...
xalloca_free(p);
}
This way, for systems, where alloca is available, we'll have optimal
on-stack allocations with fast executions. On the other hand, on
systems, where alloca is not available, this gracefully fallbacks to
xmalloc/free.
Both autoconf and config.mak.uname configurations were updated. For
autoconf, we are not bothering considering cases, when no alloca.h is
available, but alloca() works some other way - its simply alloca.h is
available and works or not, everything else is deep legacy.
For config.mak.uname, I've tried to make my almost-sure guess for where
alloca() is available, but since I only have access to Linux it is the
only change I can be sure about myself, with relevant to other changed
systems people Cc'ed.
NOTE
SunOS and Windows had explicit -DHAVE_ALLOCA_H in their configurations.
I've changed that to now-common HAVE_ALLOCA_H=YesPlease which should be
correct.
Cc: Brandon Casey <drafnel@gmail.com>
Cc: Marius Storm-Olsen <mstormo@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Gerrit Pape <pape@smarden.org>
Cc: Petr Salinger <Petr.Salinger@seznam.cz>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Thomas Schwinge <thomas@codesourcery.com> (GNU Hurd changes)
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-27 15:22:50 +01:00
|
|
|
HAVE_ALLOCA_H = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
HAVE_PATHS_H = YesPlease
|
|
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
|
|
|
HAVE_DEV_TTY = YesPlease
|
2014-07-12 02:05:42 +02:00
|
|
|
HAVE_CLOCK_GETTIME = YesPlease
|
2015-01-08 21:00:56 +01:00
|
|
|
HAVE_CLOCK_MONOTONIC = YesPlease
|
2016-07-11 00:16:44 +02:00
|
|
|
# -lrt is needed for clock_gettime on glibc <= 2.16
|
|
|
|
NEEDS_LIBRT = YesPlease
|
2022-03-10 23:43:20 +01:00
|
|
|
HAVE_SYNC_FILE_RANGE = YesPlease
|
2015-04-16 11:01:38 +02:00
|
|
|
HAVE_GETDELIM = YesPlease
|
2017-05-03 12:16:48 +02:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
2018-04-15 17:36:17 +02:00
|
|
|
BASIC_CFLAGS += -DHAVE_SYSINFO
|
2018-04-10 17:05:44 +02:00
|
|
|
PROCFS_EXECUTABLE_PATH = /proc/self/exe
|
tr2: log parent process name
It can be useful to tell who invoked Git - was it invoked manually by a
user via CLI or script? By an IDE? In some cases - like 'repo' tool -
we can influence the source code and set the GIT_TRACE2_PARENT_SID
environment variable from the caller process. In 'repo''s case, that
parent SID is manipulated to include the string "repo", which means we
can positively identify when Git was invoked by 'repo' tool. However,
identifying parents that way requires both that we know which tools
invoke Git and that we have the ability to modify the source code of
those tools. It cannot scale to keep up with the various IDEs and
wrappers which use Git, most of which we don't know about. Learning
which tools and wrappers invoke Git, and how, would give us insight to
decide where to improve Git's usability and performance.
Unfortunately, there's no cross-platform reliable way to gather the name
of the parent process. If procfs is present, we can use that; otherwise
we will need to discover the name another way. However, the process ID
should be sufficient to look up the process name on most platforms, so
that code may be shareable.
Git for Windows gathers similar information and logs it as a "data_json"
event. However, since "data_json" has a variable format, it is difficult
to parse effectively in some languages; instead, let's pursue a
dedicated "cmd_ancestry" event to record information about the ancestry
of the current process and a consistent, parseable way.
Git for Windows also gathers information about more than one generation
of parent. In Linux further ancestry info can be gathered with procfs,
but it's unwieldy to do so. In the interest of later moving Git for
Windows ancestry logging to the 'cmd_ancestry' event, and in the
interest of later adding more ancestry to the Linux implementation - or
of adding this functionality to other platforms which have an easier
time walking the process tree - let's make 'cmd_ancestry' accept an
array of parentage.
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-07-22 03:27:07 +02:00
|
|
|
HAVE_PLATFORM_PROCINFO = YesPlease
|
|
|
|
COMPAT_OBJS += compat/linux/procinfo.o
|
2022-01-16 03:05:20 +01:00
|
|
|
# centos7/rhel7 provides gcc 4.8.5 and zlib 1.2.7.
|
2024-04-08 17:51:44 +02:00
|
|
|
ifneq ($(findstring .el7.,$(uname_R)),)
|
2022-01-16 03:05:20 +01:00
|
|
|
BASIC_CFLAGS += -std=c99
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
fuzz: link fuzz programs with `make all` on Linux
Since 5e47215080 (fuzz: add basic fuzz testing target., 2018-10-12), we
have compiled object files for the fuzz tests as part of the default
'make all' target. This helps prevent bit-rot in lesser-used parts of
the codebase, by making sure that incompatible changes are caught at
build time.
However, since we never linked the fuzzer executables, this did not
protect us from link-time errors. As of 8b9a42bf48 (fuzz: fix fuzz test
build rules, 2024-01-19), it's now possible to link the fuzzer
executables without using a fuzzing engine and a variety of
compiler-specific (and compiler-version-specific) flags, at least on
Linux. So let's add a platform-specific option in config.mak.uname to
link the executables as part of the default `make all` target.
Since linking the fuzzer executables without a fuzzing engine does not
require a C++ compiler, we can change the FUZZ_PROGRAMS build rule to
use $(CC) by default. This avoids compiler mis-match issues when
overriding $(CC) but not $(CXX). When we *do* want to actually link with
a fuzzing engine, we can set $(FUZZ_CXX). The build instructions in the
CI fuzz-smoke-test job and in the Makefile comment have been updated
accordingly.
While we're at it, we can consolidate some of the fuzzer build
instructions into one location in the Makefile.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-04-24 20:14:42 +02:00
|
|
|
LINK_FUZZ_PROGRAMS = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),GNU/kFreeBSD)
|
Portable alloca for Git
In the next patch we'll have to use alloca() for performance reasons,
but since alloca is non-standardized and is not portable, let's have a
trick with compatibility wrappers:
1. at configure time, determine, do we have working alloca() through
alloca.h, and define
#define HAVE_ALLOCA_H
if yes.
2. in code
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# define xalloca(size) (alloca(size))
# define xalloca_free(p) do {} while(0)
#else
# define xalloca(size) (xmalloc(size))
# define xalloca_free(p) (free(p))
#endif
and use it like
func() {
p = xalloca(size);
...
xalloca_free(p);
}
This way, for systems, where alloca is available, we'll have optimal
on-stack allocations with fast executions. On the other hand, on
systems, where alloca is not available, this gracefully fallbacks to
xmalloc/free.
Both autoconf and config.mak.uname configurations were updated. For
autoconf, we are not bothering considering cases, when no alloca.h is
available, but alloca() works some other way - its simply alloca.h is
available and works or not, everything else is deep legacy.
For config.mak.uname, I've tried to make my almost-sure guess for where
alloca() is available, but since I only have access to Linux it is the
only change I can be sure about myself, with relevant to other changed
systems people Cc'ed.
NOTE
SunOS and Windows had explicit -DHAVE_ALLOCA_H in their configurations.
I've changed that to now-common HAVE_ALLOCA_H=YesPlease which should be
correct.
Cc: Brandon Casey <drafnel@gmail.com>
Cc: Marius Storm-Olsen <mstormo@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Gerrit Pape <pape@smarden.org>
Cc: Petr Salinger <Petr.Salinger@seznam.cz>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Thomas Schwinge <thomas@codesourcery.com> (GNU Hurd changes)
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-27 15:22:50 +01:00
|
|
|
HAVE_ALLOCA_H = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
HAVE_PATHS_H = YesPlease
|
|
|
|
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
|
|
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
2017-05-03 12:16:48 +02:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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)
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(uname_R),3.2)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
CFLAGS = -O2
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
CC = cc
|
|
|
|
BASIC_CFLAGS += -Kthread
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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
|
2014-08-15 19:02:46 +02:00
|
|
|
# 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".
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
OLD_ICONV = UnfortunatelyYes
|
2014-08-15 09:46:11 +02:00
|
|
|
NO_APPLE_COMMON_CRYPTO = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_STRLCPY = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1)
|
config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releases
On Mac OS X, getdelim() first became available with Xcode 4.1[1], which
was released the same day as OS X 10.7 "Lion", so assume getdelim()
availability from 10.7 onward. (As of this writing, OS X is at 10.10
"Yosemite".)
According to Wikipedia[2], 4.1 was also available for download by paying
developers on OS X 10.6 "Snow Leopard", so it's possible that some 10.6
machines may have getdelim(). However, as strbuf's use of getdelim() is
purely an optimization, let's be conservative and assume 10.6 and
earlier lack getdelim().
[1]: Or, possibly with Xcode 4.0, but that version is no longer
available for download, or not available to non-paying developers,
so testing is not possible.
[2]: http://en.wikipedia.org/wiki/Xcode
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-06-02 23:15:43 +02:00
|
|
|
HAVE_GETDELIM = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 20 && echo 1),1)
|
2021-03-01 10:29:47 +01:00
|
|
|
OPEN_RETURNS_EINTR = UnfortunatelyYes
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
USE_ST_TIMESPEC = YesPlease
|
|
|
|
HAVE_DEV_TTY = YesPlease
|
|
|
|
COMPAT_OBJS += compat/precompose_utf8.o
|
|
|
|
BASIC_CFLAGS += -DPRECOMPOSE_UNICODE
|
2014-12-16 00:15:20 +01:00
|
|
|
BASIC_CFLAGS += -DPROTECT_HFS_DEFAULT=1
|
2015-03-08 08:14:36 +01:00
|
|
|
HAVE_BSD_SYSCTL = YesPlease
|
2017-05-10 06:44:33 +02:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
2018-04-10 17:05:44 +02:00
|
|
|
HAVE_NS_GET_EXECUTABLE_PATH = YesPlease
|
wrapper: add a helper to generate numbers from a CSPRNG
There are many situations in which having access to a cryptographically
secure pseudorandom number generator (CSPRNG) is helpful. In the
future, we'll encounter one of these when dealing with temporary files.
To make this possible, let's add a function which reads from a system
CSPRNG and returns some bytes.
We know that all systems will have such an interface. A CSPRNG is
required for a secure TLS or SSH implementation and a Git implementation
which provided neither would be of little practical use. In addition,
POSIX is set to standardize getentropy(2) in the next version, so in the
(potentially distant) future we can rely on that.
For systems which lack one of the other interfaces, we provide the
ability to use OpenSSL's CSPRNG. OpenSSL is highly portable and
functions on practically every known OS, and we know it will have access
to some source of cryptographically secure randomness. We also provide
support for the arc4random in libbsd for folks who would prefer to use
that.
Because this is a security sensitive interface, we take some
precautions. We either succeed by filling the buffer completely as we
requested, or we fail. We don't return partial data because the caller
will almost never find that to be a useful behavior.
Specify a makefile knob which users can use to specify one or more
suitable CSPRNGs, and turn the multiple string options into a set of
defines, since we cannot match on strings in the preprocessor. We allow
multiple options to make the job of handling this in autoconf easier.
The order of options is important here. On systems with arc4random,
which is most of the BSDs, we use that, since, except on MirBSD and
macOS, it uses ChaCha20, which is extremely fast, and sits entirely in
userspace, avoiding a system call. We then prefer getrandom over
getentropy, because the former has been available longer on Linux, and
then OpenSSL. Finally, if none of those are available, we use
/dev/urandom, because most Unix-like operating systems provide that API.
We prefer options that don't involve device files when possible because
those work in some restricted environments where device files may not be
available.
Set the configuration variables appropriately for Linux and the BSDs,
including macOS, as well as Windows and NonStop. We specifically only
consider versions which receive publicly available security support
here. For the same reason, we don't specify getrandom(2) on Linux,
because CentOS 7 doesn't support it in glibc (although its kernel does)
and we don't want to resort to making syscalls.
Finally, add a test helper to allow this to be tested by hand and in
tests. We don't add any tests, since invoking the CSPRNG is not likely
to produce interesting, reproducible results.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-17 22:56:16 +01:00
|
|
|
CSPRNG_METHOD = arc4random
|
2023-01-08 01:42:04 +01:00
|
|
|
USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS = YesPlease
|
2020-04-26 22:09:32 +02:00
|
|
|
|
|
|
|
# Workaround for `gettext` being keg-only and not even being linked via
|
|
|
|
# `brew link --force gettext`, should be obsolete as of
|
|
|
|
# https://github.com/Homebrew/homebrew-core/pull/53489
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y)
|
2020-04-26 22:09:32 +02:00
|
|
|
BASIC_CFLAGS += -I/usr/local/include -I/usr/local/opt/gettext/include
|
|
|
|
BASIC_LDFLAGS += -L/usr/local/lib -L/usr/local/opt/gettext/lib
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo y),y)
|
2020-04-26 22:09:32 +02:00
|
|
|
MSGFMT = /usr/local/opt/gettext/bin/msgfmt
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
2024-01-18 11:22:49 +01:00
|
|
|
# On newer ARM-based machines the default installation path has changed to
|
|
|
|
# /opt/homebrew. Include it in our search paths so that the user does not
|
|
|
|
# have to configure this manually.
|
|
|
|
#
|
|
|
|
# Note that we do not employ the same workaround as above where we manually
|
|
|
|
# add gettext. The issue was fixed more than three years ago by now, and at
|
|
|
|
# that point there haven't been any ARM-based Macs yet.
|
2024-04-08 17:51:44 +02:00
|
|
|
else ifeq ($(shell test -d /opt/homebrew/ && echo y),y)
|
2024-01-18 11:22:49 +01:00
|
|
|
BASIC_CFLAGS += -I/opt/homebrew/include
|
|
|
|
BASIC_LDFLAGS += -L/opt/homebrew/lib
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(shell test -x /opt/homebrew/bin/msgfmt && echo y),y)
|
2024-01-18 11:22:49 +01:00
|
|
|
MSGFMT = /opt/homebrew/bin/msgfmt
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
endif
|
2022-03-25 19:02:52 +01:00
|
|
|
|
|
|
|
# The builtin FSMonitor on MacOS builds upon Simple-IPC. Both require
|
|
|
|
# Unix domain sockets and PThreads.
|
2024-04-08 17:51:44 +02:00
|
|
|
ifndef NO_PTHREADS
|
|
|
|
ifndef NO_UNIX_SOCKETS
|
2022-03-25 19:02:52 +01:00
|
|
|
FSMONITOR_DAEMON_BACKEND = darwin
|
2022-05-26 23:47:01 +02:00
|
|
|
FSMONITOR_OS_SETTINGS = darwin
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
endif
|
2022-03-25 19:02:52 +01:00
|
|
|
|
|
|
|
BASIC_LDFLAGS += -framework CoreServices
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),SunOS)
|
|
|
|
NEEDS_SOCKET = YesPlease
|
|
|
|
NEEDS_NSL = YesPlease
|
|
|
|
SHELL_PATH = /bin/bash
|
|
|
|
SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
|
Portable alloca for Git
In the next patch we'll have to use alloca() for performance reasons,
but since alloca is non-standardized and is not portable, let's have a
trick with compatibility wrappers:
1. at configure time, determine, do we have working alloca() through
alloca.h, and define
#define HAVE_ALLOCA_H
if yes.
2. in code
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# define xalloca(size) (alloca(size))
# define xalloca_free(p) do {} while(0)
#else
# define xalloca(size) (xmalloc(size))
# define xalloca_free(p) (free(p))
#endif
and use it like
func() {
p = xalloca(size);
...
xalloca_free(p);
}
This way, for systems, where alloca is available, we'll have optimal
on-stack allocations with fast executions. On the other hand, on
systems, where alloca is not available, this gracefully fallbacks to
xmalloc/free.
Both autoconf and config.mak.uname configurations were updated. For
autoconf, we are not bothering considering cases, when no alloca.h is
available, but alloca() works some other way - its simply alloca.h is
available and works or not, everything else is deep legacy.
For config.mak.uname, I've tried to make my almost-sure guess for where
alloca() is available, but since I only have access to Linux it is the
only change I can be sure about myself, with relevant to other changed
systems people Cc'ed.
NOTE
SunOS and Windows had explicit -DHAVE_ALLOCA_H in their configurations.
I've changed that to now-common HAVE_ALLOCA_H=YesPlease which should be
correct.
Cc: Brandon Casey <drafnel@gmail.com>
Cc: Marius Storm-Olsen <mstormo@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Gerrit Pape <pape@smarden.org>
Cc: Petr Salinger <Petr.Salinger@seznam.cz>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Thomas Schwinge <thomas@codesourcery.com> (GNU Hurd changes)
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-27 15:22:50 +01:00
|
|
|
HAVE_ALLOCA_H = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
NO_REGEX = YesPlease
|
|
|
|
NO_MSGFMT_EXTENDED_OPTIONS = YesPlease
|
|
|
|
HAVE_DEV_TTY = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(uname_R),5.6)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5.7)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5.8)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
GIT_TEST_CMP = cmp
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5.9)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
GIT_TEST_CMP = cmp
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
INSTALL = /usr/ucb/install
|
|
|
|
TAR = gtar
|
Portable alloca for Git
In the next patch we'll have to use alloca() for performance reasons,
but since alloca is non-standardized and is not portable, let's have a
trick with compatibility wrappers:
1. at configure time, determine, do we have working alloca() through
alloca.h, and define
#define HAVE_ALLOCA_H
if yes.
2. in code
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# define xalloca(size) (alloca(size))
# define xalloca_free(p) do {} while(0)
#else
# define xalloca(size) (xmalloc(size))
# define xalloca_free(p) (free(p))
#endif
and use it like
func() {
p = xalloca(size);
...
xalloca_free(p);
}
This way, for systems, where alloca is available, we'll have optimal
on-stack allocations with fast executions. On the other hand, on
systems, where alloca is not available, this gracefully fallbacks to
xmalloc/free.
Both autoconf and config.mak.uname configurations were updated. For
autoconf, we are not bothering considering cases, when no alloca.h is
available, but alloca() works some other way - its simply alloca.h is
available and works or not, everything else is deep legacy.
For config.mak.uname, I've tried to make my almost-sure guess for where
alloca() is available, but since I only have access to Linux it is the
only change I can be sure about myself, with relevant to other changed
systems people Cc'ed.
NOTE
SunOS and Windows had explicit -DHAVE_ALLOCA_H in their configurations.
I've changed that to now-common HAVE_ALLOCA_H=YesPlease which should be
correct.
Cc: Brandon Casey <drafnel@gmail.com>
Cc: Marius Storm-Olsen <mstormo@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Gerrit Pape <pape@smarden.org>
Cc: Petr Salinger <Petr.Salinger@seznam.cz>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Thomas Schwinge <thomas@codesourcery.com> (GNU Hurd changes)
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-27 15:22:50 +01:00
|
|
|
BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_O),Cygwin)
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_D_TYPE_IN_DIRENT = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_SYMLINK_HEAD = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
OLD_ICONV = UnfortunatelyYes
|
2013-07-20 01:08:30 +02:00
|
|
|
# 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
|
2024-04-08 17:51:44 +02:00
|
|
|
else
|
2013-07-20 01:08:28 +02:00
|
|
|
NO_REGEX = UnfortunatelyYes
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
config.mak.uname: add HAVE_DEV_TTY to cygwin config section
If neither HAVE_DEV_TTY nor GIT_WINDOWS_NATIVE is set, while compiling
the 'compat/terminal.c' code, then the fallback code calls the system
getpass() function. Unfortunately, this ignores the 'echo' parameter of
the git_terminal_prompt() function, since it has no way to implement that
functionality. This results in a less than optimal user experience on
cygwin, which does not define either of those build flags.
However, cygwin does have a functional '/dev/tty', so that it can build
with HAVE_DEV_TTY and benefit from the improved user experience.
The improved git_terminal_prompt() function that comes with HAVE_DEV_TTY
is used in the git_prompt() function, which in turn is used by the
'git credential', 'git bisect' and 'git help' commands. In addition to
git_terminal_prompt(), read_key_without_echo() is likewise improved and
used by the 'git add -p' command.
While using the 'git credential fill' command, for example:
$ printf "%s\n" protocol=https host=example.com path=git | ./git credential fill
Username for 'https://example.com': user
Password for 'https://user@example.com':
protocol=https
host=example.com
username=user
password=pass
$
The 'user' name is now echoed while typing (the password isn't), where this
wasn't the case before.
When using the auto-correct feature:
$ ./git -c help.autocorrect=prompt fred
WARNING: You called a Git command named 'fred', which does not exist.
Run 'grep' instead [y/N]? n
$ ./git -c help.autocorrect=prompt fred
WARNING: You called a Git command named 'fred', which does not exist.
Run 'grep' instead [y/N]? y
fatal: no pattern given
$
The user can actually see what they are typing at the prompt. Similar
comments apply to 'git bisect':
$ ./git bisect bad master~1
You need to start by "git bisect start"
Do you want me to do it for you [Y/n]? y
status: waiting for both good and bad commits
status: waiting for good commit(s), bad commit known
$ ./git bisect reset
Already on 'master-tmp'
$
$ ./git bisect start
status: waiting for both good and bad commits
$ ./git bisect bad master~1
status: waiting for good commit(s), bad commit known
$ ./git bisect next
warning: bisecting only with a bad commit
Are you sure [Y/n]? n
$ ./git bisect reset
Already on 'master-tmp'
$
The read_key_without_echo() function leads to a much improved 'git add -p'
command, when the 'interactive.singleKey' configuration is set:
$ cd ..
$ mkdir test-git
$ cd test-git
$ git init -q
$ echo foo >file
$ git add file
$ echo bar >file
$ ../git/git -c interactive.singleKey=true add -p
diff --git a/file b/file
index 257cc56..5716ca5 100644
--- a/file
+++ b/file
@@ -1 +1 @@
-foo
+bar
(1/1) Stage this hunk [y,n,q,a,d,e,p,?]? y
$
Note that, not only is the user input echoed, but that it is immediately
accepted (without having to type <return>) and the program exits with the
hunk staged (in this case) or not.
In order to reap these benefits, set the HAVE_DEV_TTY build flag in the
cygwin configuration section of config.mak.uname.
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-09 03:23:48 +02:00
|
|
|
HAVE_DEV_TTY = YesPlease
|
Portable alloca for Git
In the next patch we'll have to use alloca() for performance reasons,
but since alloca is non-standardized and is not portable, let's have a
trick with compatibility wrappers:
1. at configure time, determine, do we have working alloca() through
alloca.h, and define
#define HAVE_ALLOCA_H
if yes.
2. in code
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# define xalloca(size) (alloca(size))
# define xalloca_free(p) do {} while(0)
#else
# define xalloca(size) (xmalloc(size))
# define xalloca_free(p) (free(p))
#endif
and use it like
func() {
p = xalloca(size);
...
xalloca_free(p);
}
This way, for systems, where alloca is available, we'll have optimal
on-stack allocations with fast executions. On the other hand, on
systems, where alloca is not available, this gracefully fallbacks to
xmalloc/free.
Both autoconf and config.mak.uname configurations were updated. For
autoconf, we are not bothering considering cases, when no alloca.h is
available, but alloca() works some other way - its simply alloca.h is
available and works or not, everything else is deep legacy.
For config.mak.uname, I've tried to make my almost-sure guess for where
alloca() is available, but since I only have access to Linux it is the
only change I can be sure about myself, with relevant to other changed
systems people Cc'ed.
NOTE
SunOS and Windows had explicit -DHAVE_ALLOCA_H in their configurations.
I've changed that to now-common HAVE_ALLOCA_H=YesPlease which should be
correct.
Cc: Brandon Casey <drafnel@gmail.com>
Cc: Marius Storm-Olsen <mstormo@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Gerrit Pape <pape@smarden.org>
Cc: Petr Salinger <Petr.Salinger@seznam.cz>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Thomas Schwinge <thomas@codesourcery.com> (GNU Hurd changes)
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-27 15:22:50 +01:00
|
|
|
HAVE_ALLOCA_H = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
|
|
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
|
|
X = .exe
|
|
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
2015-08-07 22:30:28 +02:00
|
|
|
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
2017-09-25 10:00:10 +02:00
|
|
|
MMAP_PREVENTS_DELETE = UnfortunatelyYes
|
2018-12-15 05:33:30 +01:00
|
|
|
COMPAT_OBJS += compat/win32/path-utils.o
|
2017-07-21 20:43:17 +02:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),FreeBSD)
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
2018-08-31 10:33:42 +02:00
|
|
|
# Versions up to 10.1 require OLD_ICONV; 10.2 and beyond don't.
|
|
|
|
# A typical version string looks like "10.2-RELEASE".
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '[1-9]\.'),2)
|
2018-08-31 10:33:42 +02:00
|
|
|
OLD_ICONV = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(firstword $(subst -, ,$(uname_R))),10.0)
|
2018-08-31 10:33:42 +02:00
|
|
|
OLD_ICONV = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(firstword $(subst -, ,$(uname_R))),10.1)
|
2018-08-31 10:33:42 +02:00
|
|
|
OLD_ICONV = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
PTHREAD_LIBS = -pthread
|
|
|
|
NO_UINTMAX_T = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
PYTHON_PATH = /usr/local/bin/python
|
2016-07-25 18:21:25 +02:00
|
|
|
PERL_PATH = /usr/local/bin/perl
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
HAVE_PATHS_H = YesPlease
|
2015-03-08 08:14:36 +01:00
|
|
|
HAVE_BSD_SYSCTL = YesPlease
|
2018-04-10 17:05:44 +02:00
|
|
|
HAVE_BSD_KERN_PROC_SYSCTL = YesPlease
|
wrapper: add a helper to generate numbers from a CSPRNG
There are many situations in which having access to a cryptographically
secure pseudorandom number generator (CSPRNG) is helpful. In the
future, we'll encounter one of these when dealing with temporary files.
To make this possible, let's add a function which reads from a system
CSPRNG and returns some bytes.
We know that all systems will have such an interface. A CSPRNG is
required for a secure TLS or SSH implementation and a Git implementation
which provided neither would be of little practical use. In addition,
POSIX is set to standardize getentropy(2) in the next version, so in the
(potentially distant) future we can rely on that.
For systems which lack one of the other interfaces, we provide the
ability to use OpenSSL's CSPRNG. OpenSSL is highly portable and
functions on practically every known OS, and we know it will have access
to some source of cryptographically secure randomness. We also provide
support for the arc4random in libbsd for folks who would prefer to use
that.
Because this is a security sensitive interface, we take some
precautions. We either succeed by filling the buffer completely as we
requested, or we fail. We don't return partial data because the caller
will almost never find that to be a useful behavior.
Specify a makefile knob which users can use to specify one or more
suitable CSPRNGs, and turn the multiple string options into a set of
defines, since we cannot match on strings in the preprocessor. We allow
multiple options to make the job of handling this in autoconf easier.
The order of options is important here. On systems with arc4random,
which is most of the BSDs, we use that, since, except on MirBSD and
macOS, it uses ChaCha20, which is extremely fast, and sits entirely in
userspace, avoiding a system call. We then prefer getrandom over
getentropy, because the former has been available longer on Linux, and
then OpenSSL. Finally, if none of those are available, we use
/dev/urandom, because most Unix-like operating systems provide that API.
We prefer options that don't involve device files when possible because
those work in some restricted environments where device files may not be
available.
Set the configuration variables appropriately for Linux and the BSDs,
including macOS, as well as Windows and NonStop. We specifically only
consider versions which receive publicly available security support
here. For the same reason, we don't specify getrandom(2) on Linux,
because CentOS 7 doesn't support it in glibc (although its kernel does)
and we don't want to resort to making syscalls.
Finally, add a test helper to allow this to be tested by hand and in
tests. We don't add any tests, since invoking the CSPRNG is not likely
to produce interesting, reproducible results.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-17 22:56:16 +01:00
|
|
|
CSPRNG_METHOD = arc4random
|
2016-08-04 13:40:25 +02:00
|
|
|
PAGER_ENV = LESS=FRX LV=-c MORE=FRX
|
2017-05-03 12:16:48 +02:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
2019-02-12 15:14:41 +01:00
|
|
|
FILENO_IS_A_MACRO = UnfortunatelyYes
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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
|
2015-03-08 08:14:36 +01:00
|
|
|
HAVE_BSD_SYSCTL = YesPlease
|
2018-04-10 17:05:44 +02:00
|
|
|
HAVE_BSD_KERN_PROC_SYSCTL = YesPlease
|
wrapper: add a helper to generate numbers from a CSPRNG
There are many situations in which having access to a cryptographically
secure pseudorandom number generator (CSPRNG) is helpful. In the
future, we'll encounter one of these when dealing with temporary files.
To make this possible, let's add a function which reads from a system
CSPRNG and returns some bytes.
We know that all systems will have such an interface. A CSPRNG is
required for a secure TLS or SSH implementation and a Git implementation
which provided neither would be of little practical use. In addition,
POSIX is set to standardize getentropy(2) in the next version, so in the
(potentially distant) future we can rely on that.
For systems which lack one of the other interfaces, we provide the
ability to use OpenSSL's CSPRNG. OpenSSL is highly portable and
functions on practically every known OS, and we know it will have access
to some source of cryptographically secure randomness. We also provide
support for the arc4random in libbsd for folks who would prefer to use
that.
Because this is a security sensitive interface, we take some
precautions. We either succeed by filling the buffer completely as we
requested, or we fail. We don't return partial data because the caller
will almost never find that to be a useful behavior.
Specify a makefile knob which users can use to specify one or more
suitable CSPRNGs, and turn the multiple string options into a set of
defines, since we cannot match on strings in the preprocessor. We allow
multiple options to make the job of handling this in autoconf easier.
The order of options is important here. On systems with arc4random,
which is most of the BSDs, we use that, since, except on MirBSD and
macOS, it uses ChaCha20, which is extremely fast, and sits entirely in
userspace, avoiding a system call. We then prefer getrandom over
getentropy, because the former has been available longer on Linux, and
then OpenSSL. Finally, if none of those are available, we use
/dev/urandom, because most Unix-like operating systems provide that API.
We prefer options that don't involve device files when possible because
those work in some restricted environments where device files may not be
available.
Set the configuration variables appropriately for Linux and the BSDs,
including macOS, as well as Windows and NonStop. We specifically only
consider versions which receive publicly available security support
here. For the same reason, we don't specify getrandom(2) on Linux,
because CentOS 7 doesn't support it in glibc (although its kernel does)
and we don't want to resort to making syscalls.
Finally, add a test helper to allow this to be tested by hand and in
tests. We don't add any tests, since invoking the CSPRNG is not likely
to produce interesting, reproducible results.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-17 22:56:16 +01:00
|
|
|
CSPRNG_METHOD = arc4random
|
2018-04-10 17:05:44 +02:00
|
|
|
PROCFS_EXECUTABLE_PATH = /proc/curproc/file
|
2018-12-02 03:43:20 +01:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
2019-02-12 15:14:41 +01:00
|
|
|
FILENO_IS_A_MACRO = UnfortunatelyYes
|
2013-12-31 15:36:45 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),MirBSD)
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
USE_ST_TIMESPEC = YesPlease
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
HAVE_PATHS_H = YesPlease
|
2015-03-08 08:14:36 +01:00
|
|
|
HAVE_BSD_SYSCTL = YesPlease
|
wrapper: add a helper to generate numbers from a CSPRNG
There are many situations in which having access to a cryptographically
secure pseudorandom number generator (CSPRNG) is helpful. In the
future, we'll encounter one of these when dealing with temporary files.
To make this possible, let's add a function which reads from a system
CSPRNG and returns some bytes.
We know that all systems will have such an interface. A CSPRNG is
required for a secure TLS or SSH implementation and a Git implementation
which provided neither would be of little practical use. In addition,
POSIX is set to standardize getentropy(2) in the next version, so in the
(potentially distant) future we can rely on that.
For systems which lack one of the other interfaces, we provide the
ability to use OpenSSL's CSPRNG. OpenSSL is highly portable and
functions on practically every known OS, and we know it will have access
to some source of cryptographically secure randomness. We also provide
support for the arc4random in libbsd for folks who would prefer to use
that.
Because this is a security sensitive interface, we take some
precautions. We either succeed by filling the buffer completely as we
requested, or we fail. We don't return partial data because the caller
will almost never find that to be a useful behavior.
Specify a makefile knob which users can use to specify one or more
suitable CSPRNGs, and turn the multiple string options into a set of
defines, since we cannot match on strings in the preprocessor. We allow
multiple options to make the job of handling this in autoconf easier.
The order of options is important here. On systems with arc4random,
which is most of the BSDs, we use that, since, except on MirBSD and
macOS, it uses ChaCha20, which is extremely fast, and sits entirely in
userspace, avoiding a system call. We then prefer getrandom over
getentropy, because the former has been available longer on Linux, and
then OpenSSL. Finally, if none of those are available, we use
/dev/urandom, because most Unix-like operating systems provide that API.
We prefer options that don't involve device files when possible because
those work in some restricted environments where device files may not be
available.
Set the configuration variables appropriately for Linux and the BSDs,
including macOS, as well as Windows and NonStop. We specifically only
consider versions which receive publicly available security support
here. For the same reason, we don't specify getrandom(2) on Linux,
because CentOS 7 doesn't support it in glibc (although its kernel does)
and we don't want to resort to making syscalls.
Finally, add a test helper to allow this to be tested by hand and in
tests. We don't add any tests, since invoking the CSPRNG is not likely
to produce interesting, reproducible results.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-17 22:56:16 +01:00
|
|
|
CSPRNG_METHOD = arc4random
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),NetBSD)
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NEEDS_LIBICONV = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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
|
2015-03-08 08:14:36 +01:00
|
|
|
HAVE_BSD_SYSCTL = YesPlease
|
2018-04-10 17:05:44 +02:00
|
|
|
HAVE_BSD_KERN_PROC_SYSCTL = YesPlease
|
wrapper: add a helper to generate numbers from a CSPRNG
There are many situations in which having access to a cryptographically
secure pseudorandom number generator (CSPRNG) is helpful. In the
future, we'll encounter one of these when dealing with temporary files.
To make this possible, let's add a function which reads from a system
CSPRNG and returns some bytes.
We know that all systems will have such an interface. A CSPRNG is
required for a secure TLS or SSH implementation and a Git implementation
which provided neither would be of little practical use. In addition,
POSIX is set to standardize getentropy(2) in the next version, so in the
(potentially distant) future we can rely on that.
For systems which lack one of the other interfaces, we provide the
ability to use OpenSSL's CSPRNG. OpenSSL is highly portable and
functions on practically every known OS, and we know it will have access
to some source of cryptographically secure randomness. We also provide
support for the arc4random in libbsd for folks who would prefer to use
that.
Because this is a security sensitive interface, we take some
precautions. We either succeed by filling the buffer completely as we
requested, or we fail. We don't return partial data because the caller
will almost never find that to be a useful behavior.
Specify a makefile knob which users can use to specify one or more
suitable CSPRNGs, and turn the multiple string options into a set of
defines, since we cannot match on strings in the preprocessor. We allow
multiple options to make the job of handling this in autoconf easier.
The order of options is important here. On systems with arc4random,
which is most of the BSDs, we use that, since, except on MirBSD and
macOS, it uses ChaCha20, which is extremely fast, and sits entirely in
userspace, avoiding a system call. We then prefer getrandom over
getentropy, because the former has been available longer on Linux, and
then OpenSSL. Finally, if none of those are available, we use
/dev/urandom, because most Unix-like operating systems provide that API.
We prefer options that don't involve device files when possible because
those work in some restricted environments where device files may not be
available.
Set the configuration variables appropriately for Linux and the BSDs,
including macOS, as well as Windows and NonStop. We specifically only
consider versions which receive publicly available security support
here. For the same reason, we don't specify getrandom(2) on Linux,
because CentOS 7 doesn't support it in glibc (although its kernel does)
and we don't want to resort to making syscalls.
Finally, add a test helper to allow this to be tested by hand and in
tests. We don't add any tests, since invoking the CSPRNG is not likely
to produce interesting, reproducible results.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-17 22:56:16 +01:00
|
|
|
CSPRNG_METHOD = arc4random
|
2018-04-10 17:05:44 +02:00
|
|
|
PROCFS_EXECUTABLE_PATH = /proc/curproc/exe
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),AIX)
|
|
|
|
DEFAULT_PAGER = more
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
2017-05-03 15:54:30 +02:00
|
|
|
NO_REGEX = NeedsStartEnd
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
|
|
|
INTERNAL_QSORT = UnfortunatelyYes
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
BASIC_CFLAGS += -D_LARGE_FILES
|
2019-04-18 10:55:09 +02:00
|
|
|
FILENO_IS_A_MACRO = UnfortunatelyYes
|
2019-04-25 09:01:56 +02:00
|
|
|
NEED_ACCESS_ROOT_HANDLER = UnfortunatelyYes
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_PTHREADS = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
else
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
PTHREAD_LIBS = -lpthread
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
INLINE = ''
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
GIT_TEST_CMP = cmp
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),GNU)
|
|
|
|
# GNU/Hurd
|
Portable alloca for Git
In the next patch we'll have to use alloca() for performance reasons,
but since alloca is non-standardized and is not portable, let's have a
trick with compatibility wrappers:
1. at configure time, determine, do we have working alloca() through
alloca.h, and define
#define HAVE_ALLOCA_H
if yes.
2. in code
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# define xalloca(size) (alloca(size))
# define xalloca_free(p) do {} while(0)
#else
# define xalloca(size) (xmalloc(size))
# define xalloca_free(p) (free(p))
#endif
and use it like
func() {
p = xalloca(size);
...
xalloca_free(p);
}
This way, for systems, where alloca is available, we'll have optimal
on-stack allocations with fast executions. On the other hand, on
systems, where alloca is not available, this gracefully fallbacks to
xmalloc/free.
Both autoconf and config.mak.uname configurations were updated. For
autoconf, we are not bothering considering cases, when no alloca.h is
available, but alloca() works some other way - its simply alloca.h is
available and works or not, everything else is deep legacy.
For config.mak.uname, I've tried to make my almost-sure guess for where
alloca() is available, but since I only have access to Linux it is the
only change I can be sure about myself, with relevant to other changed
systems people Cc'ed.
NOTE
SunOS and Windows had explicit -DHAVE_ALLOCA_H in their configurations.
I've changed that to now-common HAVE_ALLOCA_H=YesPlease which should be
correct.
Cc: Brandon Casey <drafnel@gmail.com>
Cc: Marius Storm-Olsen <mstormo@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Gerrit Pape <pape@smarden.org>
Cc: Petr Salinger <Petr.Salinger@seznam.cz>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Thomas Schwinge <thomas@codesourcery.com> (GNU Hurd changes)
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-27 15:22:50 +01:00
|
|
|
HAVE_ALLOCA_H = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
HAVE_PATHS_H = YesPlease
|
|
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
2020-04-22 17:33:47 +02:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(uname_R),B.11.00)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),B.10.20)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
# Override HP-UX 11.x setting:
|
|
|
|
INLINE =
|
|
|
|
SOCKLEN_T = size_t
|
|
|
|
NO_PREAD = YesPlease
|
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
GIT_TEST_CMP = cmp
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),Windows)
|
|
|
|
GIT_VERSION := $(GIT_VERSION).MSVC
|
|
|
|
pathsep = ;
|
2019-06-25 16:49:39 +02:00
|
|
|
# Assume that this is built in Git for Windows' SDK
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq (MINGW32,$(MSYSTEM))
|
2019-06-25 16:49:39 +02:00
|
|
|
prefix = /mingw32
|
2024-04-08 17:51:44 +02:00
|
|
|
else
|
2019-06-25 16:49:39 +02:00
|
|
|
prefix = /mingw64
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
2019-06-25 16:49:39 +02:00
|
|
|
# Prepend MSVC 64-bit tool-chain to PATH.
|
|
|
|
#
|
|
|
|
# A regular Git Bash *does not* have cl.exe in its $PATH. As there is a
|
|
|
|
# link.exe next to, and required by, cl.exe, we have to prepend this
|
|
|
|
# onto the existing $PATH.
|
|
|
|
#
|
|
|
|
SANE_TOOL_PATH ?= $(msvc_bin_dir_msys)
|
Portable alloca for Git
In the next patch we'll have to use alloca() for performance reasons,
but since alloca is non-standardized and is not portable, let's have a
trick with compatibility wrappers:
1. at configure time, determine, do we have working alloca() through
alloca.h, and define
#define HAVE_ALLOCA_H
if yes.
2. in code
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# define xalloca(size) (alloca(size))
# define xalloca_free(p) do {} while(0)
#else
# define xalloca(size) (xmalloc(size))
# define xalloca_free(p) (free(p))
#endif
and use it like
func() {
p = xalloca(size);
...
xalloca_free(p);
}
This way, for systems, where alloca is available, we'll have optimal
on-stack allocations with fast executions. On the other hand, on
systems, where alloca is not available, this gracefully fallbacks to
xmalloc/free.
Both autoconf and config.mak.uname configurations were updated. For
autoconf, we are not bothering considering cases, when no alloca.h is
available, but alloca() works some other way - its simply alloca.h is
available and works or not, everything else is deep legacy.
For config.mak.uname, I've tried to make my almost-sure guess for where
alloca() is available, but since I only have access to Linux it is the
only change I can be sure about myself, with relevant to other changed
systems people Cc'ed.
NOTE
SunOS and Windows had explicit -DHAVE_ALLOCA_H in their configurations.
I've changed that to now-common HAVE_ALLOCA_H=YesPlease which should be
correct.
Cc: Brandon Casey <drafnel@gmail.com>
Cc: Marius Storm-Olsen <mstormo@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Gerrit Pape <pape@smarden.org>
Cc: Petr Salinger <Petr.Salinger@seznam.cz>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Thomas Schwinge <thomas@codesourcery.com> (GNU Hurd changes)
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-27 15:22:50 +01:00
|
|
|
HAVE_ALLOCA_H = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_PREAD = YesPlease
|
|
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
|
|
NO_LIBGEN_H = YesPlease
|
|
|
|
NO_POLL = YesPlease
|
|
|
|
NO_SYMLINK_HEAD = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
2019-06-25 16:49:39 +02:00
|
|
|
NEEDS_LIBICONV = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
2019-06-25 16:49:39 +02:00
|
|
|
NO_INTTYPES_H = YesPlease
|
wrapper: add a helper to generate numbers from a CSPRNG
There are many situations in which having access to a cryptographically
secure pseudorandom number generator (CSPRNG) is helpful. In the
future, we'll encounter one of these when dealing with temporary files.
To make this possible, let's add a function which reads from a system
CSPRNG and returns some bytes.
We know that all systems will have such an interface. A CSPRNG is
required for a secure TLS or SSH implementation and a Git implementation
which provided neither would be of little practical use. In addition,
POSIX is set to standardize getentropy(2) in the next version, so in the
(potentially distant) future we can rely on that.
For systems which lack one of the other interfaces, we provide the
ability to use OpenSSL's CSPRNG. OpenSSL is highly portable and
functions on practically every known OS, and we know it will have access
to some source of cryptographically secure randomness. We also provide
support for the arc4random in libbsd for folks who would prefer to use
that.
Because this is a security sensitive interface, we take some
precautions. We either succeed by filling the buffer completely as we
requested, or we fail. We don't return partial data because the caller
will almost never find that to be a useful behavior.
Specify a makefile knob which users can use to specify one or more
suitable CSPRNGs, and turn the multiple string options into a set of
defines, since we cannot match on strings in the preprocessor. We allow
multiple options to make the job of handling this in autoconf easier.
The order of options is important here. On systems with arc4random,
which is most of the BSDs, we use that, since, except on MirBSD and
macOS, it uses ChaCha20, which is extremely fast, and sits entirely in
userspace, avoiding a system call. We then prefer getrandom over
getentropy, because the former has been available longer on Linux, and
then OpenSSL. Finally, if none of those are available, we use
/dev/urandom, because most Unix-like operating systems provide that API.
We prefer options that don't involve device files when possible because
those work in some restricted environments where device files may not be
available.
Set the configuration variables appropriately for Linux and the BSDs,
including macOS, as well as Windows and NonStop. We specifically only
consider versions which receive publicly available security support
here. For the same reason, we don't specify getrandom(2) on Linux,
because CentOS 7 doesn't support it in glibc (although its kernel does)
and we don't want to resort to making syscalls.
Finally, add a test helper to allow this to be tested by hand and in
tests. We don't add any tests, since invoking the CSPRNG is not likely
to produce interesting, reproducible results.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-17 22:56:16 +01:00
|
|
|
CSPRNG_METHOD = rtlgenrandom
|
2019-06-25 16:49:39 +02:00
|
|
|
# VS2015 with UCRT claims that snprintf and friends are C99 compliant,
|
|
|
|
# so we don't need this:
|
|
|
|
#
|
|
|
|
# SNPRINTF_RETURNS_BOGUS = YesPlease
|
2022-03-25 19:02:51 +01:00
|
|
|
|
|
|
|
# The builtin FSMonitor requires Named Pipes and Threads on Windows.
|
|
|
|
# These are always available, so we do not have to conditionally
|
|
|
|
# support it.
|
|
|
|
FSMONITOR_DAEMON_BACKEND = win32
|
2022-05-26 23:46:59 +02:00
|
|
|
FSMONITOR_OS_SETTINGS = win32
|
|
|
|
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_SVN_TESTS = YesPlease
|
|
|
|
RUNTIME_PREFIX = YesPlease
|
2018-04-10 17:05:46 +02:00
|
|
|
HAVE_WPGMPTR = YesWeDo
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
2021-03-15 22:08:23 +01:00
|
|
|
USE_WIN32_IPC = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
USE_WIN32_MMAP = YesPlease
|
2017-09-25 10:00:10 +02:00
|
|
|
MMAP_PREVENTS_DELETE = UnfortunatelyYes
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
# USE_NED_ALLOCATOR = YesPlease
|
|
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
|
|
|
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
|
|
|
NO_REGEX = YesPlease
|
2013-09-11 01:21:53 +02:00
|
|
|
NO_GETTEXT = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_PYTHON = YesPlease
|
2013-01-31 19:33:57 +01:00
|
|
|
ETAGS_TARGET = ETAGS
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_POSIX_GOODIES = UnfortunatelyYes
|
|
|
|
NATIVE_CRLF = YesPlease
|
|
|
|
DEFAULT_HELP_FORMAT = html
|
mingw: move Git for Windows' system config where users expect it
Git for Windows' prefix is `/mingw64/` (or `/mingw32/` for 32-bit
versions), therefore the system config is located at the clunky location
`C:\Program Files\Git\mingw64\etc\gitconfig`.
This moves the system config into a more logical location: the `mingw64`
part of `C:\Program Files\Git\mingw64\etc\gitconfig` never made sense,
as it is a mere implementation detail. Let's skip the `mingw64` part and
move this to `C:\Program Files\Git\etc\gitconfig`.
Side note: in the rare (and not recommended) case a user chooses to
install 32-bit Git for Windows on a 64-bit system, the path will of
course be `C:\Program Files (x86)\Git\etc\gitconfig`.
Background: During the Git for Windows v1.x days, the system config was
located at `C:\Program Files (x86)\Git\etc\gitconfig`. With Git for
Windows v2.x, it moved to `C:\Program Files\Git\mingw64\gitconfig` (or
`C:\Program Files (x86)\Git\mingw32\gitconfig`). Rather than fixing it
back then, we tried to introduce a "Windows-wide" config, but that never
caught on.
Likewise, we move the system `gitattributes` into the same directory.
Obviously, we are cautious to do this only for the known install
locations `/mingw64` and `/mingw32`; If anybody wants to override that
while building their version of Git (e.g. via `make prefix=$HOME`), we
leave the default location of the system config and gitattributes alone.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-06-22 12:46:46 +02:00
|
|
|
ifeq (/mingw64,$(subst 32,64,$(prefix)))
|
|
|
|
# Move system config into top-level /etc/
|
|
|
|
ETC_GITCONFIG = ../etc/gitconfig
|
|
|
|
ETC_GITATTRIBUTES = ../etc/gitattributes
|
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
|
|
|
|
CC = compat/vcbuild/scripts/clink.pl
|
|
|
|
AR = compat/vcbuild/scripts/lib.pl
|
|
|
|
CFLAGS =
|
2019-06-25 16:49:39 +02:00
|
|
|
BASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
COMPAT_OBJS = compat/msvc.o compat/winansi.o \
|
2022-03-10 23:43:20 +01:00
|
|
|
compat/win32/flush.o \
|
2019-04-08 13:26:16 +02:00
|
|
|
compat/win32/path-utils.o \
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
compat/win32/pthread.o compat/win32/syslog.o \
|
2019-02-22 23:25:02 +01:00
|
|
|
compat/win32/trace2_win32_process_info.o \
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
compat/win32/dirent.o
|
2019-06-25 16:49:39 +02:00
|
|
|
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
|
mingw: replace mingw_startup() hack
Git for Windows has special code to retrieve the command-line parameters
(and even the environment) in UTF-16 encoding, so that they can be
converted to UTF-8. This is necessary because Git for Windows wants to
use UTF-8 encoded strings throughout its code, and the main() function
does not get the parameters in that encoding.
To do that, we used the __wgetmainargs() function, which is not even a
Win32 API function, but provided by the MINGW "runtime" instead.
Obviously, this method would not work with any compiler other than GCC,
and in preparation for compiling with Visual C++, we would like to avoid
precisely that.
Lucky us, there is a much more elegant way: we can simply implement the
UTF-16 variant of `main()`: `wmain()`.
To make that work, we need to link with -municode. The command-line
parameters are passed to `wmain()` encoded in UTF-16, as desired, and
this method also works with GCC, and also with Visual C++ after
adjusting the MSVC linker flags to force it to use `wmain()`.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-19 23:05:59 +02:00
|
|
|
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -ENTRY:wmainCRTStartup -SUBSYSTEM:CONSOLE
|
2019-06-25 16:49:39 +02:00
|
|
|
# invalidcontinue.obj allows Git's source code to close the same file
|
|
|
|
# handle twice, or to access the osfhandle of an already-closed stdout
|
|
|
|
# See https://msdn.microsoft.com/en-us/library/ms235330.aspx
|
|
|
|
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj kernel32.lib ntdll.lib
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
PTHREAD_LIBS =
|
|
|
|
lib =
|
2019-06-25 16:49:39 +02:00
|
|
|
BASIC_CFLAGS += $(vcpkg_inc) $(sdk_includes) $(msvc_includes)
|
|
|
|
ifndef DEBUG
|
|
|
|
BASIC_CFLAGS += $(vcpkg_rel_lib)
|
|
|
|
else
|
|
|
|
BASIC_CFLAGS += $(vcpkg_dbg_lib)
|
|
|
|
endif
|
|
|
|
BASIC_CFLAGS += $(sdk_libs) $(msvc_libs)
|
|
|
|
|
2019-06-25 16:49:40 +02:00
|
|
|
ifneq ($(USE_MSVC_CRTDBG),)
|
|
|
|
# Optionally enable memory leak reporting.
|
|
|
|
BASIC_CFLAGS += -DUSE_MSVC_CRTDBG
|
|
|
|
endif
|
2019-06-25 16:49:39 +02:00
|
|
|
# Always give "-Zi" to the compiler and "-debug" to linker (even in
|
|
|
|
# release mode) to force a PDB to be generated (like RelWithDebInfo).
|
|
|
|
BASIC_CFLAGS += -Zi
|
|
|
|
BASIC_LDFLAGS += -debug -Zf
|
|
|
|
|
|
|
|
ifdef NO_SAFESEH
|
|
|
|
LDFLAGS += -SAFESEH:NO
|
|
|
|
endif
|
|
|
|
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
ifndef DEBUG
|
2019-06-25 16:49:39 +02:00
|
|
|
BASIC_CFLAGS += -GL -Gy -O2 -Oy- -MD -DNDEBUG
|
|
|
|
BASIC_LDFLAGS += -release -LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:CV,FIXUP
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
AR += -LTCG
|
|
|
|
else
|
2019-06-25 16:49:39 +02:00
|
|
|
BASIC_CFLAGS += -MDd -DDEBUG -D_DEBUG
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
|
|
|
X = .exe
|
2019-06-19 23:06:00 +02:00
|
|
|
|
2023-08-09 18:54:46 +02:00
|
|
|
EXTRA_PROGRAMS += headless-git$X
|
|
|
|
|
2019-06-19 23:06:00 +02:00
|
|
|
compat/msvc.o: compat/msvc.c compat/mingw.c GIT-CFLAGS
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),Interix)
|
|
|
|
NO_INITGROUPS = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(uname_R),3.5)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
|
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5.2)
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
|
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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_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
|
2019-01-03 22:03:49 +01:00
|
|
|
# Build down-rev compatible objects that don't use our new getopt_long.
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(uname_R).$(uname_V),J06.21)
|
2019-01-03 22:03:49 +01:00
|
|
|
CC += -WRVU=J06.20
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_R).$(uname_V),L17.02)
|
2019-01-03 22:03:49 +01:00
|
|
|
CC += -WRVU=L16.05
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
# 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.
|
2019-01-03 22:03:49 +01:00
|
|
|
CFLAGS = -g -O0 -Winline
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
# We'd want it to be here.
|
|
|
|
prefix = /usr/local
|
2019-01-03 22:03:49 +01:00
|
|
|
# perl and python must be in /usr/bin on NonStop - supplied by HPE
|
|
|
|
# with operating system in that managed directory.
|
|
|
|
PERL_PATH = /usr/bin/perl
|
|
|
|
PYTHON_PATH = /usr/bin/python
|
|
|
|
# The current /usr/coreutils/rm at lowest support level does not work
|
|
|
|
# with the git test structure. Long paths as in
|
|
|
|
# 'trash directory...' cause rm to terminate prematurely without fully
|
|
|
|
# removing the directory at OS releases J06.21 and L17.02.
|
|
|
|
# Default to the older rm until those two releases are deprecated.
|
|
|
|
RM = /bin/rm -f
|
|
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
|
|
HAVE_DEV_TTY = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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
|
2019-01-03 22:03:49 +01:00
|
|
|
NO_GETTEXT = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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
|
2019-01-03 22:03:49 +01:00
|
|
|
NO_REGEX = NeedsStartEnd
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_PTHREADS = UnfortunatelyYes
|
2019-02-10 01:20:16 +01:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
|
|
|
|
# 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
|
wrapper: add a helper to generate numbers from a CSPRNG
There are many situations in which having access to a cryptographically
secure pseudorandom number generator (CSPRNG) is helpful. In the
future, we'll encounter one of these when dealing with temporary files.
To make this possible, let's add a function which reads from a system
CSPRNG and returns some bytes.
We know that all systems will have such an interface. A CSPRNG is
required for a secure TLS or SSH implementation and a Git implementation
which provided neither would be of little practical use. In addition,
POSIX is set to standardize getentropy(2) in the next version, so in the
(potentially distant) future we can rely on that.
For systems which lack one of the other interfaces, we provide the
ability to use OpenSSL's CSPRNG. OpenSSL is highly portable and
functions on practically every known OS, and we know it will have access
to some source of cryptographically secure randomness. We also provide
support for the arc4random in libbsd for folks who would prefer to use
that.
Because this is a security sensitive interface, we take some
precautions. We either succeed by filling the buffer completely as we
requested, or we fail. We don't return partial data because the caller
will almost never find that to be a useful behavior.
Specify a makefile knob which users can use to specify one or more
suitable CSPRNGs, and turn the multiple string options into a set of
defines, since we cannot match on strings in the preprocessor. We allow
multiple options to make the job of handling this in autoconf easier.
The order of options is important here. On systems with arc4random,
which is most of the BSDs, we use that, since, except on MirBSD and
macOS, it uses ChaCha20, which is extremely fast, and sits entirely in
userspace, avoiding a system call. We then prefer getrandom over
getentropy, because the former has been available longer on Linux, and
then OpenSSL. Finally, if none of those are available, we use
/dev/urandom, because most Unix-like operating systems provide that API.
We prefer options that don't involve device files when possible because
those work in some restricted environments where device files may not be
available.
Set the configuration variables appropriately for Linux and the BSDs,
including macOS, as well as Windows and NonStop. We specifically only
consider versions which receive publicly available security support
here. For the same reason, we don't specify getrandom(2) on Linux,
because CentOS 7 doesn't support it in glibc (although its kernel does)
and we don't want to resort to making syscalls.
Finally, add a test helper to allow this to be tested by hand and in
tests. We don't add any tests, since invoking the CSPRNG is not likely
to produce interesting, reproducible results.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-17 22:56:16 +01:00
|
|
|
CSPRNG_METHOD = openssl
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
SANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin
|
2019-02-09 18:26:11 +01:00
|
|
|
SHELL_PATH = /usr/coreutils/bin/bash
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
2024-03-06 06:44:17 +01:00
|
|
|
ifeq ($(uname_S),OS/390)
|
|
|
|
NO_SYS_POLL_H = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_REGEX = YesPlease
|
|
|
|
NO_MMAP = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_GECOS_IN_PWENT = YesPlease
|
|
|
|
HAVE_STRINGS_H = YesPlease
|
|
|
|
NEEDS_MODE_TRANSLATION = YesPlease
|
2024-08-22 15:52:12 +02:00
|
|
|
HAVE_ZOS_GET_EXECUTABLE_PATH = YesPlease
|
2024-03-06 06:44:17 +01:00
|
|
|
endif
|
2021-09-29 05:19:40 +02:00
|
|
|
ifeq ($(uname_S),MINGW)
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '1\.'),2)
|
2023-02-02 04:51:38 +01:00
|
|
|
$(error "Building with MSys is no longer supported")
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
pathsep = ;
|
2014-04-09 14:48:27 +02:00
|
|
|
HAVE_ALLOCA_H = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_PREAD = YesPlease
|
|
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
|
|
NO_LIBGEN_H = YesPlease
|
|
|
|
NO_POLL = YesPlease
|
|
|
|
NO_SYMLINK_HEAD = 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
|
2022-03-25 19:02:51 +01:00
|
|
|
|
|
|
|
# The builtin FSMonitor requires Named Pipes and Threads on Windows.
|
|
|
|
# These are always available, so we do not have to conditionally
|
|
|
|
# support it.
|
|
|
|
FSMONITOR_DAEMON_BACKEND = win32
|
2022-05-26 23:46:59 +02:00
|
|
|
FSMONITOR_OS_SETTINGS = win32
|
|
|
|
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
RUNTIME_PREFIX = YesPlease
|
2018-04-10 17:05:46 +02:00
|
|
|
HAVE_WPGMPTR = YesWeDo
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
2021-03-15 22:08:23 +01:00
|
|
|
USE_WIN32_IPC = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
USE_WIN32_MMAP = YesPlease
|
2017-09-25 10:00:10 +02:00
|
|
|
MMAP_PREVENTS_DELETE = UnfortunatelyYes
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
|
|
|
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
|
|
|
NO_REGEX = YesPlease
|
|
|
|
ETAGS_TARGET = ETAGS
|
|
|
|
NO_POSIX_GOODIES = UnfortunatelyYes
|
2012-06-21 13:24:14 +02:00
|
|
|
DEFAULT_HELP_FORMAT = html
|
2021-07-22 03:27:06 +02:00
|
|
|
HAVE_PLATFORM_PROCINFO = YesPlease
|
wrapper: add a helper to generate numbers from a CSPRNG
There are many situations in which having access to a cryptographically
secure pseudorandom number generator (CSPRNG) is helpful. In the
future, we'll encounter one of these when dealing with temporary files.
To make this possible, let's add a function which reads from a system
CSPRNG and returns some bytes.
We know that all systems will have such an interface. A CSPRNG is
required for a secure TLS or SSH implementation and a Git implementation
which provided neither would be of little practical use. In addition,
POSIX is set to standardize getentropy(2) in the next version, so in the
(potentially distant) future we can rely on that.
For systems which lack one of the other interfaces, we provide the
ability to use OpenSSL's CSPRNG. OpenSSL is highly portable and
functions on practically every known OS, and we know it will have access
to some source of cryptographically secure randomness. We also provide
support for the arc4random in libbsd for folks who would prefer to use
that.
Because this is a security sensitive interface, we take some
precautions. We either succeed by filling the buffer completely as we
requested, or we fail. We don't return partial data because the caller
will almost never find that to be a useful behavior.
Specify a makefile knob which users can use to specify one or more
suitable CSPRNGs, and turn the multiple string options into a set of
defines, since we cannot match on strings in the preprocessor. We allow
multiple options to make the job of handling this in autoconf easier.
The order of options is important here. On systems with arc4random,
which is most of the BSDs, we use that, since, except on MirBSD and
macOS, it uses ChaCha20, which is extremely fast, and sits entirely in
userspace, avoiding a system call. We then prefer getrandom over
getentropy, because the former has been available longer on Linux, and
then OpenSSL. Finally, if none of those are available, we use
/dev/urandom, because most Unix-like operating systems provide that API.
We prefer options that don't involve device files when possible because
those work in some restricted environments where device files may not be
available.
Set the configuration variables appropriately for Linux and the BSDs,
including macOS, as well as Windows and NonStop. We specifically only
consider versions which receive publicly available security support
here. For the same reason, we don't specify getrandom(2) on Linux,
because CentOS 7 doesn't support it in glibc (although its kernel does)
and we don't want to resort to making syscalls.
Finally, add a test helper to allow this to be tested by hand and in
tests. We don't add any tests, since invoking the CSPRNG is not likely
to produce interesting, reproducible results.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-17 22:56:16 +01:00
|
|
|
CSPRNG_METHOD = rtlgenrandom
|
mingw: replace mingw_startup() hack
Git for Windows has special code to retrieve the command-line parameters
(and even the environment) in UTF-16 encoding, so that they can be
converted to UTF-8. This is necessary because Git for Windows wants to
use UTF-8 encoded strings throughout its code, and the main() function
does not get the parameters in that encoding.
To do that, we used the __wgetmainargs() function, which is not even a
Win32 API function, but provided by the MINGW "runtime" instead.
Obviously, this method would not work with any compiler other than GCC,
and in preparation for compiling with Visual C++, we would like to avoid
precisely that.
Lucky us, there is a much more elegant way: we can simply implement the
UTF-16 variant of `main()`: `wmain()`.
To make that work, we need to link with -municode. The command-line
parameters are passed to `wmain()` encoded in UTF-16, as desired, and
this method also works with GCC, and also with Visual C++ after
adjusting the MSVC linker flags to force it to use `wmain()`.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-19 23:05:59 +02:00
|
|
|
BASIC_LDFLAGS += -municode
|
2016-01-13 14:31:01 +01:00
|
|
|
COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
|
|
|
|
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
|
2019-02-22 23:25:02 +01:00
|
|
|
compat/win32/trace2_win32_process_info.o \
|
2022-03-10 23:43:20 +01:00
|
|
|
compat/win32/flush.o \
|
2018-12-15 05:33:30 +01:00
|
|
|
compat/win32/path-utils.o \
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
compat/win32/pthread.o compat/win32/syslog.o \
|
|
|
|
compat/win32/dirent.o
|
2019-12-04 22:27:04 +01:00
|
|
|
BASIC_CFLAGS += -DWIN32
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
EXTLIBS += -lws2_32
|
2012-05-24 01:56:24 +02:00
|
|
|
GITLIBS += git.res
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
PTHREAD_LIBS =
|
2012-05-24 01:56:24 +02:00
|
|
|
RC = windres -O coff
|
2010-09-04 10:25:09 +02:00
|
|
|
NATIVE_CRLF = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
X = .exe
|
2023-02-02 04:51:38 +01:00
|
|
|
# MSys2
|
|
|
|
prefix = /usr/
|
|
|
|
# Enable DEP
|
|
|
|
BASIC_LDFLAGS += -Wl,--nxcompat
|
|
|
|
# Enable ASLR (unless debugging)
|
2024-04-08 17:51:44 +02:00
|
|
|
ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
|
2023-02-02 04:51:38 +01:00
|
|
|
BASIC_LDFLAGS += -Wl,--dynamicbase
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq (MINGW32,$(MSYSTEM))
|
2023-02-02 04:51:38 +01:00
|
|
|
prefix = /mingw32
|
|
|
|
HOST_CPU = i686
|
|
|
|
BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
|
|
|
ifeq (MINGW64,$(MSYSTEM))
|
2023-02-02 04:51:38 +01:00
|
|
|
prefix = /mingw64
|
|
|
|
HOST_CPU = x86_64
|
|
|
|
BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
|
2024-04-08 17:51:44 +02:00
|
|
|
else
|
2023-02-02 04:51:38 +01:00
|
|
|
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
|
|
|
|
BASIC_LDFLAGS += -Wl,--large-address-aware
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
2023-02-02 04:51:38 +01:00
|
|
|
CC = gcc
|
|
|
|
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
|
|
|
|
-fstack-protector-strong
|
|
|
|
EXTLIBS += -lntdll
|
2023-08-09 18:54:46 +02:00
|
|
|
EXTRA_PROGRAMS += headless-git$X
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
INSTALL = /bin/install
|
|
|
|
INTERNAL_QSORT = YesPlease
|
|
|
|
HAVE_LIBCHARSET_H = YesPlease
|
2023-02-02 04:51:38 +01:00
|
|
|
USE_GETTEXT_SCHEME = fallthrough
|
|
|
|
USE_LIBPCRE = YesPlease
|
|
|
|
USE_NED_ALLOCATOR = YesPlease
|
2024-04-08 17:51:44 +02:00
|
|
|
ifeq (/mingw64,$(subst 32,64,$(prefix)))
|
2023-02-02 04:51:38 +01:00
|
|
|
# Move system config into top-level /etc/
|
|
|
|
ETC_GITCONFIG = ../etc/gitconfig
|
|
|
|
ETC_GITATTRIBUTES = ../etc/gitattributes
|
2024-04-08 17:51:44 +02:00
|
|
|
endif
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),QNX)
|
|
|
|
COMPAT_CFLAGS += -DSA_RESTART=0
|
2013-02-11 23:03:45 +01:00
|
|
|
EXPAT_NEEDS_XMLPARSE_H = YesPlease
|
Makefile: hoist uname autodetection to config.mak.uname
Our Makefile first sets up some sane per-platform defaults
by looking at "uname", then modifies that according to the
results of autoconf (if any), then modifies that according
to the user's wishes in config.mak.
For sub-Makefiles like Documentation/Makefile, the latter
two are available, but the uname defaults are available only
to the main Makefile. This hasn't been a problem so far,
because the sub-Makefiles do not rely on any of those
automatic settings to do their work.
This patch puts the uname magic into its own file so it can
be reused in other Makefiles, opening up the possibility of
new knobs.
Note that we leave one reference to uname in the top-level
Makefile: if we are on Darwin, we must check the NO_FINK and
NO_DARWIN_PORTS settings. But because we are combining uname
settings with user-options, we must do so after all of the
config is loaded. This is acceptable, as the resulting
conditionals are about setting variables specific to the
top-level Makefile (and if that ever changes, we can hoist
them into a separate post-config include, too).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-03 22:05:41 +01:00
|
|
|
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_STRCASESTR = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
endif
|
2019-07-29 22:08:12 +02:00
|
|
|
|
|
|
|
vcxproj:
|
|
|
|
# Require clean work tree
|
|
|
|
git update-index -q --refresh && \
|
|
|
|
git diff-files --quiet && \
|
|
|
|
git diff-index --cached --quiet HEAD --
|
|
|
|
|
|
|
|
# Make .vcxproj files and add them
|
|
|
|
perl contrib/buildsystems/generate -g Vcxproj
|
|
|
|
git add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj
|
|
|
|
|
2019-10-04 17:09:31 +02:00
|
|
|
# Generate the LinkOrCopyBuiltins.targets and LinkOrCopyRemoteHttp.targets file
|
2019-07-29 22:08:13 +02:00
|
|
|
(echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \
|
|
|
|
echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \
|
|
|
|
for name in $(BUILT_INS);\
|
|
|
|
do \
|
|
|
|
echo ' <Copy SourceFiles="$$(OutDir)\git.exe" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
|
|
|
|
done && \
|
2019-10-04 17:09:31 +02:00
|
|
|
echo ' </Target>' && \
|
|
|
|
echo '</Project>') >git/LinkOrCopyBuiltins.targets
|
|
|
|
(echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \
|
|
|
|
echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \
|
2019-07-29 22:08:13 +02:00
|
|
|
for name in $(REMOTE_CURL_ALIASES); \
|
|
|
|
do \
|
|
|
|
echo ' <Copy SourceFiles="$$(OutDir)\'"$(REMOTE_CURL_PRIMARY)"'" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
|
|
|
|
done && \
|
|
|
|
echo ' </Target>' && \
|
2019-10-04 17:09:31 +02:00
|
|
|
echo '</Project>') >git-remote-http/LinkOrCopyRemoteHttp.targets
|
|
|
|
git add -f git/LinkOrCopyBuiltins.targets git-remote-http/LinkOrCopyRemoteHttp.targets
|
2019-07-29 22:08:13 +02:00
|
|
|
|
Makefile: stop hardcoding {command,config}-list.h
Change various places that hardcode the names of these two files to
refer to either $(GENERATED_H), or to a new generated-hdrs
target. That target is consistent with the *-objs targets I recently
added in 029bac01a8 (Makefile: add {program,xdiff,test,git,fuzz}-objs
& objects targets, 2021-02-23).
A subsequent commit will add a new generated hook-list.h. By doing
this refactoring we'll only need to add the new file to the
GENERATED_H variable, not EXCEPT_HDRS, the vcbuild/README etc.
Hardcoding command-list.h there seems to have been a case of
copy/paste programming in 976aaedca0 (msvc: add a Makefile target to
pre-generate the Visual Studio solution, 2019-07-29). The
config-list.h was added later in 709df95b78 (help: move
list_config_help to builtin/help, 2020-04-16).
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-23 12:29:57 +02:00
|
|
|
# Add generated headers
|
|
|
|
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(GENERATED_H)
|
|
|
|
git add -f $(GENERATED_H)
|
2019-07-29 22:08:12 +02:00
|
|
|
|
|
|
|
# Add scripts
|
|
|
|
rm -f perl/perl.mak
|
2019-10-04 17:09:32 +02:00
|
|
|
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(SCRIPT_LIB) $(SCRIPTS)
|
2019-07-29 22:08:12 +02:00
|
|
|
# Strip out the sane tool path, needed only for building
|
|
|
|
sed -i '/^git_broken_path_fix ".*/d' git-sh-setup
|
2019-10-04 17:09:32 +02:00
|
|
|
git add -f $(SCRIPT_LIB) $(SCRIPTS)
|
2019-07-29 22:08:12 +02:00
|
|
|
|
|
|
|
# Add Perl module
|
|
|
|
$(MAKE) $(LIB_PERL_GEN)
|
|
|
|
git add -f perl/build
|
|
|
|
|
|
|
|
# Add bin-wrappers, for testing
|
|
|
|
rm -rf bin-wrappers/
|
|
|
|
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(test_bindir_programs)
|
|
|
|
# Ensure that the GIT_EXEC_PATH is a Unix-y one, and that the absolute
|
|
|
|
# path of the repository is not hard-coded (GIT_EXEC_PATH will be set
|
|
|
|
# by test-lib.sh according to the current setup)
|
|
|
|
sed -i -e 's/^\(GIT_EXEC_PATH\)=.*/test -n "$${\1##*:*}" ||\
|
|
|
|
\1="$$(cygpath -u "$$\1")"/' \
|
|
|
|
-e "s|'$$(pwd)|\"\$$GIT_EXEC_PATH\"'|g" bin-wrappers/*
|
|
|
|
# Ensure that test-* helpers find the .dll files copied to top-level
|
|
|
|
sed -i 's|^PATH=.*|&:"$$GIT_EXEC_PATH"|' bin-wrappers/test-*
|
|
|
|
# We do not want to force hard-linking builtins
|
|
|
|
sed -i 's|\(git\)-\([-a-z]*\)\.exe"|\1.exe" \2|g' \
|
|
|
|
bin-wrappers/git-{receive-pack,upload-archive}
|
|
|
|
git add -f $(test_bindir_programs)
|
|
|
|
# remote-ext is a builtin, but invoked as if it were external
|
|
|
|
sed 's|receive-pack|remote-ext|g' \
|
|
|
|
<bin-wrappers/git-receive-pack >bin-wrappers/git-remote-ext
|
|
|
|
git add -f bin-wrappers/git-remote-ext
|
|
|
|
|
|
|
|
# Add templates
|
|
|
|
$(MAKE) -C templates
|
|
|
|
git add -f templates/boilerplates.made templates/blt/
|
|
|
|
|
2019-10-04 17:09:32 +02:00
|
|
|
# Add the translated messages
|
|
|
|
make MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(MOFILES)
|
|
|
|
git add -f $(MOFILES)
|
|
|
|
|
2019-07-29 22:08:12 +02:00
|
|
|
# Add build options
|
|
|
|
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 GIT-BUILD-OPTIONS
|
|
|
|
git add -f GIT-BUILD-OPTIONS
|
|
|
|
|
|
|
|
# Commit the whole shebang
|
|
|
|
git commit -m "Generate Visual Studio solution" \
|
|
|
|
-m "Auto-generated by \`$(MAKE)$(MAKEFLAGS) $@\`"
|