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-04 01:05:41 +04:00
|
|
|
# Platform specific Makefile tweaks based on uname detection
|
|
|
|
|
|
|
|
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
|
|
|
uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
|
|
|
|
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
|
|
|
|
uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
|
|
|
|
uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
|
|
|
|
uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
|
|
|
|
|
|
|
|
ifdef MSVC
|
|
|
|
# avoid the MingW and Cygwin configuration sections
|
|
|
|
uname_S := Windows
|
|
|
|
uname_O := Windows
|
|
|
|
endif
|
|
|
|
|
|
|
|
# We choose to avoid "if .. else if .. else .. endif endif"
|
|
|
|
# because maintaining the nesting to match is a pain. If
|
|
|
|
# we had "elif" things would have been much nicer...
|
|
|
|
|
|
|
|
ifeq ($(uname_S),OSF1)
|
|
|
|
# Need this for u_short definitions et al
|
|
|
|
BASIC_CFLAGS += -D_OSF_SOURCE
|
|
|
|
SOCKLEN_T = int
|
|
|
|
NO_STRTOULL = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),Linux)
|
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 18:22:50 +04: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-04 01:05:41 +04:00
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
HAVE_PATHS_H = YesPlease
|
|
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
|
|
|
HAVE_DEV_TTY = YesPlease
|
2014-07-12 04:05:42 +04:00
|
|
|
HAVE_CLOCK_GETTIME = YesPlease
|
2015-01-08 23:00:56 +03:00
|
|
|
HAVE_CLOCK_MONOTONIC = YesPlease
|
2016-07-11 01:16:44 +03:00
|
|
|
# -lrt is needed for clock_gettime on glibc <= 2.16
|
|
|
|
NEEDS_LIBRT = YesPlease
|
2015-04-16 12:01:38 +03:00
|
|
|
HAVE_GETDELIM = YesPlease
|
2016-03-09 02:47:57 +03:00
|
|
|
SANE_TEXT_GREP=-a
|
2017-05-03 13:16:48 +03: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-04 01:05:41 +04: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 18:22:50 +04: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-04 01:05:41 +04:00
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
HAVE_PATHS_H = YesPlease
|
|
|
|
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
|
|
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
2017-05-03 13:16:48 +03: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-04 01:05:41 +04: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)
|
|
|
|
ifeq ($(uname_R),3.2)
|
|
|
|
CFLAGS = -O2
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5)
|
|
|
|
CC = cc
|
|
|
|
BASIC_CFLAGS += -Kthread
|
|
|
|
endif
|
|
|
|
NEEDS_SOCKET = YesPlease
|
|
|
|
NEEDS_NSL = YesPlease
|
|
|
|
NEEDS_SSL_WITH_CRYPTO = YesPlease
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
SHELL_PATH = /usr/bin/bash
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
NO_HSTRERROR = YesPlease
|
|
|
|
BASIC_CFLAGS += -I/usr/local/include
|
|
|
|
BASIC_LDFLAGS += -L/usr/local/lib
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
INSTALL = ginstall
|
|
|
|
TAR = gtar
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),Darwin)
|
|
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
|
|
NEEDS_SSL_WITH_CRYPTO = YesPlease
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
2014-08-15 21:02:46 +04: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".
|
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-04 01:05:41 +04:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
|
|
|
|
OLD_ICONV = UnfortunatelyYes
|
2014-08-15 11:46:11 +04:00
|
|
|
NO_APPLE_COMMON_CRYPTO = 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-04 01:05:41 +04:00
|
|
|
endif
|
|
|
|
ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
endif
|
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-03 00:15:43 +03:00
|
|
|
ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1)
|
|
|
|
HAVE_GETDELIM = YesPlease
|
|
|
|
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-04 01:05:41 +04: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 02:15:20 +03:00
|
|
|
BASIC_CFLAGS += -DPROTECT_HFS_DEFAULT=1
|
2015-03-08 10:14:36 +03:00
|
|
|
HAVE_BSD_SYSCTL = YesPlease
|
2017-05-10 07:44:33 +03: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-04 01:05:41 +04: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 18:22:50 +04: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-04 01:05:41 +04:00
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
NO_REGEX = YesPlease
|
|
|
|
NO_MSGFMT_EXTENDED_OPTIONS = YesPlease
|
|
|
|
HAVE_DEV_TTY = YesPlease
|
|
|
|
ifeq ($(uname_R),5.6)
|
|
|
|
SOCKLEN_T = int
|
|
|
|
NO_HSTRERROR = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
GIT_TEST_CMP = cmp
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5.7)
|
|
|
|
NEEDS_RESOLV = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
GIT_TEST_CMP = cmp
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5.8)
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
GIT_TEST_CMP = cmp
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5.9)
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
GIT_TEST_CMP = cmp
|
|
|
|
endif
|
|
|
|
INSTALL = /usr/ucb/install
|
|
|
|
TAR = gtar
|
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 18:22:50 +04: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-04 01:05:41 +04:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_O),Cygwin)
|
|
|
|
ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
|
|
|
|
NO_D_TYPE_IN_DIRENT = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_SYMLINK_HEAD = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
OLD_ICONV = UnfortunatelyYes
|
2013-07-20 03:08:30 +04: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
|
2013-07-20 03:08:28 +04:00
|
|
|
else
|
|
|
|
NO_REGEX = 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-04 01:05:41 +04:00
|
|
|
endif
|
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 18:22:50 +04: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-04 01:05:41 +04:00
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
|
|
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
|
|
X = .exe
|
|
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
|
|
|
SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
|
2015-08-07 23:30:28 +03:00
|
|
|
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
2017-07-03 17:41:37 +03:00
|
|
|
COMPAT_OBJS += compat/cygwin.o
|
2017-07-21 21:43:17 +03: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-04 01:05:41 +04:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),FreeBSD)
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
OLD_ICONV = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
BASIC_CFLAGS += -I/usr/local/include
|
|
|
|
BASIC_LDFLAGS += -L/usr/local/lib
|
|
|
|
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
|
|
|
|
USE_ST_TIMESPEC = YesPlease
|
|
|
|
ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
|
|
|
|
PTHREAD_LIBS = -pthread
|
|
|
|
NO_UINTMAX_T = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
endif
|
|
|
|
PYTHON_PATH = /usr/local/bin/python
|
2016-07-25 19:21:25 +03: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-04 01:05:41 +04:00
|
|
|
HAVE_PATHS_H = YesPlease
|
2014-04-02 01:28:42 +04:00
|
|
|
GMTIME_UNRELIABLE_ERRORS = UnfortunatelyYes
|
2015-03-08 10:14:36 +03:00
|
|
|
HAVE_BSD_SYSCTL = YesPlease
|
2016-08-04 14:40:25 +03:00
|
|
|
PAGER_ENV = LESS=FRX LV=-c MORE=FRX
|
2017-05-03 13:16:48 +03: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-04 01:05:41 +04: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 10:14:36 +03:00
|
|
|
HAVE_BSD_SYSCTL = YesPlease
|
2013-12-31 18:36:45 +04: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 10:14:36 +03:00
|
|
|
HAVE_BSD_SYSCTL = 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-04 01:05:41 +04:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),NetBSD)
|
|
|
|
ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
endif
|
|
|
|
BASIC_CFLAGS += -I/usr/pkg/include
|
|
|
|
BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
|
|
|
|
USE_ST_TIMESPEC = YesPlease
|
|
|
|
HAVE_PATHS_H = YesPlease
|
2015-03-08 10:14:36 +03:00
|
|
|
HAVE_BSD_SYSCTL = 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-04 01:05:41 +04: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 16:54:30 +03: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-04 01:05:41 +04:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
|
|
|
INTERNAL_QSORT = UnfortunatelyYes
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
BASIC_CFLAGS += -D_LARGE_FILES
|
|
|
|
ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
|
|
|
|
NO_PTHREADS = YesPlease
|
|
|
|
else
|
|
|
|
PTHREAD_LIBS = -lpthread
|
|
|
|
endif
|
|
|
|
ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3)
|
|
|
|
INLINE = ''
|
|
|
|
endif
|
|
|
|
GIT_TEST_CMP = cmp
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),GNU)
|
|
|
|
# GNU/Hurd
|
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 18:22:50 +04: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-04 01:05:41 +04:00
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
HAVE_PATHS_H = YesPlease
|
|
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),IRIX)
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
# When compiled with the MIPSpro 7.4.4m compiler, and without pthreads
|
|
|
|
# (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),
|
|
|
|
# git dies with a segmentation fault when trying to access the first
|
|
|
|
# entry of a reflog. The conservative choice is made to always set
|
|
|
|
# NO_MMAP. If you suspect that your compiler is not affected by this
|
|
|
|
# issue, comment out the NO_MMAP statement.
|
|
|
|
NO_MMAP = YesPlease
|
|
|
|
NO_REGEX = YesPlease
|
|
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
|
|
|
SHELL_PATH = /usr/gnu/bin/bash
|
|
|
|
NEEDS_LIBGEN = YesPlease
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),IRIX64)
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
# When compiled with the MIPSpro 7.4.4m compiler, and without pthreads
|
|
|
|
# (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),
|
|
|
|
# git dies with a segmentation fault when trying to access the first
|
|
|
|
# entry of a reflog. The conservative choice is made to always set
|
|
|
|
# NO_MMAP. If you suspect that your compiler is not affected by this
|
|
|
|
# issue, comment out the NO_MMAP statement.
|
|
|
|
NO_MMAP = YesPlease
|
|
|
|
NO_REGEX = YesPlease
|
|
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
|
|
|
SHELL_PATH = /usr/gnu/bin/bash
|
|
|
|
NEEDS_LIBGEN = YesPlease
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),HP-UX)
|
|
|
|
INLINE = __inline
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_HSTRERROR = YesPlease
|
|
|
|
NO_SYS_SELECT_H = YesPlease
|
|
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
|
|
|
ifeq ($(uname_R),B.11.00)
|
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),B.10.20)
|
|
|
|
# Override HP-UX 11.x setting:
|
|
|
|
INLINE =
|
|
|
|
SOCKLEN_T = size_t
|
|
|
|
NO_PREAD = YesPlease
|
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
|
|
|
endif
|
|
|
|
GIT_TEST_CMP = cmp
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),Windows)
|
|
|
|
GIT_VERSION := $(GIT_VERSION).MSVC
|
|
|
|
pathsep = ;
|
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 18:22:50 +04: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-04 01:05:41 +04:00
|
|
|
NO_PREAD = YesPlease
|
|
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
|
|
NO_LIBGEN_H = YesPlease
|
|
|
|
NO_POLL = YesPlease
|
|
|
|
NO_SYMLINK_HEAD = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
NO_UNIX_SOCKETS = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
# NEEDS_LIBICONV = YesPlease
|
|
|
|
NO_ICONV = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
|
|
|
NO_SVN_TESTS = YesPlease
|
|
|
|
RUNTIME_PREFIX = YesPlease
|
|
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
|
|
|
USE_WIN32_MMAP = YesPlease
|
|
|
|
# USE_NED_ALLOCATOR = YesPlease
|
|
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
|
|
|
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
|
|
|
NO_REGEX = YesPlease
|
2013-09-11 03:21:53 +04: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-04 01:05:41 +04:00
|
|
|
NO_PYTHON = YesPlease
|
|
|
|
BLK_SHA1 = YesPlease
|
2013-01-31 22:33:57 +04:00
|
|
|
ETAGS_TARGET = ETAGS
|
2013-01-31 22:30:14 +04:00
|
|
|
NO_INET_PTON = YesPlease
|
|
|
|
NO_INET_NTOP = 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-04 01:05:41 +04:00
|
|
|
NO_POSIX_GOODIES = UnfortunatelyYes
|
|
|
|
NATIVE_CRLF = YesPlease
|
|
|
|
DEFAULT_HELP_FORMAT = html
|
|
|
|
|
|
|
|
CC = compat/vcbuild/scripts/clink.pl
|
|
|
|
AR = compat/vcbuild/scripts/lib.pl
|
|
|
|
CFLAGS =
|
|
|
|
BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
|
|
|
|
COMPAT_OBJS = compat/msvc.o compat/winansi.o \
|
|
|
|
compat/win32/pthread.o compat/win32/syslog.o \
|
|
|
|
compat/win32/dirent.o
|
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 18:22:50 +04:00
|
|
|
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
|
2011-01-07 19:20:21 +03:00
|
|
|
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE
|
2014-03-29 00:08:02 +04:00
|
|
|
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj
|
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-04 01:05:41 +04:00
|
|
|
PTHREAD_LIBS =
|
|
|
|
lib =
|
2014-12-17 01:46:59 +03:00
|
|
|
BASIC_CFLAGS += -DPROTECT_NTFS_DEFAULT=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-04 01:05:41 +04:00
|
|
|
ifndef DEBUG
|
2011-01-07 19:20:21 +03:00
|
|
|
BASIC_CFLAGS += -GL -Os -MD
|
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-04 01:05:41 +04:00
|
|
|
BASIC_LDFLAGS += -LTCG
|
|
|
|
AR += -LTCG
|
|
|
|
else
|
2011-01-07 19:20:21 +03:00
|
|
|
BASIC_CFLAGS += -Zi -MDd
|
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-04 01:05:41 +04:00
|
|
|
endif
|
|
|
|
X = .exe
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),Interix)
|
|
|
|
NO_INITGROUPS = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
|
|
|
ifeq ($(uname_R),3.5)
|
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
|
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5.2)
|
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
|
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),Minix)
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
|
|
|
NEEDS_LIBGEN =
|
|
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
|
|
NEEDS_IDN_WITH_CURL = YesPlease
|
|
|
|
NEEDS_SSL_WITH_CURL = YesPlease
|
|
|
|
NEEDS_RESOLV =
|
|
|
|
NO_HSTRERROR = YesPlease
|
|
|
|
NO_MMAP = YesPlease
|
|
|
|
NO_CURL =
|
|
|
|
NO_EXPAT =
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),NONSTOP_KERNEL)
|
|
|
|
# Needs some C99 features, "inline" is just one of them.
|
|
|
|
# INLINE='' would just replace one set of warnings with another and
|
|
|
|
# still not compile in c89 mode, due to non-const array initializations.
|
|
|
|
CC = cc -c99
|
|
|
|
# Disable all optimization, seems to result in bad code, with -O or -O2
|
|
|
|
# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects
|
|
|
|
# abends on "git push". Needs more investigation.
|
|
|
|
CFLAGS = -g -O0
|
|
|
|
# We'd want it to be here.
|
|
|
|
prefix = /usr/local
|
|
|
|
# Our's are in ${prefix}/bin (perl might also be in /usr/bin/perl).
|
|
|
|
PERL_PATH = ${prefix}/bin/perl
|
|
|
|
PYTHON_PATH = ${prefix}/bin/python
|
|
|
|
|
|
|
|
# As detected by './configure'.
|
|
|
|
# Missdetected, hence commented out, see below.
|
|
|
|
#NO_CURL = YesPlease
|
|
|
|
# Added manually, see above.
|
|
|
|
NEEDS_SSL_WITH_CURL = YesPlease
|
|
|
|
HAVE_LIBCHARSET_H = YesPlease
|
|
|
|
HAVE_STRINGS_H = YesPlease
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
|
|
|
|
NO_SYS_SELECT_H = UnfortunatelyYes
|
|
|
|
NO_D_TYPE_IN_DIRENT = YesPlease
|
|
|
|
NO_HSTRERROR = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
# Currently libiconv-1.9.1.
|
|
|
|
OLD_ICONV = UnfortunatelyYes
|
|
|
|
NO_REGEX = YesPlease
|
|
|
|
NO_PTHREADS = UnfortunatelyYes
|
|
|
|
|
|
|
|
# Not detected (nor checked for) by './configure'.
|
|
|
|
# We don't have SA_RESTART on NonStop, unfortunalety.
|
|
|
|
COMPAT_CFLAGS += -DSA_RESTART=0
|
|
|
|
# Apparently needed in compat/fnmatch/fnmatch.c.
|
|
|
|
COMPAT_CFLAGS += -DHAVE_STRING_H=1
|
|
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
|
|
|
NO_PREAD = YesPlease
|
|
|
|
NO_MMAP = YesPlease
|
|
|
|
NO_POLL = YesPlease
|
|
|
|
NO_INTPTR_T = UnfortunatelyYes
|
|
|
|
# Bug report 10-120822-4477 submitted to HP NonStop development.
|
|
|
|
MKDIR_WO_TRAILING_SLASH = YesPlease
|
|
|
|
# RFE 10-120912-4693 submitted to HP NonStop development.
|
|
|
|
NO_SETITIMER = UnfortunatelyYes
|
|
|
|
SANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin
|
|
|
|
SHELL_PATH = /usr/local/bin/bash
|
|
|
|
# as of H06.25/J06.14, we might better use this
|
|
|
|
#SHELL_PATH = /usr/coreutils/bin/bash
|
|
|
|
endif
|
|
|
|
ifneq (,$(findstring MINGW,$(uname_S)))
|
|
|
|
pathsep = ;
|
2014-04-09 16:48:27 +04: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-04 01:05:41 +04:00
|
|
|
NO_PREAD = YesPlease
|
|
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
|
|
|
NO_LIBGEN_H = YesPlease
|
|
|
|
NO_POLL = YesPlease
|
|
|
|
NO_SYMLINK_HEAD = YesPlease
|
|
|
|
NO_UNIX_SOCKETS = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
NO_SVN_TESTS = YesPlease
|
|
|
|
NO_PERL_MAKEMAKER = YesPlease
|
|
|
|
RUNTIME_PREFIX = YesPlease
|
|
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
|
|
|
USE_WIN32_MMAP = YesPlease
|
|
|
|
USE_NED_ALLOCATOR = YesPlease
|
|
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
|
|
|
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
|
|
|
NO_REGEX = YesPlease
|
|
|
|
NO_PYTHON = YesPlease
|
|
|
|
ETAGS_TARGET = ETAGS
|
|
|
|
NO_INET_PTON = YesPlease
|
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_POSIX_GOODIES = UnfortunatelyYes
|
2012-06-21 15:24:14 +04:00
|
|
|
DEFAULT_HELP_FORMAT = html
|
2016-01-13 16:31:01 +03: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-04 01:05:41 +04:00
|
|
|
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
|
|
|
|
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
|
|
|
|
compat/win32/pthread.o compat/win32/syslog.o \
|
|
|
|
compat/win32/dirent.o
|
2014-12-17 01:46:59 +03:00
|
|
|
BASIC_CFLAGS += -DPROTECT_NTFS_DEFAULT=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-04 01:05:41 +04:00
|
|
|
EXTLIBS += -lws2_32
|
2012-05-24 03:56:24 +04: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-04 01:05:41 +04:00
|
|
|
PTHREAD_LIBS =
|
2012-05-24 03:56:24 +04:00
|
|
|
RC = windres -O coff
|
2010-09-04 12:25:09 +04: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-04 01:05:41 +04:00
|
|
|
X = .exe
|
|
|
|
SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
|
|
|
|
ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
|
|
|
|
htmldir = doc/git/html/
|
|
|
|
prefix =
|
|
|
|
INSTALL = /bin/install
|
|
|
|
EXTLIBS += /mingw/lib/libz.a
|
|
|
|
NO_R_TO_GCC_LINKER = YesPlease
|
|
|
|
INTERNAL_QSORT = YesPlease
|
|
|
|
HAVE_LIBCHARSET_H = YesPlease
|
2012-01-06 02:41:41 +04:00
|
|
|
NO_GETTEXT = YesPlease
|
config.mak.uname: support MSys2
For a long time, Git for Windows lagged behind Git's 2.x releases because
the Git for Windows developers wanted to let that big jump coincide with
a well-needed jump away from MSys to MSys2.
To understand why this is such a big issue, it needs to be noted that
many parts of Git are not written in portable C, but instead Git relies
on a POSIX shell and Perl to be available.
To support the scripts, Git for Windows has to ship a minimal POSIX
emulation layer with Bash and Perl thrown in, and when the Git for
Windows effort started in August 2007, this developer settled on using
MSys, a stripped down version of Cygwin. Consequently, the original name
of the project was "msysGit" (which, sadly, caused a *lot* of confusion
because few Windows users know about MSys, and even less care).
To compile the C code of Git for Windows, MSys was used, too: it sports
two versions of the GNU C Compiler: one that links implicitly to the
POSIX emulation layer, and another one that targets the plain Win32 API
(with a few convenience functions thrown in). Git for Windows'
executables are built using the latter, and therefore they are really
just Win32 programs. To discern executables requiring the POSIX
emulation layer from the ones that do not, the latter are called MinGW
(Minimal GNU for Windows) when the former are called MSys executables.
This reliance on MSys incurred challenges, too, though: some of our
changes to the MSys runtime -- necessary to support Git for Windows
better -- were not accepted upstream, so we had to maintain our own
fork. Also, the MSys runtime was not developed further to support e.g.
UTF-8 or 64-bit, and apart from lacking a package management system
until much later (when mingw-get was introduced), many packages provided
by the MSys/MinGW project lag behind the respective source code
versions, in particular Bash and OpenSSL. For a while, the Git for
Windows project tried to remedy the situation by trying to build newer
versions of those packages, but the situation quickly became untenable,
especially with problems like the Heartbleed bug requiring swift action
that has nothing to do with developing Git for Windows further.
Happily, in the meantime the MSys2 project (https://msys2.github.io/)
emerged, and was chosen to be the base of the Git for Windows 2.x. Just
like MSys, MSys2 is a stripped down version of Cygwin, but it is
actively kept up-to-date with Cygwin's source code. Thereby, it already
supports Unicode internally, and it also offers the 64-bit support that
we yearned for since the beginning of the Git for Windows project.
MSys2 also ported the Pacman package management system from Arch Linux
and uses it heavily. This brings the same convenience to which Linux
users are used to from `yum` or `apt-get`, and to which MacOSX users are
used to from Homebrew or MacPorts, or BSD users from the Ports system,
to MSys2: a simple `pacman -Syu` will update all installed packages to
the newest versions currently available.
MSys2 is also *very* active, typically providing package updates
multiple times per week.
It still required a two-month effort to bring everything to a state
where Git's test suite passes, many more months until the first official
Git for Windows 2.x was released, and a couple of patches still await
their submission to the respective upstream projects. Yet without MSys2,
the modernization of Git for Windows would simply not have happened.
This commit lays the ground work to supporting MSys2-based Git builds.
Assisted-by: Waldek Maleska <weakcamel@users.github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13 16:30:53 +03:00
|
|
|
COMPAT_CLFAGS += -D__USE_MINGW_ACCESS
|
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-04 01:05:41 +04:00
|
|
|
else
|
config.mak.uname: support MSys2
For a long time, Git for Windows lagged behind Git's 2.x releases because
the Git for Windows developers wanted to let that big jump coincide with
a well-needed jump away from MSys to MSys2.
To understand why this is such a big issue, it needs to be noted that
many parts of Git are not written in portable C, but instead Git relies
on a POSIX shell and Perl to be available.
To support the scripts, Git for Windows has to ship a minimal POSIX
emulation layer with Bash and Perl thrown in, and when the Git for
Windows effort started in August 2007, this developer settled on using
MSys, a stripped down version of Cygwin. Consequently, the original name
of the project was "msysGit" (which, sadly, caused a *lot* of confusion
because few Windows users know about MSys, and even less care).
To compile the C code of Git for Windows, MSys was used, too: it sports
two versions of the GNU C Compiler: one that links implicitly to the
POSIX emulation layer, and another one that targets the plain Win32 API
(with a few convenience functions thrown in). Git for Windows'
executables are built using the latter, and therefore they are really
just Win32 programs. To discern executables requiring the POSIX
emulation layer from the ones that do not, the latter are called MinGW
(Minimal GNU for Windows) when the former are called MSys executables.
This reliance on MSys incurred challenges, too, though: some of our
changes to the MSys runtime -- necessary to support Git for Windows
better -- were not accepted upstream, so we had to maintain our own
fork. Also, the MSys runtime was not developed further to support e.g.
UTF-8 or 64-bit, and apart from lacking a package management system
until much later (when mingw-get was introduced), many packages provided
by the MSys/MinGW project lag behind the respective source code
versions, in particular Bash and OpenSSL. For a while, the Git for
Windows project tried to remedy the situation by trying to build newer
versions of those packages, but the situation quickly became untenable,
especially with problems like the Heartbleed bug requiring swift action
that has nothing to do with developing Git for Windows further.
Happily, in the meantime the MSys2 project (https://msys2.github.io/)
emerged, and was chosen to be the base of the Git for Windows 2.x. Just
like MSys, MSys2 is a stripped down version of Cygwin, but it is
actively kept up-to-date with Cygwin's source code. Thereby, it already
supports Unicode internally, and it also offers the 64-bit support that
we yearned for since the beginning of the Git for Windows project.
MSys2 also ported the Pacman package management system from Arch Linux
and uses it heavily. This brings the same convenience to which Linux
users are used to from `yum` or `apt-get`, and to which MacOSX users are
used to from Homebrew or MacPorts, or BSD users from the Ports system,
to MSys2: a simple `pacman -Syu` will update all installed packages to
the newest versions currently available.
MSys2 is also *very* active, typically providing package updates
multiple times per week.
It still required a two-month effort to bring everything to a state
where Git's test suite passes, many more months until the first official
Git for Windows 2.x was released, and a couple of patches still await
their submission to the respective upstream projects. Yet without MSys2,
the modernization of Git for Windows would simply not have happened.
This commit lays the ground work to supporting MSys2-based Git builds.
Assisted-by: Waldek Maleska <weakcamel@users.github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13 16:30:53 +03:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '2\.'),2)
|
|
|
|
# MSys2
|
2016-01-13 16:31:01 +03:00
|
|
|
prefix = /usr/
|
|
|
|
ifeq (MINGW32,$(MSYSTEM))
|
|
|
|
prefix = /mingw32
|
|
|
|
endif
|
|
|
|
ifeq (MINGW64,$(MSYSTEM))
|
|
|
|
prefix = /mingw64
|
|
|
|
else
|
|
|
|
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
|
|
|
|
BASIC_LDFLAGS += -Wl,--large-address-aware
|
|
|
|
endif
|
config.mak.uname: support MSys2
For a long time, Git for Windows lagged behind Git's 2.x releases because
the Git for Windows developers wanted to let that big jump coincide with
a well-needed jump away from MSys to MSys2.
To understand why this is such a big issue, it needs to be noted that
many parts of Git are not written in portable C, but instead Git relies
on a POSIX shell and Perl to be available.
To support the scripts, Git for Windows has to ship a minimal POSIX
emulation layer with Bash and Perl thrown in, and when the Git for
Windows effort started in August 2007, this developer settled on using
MSys, a stripped down version of Cygwin. Consequently, the original name
of the project was "msysGit" (which, sadly, caused a *lot* of confusion
because few Windows users know about MSys, and even less care).
To compile the C code of Git for Windows, MSys was used, too: it sports
two versions of the GNU C Compiler: one that links implicitly to the
POSIX emulation layer, and another one that targets the plain Win32 API
(with a few convenience functions thrown in). Git for Windows'
executables are built using the latter, and therefore they are really
just Win32 programs. To discern executables requiring the POSIX
emulation layer from the ones that do not, the latter are called MinGW
(Minimal GNU for Windows) when the former are called MSys executables.
This reliance on MSys incurred challenges, too, though: some of our
changes to the MSys runtime -- necessary to support Git for Windows
better -- were not accepted upstream, so we had to maintain our own
fork. Also, the MSys runtime was not developed further to support e.g.
UTF-8 or 64-bit, and apart from lacking a package management system
until much later (when mingw-get was introduced), many packages provided
by the MSys/MinGW project lag behind the respective source code
versions, in particular Bash and OpenSSL. For a while, the Git for
Windows project tried to remedy the situation by trying to build newer
versions of those packages, but the situation quickly became untenable,
especially with problems like the Heartbleed bug requiring swift action
that has nothing to do with developing Git for Windows further.
Happily, in the meantime the MSys2 project (https://msys2.github.io/)
emerged, and was chosen to be the base of the Git for Windows 2.x. Just
like MSys, MSys2 is a stripped down version of Cygwin, but it is
actively kept up-to-date with Cygwin's source code. Thereby, it already
supports Unicode internally, and it also offers the 64-bit support that
we yearned for since the beginning of the Git for Windows project.
MSys2 also ported the Pacman package management system from Arch Linux
and uses it heavily. This brings the same convenience to which Linux
users are used to from `yum` or `apt-get`, and to which MacOSX users are
used to from Homebrew or MacPorts, or BSD users from the Ports system,
to MSys2: a simple `pacman -Syu` will update all installed packages to
the newest versions currently available.
MSys2 is also *very* active, typically providing package updates
multiple times per week.
It still required a two-month effort to bring everything to a state
where Git's test suite passes, many more months until the first official
Git for Windows 2.x was released, and a couple of patches still await
their submission to the respective upstream projects. Yet without MSys2,
the modernization of Git for Windows would simply not have happened.
This commit lays the ground work to supporting MSys2-based Git builds.
Assisted-by: Waldek Maleska <weakcamel@users.github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13 16:30:53 +03:00
|
|
|
CC = gcc
|
2016-04-27 18:16:37 +03:00
|
|
|
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY
|
|
|
|
EXTLIBS += -lntdll
|
config.mak.uname: support MSys2
For a long time, Git for Windows lagged behind Git's 2.x releases because
the Git for Windows developers wanted to let that big jump coincide with
a well-needed jump away from MSys to MSys2.
To understand why this is such a big issue, it needs to be noted that
many parts of Git are not written in portable C, but instead Git relies
on a POSIX shell and Perl to be available.
To support the scripts, Git for Windows has to ship a minimal POSIX
emulation layer with Bash and Perl thrown in, and when the Git for
Windows effort started in August 2007, this developer settled on using
MSys, a stripped down version of Cygwin. Consequently, the original name
of the project was "msysGit" (which, sadly, caused a *lot* of confusion
because few Windows users know about MSys, and even less care).
To compile the C code of Git for Windows, MSys was used, too: it sports
two versions of the GNU C Compiler: one that links implicitly to the
POSIX emulation layer, and another one that targets the plain Win32 API
(with a few convenience functions thrown in). Git for Windows'
executables are built using the latter, and therefore they are really
just Win32 programs. To discern executables requiring the POSIX
emulation layer from the ones that do not, the latter are called MinGW
(Minimal GNU for Windows) when the former are called MSys executables.
This reliance on MSys incurred challenges, too, though: some of our
changes to the MSys runtime -- necessary to support Git for Windows
better -- were not accepted upstream, so we had to maintain our own
fork. Also, the MSys runtime was not developed further to support e.g.
UTF-8 or 64-bit, and apart from lacking a package management system
until much later (when mingw-get was introduced), many packages provided
by the MSys/MinGW project lag behind the respective source code
versions, in particular Bash and OpenSSL. For a while, the Git for
Windows project tried to remedy the situation by trying to build newer
versions of those packages, but the situation quickly became untenable,
especially with problems like the Heartbleed bug requiring swift action
that has nothing to do with developing Git for Windows further.
Happily, in the meantime the MSys2 project (https://msys2.github.io/)
emerged, and was chosen to be the base of the Git for Windows 2.x. Just
like MSys, MSys2 is a stripped down version of Cygwin, but it is
actively kept up-to-date with Cygwin's source code. Thereby, it already
supports Unicode internally, and it also offers the 64-bit support that
we yearned for since the beginning of the Git for Windows project.
MSys2 also ported the Pacman package management system from Arch Linux
and uses it heavily. This brings the same convenience to which Linux
users are used to from `yum` or `apt-get`, and to which MacOSX users are
used to from Homebrew or MacPorts, or BSD users from the Ports system,
to MSys2: a simple `pacman -Syu` will update all installed packages to
the newest versions currently available.
MSys2 is also *very* active, typically providing package updates
multiple times per week.
It still required a two-month effort to bring everything to a state
where Git's test suite passes, many more months until the first official
Git for Windows 2.x was released, and a couple of patches still await
their submission to the respective upstream projects. Yet without MSys2,
the modernization of Git for Windows would simply not have happened.
This commit lays the ground work to supporting MSys2-based Git builds.
Assisted-by: Waldek Maleska <weakcamel@users.github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13 16:30:53 +03:00
|
|
|
INSTALL = /bin/install
|
|
|
|
NO_R_TO_GCC_LINKER = YesPlease
|
|
|
|
INTERNAL_QSORT = YesPlease
|
|
|
|
HAVE_LIBCHARSET_H = YesPlease
|
2016-01-26 17:34:16 +03:00
|
|
|
NO_GETTEXT =
|
2016-01-26 17:34:30 +03:00
|
|
|
USE_GETTEXT_SCHEME = fallthrough
|
config.mak.uname: support MSys2
For a long time, Git for Windows lagged behind Git's 2.x releases because
the Git for Windows developers wanted to let that big jump coincide with
a well-needed jump away from MSys to MSys2.
To understand why this is such a big issue, it needs to be noted that
many parts of Git are not written in portable C, but instead Git relies
on a POSIX shell and Perl to be available.
To support the scripts, Git for Windows has to ship a minimal POSIX
emulation layer with Bash and Perl thrown in, and when the Git for
Windows effort started in August 2007, this developer settled on using
MSys, a stripped down version of Cygwin. Consequently, the original name
of the project was "msysGit" (which, sadly, caused a *lot* of confusion
because few Windows users know about MSys, and even less care).
To compile the C code of Git for Windows, MSys was used, too: it sports
two versions of the GNU C Compiler: one that links implicitly to the
POSIX emulation layer, and another one that targets the plain Win32 API
(with a few convenience functions thrown in). Git for Windows'
executables are built using the latter, and therefore they are really
just Win32 programs. To discern executables requiring the POSIX
emulation layer from the ones that do not, the latter are called MinGW
(Minimal GNU for Windows) when the former are called MSys executables.
This reliance on MSys incurred challenges, too, though: some of our
changes to the MSys runtime -- necessary to support Git for Windows
better -- were not accepted upstream, so we had to maintain our own
fork. Also, the MSys runtime was not developed further to support e.g.
UTF-8 or 64-bit, and apart from lacking a package management system
until much later (when mingw-get was introduced), many packages provided
by the MSys/MinGW project lag behind the respective source code
versions, in particular Bash and OpenSSL. For a while, the Git for
Windows project tried to remedy the situation by trying to build newer
versions of those packages, but the situation quickly became untenable,
especially with problems like the Heartbleed bug requiring swift action
that has nothing to do with developing Git for Windows further.
Happily, in the meantime the MSys2 project (https://msys2.github.io/)
emerged, and was chosen to be the base of the Git for Windows 2.x. Just
like MSys, MSys2 is a stripped down version of Cygwin, but it is
actively kept up-to-date with Cygwin's source code. Thereby, it already
supports Unicode internally, and it also offers the 64-bit support that
we yearned for since the beginning of the Git for Windows project.
MSys2 also ported the Pacman package management system from Arch Linux
and uses it heavily. This brings the same convenience to which Linux
users are used to from `yum` or `apt-get`, and to which MacOSX users are
used to from Homebrew or MacPorts, or BSD users from the Ports system,
to MSys2: a simple `pacman -Syu` will update all installed packages to
the newest versions currently available.
MSys2 is also *very* active, typically providing package updates
multiple times per week.
It still required a two-month effort to bring everything to a state
where Git's test suite passes, many more months until the first official
Git for Windows 2.x was released, and a couple of patches still await
their submission to the respective upstream projects. Yet without MSys2,
the modernization of Git for Windows would simply not have happened.
This commit lays the ground work to supporting MSys2-based Git builds.
Assisted-by: Waldek Maleska <weakcamel@users.github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13 16:30:53 +03:00
|
|
|
USE_LIBPCRE= YesPlease
|
grep: un-break building with PCRE >= 8.32 without --enable-jit
Amend my change earlier in this series ("grep: add support for the
PCRE v1 JIT API", 2017-04-11) to un-break the build on PCRE v1
versions later than 8.31 compiled without --enable-jit.
As explained in that change and a later compatibility change in this
series ("grep: un-break building with PCRE < 8.32", 2017-05-10) the
pcre_jit_exec() function is a faster path to execute the JIT.
Unfortunately there's no compatibility stub for that function compiled
into the library if pcre_config(PCRE_CONFIG_JIT, &ret) would return 0,
and no macro that can be used to check for it, so the only portable
option to support builds without --enable-jit is via a new
NO_LIBPCRE1_JIT=UnfortunatelyYes Makefile option[1].
Another option would be to make the JIT opt-in via
USE_LIBPCRE1_JIT=YesPlease, after all it's not a default option of
PCRE v1.
I think it makes more sense to make it opt-out since even though it's
not a default option, most packagers of PCRE seem to turn it on by
default, with the notable exception of the MinGW package.
Make the MinGW platform work by default by changing the build defaults
to turn on NO_LIBPCRE1_JIT=UnfortunatelyYes. It is the only platform
that turns on USE_LIBPCRE=YesPlease by default, see commit
df5218b4c3 ("config.mak.uname: support MSys2", 2016-01-13) for that
change.
1. "How do I support pcre1 JIT on all
versions?" (https://lists.exim.org/lurker/thread/20170601.103148.10253788.en.html)
2. https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-pcre/PKGBUILD
(referenced from "Re: PCRE v2 compile error, was Re: What's cooking
in git.git (May 2017, #01; Mon, 1)";
<alpine.DEB.2.20.1705021756530.3480@virtualbox>)
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-01 21:20:55 +03:00
|
|
|
NO_LIBPCRE1_JIT = UnfortunatelyYes
|
config.mak.uname: support MSys2
For a long time, Git for Windows lagged behind Git's 2.x releases because
the Git for Windows developers wanted to let that big jump coincide with
a well-needed jump away from MSys to MSys2.
To understand why this is such a big issue, it needs to be noted that
many parts of Git are not written in portable C, but instead Git relies
on a POSIX shell and Perl to be available.
To support the scripts, Git for Windows has to ship a minimal POSIX
emulation layer with Bash and Perl thrown in, and when the Git for
Windows effort started in August 2007, this developer settled on using
MSys, a stripped down version of Cygwin. Consequently, the original name
of the project was "msysGit" (which, sadly, caused a *lot* of confusion
because few Windows users know about MSys, and even less care).
To compile the C code of Git for Windows, MSys was used, too: it sports
two versions of the GNU C Compiler: one that links implicitly to the
POSIX emulation layer, and another one that targets the plain Win32 API
(with a few convenience functions thrown in). Git for Windows'
executables are built using the latter, and therefore they are really
just Win32 programs. To discern executables requiring the POSIX
emulation layer from the ones that do not, the latter are called MinGW
(Minimal GNU for Windows) when the former are called MSys executables.
This reliance on MSys incurred challenges, too, though: some of our
changes to the MSys runtime -- necessary to support Git for Windows
better -- were not accepted upstream, so we had to maintain our own
fork. Also, the MSys runtime was not developed further to support e.g.
UTF-8 or 64-bit, and apart from lacking a package management system
until much later (when mingw-get was introduced), many packages provided
by the MSys/MinGW project lag behind the respective source code
versions, in particular Bash and OpenSSL. For a while, the Git for
Windows project tried to remedy the situation by trying to build newer
versions of those packages, but the situation quickly became untenable,
especially with problems like the Heartbleed bug requiring swift action
that has nothing to do with developing Git for Windows further.
Happily, in the meantime the MSys2 project (https://msys2.github.io/)
emerged, and was chosen to be the base of the Git for Windows 2.x. Just
like MSys, MSys2 is a stripped down version of Cygwin, but it is
actively kept up-to-date with Cygwin's source code. Thereby, it already
supports Unicode internally, and it also offers the 64-bit support that
we yearned for since the beginning of the Git for Windows project.
MSys2 also ported the Pacman package management system from Arch Linux
and uses it heavily. This brings the same convenience to which Linux
users are used to from `yum` or `apt-get`, and to which MacOSX users are
used to from Homebrew or MacPorts, or BSD users from the Ports system,
to MSys2: a simple `pacman -Syu` will update all installed packages to
the newest versions currently available.
MSys2 is also *very* active, typically providing package updates
multiple times per week.
It still required a two-month effort to bring everything to a state
where Git's test suite passes, many more months until the first official
Git for Windows 2.x was released, and a couple of patches still await
their submission to the respective upstream projects. Yet without MSys2,
the modernization of Git for Windows would simply not have happened.
This commit lays the ground work to supporting MSys2-based Git builds.
Assisted-by: Waldek Maleska <weakcamel@users.github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13 16:30:53 +03:00
|
|
|
NO_CURL =
|
|
|
|
USE_NED_ALLOCATOR = YesPlease
|
|
|
|
else
|
|
|
|
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO
|
|
|
|
NO_CURL = YesPlease
|
|
|
|
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-04 01:05:41 +04:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),QNX)
|
|
|
|
COMPAT_CFLAGS += -DSA_RESTART=0
|
2013-02-12 02:03:45 +04: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-04 01:05:41 +04: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_R_TO_GCC_LINKER = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
endif
|