2005-12-02 04:26:41 +08:00
|
|
|
# The default target of this Makefile is...
|
2007-01-11 04:24:54 +08:00
|
|
|
all::
|
2005-12-02 04:26:41 +08:00
|
|
|
|
2007-03-06 15:09:14 +08:00
|
|
|
# Define V=1 to have a more verbose compile.
|
2007-03-06 14:35:01 +08:00
|
|
|
#
|
2009-06-06 07:36:15 +08:00
|
|
|
# Define SHELL_PATH to a POSIX shell if your /bin/sh is broken.
|
|
|
|
#
|
|
|
|
# Define SANE_TOOL_PATH to a colon-separated list of paths to prepend
|
|
|
|
# to PATH if your tools in /usr/bin are broken.
|
|
|
|
#
|
2010-05-14 17:31:42 +08:00
|
|
|
# Define SOCKLEN_T to a suitable type (such as 'size_t') if your
|
|
|
|
# system headers do not define a socklen_t type.
|
|
|
|
#
|
2010-05-14 17:31:43 +08:00
|
|
|
# Define INLINE to a suitable substitute (such as '__inline' or '') if git
|
|
|
|
# fails to compile with errors about undefined inline functions or similar.
|
|
|
|
#
|
2008-03-05 23:46:13 +08:00
|
|
|
# Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
|
|
|
|
# or vsnprintf() return -1 instead of number of characters which would
|
|
|
|
# have been written to the final string if enough space had been available.
|
|
|
|
#
|
2008-02-09 10:32:47 +08:00
|
|
|
# Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
|
|
|
|
# when attempting to read from an fopen'ed directory.
|
|
|
|
#
|
2006-03-01 07:07:20 +08:00
|
|
|
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
|
2009-08-18 08:09:56 +08:00
|
|
|
# This also implies BLK_SHA1.
|
2005-05-23 06:08:15 +08:00
|
|
|
#
|
2011-05-10 05:52:05 +08:00
|
|
|
# Define USE_LIBPCRE if you have and want to use libpcre. git-grep will be
|
|
|
|
# able to use Perl-compatible regular expressions.
|
|
|
|
#
|
|
|
|
# Define LIBPCREDIR=/foo/bar if your libpcre header and library files are in
|
|
|
|
# /foo/bar/include and /foo/bar/lib directories.
|
|
|
|
#
|
2011-08-03 20:07:57 +08:00
|
|
|
# Define NO_CURL if you do not have libcurl installed. git-http-fetch and
|
2005-11-03 03:19:24 +08:00
|
|
|
# git-http-push are not built, and you cannot use http:// and https://
|
2011-08-03 20:07:57 +08:00
|
|
|
# transports (neither smart nor dumb).
|
2005-07-31 08:14:23 +08:00
|
|
|
#
|
2005-09-19 22:11:19 +08:00
|
|
|
# Define CURLDIR=/foo/bar if your curl header and library files are in
|
|
|
|
# /foo/bar/include and /foo/bar/lib directories.
|
|
|
|
#
|
2005-11-03 03:19:24 +08:00
|
|
|
# Define NO_EXPAT if you do not have expat installed. git-http-push is
|
2011-08-03 20:07:57 +08:00
|
|
|
# not built, and you cannot push using http:// and https:// transports (dumb).
|
2005-11-03 03:19:24 +08:00
|
|
|
#
|
2009-01-29 04:43:57 +08:00
|
|
|
# Define EXPATDIR=/foo/bar if your expat header and library files are in
|
|
|
|
# /foo/bar/include and /foo/bar/lib directories.
|
|
|
|
#
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
# Define NO_GETTEXT if you don't want Git output to be translated.
|
|
|
|
# A translated Git requires GNU libintl or another gettext implementation,
|
|
|
|
# plus libintl-perl at runtime.
|
|
|
|
#
|
2012-01-24 06:04:29 +08:00
|
|
|
# Define USE_GETTEXT_SCHEME and set it to 'fallthrough', if you don't trust
|
|
|
|
# the installed gettext translation of the shell scripts output.
|
|
|
|
#
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
# Define HAVE_LIBCHARSET_H if you haven't set NO_GETTEXT and you can't
|
|
|
|
# trust the langinfo.h's nl_langinfo(CODESET) function to return the
|
|
|
|
# current character set. GNU and Solaris have a nl_langinfo(CODESET),
|
|
|
|
# FreeBSD can use either, but MinGW and some others need to use
|
|
|
|
# libcharset.h's locale_charset() instead.
|
|
|
|
#
|
2012-02-13 00:23:36 +08:00
|
|
|
# Define CHARSET_LIB to you need to link with library other than -liconv to
|
|
|
|
# use locale_charset() function. On some platforms this needs to set to
|
|
|
|
# -lcharset
|
|
|
|
#
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
# Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't
|
|
|
|
# need -lintl when linking.
|
|
|
|
#
|
|
|
|
# Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt
|
|
|
|
# doesn't support GNU extensions like --check and --statistics
|
|
|
|
#
|
2010-04-13 17:07:13 +08:00
|
|
|
# Define HAVE_PATHS_H if you have paths.h and want to use the default PATH
|
|
|
|
# it specifies.
|
|
|
|
#
|
2006-01-20 09:13:51 +08:00
|
|
|
# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
|
|
|
|
#
|
2006-01-20 09:13:57 +08:00
|
|
|
# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
|
2010-04-02 06:43:54 +08:00
|
|
|
# d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).
|
2006-01-20 09:13:57 +08:00
|
|
|
#
|
2005-09-19 09:30:50 +08:00
|
|
|
# Define NO_STRCASESTR if you don't have strcasestr.
|
|
|
|
#
|
2007-09-07 06:32:54 +08:00
|
|
|
# Define NO_MEMMEM if you don't have memmem.
|
|
|
|
#
|
2006-06-24 22:01:25 +08:00
|
|
|
# Define NO_STRLCPY if you don't have strlcpy.
|
|
|
|
#
|
2011-11-02 23:46:22 +08:00
|
|
|
# Define NO_STRTOUMAX if you don't have both strtoimax and strtoumax in the
|
|
|
|
# C library. If your compiler also does not support long long or does not have
|
2007-02-20 08:22:56 +08:00
|
|
|
# strtoull, define NO_STRTOULL.
|
|
|
|
#
|
2005-12-03 07:08:28 +08:00
|
|
|
# Define NO_SETENV if you don't have setenv in the C library.
|
|
|
|
#
|
2008-01-18 09:03:51 +08:00
|
|
|
# Define NO_UNSETENV if you don't have unsetenv in the C library.
|
|
|
|
#
|
2007-10-21 04:03:49 +08:00
|
|
|
# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
|
|
|
|
#
|
2009-05-31 16:35:50 +08:00
|
|
|
# Define NO_MKSTEMPS if you don't have mkstemps in the C library.
|
|
|
|
#
|
2010-08-14 07:59:40 +08:00
|
|
|
# Define NO_STRTOK_R if you don't have strtok_r in the C library.
|
|
|
|
#
|
2010-10-03 17:56:39 +08:00
|
|
|
# Define NO_FNMATCH if you don't have fnmatch in the C library.
|
|
|
|
#
|
2010-10-04 10:48:11 +08:00
|
|
|
# Define NO_FNMATCH_CASEFOLD if your fnmatch function doesn't have the
|
|
|
|
# FNM_CASEFOLD GNU extension.
|
|
|
|
#
|
2011-05-19 19:37:55 +08:00
|
|
|
# Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
|
|
|
|
# in the C library.
|
|
|
|
#
|
2009-05-31 16:35:51 +08:00
|
|
|
# Define NO_LIBGEN_H if you don't have libgen.h.
|
|
|
|
#
|
2009-07-11 01:10:45 +08:00
|
|
|
# Define NEEDS_LIBGEN if your libgen needs -lgen when linking
|
|
|
|
#
|
2008-01-25 02:34:46 +08:00
|
|
|
# Define NO_SYS_SELECT_H if you don't have sys/select.h.
|
|
|
|
#
|
2006-05-02 15:40:24 +08:00
|
|
|
# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
|
|
|
|
# Enable it on Windows. By default, symrefs are still used.
|
2005-11-15 13:59:50 +08:00
|
|
|
#
|
2006-07-09 17:44:58 +08:00
|
|
|
# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability
|
2006-07-06 15:14:16 +08:00
|
|
|
# tests. These tests take up a significant amount of the total test time
|
|
|
|
# but are not needed unless you plan to talk to SVN repos.
|
|
|
|
#
|
2006-07-24 12:28:28 +08:00
|
|
|
# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink
|
|
|
|
# installed in /sw, but don't want GIT to link against any libraries
|
|
|
|
# installed there. If defined you may specify your own (or Fink's)
|
|
|
|
# include directories and library directories by defining CFLAGS
|
|
|
|
# and LDFLAGS appropriately.
|
|
|
|
#
|
|
|
|
# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,
|
|
|
|
# have DarwinPorts installed in /opt/local, but don't want GIT to
|
|
|
|
# link against any libraries installed there. If defined you may
|
|
|
|
# specify your own (or DarwinPort's) include directories and
|
|
|
|
# library directories by defining CFLAGS and LDFLAGS appropriately.
|
|
|
|
#
|
2012-07-23 14:29:14 +08:00
|
|
|
# Define BLK_SHA1 environment variable to make use of the bundled
|
|
|
|
# optimized C SHA1 routine.
|
2009-08-06 07:13:20 +08:00
|
|
|
#
|
2005-07-29 23:48:26 +08:00
|
|
|
# Define PPC_SHA1 environment variable when running make to make use of
|
|
|
|
# a bundled SHA1 routine optimized for PowerPC.
|
2005-09-08 03:22:56 +08:00
|
|
|
#
|
2009-09-08 21:54:38 +08:00
|
|
|
# Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin).
|
|
|
|
#
|
|
|
|
# Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin).
|
2005-09-06 07:24:03 +08:00
|
|
|
#
|
2011-07-20 06:55:47 +08:00
|
|
|
# Define NEEDS_SSL_WITH_CURL if you need -lssl with -lcurl (Minix).
|
|
|
|
#
|
|
|
|
# Define NEEDS_IDN_WITH_CURL if you need -lidn when using -lcurl (Minix).
|
|
|
|
#
|
2005-09-08 03:22:56 +08:00
|
|
|
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
|
2005-09-06 07:24:03 +08:00
|
|
|
#
|
|
|
|
# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
|
|
|
|
# Patrick Mauritz).
|
|
|
|
#
|
2009-06-06 07:36:10 +08:00
|
|
|
# Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.
|
|
|
|
# Notably on Solaris hstrerror resides in libresolv and on Solaris 7
|
|
|
|
# inet_ntop and inet_pton additionally reside there.
|
|
|
|
#
|
2005-10-09 06:54:36 +08:00
|
|
|
# Define NO_MMAP if you want to avoid mmap.
|
|
|
|
#
|
2008-11-15 20:08:14 +08:00
|
|
|
# Define NO_PTHREADS if you do not have or do not want to use Pthreads.
|
|
|
|
#
|
2007-01-10 05:04:12 +08:00
|
|
|
# Define NO_PREAD if you have a problem with pread() system call (e.g.
|
2010-04-02 06:43:54 +08:00
|
|
|
# cygwin1.dll before v1.5.22).
|
2007-01-10 05:04:12 +08:00
|
|
|
#
|
2012-06-27 02:19:32 +08:00
|
|
|
# Define NO_THREAD_SAFE_PREAD if your pread() implementation is not
|
|
|
|
# thread-safe. (e.g. compat/pread.c or cygwin)
|
|
|
|
#
|
2006-12-14 19:15:57 +08:00
|
|
|
# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
|
|
|
|
# generally faster on your platform than accessing the working directory.
|
|
|
|
#
|
2006-12-31 12:53:55 +08:00
|
|
|
# Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
|
|
|
|
# the executable mode bit, but doesn't really do so.
|
|
|
|
#
|
2005-09-29 07:52:21 +08:00
|
|
|
# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
|
|
|
|
#
|
2011-12-13 05:12:56 +08:00
|
|
|
# Define NO_UNIX_SOCKETS if your system does not offer unix sockets.
|
|
|
|
#
|
2006-01-20 09:13:32 +08:00
|
|
|
# Define NO_SOCKADDR_STORAGE if your platform does not have struct
|
|
|
|
# sockaddr_storage.
|
|
|
|
#
|
2006-02-16 16:38:01 +08:00
|
|
|
# Define NO_ICONV if your libc does not properly support iconv.
|
|
|
|
#
|
2007-03-04 02:29:03 +08:00
|
|
|
# Define OLD_ICONV if your library has an old iconv(), where the second
|
|
|
|
# (input buffer pointer) parameter is declared with type (const char **).
|
|
|
|
#
|
2007-11-07 11:24:28 +08:00
|
|
|
# Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.
|
|
|
|
#
|
2007-07-01 01:05:03 +08:00
|
|
|
# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib"
|
|
|
|
# that tells runtime paths to dynamic libraries;
|
|
|
|
# "-Wl,-rpath=/path/lib" is used instead.
|
2006-12-28 06:17:35 +08:00
|
|
|
#
|
2011-06-19 09:07:03 +08:00
|
|
|
# Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback,
|
|
|
|
# as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
|
|
|
|
#
|
2005-07-29 23:48:26 +08:00
|
|
|
# Define USE_NSEC below if you want git to care about sub-second file mtimes
|
|
|
|
# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
|
|
|
|
# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
|
|
|
|
# randomly break unless your underlying filesystem supports those sub-second
|
|
|
|
# times (my ext3 doesn't).
|
2006-06-24 08:57:48 +08:00
|
|
|
#
|
2009-03-09 04:04:28 +08:00
|
|
|
# Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of
|
|
|
|
# "st_ctim"
|
|
|
|
#
|
2009-03-05 01:47:40 +08:00
|
|
|
# Define NO_NSEC if your "struct stat" does not have "st_ctim.tv_nsec"
|
|
|
|
# available. This automatically turns USE_NSEC off.
|
|
|
|
#
|
2005-07-29 23:48:26 +08:00
|
|
|
# Define USE_STDEV below if you want git to care about the underlying device
|
2007-11-30 19:35:23 +08:00
|
|
|
# change being considered an inode change from the update-index perspective.
|
2006-12-04 17:50:04 +08:00
|
|
|
#
|
2008-08-19 03:57:16 +08:00
|
|
|
# Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks
|
|
|
|
# field that counts the on-disk footprint in 512-byte blocks.
|
|
|
|
#
|
2009-10-09 18:15:29 +08:00
|
|
|
# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72
|
|
|
|
# (not v1.73 or v1.71).
|
|
|
|
#
|
2010-11-20 01:54:24 +08:00
|
|
|
# Define ASCIIDOC_ROFF if your DocBook XSL does not escape raw roff directives
|
|
|
|
# (versions 1.68.1 through v1.72).
|
2007-11-14 17:38:46 +08:00
|
|
|
#
|
2009-10-22 16:19:06 +08:00
|
|
|
# Define GNU_ROFF if your target system uses GNU groff. This forces
|
|
|
|
# apostrophes to be ASCII so that cut&pasting examples to the shell
|
|
|
|
# will work.
|
|
|
|
#
|
2006-12-04 17:50:04 +08:00
|
|
|
# Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
|
|
|
|
# MakeMaker (e.g. using ActiveState under Cygwin).
|
|
|
|
#
|
2009-04-04 03:32:20 +08:00
|
|
|
# Define NO_PERL if you do not want Perl scripts or libraries at all.
|
|
|
|
#
|
2009-11-18 09:42:31 +08:00
|
|
|
# Define NO_PYTHON if you do not want Python scripts or libraries at all.
|
|
|
|
#
|
2007-03-28 19:00:23 +08:00
|
|
|
# Define NO_TCLTK if you do not want Tcl/Tk GUI.
|
|
|
|
#
|
2007-05-08 11:36:31 +08:00
|
|
|
# The TCL_PATH variable governs the location of the Tcl interpreter
|
|
|
|
# used to optimize git-gui for your system. Only used if NO_TCLTK
|
|
|
|
# is not set. Defaults to the bare 'tclsh'.
|
|
|
|
#
|
|
|
|
# The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter.
|
2007-03-28 19:12:07 +08:00
|
|
|
# If not set it defaults to the bare 'wish'. If it is set to the empty
|
|
|
|
# string then NO_TCLTK will be forced (this is used by configure script).
|
|
|
|
#
|
2008-02-06 05:10:44 +08:00
|
|
|
# Define INTERNAL_QSORT to use Git's implementation of qsort(), which
|
|
|
|
# is a simplified version of the merge sort used in glibc. This is
|
|
|
|
# recommended if Git triggers O(n^2) behavior in your platform's qsort().
|
|
|
|
#
|
2009-04-20 16:17:00 +08:00
|
|
|
# Define UNRELIABLE_FSTAT if your system's fstat does not return the same
|
|
|
|
# information on a not yet closed file that lstat would return for the same
|
|
|
|
# file after it was closed.
|
2009-04-25 17:57:14 +08:00
|
|
|
#
|
2009-04-28 06:32:25 +08:00
|
|
|
# Define OBJECT_CREATION_USES_RENAMES if your operating systems has problems
|
|
|
|
# when hardlinking a file to another name and unlinking the original file right
|
2009-04-25 17:57:14 +08:00
|
|
|
# away (some NTFS drivers seem to zero the contents in that scenario).
|
2009-05-23 16:43:08 +08:00
|
|
|
#
|
2009-05-11 19:02:18 +08:00
|
|
|
# Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed
|
|
|
|
# programs as a tar, where bin/ and libexec/ might be on different file systems.
|
2009-06-01 00:15:23 +08:00
|
|
|
#
|
2012-05-03 06:12:10 +08:00
|
|
|
# Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or
|
|
|
|
# copies to install built-in git commands e.g. git-cat-file.
|
|
|
|
#
|
2009-06-01 00:15:23 +08:00
|
|
|
# Define USE_NED_ALLOCATOR if you want to replace the platforms default
|
|
|
|
# memory allocators with the nedmalloc allocator written by Niall Douglas.
|
2009-06-17 03:07:40 +08:00
|
|
|
#
|
|
|
|
# Define NO_REGEX if you have no or inferior regex support in your C library.
|
2009-10-31 09:44:41 +08:00
|
|
|
#
|
add generic terminal prompt function
When we need to prompt the user for input interactively, we
want to access their terminal directly. We can't rely on
stdio because it may be connected to pipes or files, rather
than the terminal. Instead, we use "getpass()", because it
abstracts the idea of prompting and reading from the
terminal. However, it has some problems:
1. It never echoes the typed characters, which makes it OK
for passwords but annoying for other input (like usernames).
2. Some implementations of getpass() have an extremely
small input buffer (e.g., Solaris 8 is reported to
support only 8 characters).
3. Some implementations of getpass() will fall back to
reading from stdin (e.g., glibc). We explicitly don't
want this, because our stdin may be connected to a pipe
speaking a particular protocol, and reading will
disrupt the protocol flow (e.g., the remote-curl
helper).
4. Some implementations of getpass() turn off signals, so
that hitting "^C" on the terminal does not break out of
the password prompt. This can be a mild annoyance.
Instead, let's provide an abstract "git_terminal_prompt"
function that addresses these concerns. This patch includes
an implementation based on /dev/tty, enabled by setting
HAVE_DEV_TTY. The fallback is to use getpass() as before.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-10 18:41:01 +08:00
|
|
|
# Define HAVE_DEV_TTY if your system can open /dev/tty to interact with the
|
|
|
|
# user.
|
|
|
|
#
|
2011-02-23 07:41:21 +08:00
|
|
|
# Define GETTEXT_POISON if you are debugging the choice of strings marked
|
2011-02-23 07:41:22 +08:00
|
|
|
# for translation. In a GETTEXT_POISON build, you can turn all strings marked
|
|
|
|
# for translation into gibberish by setting the GIT_GETTEXT_POISON variable
|
|
|
|
# (to any value) in your environment.
|
2011-02-23 07:41:21 +08:00
|
|
|
#
|
2009-09-01 19:39:20 +08:00
|
|
|
# Define JSMIN to point to JavaScript minifier that functions as
|
|
|
|
# a filter to have gitweb.js minified.
|
2009-12-02 03:28:15 +08:00
|
|
|
#
|
2010-04-03 08:35:05 +08:00
|
|
|
# Define CSSMIN to point to a CSS minifier in order to generate a minified
|
|
|
|
# version of gitweb.css
|
|
|
|
#
|
2009-10-31 09:45:34 +08:00
|
|
|
# Define DEFAULT_PAGER to a sensible pager command (defaults to "less") if
|
|
|
|
# you want to use something different. The value will be interpreted by the
|
|
|
|
# shell at runtime when it is used.
|
|
|
|
#
|
2009-10-31 09:44:41 +08:00
|
|
|
# Define DEFAULT_EDITOR to a sensible editor command (defaults to "vi") if you
|
|
|
|
# want to use something different. The value will be interpreted by the shell
|
|
|
|
# if necessary when it is used. Examples:
|
|
|
|
#
|
|
|
|
# DEFAULT_EDITOR='~/bin/vi',
|
|
|
|
# DEFAULT_EDITOR='$GIT_FALLBACK_EDITOR',
|
|
|
|
# DEFAULT_EDITOR='"C:\Program Files\Vim\gvim.exe" --nofork'
|
2010-01-26 23:52:49 +08:00
|
|
|
#
|
2011-11-18 17:58:21 +08:00
|
|
|
# Define COMPUTE_HEADER_DEPENDENCIES to "yes" if you want dependencies on
|
|
|
|
# header files to be automatically computed, to avoid rebuilding objects when
|
|
|
|
# an unrelated header file changes. Define it to "no" to use the hard-coded
|
|
|
|
# dependency rules. The default is "auto", which means to use computed header
|
|
|
|
# dependencies if your compiler is detected to support it.
|
|
|
|
#
|
2010-01-26 23:57:15 +08:00
|
|
|
# Define CHECK_HEADER_DEPENDENCIES to check for problems in the hard-coded
|
|
|
|
# dependency rules.
|
2010-06-21 21:02:49 +08:00
|
|
|
#
|
2010-06-05 03:29:08 +08:00
|
|
|
# Define NATIVE_CRLF if your platform uses CRLF for line endings.
|
2012-04-07 05:01:23 +08:00
|
|
|
#
|
|
|
|
# Define XDL_FAST_HASH to use an alternative line-hashing method in
|
|
|
|
# the diff algorithm. It gives a nice speedup if your processor has
|
|
|
|
# fast unaligned word loads. Does NOT work on big-endian systems!
|
|
|
|
# Enabled by default on x86_64.
|
2012-06-03 03:01:12 +08:00
|
|
|
#
|
|
|
|
# Define GIT_USER_AGENT if you want to change how git identifies itself during
|
|
|
|
# network interactions. The default is "git/$(GIT_VERSION)".
|
2012-06-22 05:42:38 +08:00
|
|
|
#
|
2012-06-07 04:28:16 +08:00
|
|
|
# Define DEFAULT_HELP_FORMAT to "man", "info" or "html"
|
|
|
|
# (defaults to "man") if you want to have a different default when
|
|
|
|
# "git help" is called without a parameter specifying the format.
|
2005-07-29 23:48:26 +08:00
|
|
|
|
2010-01-06 16:06:58 +08:00
|
|
|
GIT-VERSION-FILE: FORCE
|
2006-02-14 07:15:14 +08:00
|
|
|
@$(SHELL_PATH) ./GIT-VERSION-GEN
|
2005-12-28 06:40:17 +08:00
|
|
|
-include GIT-VERSION-FILE
|
2005-07-08 04:09:50 +08:00
|
|
|
|
2006-02-21 07:36:28 +08:00
|
|
|
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
|
|
|
uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
|
|
|
|
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
|
|
|
|
uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
|
|
|
|
uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
|
2008-11-15 20:08:14 +08:00
|
|
|
uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
|
2006-02-21 07:36:28 +08:00
|
|
|
|
2009-11-08 04:08:01 +08:00
|
|
|
ifdef MSVC
|
|
|
|
# avoid the MingW and Cygwin configuration sections
|
|
|
|
uname_S := Windows
|
|
|
|
uname_O := Windows
|
|
|
|
endif
|
|
|
|
|
2005-11-13 17:46:13 +08:00
|
|
|
# CFLAGS and LDFLAGS are for the users to override from the command line.
|
2005-11-05 15:50:09 +08:00
|
|
|
|
2005-08-06 13:36:15 +08:00
|
|
|
CFLAGS = -g -O2 -Wall
|
2005-11-13 17:46:13 +08:00
|
|
|
LDFLAGS =
|
2010-05-14 17:31:32 +08:00
|
|
|
ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
|
2005-11-13 17:46:13 +08:00
|
|
|
ALL_LDFLAGS = $(LDFLAGS)
|
2006-01-13 13:42:25 +08:00
|
|
|
STRIP ?= strip
|
2005-05-07 16:41:54 +08:00
|
|
|
|
2008-07-24 03:12:18 +08:00
|
|
|
# Among the variables below, these:
|
|
|
|
# gitexecdir
|
|
|
|
# template_dir
|
2009-01-18 20:00:09 +08:00
|
|
|
# mandir
|
|
|
|
# infodir
|
2008-07-24 03:12:18 +08:00
|
|
|
# htmldir
|
2011-05-09 16:24:55 +08:00
|
|
|
# sysconfdir
|
2009-01-18 20:00:09 +08:00
|
|
|
# can be specified as a relative path some/where/else;
|
|
|
|
# this is interpreted as relative to $(prefix) and "git" at
|
2008-07-24 03:12:18 +08:00
|
|
|
# runtime figures out where they are based on the path to the executable.
|
|
|
|
# This can help installing the suite in a relocatable way.
|
|
|
|
|
2005-08-06 13:36:15 +08:00
|
|
|
prefix = $(HOME)
|
2009-01-18 20:00:09 +08:00
|
|
|
bindir_relative = bin
|
|
|
|
bindir = $(prefix)/$(bindir_relative)
|
|
|
|
mandir = share/man
|
|
|
|
infodir = share/info
|
|
|
|
gitexecdir = libexec/git-core
|
2011-08-18 15:23:46 +08:00
|
|
|
mergetoolsdir = $(gitexecdir)/mergetools
|
2007-06-11 16:02:17 +08:00
|
|
|
sharedir = $(prefix)/share
|
2010-05-28 14:25:50 +08:00
|
|
|
gitwebdir = $(sharedir)/gitweb
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
localedir = $(sharedir)/locale
|
2009-01-18 20:00:09 +08:00
|
|
|
template_dir = share/git-core/templates
|
|
|
|
htmldir = share/doc/git-doc
|
|
|
|
ETC_GITCONFIG = $(sysconfdir)/gitconfig
|
2010-09-01 06:42:43 +08:00
|
|
|
ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
|
2007-08-01 12:30:35 +08:00
|
|
|
lib = lib
|
2005-08-05 07:56:38 +08:00
|
|
|
# DESTDIR=
|
2009-05-23 16:04:48 +08:00
|
|
|
pathsep = :
|
2005-04-13 17:14:06 +08:00
|
|
|
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
export prefix bindir sharedir sysconfdir gitwebdir localedir
|
2006-06-30 04:11:25 +08:00
|
|
|
|
2011-12-21 07:40:47 +08:00
|
|
|
CC = cc
|
2005-08-06 13:36:15 +08:00
|
|
|
AR = ar
|
2007-07-15 01:51:44 +08:00
|
|
|
RM = rm -f
|
2010-05-14 17:31:36 +08:00
|
|
|
DIFF = diff
|
2005-09-24 01:41:40 +08:00
|
|
|
TAR = tar
|
2007-07-30 06:23:28 +08:00
|
|
|
FIND = find
|
2005-08-06 13:36:15 +08:00
|
|
|
INSTALL = install
|
|
|
|
RPMBUILD = rpmbuild
|
2007-05-08 11:36:31 +08:00
|
|
|
TCL_PATH = tclsh
|
2007-03-28 19:12:07 +08:00
|
|
|
TCLTK_PATH = wish
|
2011-02-23 07:41:23 +08:00
|
|
|
XGETTEXT = xgettext
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
MSGFMT = msgfmt
|
2008-11-03 07:43:20 +08:00
|
|
|
PTHREAD_LIBS = -lpthread
|
2010-05-14 17:31:34 +08:00
|
|
|
PTHREAD_CFLAGS =
|
2010-07-26 15:43:41 +08:00
|
|
|
GCOV = gcov
|
2005-04-08 06:13:13 +08:00
|
|
|
|
2007-05-08 11:36:31 +08:00
|
|
|
export TCL_PATH TCLTK_PATH
|
|
|
|
|
2011-04-08 02:22:18 +08:00
|
|
|
SPARSE_FLAGS =
|
2005-07-04 01:02:35 +08:00
|
|
|
|
2005-07-29 23:50:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
### --- END CONFIGURATION SECTION ---
|
|
|
|
|
2006-06-25 09:47:03 +08:00
|
|
|
# Those must not be GNU-specific; they are shared with perl/ which may
|
2006-09-24 02:20:47 +08:00
|
|
|
# be built by a different compiler. (Note that this is an artifact now
|
|
|
|
# but it still might be nice to keep that distinction.)
|
2010-02-23 00:42:18 +08:00
|
|
|
BASIC_CFLAGS = -I.
|
2006-09-24 02:20:47 +08:00
|
|
|
BASIC_LDFLAGS =
|
2006-06-25 09:47:03 +08:00
|
|
|
|
2009-03-26 00:27:28 +08:00
|
|
|
# Guard against environment variables
|
|
|
|
BUILTIN_OBJS =
|
|
|
|
BUILT_INS =
|
|
|
|
COMPAT_CFLAGS =
|
|
|
|
COMPAT_OBJS =
|
2011-03-28 02:13:22 +08:00
|
|
|
XDIFF_OBJS =
|
|
|
|
VCSSVN_OBJS =
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
GENERATED_H =
|
2010-03-20 11:20:12 +08:00
|
|
|
EXTRA_CPPFLAGS =
|
2009-03-26 00:27:28 +08:00
|
|
|
LIB_H =
|
|
|
|
LIB_OBJS =
|
2010-01-26 23:54:23 +08:00
|
|
|
PROGRAM_OBJS =
|
2009-03-26 00:27:28 +08:00
|
|
|
PROGRAMS =
|
|
|
|
SCRIPT_PERL =
|
2009-11-18 09:42:31 +08:00
|
|
|
SCRIPT_PYTHON =
|
2009-03-26 00:27:28 +08:00
|
|
|
SCRIPT_SH =
|
2010-02-01 03:46:53 +08:00
|
|
|
SCRIPT_LIB =
|
2010-01-27 00:08:44 +08:00
|
|
|
TEST_PROGRAMS_NEED_X =
|
2009-03-26 00:27:28 +08:00
|
|
|
|
2010-03-20 08:06:15 +08:00
|
|
|
# Having this variable in your environment would break pipelines because
|
|
|
|
# you cause "cd" to echo its destination to stdout. It can also take
|
|
|
|
# scripts to unexpected places. If you like CDPATH, define it for your
|
|
|
|
# interactive shell sessions without exporting it.
|
|
|
|
unexport CDPATH
|
|
|
|
|
2008-03-12 16:46:26 +08:00
|
|
|
SCRIPT_SH += git-am.sh
|
|
|
|
SCRIPT_SH += git-bisect.sh
|
2009-04-07 16:21:20 +08:00
|
|
|
SCRIPT_SH += git-difftool--helper.sh
|
2008-03-12 16:46:26 +08:00
|
|
|
SCRIPT_SH += git-filter-branch.sh
|
|
|
|
SCRIPT_SH += git-lost-found.sh
|
|
|
|
SCRIPT_SH += git-merge-octopus.sh
|
|
|
|
SCRIPT_SH += git-merge-one-file.sh
|
|
|
|
SCRIPT_SH += git-merge-resolve.sh
|
|
|
|
SCRIPT_SH += git-mergetool.sh
|
|
|
|
SCRIPT_SH += git-pull.sh
|
|
|
|
SCRIPT_SH += git-quiltimport.sh
|
|
|
|
SCRIPT_SH += git-rebase.sh
|
|
|
|
SCRIPT_SH += git-repack.sh
|
|
|
|
SCRIPT_SH += git-request-pull.sh
|
|
|
|
SCRIPT_SH += git-stash.sh
|
|
|
|
SCRIPT_SH += git-submodule.sh
|
|
|
|
SCRIPT_SH += git-web--browse.sh
|
|
|
|
|
2010-02-01 03:46:53 +08:00
|
|
|
SCRIPT_LIB += git-mergetool--lib
|
|
|
|
SCRIPT_LIB += git-parse-remote
|
2011-02-25 11:32:06 +08:00
|
|
|
SCRIPT_LIB += git-rebase--am
|
|
|
|
SCRIPT_LIB += git-rebase--interactive
|
|
|
|
SCRIPT_LIB += git-rebase--merge
|
2010-02-01 03:46:53 +08:00
|
|
|
SCRIPT_LIB += git-sh-setup
|
2011-05-14 21:47:43 +08:00
|
|
|
SCRIPT_LIB += git-sh-i18n
|
2010-02-01 03:46:53 +08:00
|
|
|
|
2008-03-12 16:46:26 +08:00
|
|
|
SCRIPT_PERL += git-add--interactive.perl
|
2009-04-07 16:21:20 +08:00
|
|
|
SCRIPT_PERL += git-difftool.perl
|
2008-03-12 16:46:26 +08:00
|
|
|
SCRIPT_PERL += git-archimport.perl
|
|
|
|
SCRIPT_PERL += git-cvsexportcommit.perl
|
|
|
|
SCRIPT_PERL += git-cvsimport.perl
|
|
|
|
SCRIPT_PERL += git-cvsserver.perl
|
|
|
|
SCRIPT_PERL += git-relink.perl
|
|
|
|
SCRIPT_PERL += git-send-email.perl
|
|
|
|
SCRIPT_PERL += git-svn.perl
|
2005-07-31 08:31:47 +08:00
|
|
|
|
2010-03-30 00:48:28 +08:00
|
|
|
SCRIPT_PYTHON += git-remote-testgit.py
|
2012-04-09 08:18:00 +08:00
|
|
|
SCRIPT_PYTHON += git-p4.py
|
2010-03-30 00:48:28 +08:00
|
|
|
|
2005-11-22 07:44:15 +08:00
|
|
|
SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
|
|
|
|
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
|
2009-11-18 09:42:31 +08:00
|
|
|
$(patsubst %.py,%,$(SCRIPT_PYTHON)) \
|
2007-11-24 04:35:08 +08:00
|
|
|
git-instaweb
|
2005-11-22 07:44:15 +08:00
|
|
|
|
2010-09-29 05:08:38 +08:00
|
|
|
ETAGS_TARGET = TAGS
|
|
|
|
|
2006-08-16 12:38:07 +08:00
|
|
|
# Empty...
|
|
|
|
EXTRA_PROGRAMS =
|
2005-11-22 07:44:15 +08:00
|
|
|
|
2008-03-12 16:46:26 +08:00
|
|
|
# ... and all the rest that could be moved out of bindir to gitexecdir
|
|
|
|
PROGRAMS += $(EXTRA_PROGRAMS)
|
2010-01-26 23:54:23 +08:00
|
|
|
|
2012-05-04 21:52:36 +08:00
|
|
|
PROGRAM_OBJS += credential-store.o
|
2010-11-04 09:35:24 +08:00
|
|
|
PROGRAM_OBJS += daemon.o
|
2010-01-26 23:54:23 +08:00
|
|
|
PROGRAM_OBJS += fast-import.o
|
2012-05-04 21:52:36 +08:00
|
|
|
PROGRAM_OBJS += http-backend.o
|
2010-01-26 23:54:23 +08:00
|
|
|
PROGRAM_OBJS += imap-send.o
|
2012-05-04 21:52:36 +08:00
|
|
|
PROGRAM_OBJS += sh-i18n--envsubst.o
|
2010-01-26 23:54:23 +08:00
|
|
|
PROGRAM_OBJS += shell.o
|
|
|
|
PROGRAM_OBJS += show-index.o
|
|
|
|
PROGRAM_OBJS += upload-pack.o
|
2012-09-19 23:21:16 +08:00
|
|
|
PROGRAM_OBJS += remote-testsvn.o
|
2010-01-26 23:54:23 +08:00
|
|
|
|
2012-02-08 18:59:04 +08:00
|
|
|
# Binary suffix, set to .exe for Windows builds
|
|
|
|
X =
|
|
|
|
|
2010-01-26 23:54:23 +08:00
|
|
|
PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
|
2008-03-12 16:46:26 +08:00
|
|
|
|
2010-01-27 00:08:44 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-chmtime
|
|
|
|
TEST_PROGRAMS_NEED_X += test-ctype
|
|
|
|
TEST_PROGRAMS_NEED_X += test-date
|
|
|
|
TEST_PROGRAMS_NEED_X += test-delta
|
|
|
|
TEST_PROGRAMS_NEED_X += test-dump-cache-tree
|
|
|
|
TEST_PROGRAMS_NEED_X += test-genrandom
|
2011-05-20 05:24:24 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-index-version
|
2010-08-10 06:39:43 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-line-buffer
|
2010-01-27 00:08:44 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-match-trees
|
2012-04-01 06:10:11 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-mergesort
|
2011-05-20 05:24:24 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-mktemp
|
2010-01-27 00:08:44 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-parse-options
|
|
|
|
TEST_PROGRAMS_NEED_X += test-path-utils
|
2012-03-29 15:21:21 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-revision-walking
|
2010-01-27 00:08:44 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-run-command
|
2012-05-04 21:52:36 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-scrap-cache-tree
|
2010-01-27 00:08:44 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-sha1
|
|
|
|
TEST_PROGRAMS_NEED_X += test-sigchain
|
2010-12-27 09:26:04 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-subprocess
|
2010-08-10 06:55:00 +08:00
|
|
|
TEST_PROGRAMS_NEED_X += test-svn-fe
|
2010-01-27 00:08:44 +08:00
|
|
|
|
2010-03-03 04:44:08 +08:00
|
|
|
TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
|
2008-03-12 16:46:26 +08:00
|
|
|
|
2008-02-24 03:08:25 +08:00
|
|
|
# List built-in command $C whose implementation cmd_$C() is not in
|
2010-02-23 00:42:18 +08:00
|
|
|
# builtin/$C.o but is linked in as part of some other command.
|
|
|
|
BUILT_INS += $(patsubst builtin/%.o,git-%$X,$(BUILTIN_OBJS))
|
2008-03-12 16:46:26 +08:00
|
|
|
|
|
|
|
BUILT_INS += git-cherry$X
|
2009-02-10 06:00:45 +08:00
|
|
|
BUILT_INS += git-cherry-pick$X
|
2008-03-12 16:46:26 +08:00
|
|
|
BUILT_INS += git-format-patch$X
|
|
|
|
BUILT_INS += git-fsck-objects$X
|
|
|
|
BUILT_INS += git-get-tar-commit-id$X
|
|
|
|
BUILT_INS += git-init$X
|
|
|
|
BUILT_INS += git-merge-subtree$X
|
|
|
|
BUILT_INS += git-peek-remote$X
|
|
|
|
BUILT_INS += git-repo-config$X
|
|
|
|
BUILT_INS += git-show$X
|
2008-12-03 16:30:34 +08:00
|
|
|
BUILT_INS += git-stage$X
|
2008-03-12 16:46:26 +08:00
|
|
|
BUILT_INS += git-status$X
|
|
|
|
BUILT_INS += git-whatchanged$X
|
2006-04-11 08:37:58 +08:00
|
|
|
|
2009-08-08 03:09:29 +08:00
|
|
|
# what 'all' will build and 'install' will install in gitexecdir,
|
|
|
|
# excluding programs for built-in commands
|
2007-02-07 13:27:09 +08:00
|
|
|
ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
|
2005-04-08 06:13:13 +08:00
|
|
|
|
2007-03-28 19:00:23 +08:00
|
|
|
# what 'all' will build but not install in gitexecdir
|
2009-04-04 03:32:20 +08:00
|
|
|
OTHER_PROGRAMS = git$X
|
2007-03-28 19:00:23 +08:00
|
|
|
|
2009-12-03 13:14:05 +08:00
|
|
|
# what test wrappers are needed and 'install' will install, in bindir
|
|
|
|
BINDIR_PROGRAMS_NEED_X += git
|
|
|
|
BINDIR_PROGRAMS_NEED_X += git-upload-pack
|
|
|
|
BINDIR_PROGRAMS_NEED_X += git-receive-pack
|
|
|
|
BINDIR_PROGRAMS_NEED_X += git-upload-archive
|
|
|
|
BINDIR_PROGRAMS_NEED_X += git-shell
|
|
|
|
|
|
|
|
BINDIR_PROGRAMS_NO_X += git-cvsserver
|
|
|
|
|
2005-11-21 13:11:22 +08:00
|
|
|
# Set paths to tools early so that they can be used for version tests.
|
|
|
|
ifndef SHELL_PATH
|
|
|
|
SHELL_PATH = /bin/sh
|
|
|
|
endif
|
|
|
|
ifndef PERL_PATH
|
|
|
|
PERL_PATH = /usr/bin/perl
|
|
|
|
endif
|
2009-11-18 09:42:31 +08:00
|
|
|
ifndef PYTHON_PATH
|
|
|
|
PYTHON_PATH = /usr/bin/python
|
|
|
|
endif
|
2005-09-11 08:46:27 +08:00
|
|
|
|
2006-12-15 15:03:03 +08:00
|
|
|
export PERL_PATH
|
2009-11-18 09:42:31 +08:00
|
|
|
export PYTHON_PATH
|
2006-12-15 15:03:03 +08:00
|
|
|
|
2005-04-19 03:49:39 +08:00
|
|
|
LIB_FILE=libgit.a
|
Use a *real* built-in diff generator
This uses a simplified libxdiff setup to generate unified diffs _without_
doing fork/execve of GNU "diff".
This has several huge advantages, for example:
Before:
[torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null
real 0m24.818s
user 0m13.332s
sys 0m8.664s
After:
[torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null
real 0m4.563s
user 0m2.944s
sys 0m1.580s
and the fact that this should be a lot more portable (ie we can ignore all
the issues with doing fork/execve under Windows).
Perhaps even more importantly, this allows us to do diffs without actually
ever writing out the git file contents to a temporary file (and without
any of the shell quoting issues on filenames etc etc).
NOTE! THIS PATCH DOES NOT DO THAT OPTIMIZATION YET! I was lazy, and the
current "diff-core" code actually will always write the temp-files,
because it used to be something that you simply had to do. So this current
one actually writes a temp-file like before, and then reads it into memory
again just to do the diff. Stupid.
But if this basic infrastructure is accepted, we can start switching over
diff-core to not write temp-files, which should speed things up even
further, especially when doing big tree-to-tree diffs.
Now, in the interest of full disclosure, I should also point out a few
downsides:
- the libxdiff algorithm is different, and I bet GNU diff has gotten a
lot more testing. And the thing is, generating a diff is not an exact
science - you can get two different diffs (and you will), and they can
both be perfectly valid. So it's not possible to "validate" the
libxdiff output by just comparing it against GNU diff.
- GNU diff does some nice eye-candy, like trying to figure out what the
last function was, and adding that information to the "@@ .." line.
libxdiff doesn't do that.
- The libxdiff thing has some known deficiencies. In particular, it gets
the "\No newline at end of file" case wrong. So this is currently for
the experimental branch only. I hope Davide will help fix it.
That said, I think the huge performance advantage, and the fact that it
integrates better is definitely worth it. But it should go into a
development branch at least due to the missing newline issue.
Technical note: this is based on libxdiff-0.17, but I did some surgery to
get rid of the extraneous fat - stuff that git doesn't need, and seriously
cutting down on mmfile_t, which had much more capabilities than the diff
algorithm either needed or used. In this version, "mmfile_t" is just a
trivial <pointer,length> tuple.
That said, I tried to keep the differences to simple removals, so that you
can do a diff between this and the libxdiff origin, and you'll basically
see just things getting deleted. Even the mmfile_t simplifications are
left in a state where the diffs should be readable.
Apologies to Davide, whom I'd love to get feedback on this all from (I
wrote my own "fill_mmfile()" for the new simpler mmfile_t format: the old
complex format had a helper function for that, but I did my surgery with
the goal in mind that eventually we _should_ just do
mmfile_t mf;
buf = read_sha1_file(sha1, type, &size);
mf->ptr = buf;
mf->size = size;
.. use "mf" directly ..
which was really a nightmare with the old "helpful" mmfile_t, and really
is that easy with the new cut-down interfaces).
[ Btw, as any hawk-eye can see from the diff, this was actually generated
with itself, so it is "self-hosting". That's about all the testing it
has gotten, along with the above kernel diff, which eye-balls correctly,
but shows the newline issue when you double-check it with "git-apply" ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-25 12:13:22 +08:00
|
|
|
XDIFF_LIB=xdiff/lib.a
|
2010-08-10 06:04:29 +08:00
|
|
|
VCSSVN_LIB=vcs-svn/lib.a
|
[PATCH] Add update-server-info.
The git-update-server-info command prepares informational files
to help clients discover the contents of a repository, and pull
from it via a dumb transport protocols. Currently, the
following files are produced.
- The $repo/info/refs file lists the name of heads and tags
available in the $repo/refs/ directory, along with their
SHA1. This can be used by git-ls-remote command running on
the client side.
- The $repo/info/rev-cache file describes the commit ancestry
reachable from references in the $repo/refs/ directory. This
file is in an append-only binary format to make the server
side friendly to rsync mirroring scheme, and can be read by
git-show-rev-cache command.
- The $repo/objects/info/pack file lists the name of the packs
available, the interdependencies among them, and the head
commits and tags contained in them. Along with the other two
files, this is designed to help clients to make smart pull
decisions.
The git-receive-pack command is changed to invoke it at the end,
so just after a push to a public repository finishes via "git
push", the server info is automatically updated.
In addition, building of the rev-cache file can be done by a
standalone git-build-rev-cache command separately.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-24 08:54:41 +08:00
|
|
|
|
2012-07-07 11:39:18 +08:00
|
|
|
LIB_H += xdiff/xinclude.h
|
|
|
|
LIB_H += xdiff/xmacros.h
|
|
|
|
LIB_H += xdiff/xdiff.h
|
|
|
|
LIB_H += xdiff/xtypes.h
|
|
|
|
LIB_H += xdiff/xutils.h
|
|
|
|
LIB_H += xdiff/xprepare.h
|
|
|
|
LIB_H += xdiff/xdiffi.h
|
|
|
|
LIB_H += xdiff/xemit.h
|
|
|
|
|
|
|
|
LIB_H += vcs-svn/line_buffer.h
|
|
|
|
LIB_H += vcs-svn/sliding_window.h
|
|
|
|
LIB_H += vcs-svn/repo_tree.h
|
|
|
|
LIB_H += vcs-svn/fast_export.h
|
|
|
|
LIB_H += vcs-svn/svndiff.h
|
|
|
|
LIB_H += vcs-svn/svndump.h
|
2012-04-23 20:30:21 +08:00
|
|
|
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
GENERATED_H += common-cmds.h
|
2012-04-23 20:30:21 +08:00
|
|
|
|
2009-09-09 19:38:58 +08:00
|
|
|
LIB_H += advice.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += archive.h
|
2011-09-14 05:57:57 +08:00
|
|
|
LIB_H += argv-array.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += attr.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += bisect.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += blob.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += branch.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += builtin.h
|
2011-10-29 05:48:40 +08:00
|
|
|
LIB_H += bulk-checkin.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += bundle.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += cache-tree.h
|
2012-06-21 02:30:08 +08:00
|
|
|
LIB_H += cache.h
|
2010-01-26 23:44:47 +08:00
|
|
|
LIB_H += color.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += column.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += commit.h
|
2009-11-02 07:09:05 +08:00
|
|
|
LIB_H += compat/bswap.h
|
2008-09-30 21:53:47 +08:00
|
|
|
LIB_H += compat/cygwin.h
|
2009-02-10 06:00:45 +08:00
|
|
|
LIB_H += compat/mingw.h
|
2011-08-21 06:40:40 +08:00
|
|
|
LIB_H += compat/obstack.h
|
git on Mac OS and precomposed unicode
Mac OS X mangles file names containing unicode on file systems HFS+,
VFAT or SAMBA. When a file using unicode code points outside ASCII
is created on a HFS+ drive, the file name is converted into
decomposed unicode and written to disk. No conversion is done if
the file name is already decomposed unicode.
Calling open("\xc3\x84", ...) with a precomposed "Ä" yields the same
result as open("\x41\xcc\x88",...) with a decomposed "Ä".
As a consequence, readdir() returns the file names in decomposed
unicode, even if the user expects precomposed unicode. Unlike on
HFS+, Mac OS X stores files on a VFAT drive (e.g. an USB drive) in
precomposed unicode, but readdir() still returns file names in
decomposed unicode. When a git repository is stored on a network
share using SAMBA, file names are send over the wire and written to
disk on the remote system in precomposed unicode, but Mac OS X
readdir() returns decomposed unicode to be compatible with its
behaviour on HFS+ and VFAT.
The unicode decomposition causes many problems:
- The names "git add" and other commands get from the end user may
often be precomposed form (the decomposed form is not easily input
from the keyboard), but when the commands read from the filesystem
to see what it is going to update the index with already is on the
filesystem, readdir() will give decomposed form, which is different.
- Similarly "git log", "git mv" and all other commands that need to
compare pathnames found on the command line (often but not always
precomposed form; a command line input resulting from globbing may
be in decomposed) with pathnames found in the tree objects (should
be precomposed form to be compatible with other systems and for
consistency in general).
- The same for names stored in the index, which should be
precomposed, that may need to be compared with the names read from
readdir().
NFS mounted from Linux is fully transparent and does not suffer from
the above.
As Mac OS X treats precomposed and decomposed file names as equal,
we can
- wrap readdir() on Mac OS X to return the precomposed form, and
- normalize decomposed form given from the command line also to the
precomposed form,
to ensure that all pathnames used in Git are always in the
precomposed form. This behaviour can be requested by setting
"core.precomposedunicode" configuration variable to true.
The code in compat/precomposed_utf8.c implements basically 4 new
functions: precomposed_utf8_opendir(), precomposed_utf8_readdir(),
precomposed_utf8_closedir() and precompose_argv(). The first three
are to wrap opendir(3), readdir(3), and closedir(3) functions.
The argv[] conversion allows to use the TAB filename completion done
by the shell on command line. It tolerates other tools which use
readdir() to feed decomposed file names into git.
When creating a new git repository with "git init" or "git clone",
"core.precomposedunicode" will be set "false".
The user needs to activate this feature manually. She typically
sets core.precomposedunicode to "true" on HFS and VFAT, or file
systems mounted via SAMBA.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-08 21:50:25 +08:00
|
|
|
LIB_H += compat/precompose_utf8.h
|
add generic terminal prompt function
When we need to prompt the user for input interactively, we
want to access their terminal directly. We can't rely on
stdio because it may be connected to pipes or files, rather
than the terminal. Instead, we use "getpass()", because it
abstracts the idea of prompting and reading from the
terminal. However, it has some problems:
1. It never echoes the typed characters, which makes it OK
for passwords but annoying for other input (like usernames).
2. Some implementations of getpass() have an extremely
small input buffer (e.g., Solaris 8 is reported to
support only 8 characters).
3. Some implementations of getpass() will fall back to
reading from stdin (e.g., glibc). We explicitly don't
want this, because our stdin may be connected to a pipe
speaking a particular protocol, and reading will
disrupt the protocol flow (e.g., the remote-curl
helper).
4. Some implementations of getpass() turn off signals, so
that hitting "^C" on the terminal does not break out of
the password prompt. This can be a mild annoyance.
Instead, let's provide an abstract "git_terminal_prompt"
function that addresses these concerns. This patch includes
an implementation based on /dev/tty, enabled by setting
HAVE_DEV_TTY. The fallback is to use getpass() as before.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-10 18:41:01 +08:00
|
|
|
LIB_H += compat/terminal.h
|
2012-05-04 21:52:36 +08:00
|
|
|
LIB_H += compat/win32/dirent.h
|
|
|
|
LIB_H += compat/win32/poll.h
|
2010-01-16 04:12:20 +08:00
|
|
|
LIB_H += compat/win32/pthread.h
|
2010-11-04 09:35:10 +08:00
|
|
|
LIB_H += compat/win32/syslog.h
|
2011-09-03 07:33:22 +08:00
|
|
|
LIB_H += connected.h
|
2011-11-18 18:02:02 +08:00
|
|
|
LIB_H += convert.h
|
2011-12-10 18:31:11 +08:00
|
|
|
LIB_H += credential.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += csum-file.h
|
|
|
|
LIB_H += decorate.h
|
|
|
|
LIB_H += delta.h
|
|
|
|
LIB_H += diff.h
|
2012-05-04 21:52:36 +08:00
|
|
|
LIB_H += diffcore.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += dir.h
|
2010-01-26 23:44:47 +08:00
|
|
|
LIB_H += exec_cmd.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += fetch-pack.h
|
2011-10-07 14:12:09 +08:00
|
|
|
LIB_H += fmt-merge-msg.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += fsck.h
|
2011-02-23 07:41:20 +08:00
|
|
|
LIB_H += gettext.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += git-compat-util.h
|
2011-09-08 12:19:47 +08:00
|
|
|
LIB_H += gpg-interface.h
|
2008-05-04 18:36:53 +08:00
|
|
|
LIB_H += graph.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += grep.h
|
|
|
|
LIB_H += hash.h
|
2008-07-30 07:16:58 +08:00
|
|
|
LIB_H += help.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += http.h
|
Use kwset in pickaxe
Benchmarks in the hot cache case:
before:
$ perf stat --repeat=5 git log -Sqwerty
Performance counter stats for 'git log -Sqwerty' (5 runs):
47,092,744 cache-misses # 2.825 M/sec ( +- 1.607% )
123,368,389 cache-references # 7.400 M/sec ( +- 0.812% )
330,040,998 branch-misses # 3.134 % ( +- 0.257% )
10,530,896,750 branches # 631.663 M/sec ( +- 0.121% )
62,037,201,030 instructions # 1.399 IPC ( +- 0.142% )
44,331,294,321 cycles # 2659.073 M/sec ( +- 0.326% )
96,794 page-faults # 0.006 M/sec ( +- 11.952% )
25 CPU-migrations # 0.000 M/sec ( +- 25.266% )
1,424 context-switches # 0.000 M/sec ( +- 0.540% )
16671.708650 task-clock-msecs # 0.997 CPUs ( +- 0.343% )
16.728692052 seconds time elapsed ( +- 0.344% )
after:
$ perf stat --repeat=5 git log -Sqwerty
Performance counter stats for 'git log -Sqwerty' (5 runs):
51,385,522 cache-misses # 4.619 M/sec ( +- 0.565% )
129,177,880 cache-references # 11.611 M/sec ( +- 0.219% )
319,222,775 branch-misses # 6.946 % ( +- 0.134% )
4,595,913,233 branches # 413.086 M/sec ( +- 0.112% )
31,395,042,533 instructions # 1.062 IPC ( +- 0.129% )
29,558,348,598 cycles # 2656.740 M/sec ( +- 0.204% )
93,224 page-faults # 0.008 M/sec ( +- 4.487% )
19 CPU-migrations # 0.000 M/sec ( +- 10.425% )
950 context-switches # 0.000 M/sec ( +- 0.360% )
11125.796039 task-clock-msecs # 0.997 CPUs ( +- 0.239% )
11.164216599 seconds time elapsed ( +- 0.240% )
So the kwset code is about 33% faster.
Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-21 06:41:57 +08:00
|
|
|
LIB_H += kwset.h
|
2008-08-31 21:50:23 +08:00
|
|
|
LIB_H += levenshtein.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += list-objects.h
|
|
|
|
LIB_H += ll-merge.h
|
|
|
|
LIB_H += log-tree.h
|
|
|
|
LIB_H += mailmap.h
|
2011-04-08 02:31:24 +08:00
|
|
|
LIB_H += merge-file.h
|
2008-09-03 07:49:05 +08:00
|
|
|
LIB_H += merge-recursive.h
|
2012-04-01 06:10:11 +08:00
|
|
|
LIB_H += mergesort.h
|
2010-04-02 08:07:40 +08:00
|
|
|
LIB_H += notes-cache.h
|
2010-11-10 05:49:46 +08:00
|
|
|
LIB_H += notes-merge.h
|
2012-06-21 02:30:08 +08:00
|
|
|
LIB_H += notes.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += object.h
|
2008-06-15 22:05:06 +08:00
|
|
|
LIB_H += pack-refs.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += pack-revindex.h
|
2012-06-21 02:30:08 +08:00
|
|
|
LIB_H += pack.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += parse-options.h
|
|
|
|
LIB_H += patch-ids.h
|
|
|
|
LIB_H += pkt-line.h
|
|
|
|
LIB_H += progress.h
|
2011-12-10 18:40:54 +08:00
|
|
|
LIB_H += prompt.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += quote.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += reachable.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += reflog-walk.h
|
|
|
|
LIB_H += refs.h
|
|
|
|
LIB_H += remote.h
|
2008-07-09 20:58:57 +08:00
|
|
|
LIB_H += rerere.h
|
2009-12-25 16:30:51 +08:00
|
|
|
LIB_H += resolve-undo.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += revision.h
|
|
|
|
LIB_H += run-command.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += send-pack.h
|
2011-08-04 18:39:11 +08:00
|
|
|
LIB_H += sequencer.h
|
2011-05-20 05:34:33 +08:00
|
|
|
LIB_H += sha1-array.h
|
sha1-lookup: more memory efficient search in sorted list of SHA-1
Currently, when looking for a packed object from the pack idx, a
simple binary search is used.
A conventional binary search loop looks like this:
unsigned lo, hi;
do {
unsigned mi = (lo + hi) / 2;
int cmp = "entry pointed at by mi" minus "target";
if (!cmp)
return mi; "mi is the wanted one"
if (cmp > 0)
hi = mi; "mi is larger than target"
else
lo = mi+1; "mi is smaller than target"
} while (lo < hi);
"did not find what we wanted"
The invariants are:
- When entering the loop, 'lo' points at a slot that is never
above the target (it could be at the target), 'hi' points at
a slot that is guaranteed to be above the target (it can
never be at the target).
- We find a point 'mi' between 'lo' and 'hi' ('mi' could be
the same as 'lo', but never can be as high as 'hi'), and
check if 'mi' hits the target. There are three cases:
- if it is a hit, we have found what we are looking for;
- if it is strictly higher than the target, we set it to
'hi', and repeat the search.
- if it is strictly lower than the target, we update 'lo'
to one slot after it, because we allow 'lo' to be at the
target and 'mi' is known to be below the target.
If the loop exits, there is no matching entry.
When choosing 'mi', we do not have to take the "middle" but
anywhere in between 'lo' and 'hi', as long as lo <= mi < hi is
satisfied. When we somehow know that the distance between the
target and 'lo' is much shorter than the target and 'hi', we
could pick 'mi' that is much closer to 'lo' than (hi+lo)/2,
which a conventional binary search would pick.
This patch takes advantage of the fact that the SHA-1 is a good
hash function, and as long as there are enough entries in the
table, we can expect uniform distribution. An entry that begins
with for example "deadbeef..." is much likely to appear much
later than in the midway of a reasonably populated table. In
fact, it can be expected to be near 87% (222/256) from the top
of the table.
This is a work-in-progress and has switches to allow easier
experiments and debugging. Exporting GIT_USE_LOOKUP environment
variable enables this code.
On my admittedly memory starved machine, with a partial KDE
repository (3.0G pack with 95M idx):
$ GIT_USE_LOOKUP=t git log -800 --stat HEAD >/dev/null
3.93user 0.16system 0:04.09elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+55588minor)pagefaults 0swaps
Without the patch, the numbers are:
$ git log -800 --stat HEAD >/dev/null
4.00user 0.15system 0:04.17elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+60258minor)pagefaults 0swaps
In the same repository:
$ GIT_USE_LOOKUP=t git log -2000 HEAD >/dev/null
0.12user 0.00system 0:00.12elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+4241minor)pagefaults 0swaps
Without the patch, the numbers are:
$ git log -2000 HEAD >/dev/null
0.05user 0.01system 0:00.07elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+8506minor)pagefaults 0swaps
There isn't much time difference, but the number of minor faults
seems to show that we are touching much smaller number of pages,
which is expected.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-29 18:05:47 +08:00
|
|
|
LIB_H += sha1-lookup.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += shortlog.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += sideband.h
|
chain kill signals for cleanup functions
If a piece of code wanted to do some cleanup before exiting
(e.g., cleaning up a lockfile or a tempfile), our usual
strategy was to install a signal handler that did something
like this:
do_cleanup(); /* actual work */
signal(signo, SIG_DFL); /* restore previous behavior */
raise(signo); /* deliver signal, killing ourselves */
For a single handler, this works fine. However, if we want
to clean up two _different_ things, we run into a problem.
The most recently installed handler will run, but when it
removes itself as a handler, it doesn't put back the first
handler.
This patch introduces sigchain, a tiny library for handling
a stack of signal handlers. You sigchain_push each handler,
and use sigchain_pop to restore whoever was before you in
the stack.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-22 14:02:35 +08:00
|
|
|
LIB_H += sigchain.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += strbuf.h
|
2011-05-12 10:30:25 +08:00
|
|
|
LIB_H += streaming.h
|
2009-02-10 06:00:45 +08:00
|
|
|
LIB_H += string-list.h
|
2009-10-19 20:38:32 +08:00
|
|
|
LIB_H += submodule.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += tag.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += tar.h
|
2012-02-25 07:42:42 +08:00
|
|
|
LIB_H += thread-utils.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += transport.h
|
|
|
|
LIB_H += tree-walk.h
|
2012-06-21 02:30:08 +08:00
|
|
|
LIB_H += tree.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += unpack-trees.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += url.h
|
2008-10-06 05:43:21 +08:00
|
|
|
LIB_H += userdiff.h
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_H += utf8.h
|
2012-04-04 06:53:08 +08:00
|
|
|
LIB_H += varint.h
|
Makefile: fold MISC_H into LIB_H
We keep a list of most of the header files in LIB_H, but
some are split out into MISC_H. The original point
of LIB_H was that it would force recompilation of C files
when any of the library headers changed. It was
over-encompassing, since not all C files included all of the
library headers; this made it simple to maintain, but meant
that we sometimes recompiled when it was not necessary.
Over time, some new headers were omitted from LIB_H, and
rules were added to the Makefile for a few specific targets
to explicitly depend on them. This avoided some unnecessary
recompilation at the cost of having to maintain the
dependency list of those targets manually (e.g., d349a03).
Later, we needed a complete list of headers from which we
should extract strings to localized. Thus 1b8b2e4 introduced
MISC_H to mention all header files not included in LIB_H,
and the concatenation of the two lists is fed to xgettext.
Headers mentioned as dependencies must also be manually
added to MISC_H to receive the benefits of localization.
Having to update multiple locations manually is a pain and
has led to errors. For example, see "git log -Swt-status.h
Makefile" for some back-and-forth between the two locations.
Or the fact that column.h was never added to MISC_H, and
therefore was not localized (which is fixed by this patch).
Moreover, the benefits of keeping these few headers out of
LIB_H is not that great, for two reasons:
1. The better way to do this is by auto-computing the
dependencies, which is more accurate and less work to
maintain. If your compiler supports it, we turn on
computed header dependencies by default these days. So
these manual dependencies are used only for people who
do not have gcc at all (which increases the chance of
them becoming stale, as many developers will never even
use them).
2. Even if you do not have gcc, the manual header
dependencies do not help all that much. They obviously
cannot help with an initial compilation (since their
purpose is to avoid unnecessary recompilation when a
header changes), which means they are only useful when
building a new version of git in the working tree that
held an existing build (e.g., after checkout or during a
bisection). But since a change of a header in LIB_H
will force recompilation, and given that the vast
majority of headers are in LIB_H, most version changes
will result in a full rebuild anyway.
Let's just fold MISC_H into LIB_H and get rid of these
manual rules. The worst case is some extra compilation, but
even that is unlikely to matter due to the reasons above.
The one exception is that we should keep common-cmds.h
separate. Because it is generated, the computed dependencies
do not handle it properly, and we must keep separate
individual dependencies on it. Let's therefore rename MISC_H
to GENERATED_H to make it more clear what should go in it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:30:56 +08:00
|
|
|
LIB_H += walker.h
|
|
|
|
LIB_H += wt-status.h
|
2010-01-26 23:44:47 +08:00
|
|
|
LIB_H += xdiff-interface.h
|
|
|
|
LIB_H += xdiff/xdiff.h
|
2008-03-12 16:46:26 +08:00
|
|
|
|
2008-06-28 04:46:42 +08:00
|
|
|
LIB_OBJS += abspath.o
|
2009-09-09 19:38:58 +08:00
|
|
|
LIB_OBJS += advice.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += alias.o
|
|
|
|
LIB_OBJS += alloc.o
|
|
|
|
LIB_OBJS += archive.o
|
|
|
|
LIB_OBJS += archive-tar.o
|
|
|
|
LIB_OBJS += archive-zip.o
|
2011-09-14 05:57:57 +08:00
|
|
|
LIB_OBJS += argv-array.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += attr.o
|
|
|
|
LIB_OBJS += base85.o
|
2009-03-26 12:55:24 +08:00
|
|
|
LIB_OBJS += bisect.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += blob.o
|
|
|
|
LIB_OBJS += branch.o
|
2011-10-29 05:48:40 +08:00
|
|
|
LIB_OBJS += bulk-checkin.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += bundle.o
|
|
|
|
LIB_OBJS += cache-tree.o
|
|
|
|
LIB_OBJS += color.o
|
2012-04-21 12:44:32 +08:00
|
|
|
LIB_OBJS += column.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += combine-diff.o
|
|
|
|
LIB_OBJS += commit.o
|
2011-08-21 06:40:40 +08:00
|
|
|
LIB_OBJS += compat/obstack.o
|
add generic terminal prompt function
When we need to prompt the user for input interactively, we
want to access their terminal directly. We can't rely on
stdio because it may be connected to pipes or files, rather
than the terminal. Instead, we use "getpass()", because it
abstracts the idea of prompting and reading from the
terminal. However, it has some problems:
1. It never echoes the typed characters, which makes it OK
for passwords but annoying for other input (like usernames).
2. Some implementations of getpass() have an extremely
small input buffer (e.g., Solaris 8 is reported to
support only 8 characters).
3. Some implementations of getpass() will fall back to
reading from stdin (e.g., glibc). We explicitly don't
want this, because our stdin may be connected to a pipe
speaking a particular protocol, and reading will
disrupt the protocol flow (e.g., the remote-curl
helper).
4. Some implementations of getpass() turn off signals, so
that hitting "^C" on the terminal does not break out of
the password prompt. This can be a mild annoyance.
Instead, let's provide an abstract "git_terminal_prompt"
function that addresses these concerns. This patch includes
an implementation based on /dev/tty, enabled by setting
HAVE_DEV_TTY. The fallback is to use getpass() as before.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-10 18:41:01 +08:00
|
|
|
LIB_OBJS += compat/terminal.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += config.o
|
|
|
|
LIB_OBJS += connect.o
|
2011-09-03 07:33:22 +08:00
|
|
|
LIB_OBJS += connected.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += convert.o
|
|
|
|
LIB_OBJS += copy.o
|
2011-12-10 18:31:11 +08:00
|
|
|
LIB_OBJS += credential.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += csum-file.o
|
|
|
|
LIB_OBJS += ctype.o
|
|
|
|
LIB_OBJS += date.o
|
|
|
|
LIB_OBJS += decorate.o
|
|
|
|
LIB_OBJS += diffcore-break.o
|
|
|
|
LIB_OBJS += diffcore-delta.o
|
|
|
|
LIB_OBJS += diffcore-order.o
|
|
|
|
LIB_OBJS += diffcore-pickaxe.o
|
|
|
|
LIB_OBJS += diffcore-rename.o
|
|
|
|
LIB_OBJS += diff-delta.o
|
|
|
|
LIB_OBJS += diff-lib.o
|
2009-02-10 06:00:45 +08:00
|
|
|
LIB_OBJS += diff-no-index.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += diff.o
|
|
|
|
LIB_OBJS += dir.o
|
2008-07-26 00:28:41 +08:00
|
|
|
LIB_OBJS += editor.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += entry.o
|
|
|
|
LIB_OBJS += environment.o
|
|
|
|
LIB_OBJS += exec_cmd.o
|
|
|
|
LIB_OBJS += fsck.o
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
LIB_OBJS += gettext.o
|
2012-05-04 21:52:36 +08:00
|
|
|
LIB_OBJS += gpg-interface.o
|
2008-05-04 18:36:53 +08:00
|
|
|
LIB_OBJS += graph.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += grep.o
|
|
|
|
LIB_OBJS += hash.o
|
|
|
|
LIB_OBJS += help.o
|
2010-01-22 07:25:19 +08:00
|
|
|
LIB_OBJS += hex.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += ident.o
|
Use kwset in pickaxe
Benchmarks in the hot cache case:
before:
$ perf stat --repeat=5 git log -Sqwerty
Performance counter stats for 'git log -Sqwerty' (5 runs):
47,092,744 cache-misses # 2.825 M/sec ( +- 1.607% )
123,368,389 cache-references # 7.400 M/sec ( +- 0.812% )
330,040,998 branch-misses # 3.134 % ( +- 0.257% )
10,530,896,750 branches # 631.663 M/sec ( +- 0.121% )
62,037,201,030 instructions # 1.399 IPC ( +- 0.142% )
44,331,294,321 cycles # 2659.073 M/sec ( +- 0.326% )
96,794 page-faults # 0.006 M/sec ( +- 11.952% )
25 CPU-migrations # 0.000 M/sec ( +- 25.266% )
1,424 context-switches # 0.000 M/sec ( +- 0.540% )
16671.708650 task-clock-msecs # 0.997 CPUs ( +- 0.343% )
16.728692052 seconds time elapsed ( +- 0.344% )
after:
$ perf stat --repeat=5 git log -Sqwerty
Performance counter stats for 'git log -Sqwerty' (5 runs):
51,385,522 cache-misses # 4.619 M/sec ( +- 0.565% )
129,177,880 cache-references # 11.611 M/sec ( +- 0.219% )
319,222,775 branch-misses # 6.946 % ( +- 0.134% )
4,595,913,233 branches # 413.086 M/sec ( +- 0.112% )
31,395,042,533 instructions # 1.062 IPC ( +- 0.129% )
29,558,348,598 cycles # 2656.740 M/sec ( +- 0.204% )
93,224 page-faults # 0.008 M/sec ( +- 4.487% )
19 CPU-migrations # 0.000 M/sec ( +- 10.425% )
950 context-switches # 0.000 M/sec ( +- 0.360% )
11125.796039 task-clock-msecs # 0.997 CPUs ( +- 0.239% )
11.164216599 seconds time elapsed ( +- 0.240% )
So the kwset code is about 33% faster.
Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-21 06:41:57 +08:00
|
|
|
LIB_OBJS += kwset.o
|
2008-08-31 21:50:23 +08:00
|
|
|
LIB_OBJS += levenshtein.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += list-objects.o
|
|
|
|
LIB_OBJS += ll-merge.o
|
|
|
|
LIB_OBJS += lockfile.o
|
|
|
|
LIB_OBJS += log-tree.o
|
|
|
|
LIB_OBJS += mailmap.o
|
|
|
|
LIB_OBJS += match-trees.o
|
|
|
|
LIB_OBJS += merge-file.o
|
2008-08-13 00:45:14 +08:00
|
|
|
LIB_OBJS += merge-recursive.o
|
2012-04-01 06:10:11 +08:00
|
|
|
LIB_OBJS += mergesort.o
|
2008-03-22 04:16:24 +08:00
|
|
|
LIB_OBJS += name-hash.o
|
2009-10-09 18:21:57 +08:00
|
|
|
LIB_OBJS += notes.o
|
2010-04-02 08:07:40 +08:00
|
|
|
LIB_OBJS += notes-cache.o
|
2010-11-10 05:49:46 +08:00
|
|
|
LIB_OBJS += notes-merge.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += object.o
|
|
|
|
LIB_OBJS += pack-check.o
|
2008-06-15 22:05:06 +08:00
|
|
|
LIB_OBJS += pack-refs.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += pack-revindex.o
|
|
|
|
LIB_OBJS += pack-write.o
|
|
|
|
LIB_OBJS += pager.o
|
|
|
|
LIB_OBJS += parse-options.o
|
2011-08-11 17:15:38 +08:00
|
|
|
LIB_OBJS += parse-options-cb.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += patch-delta.o
|
|
|
|
LIB_OBJS += patch-ids.o
|
|
|
|
LIB_OBJS += path.o
|
|
|
|
LIB_OBJS += pkt-line.o
|
2009-02-10 06:00:45 +08:00
|
|
|
LIB_OBJS += preload-index.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += pretty.o
|
|
|
|
LIB_OBJS += progress.o
|
2011-12-10 18:40:54 +08:00
|
|
|
LIB_OBJS += prompt.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += quote.o
|
|
|
|
LIB_OBJS += reachable.o
|
|
|
|
LIB_OBJS += read-cache.o
|
|
|
|
LIB_OBJS += reflog-walk.o
|
|
|
|
LIB_OBJS += refs.o
|
|
|
|
LIB_OBJS += remote.o
|
2009-01-23 17:06:53 +08:00
|
|
|
LIB_OBJS += replace_object.o
|
2008-07-09 20:58:57 +08:00
|
|
|
LIB_OBJS += rerere.o
|
2009-12-25 16:30:51 +08:00
|
|
|
LIB_OBJS += resolve-undo.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += revision.o
|
|
|
|
LIB_OBJS += run-command.o
|
2012-05-04 21:52:36 +08:00
|
|
|
LIB_OBJS += sequencer.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += server-info.o
|
|
|
|
LIB_OBJS += setup.o
|
2011-05-20 05:34:33 +08:00
|
|
|
LIB_OBJS += sha1-array.o
|
sha1-lookup: more memory efficient search in sorted list of SHA-1
Currently, when looking for a packed object from the pack idx, a
simple binary search is used.
A conventional binary search loop looks like this:
unsigned lo, hi;
do {
unsigned mi = (lo + hi) / 2;
int cmp = "entry pointed at by mi" minus "target";
if (!cmp)
return mi; "mi is the wanted one"
if (cmp > 0)
hi = mi; "mi is larger than target"
else
lo = mi+1; "mi is smaller than target"
} while (lo < hi);
"did not find what we wanted"
The invariants are:
- When entering the loop, 'lo' points at a slot that is never
above the target (it could be at the target), 'hi' points at
a slot that is guaranteed to be above the target (it can
never be at the target).
- We find a point 'mi' between 'lo' and 'hi' ('mi' could be
the same as 'lo', but never can be as high as 'hi'), and
check if 'mi' hits the target. There are three cases:
- if it is a hit, we have found what we are looking for;
- if it is strictly higher than the target, we set it to
'hi', and repeat the search.
- if it is strictly lower than the target, we update 'lo'
to one slot after it, because we allow 'lo' to be at the
target and 'mi' is known to be below the target.
If the loop exits, there is no matching entry.
When choosing 'mi', we do not have to take the "middle" but
anywhere in between 'lo' and 'hi', as long as lo <= mi < hi is
satisfied. When we somehow know that the distance between the
target and 'lo' is much shorter than the target and 'hi', we
could pick 'mi' that is much closer to 'lo' than (hi+lo)/2,
which a conventional binary search would pick.
This patch takes advantage of the fact that the SHA-1 is a good
hash function, and as long as there are enough entries in the
table, we can expect uniform distribution. An entry that begins
with for example "deadbeef..." is much likely to appear much
later than in the midway of a reasonably populated table. In
fact, it can be expected to be near 87% (222/256) from the top
of the table.
This is a work-in-progress and has switches to allow easier
experiments and debugging. Exporting GIT_USE_LOOKUP environment
variable enables this code.
On my admittedly memory starved machine, with a partial KDE
repository (3.0G pack with 95M idx):
$ GIT_USE_LOOKUP=t git log -800 --stat HEAD >/dev/null
3.93user 0.16system 0:04.09elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+55588minor)pagefaults 0swaps
Without the patch, the numbers are:
$ git log -800 --stat HEAD >/dev/null
4.00user 0.15system 0:04.17elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+60258minor)pagefaults 0swaps
In the same repository:
$ GIT_USE_LOOKUP=t git log -2000 HEAD >/dev/null
0.12user 0.00system 0:00.12elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+4241minor)pagefaults 0swaps
Without the patch, the numbers are:
$ git log -2000 HEAD >/dev/null
0.05user 0.01system 0:00.07elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+8506minor)pagefaults 0swaps
There isn't much time difference, but the number of minor faults
seems to show that we are touching much smaller number of pages,
which is expected.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-29 18:05:47 +08:00
|
|
|
LIB_OBJS += sha1-lookup.o
|
2009-02-10 06:00:45 +08:00
|
|
|
LIB_OBJS += sha1_file.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += sha1_name.o
|
|
|
|
LIB_OBJS += shallow.o
|
|
|
|
LIB_OBJS += sideband.o
|
chain kill signals for cleanup functions
If a piece of code wanted to do some cleanup before exiting
(e.g., cleaning up a lockfile or a tempfile), our usual
strategy was to install a signal handler that did something
like this:
do_cleanup(); /* actual work */
signal(signo, SIG_DFL); /* restore previous behavior */
raise(signo); /* deliver signal, killing ourselves */
For a single handler, this works fine. However, if we want
to clean up two _different_ things, we run into a problem.
The most recently installed handler will run, but when it
removes itself as a handler, it doesn't put back the first
handler.
This patch introduces sigchain, a tiny library for handling
a stack of signal handlers. You sigchain_push each handler,
and use sigchain_pop to restore whoever was before you in
the stack.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-22 14:02:35 +08:00
|
|
|
LIB_OBJS += sigchain.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += strbuf.o
|
2011-05-12 10:30:25 +08:00
|
|
|
LIB_OBJS += streaming.o
|
2009-02-10 06:00:45 +08:00
|
|
|
LIB_OBJS += string-list.o
|
2009-10-19 20:38:32 +08:00
|
|
|
LIB_OBJS += submodule.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += symlinks.o
|
|
|
|
LIB_OBJS += tag.o
|
|
|
|
LIB_OBJS += trace.o
|
|
|
|
LIB_OBJS += transport.o
|
2009-08-05 13:01:53 +08:00
|
|
|
LIB_OBJS += transport-helper.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += tree-diff.o
|
|
|
|
LIB_OBJS += tree.o
|
|
|
|
LIB_OBJS += tree-walk.o
|
|
|
|
LIB_OBJS += unpack-trees.o
|
2010-05-23 17:17:55 +08:00
|
|
|
LIB_OBJS += url.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += usage.o
|
2009-02-10 06:00:45 +08:00
|
|
|
LIB_OBJS += userdiff.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += utf8.o
|
2012-04-04 06:53:08 +08:00
|
|
|
LIB_OBJS += varint.o
|
2012-06-03 02:51:42 +08:00
|
|
|
LIB_OBJS += version.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += walker.o
|
Shrink the git binary a bit by avoiding unnecessary inline functions
So I was looking at the disgusting size of the git binary, and even with
the debugging removed, and using -Os instead of -O2, the size of the text
section was pretty high. In this day and age I guess almost a megabyte of
text isn't really all that surprising, but it still doesn't exactly make
me think "lean and mean".
With -Os, a surprising amount of text space is wasted on inline functions
that end up just being replicated multiple times, and where performance
really isn't a valid reason to inline them. In particular, the trivial
wrapper functions like "xmalloc()" are used _everywhere_, and making them
inline just duplicates the text (and the string we use to 'die()' on
failure) unnecessarily.
So this just moves them into a "wrapper.c" file, getting rid of a tiny bit
of unnecessary bloat. The following numbers are both with "CFLAGS=-Os":
Before:
[torvalds@woody git]$ size git
text data bss dec hex filename
700460 15160 292184 1007804 f60bc git
After:
[torvalds@woody git]$ size git
text data bss dec hex filename
670540 15160 292184 977884 eebdc git
so it saves almost 30k of text-space (it actually saves more than that
with the default -O2, but I don't think that's necessarily a very relevant
number from a "try to shrink git" standpoint).
It might conceivably have a performance impact, but none of this should be
_that_ performance critical. The real cost is not generally in the wrapper
anyway, but in the code it wraps (ie the cost of "xread()" is all in the
read itself, not in the trivial wrapping of it).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-23 03:19:25 +08:00
|
|
|
LIB_OBJS += wrapper.o
|
2008-03-12 16:46:26 +08:00
|
|
|
LIB_OBJS += write_or_die.o
|
|
|
|
LIB_OBJS += ws.o
|
|
|
|
LIB_OBJS += wt-status.o
|
|
|
|
LIB_OBJS += xdiff-interface.o
|
2010-11-06 19:47:34 +08:00
|
|
|
LIB_OBJS += zlib.o
|
2008-03-12 16:46:26 +08:00
|
|
|
|
2010-02-23 00:42:18 +08:00
|
|
|
BUILTIN_OBJS += builtin/add.o
|
|
|
|
BUILTIN_OBJS += builtin/annotate.o
|
|
|
|
BUILTIN_OBJS += builtin/apply.o
|
|
|
|
BUILTIN_OBJS += builtin/archive.o
|
|
|
|
BUILTIN_OBJS += builtin/bisect--helper.o
|
|
|
|
BUILTIN_OBJS += builtin/blame.o
|
|
|
|
BUILTIN_OBJS += builtin/branch.o
|
|
|
|
BUILTIN_OBJS += builtin/bundle.o
|
|
|
|
BUILTIN_OBJS += builtin/cat-file.o
|
|
|
|
BUILTIN_OBJS += builtin/check-attr.o
|
|
|
|
BUILTIN_OBJS += builtin/check-ref-format.o
|
|
|
|
BUILTIN_OBJS += builtin/checkout-index.o
|
|
|
|
BUILTIN_OBJS += builtin/checkout.o
|
|
|
|
BUILTIN_OBJS += builtin/clean.o
|
|
|
|
BUILTIN_OBJS += builtin/clone.o
|
2012-04-21 12:44:32 +08:00
|
|
|
BUILTIN_OBJS += builtin/column.o
|
2010-02-23 00:42:18 +08:00
|
|
|
BUILTIN_OBJS += builtin/commit-tree.o
|
|
|
|
BUILTIN_OBJS += builtin/commit.o
|
|
|
|
BUILTIN_OBJS += builtin/config.o
|
|
|
|
BUILTIN_OBJS += builtin/count-objects.o
|
2012-06-24 19:39:59 +08:00
|
|
|
BUILTIN_OBJS += builtin/credential.o
|
2010-02-23 00:42:18 +08:00
|
|
|
BUILTIN_OBJS += builtin/describe.o
|
|
|
|
BUILTIN_OBJS += builtin/diff-files.o
|
|
|
|
BUILTIN_OBJS += builtin/diff-index.o
|
|
|
|
BUILTIN_OBJS += builtin/diff-tree.o
|
|
|
|
BUILTIN_OBJS += builtin/diff.o
|
|
|
|
BUILTIN_OBJS += builtin/fast-export.o
|
|
|
|
BUILTIN_OBJS += builtin/fetch-pack.o
|
|
|
|
BUILTIN_OBJS += builtin/fetch.o
|
|
|
|
BUILTIN_OBJS += builtin/fmt-merge-msg.o
|
|
|
|
BUILTIN_OBJS += builtin/for-each-ref.o
|
|
|
|
BUILTIN_OBJS += builtin/fsck.o
|
|
|
|
BUILTIN_OBJS += builtin/gc.o
|
|
|
|
BUILTIN_OBJS += builtin/grep.o
|
|
|
|
BUILTIN_OBJS += builtin/hash-object.o
|
|
|
|
BUILTIN_OBJS += builtin/help.o
|
|
|
|
BUILTIN_OBJS += builtin/index-pack.o
|
|
|
|
BUILTIN_OBJS += builtin/init-db.o
|
|
|
|
BUILTIN_OBJS += builtin/log.o
|
|
|
|
BUILTIN_OBJS += builtin/ls-files.o
|
|
|
|
BUILTIN_OBJS += builtin/ls-remote.o
|
|
|
|
BUILTIN_OBJS += builtin/ls-tree.o
|
|
|
|
BUILTIN_OBJS += builtin/mailinfo.o
|
|
|
|
BUILTIN_OBJS += builtin/mailsplit.o
|
|
|
|
BUILTIN_OBJS += builtin/merge.o
|
|
|
|
BUILTIN_OBJS += builtin/merge-base.o
|
|
|
|
BUILTIN_OBJS += builtin/merge-file.o
|
|
|
|
BUILTIN_OBJS += builtin/merge-index.o
|
|
|
|
BUILTIN_OBJS += builtin/merge-ours.o
|
|
|
|
BUILTIN_OBJS += builtin/merge-recursive.o
|
|
|
|
BUILTIN_OBJS += builtin/merge-tree.o
|
|
|
|
BUILTIN_OBJS += builtin/mktag.o
|
|
|
|
BUILTIN_OBJS += builtin/mktree.o
|
|
|
|
BUILTIN_OBJS += builtin/mv.o
|
|
|
|
BUILTIN_OBJS += builtin/name-rev.o
|
2010-03-15 15:52:06 +08:00
|
|
|
BUILTIN_OBJS += builtin/notes.o
|
2010-02-23 00:42:18 +08:00
|
|
|
BUILTIN_OBJS += builtin/pack-objects.o
|
|
|
|
BUILTIN_OBJS += builtin/pack-redundant.o
|
|
|
|
BUILTIN_OBJS += builtin/pack-refs.o
|
|
|
|
BUILTIN_OBJS += builtin/patch-id.o
|
|
|
|
BUILTIN_OBJS += builtin/prune-packed.o
|
|
|
|
BUILTIN_OBJS += builtin/prune.o
|
|
|
|
BUILTIN_OBJS += builtin/push.o
|
|
|
|
BUILTIN_OBJS += builtin/read-tree.o
|
|
|
|
BUILTIN_OBJS += builtin/receive-pack.o
|
|
|
|
BUILTIN_OBJS += builtin/reflog.o
|
|
|
|
BUILTIN_OBJS += builtin/remote.o
|
2010-10-13 00:39:43 +08:00
|
|
|
BUILTIN_OBJS += builtin/remote-ext.o
|
2010-10-13 00:39:42 +08:00
|
|
|
BUILTIN_OBJS += builtin/remote-fd.o
|
2010-02-23 00:42:18 +08:00
|
|
|
BUILTIN_OBJS += builtin/replace.o
|
|
|
|
BUILTIN_OBJS += builtin/rerere.o
|
|
|
|
BUILTIN_OBJS += builtin/reset.o
|
|
|
|
BUILTIN_OBJS += builtin/rev-list.o
|
|
|
|
BUILTIN_OBJS += builtin/rev-parse.o
|
|
|
|
BUILTIN_OBJS += builtin/revert.o
|
|
|
|
BUILTIN_OBJS += builtin/rm.o
|
|
|
|
BUILTIN_OBJS += builtin/send-pack.o
|
|
|
|
BUILTIN_OBJS += builtin/shortlog.o
|
|
|
|
BUILTIN_OBJS += builtin/show-branch.o
|
|
|
|
BUILTIN_OBJS += builtin/show-ref.o
|
|
|
|
BUILTIN_OBJS += builtin/stripspace.o
|
|
|
|
BUILTIN_OBJS += builtin/symbolic-ref.o
|
|
|
|
BUILTIN_OBJS += builtin/tag.o
|
|
|
|
BUILTIN_OBJS += builtin/tar-tree.o
|
|
|
|
BUILTIN_OBJS += builtin/unpack-file.o
|
|
|
|
BUILTIN_OBJS += builtin/unpack-objects.o
|
|
|
|
BUILTIN_OBJS += builtin/update-index.o
|
|
|
|
BUILTIN_OBJS += builtin/update-ref.o
|
|
|
|
BUILTIN_OBJS += builtin/update-server-info.o
|
|
|
|
BUILTIN_OBJS += builtin/upload-archive.o
|
|
|
|
BUILTIN_OBJS += builtin/var.o
|
|
|
|
BUILTIN_OBJS += builtin/verify-pack.o
|
|
|
|
BUILTIN_OBJS += builtin/verify-tag.o
|
|
|
|
BUILTIN_OBJS += builtin/write-tree.o
|
2006-04-22 01:27:34 +08:00
|
|
|
|
2006-03-27 07:14:52 +08:00
|
|
|
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
|
2007-07-30 02:35:45 +08:00
|
|
|
EXTLIBS =
|
2005-04-22 03:33:22 +08:00
|
|
|
|
2012-06-03 03:01:12 +08:00
|
|
|
GIT_USER_AGENT = git/$(GIT_VERSION)
|
|
|
|
|
2005-09-24 01:41:40 +08:00
|
|
|
#
|
|
|
|
# Platform specific tweaks
|
|
|
|
#
|
2005-10-10 03:52:35 +08:00
|
|
|
|
|
|
|
# We choose to avoid "if .. else if .. else .. endif endif"
|
|
|
|
# because maintaining the nesting to match is a pain. If
|
|
|
|
# we had "elif" things would have been much nicer...
|
|
|
|
|
2012-04-07 05:01:23 +08:00
|
|
|
ifeq ($(uname_M),x86_64)
|
|
|
|
XDL_FAST_HASH = YesPlease
|
|
|
|
endif
|
2010-05-14 17:31:49 +08:00
|
|
|
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
|
2006-06-24 22:01:25 +08:00
|
|
|
ifeq ($(uname_S),Linux)
|
|
|
|
NO_STRLCPY = YesPlease
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
2010-04-13 17:07:13 +08:00
|
|
|
HAVE_PATHS_H = YesPlease
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
2011-12-10 18:41:27 +08:00
|
|
|
HAVE_DEV_TTY = YesPlease
|
2006-06-24 22:01:25 +08:00
|
|
|
endif
|
2006-07-30 00:26:18 +08:00
|
|
|
ifeq ($(uname_S),GNU/kFreeBSD)
|
|
|
|
NO_STRLCPY = YesPlease
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
2010-04-13 17:07:13 +08:00
|
|
|
HAVE_PATHS_H = YesPlease
|
2011-10-03 14:41:20 +08:00
|
|
|
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
2006-07-30 00:26:18 +08:00
|
|
|
endif
|
Port to 12 other Platforms.
This patch adds support to compile and run git on 12 additional platforms.
The platforms are based on UNIX Systems Labs (USL)/Novell/SYS V code base.
The most common are Novell UnixWare 2.X.X, SCO UnixWare 7.X.X,
OpenServer 5.0.X, OpenServer 6.0.X, and SCO pre OSR 5 platforms.
Looking at the the various platform headers, I find:
#if defined(_KERNEL) || !defined(_POSIX_SOURCE) \
&& !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)
which hides u_short and other typedefs that other header files on these
platforms depend on. WIth _XOPEN_SOURCE defined, sources that include
system header files that depend on the typedefs such as u_short cannot be
compiled on these platforms.
__USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived
compiler and/or some SysV based OS's.
__M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior releases
of the SCO OS's. It is used just like Apple and BSD, both of these
shouldn't have _XOPEN_SOURCE defined.
This is with suggestions and modifications from
Daniel Barkalow, Junio C Hamano, Thomas Harning, and Jeremy Maitin-Shepard.
Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-09 04:47:54 +08:00
|
|
|
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
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
Port to 12 other Platforms.
This patch adds support to compile and run git on 12 additional platforms.
The platforms are based on UNIX Systems Labs (USL)/Novell/SYS V code base.
The most common are Novell UnixWare 2.X.X, SCO UnixWare 7.X.X,
OpenServer 5.0.X, OpenServer 6.0.X, and SCO pre OSR 5 platforms.
Looking at the the various platform headers, I find:
#if defined(_KERNEL) || !defined(_POSIX_SOURCE) \
&& !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)
which hides u_short and other typedefs that other header files on these
platforms depend on. WIth _XOPEN_SOURCE defined, sources that include
system header files that depend on the typedefs such as u_short cannot be
compiled on these platforms.
__USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived
compiler and/or some SysV based OS's.
__M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior releases
of the SCO OS's. It is used just like Apple and BSD, both of these
shouldn't have _XOPEN_SOURCE defined.
This is with suggestions and modifications from
Daniel Barkalow, Junio C Hamano, Thomas Harning, and Jeremy Maitin-Shepard.
Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-09 04:47:54 +08:00
|
|
|
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
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
Port to 12 other Platforms.
This patch adds support to compile and run git on 12 additional platforms.
The platforms are based on UNIX Systems Labs (USL)/Novell/SYS V code base.
The most common are Novell UnixWare 2.X.X, SCO UnixWare 7.X.X,
OpenServer 5.0.X, OpenServer 6.0.X, and SCO pre OSR 5 platforms.
Looking at the the various platform headers, I find:
#if defined(_KERNEL) || !defined(_POSIX_SOURCE) \
&& !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)
which hides u_short and other typedefs that other header files on these
platforms depend on. WIth _XOPEN_SOURCE defined, sources that include
system header files that depend on the typedefs such as u_short cannot be
compiled on these platforms.
__USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived
compiler and/or some SysV based OS's.
__M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior releases
of the SCO OS's. It is used just like Apple and BSD, both of these
shouldn't have _XOPEN_SOURCE defined.
This is with suggestions and modifications from
Daniel Barkalow, Junio C Hamano, Thomas Harning, and Jeremy Maitin-Shepard.
Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-09 04:47:54 +08:00
|
|
|
BASIC_CFLAGS += -I/usr/local/include
|
|
|
|
BASIC_LDFLAGS += -L/usr/local/lib
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
INSTALL = ginstall
|
|
|
|
TAR = gtar
|
|
|
|
endif
|
2005-10-10 03:52:35 +08:00
|
|
|
ifeq ($(uname_S),Darwin)
|
2009-09-08 21:54:38 +08:00
|
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
2005-09-08 03:22:56 +08:00
|
|
|
NEEDS_SSL_WITH_CRYPTO = YesPlease
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
2009-02-05 14:09:08 +08:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
|
2007-12-07 03:07:03 +08:00
|
|
|
OLD_ICONV = UnfortunatelyYes
|
|
|
|
endif
|
2009-02-05 14:09:08 +08:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
|
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
endif
|
2007-09-09 13:09:17 +08:00
|
|
|
NO_MEMMEM = YesPlease
|
2009-03-09 04:04:28 +08:00
|
|
|
USE_ST_TIMESPEC = YesPlease
|
2011-12-10 18:41:30 +08:00
|
|
|
HAVE_DEV_TTY = YesPlease
|
git on Mac OS and precomposed unicode
Mac OS X mangles file names containing unicode on file systems HFS+,
VFAT or SAMBA. When a file using unicode code points outside ASCII
is created on a HFS+ drive, the file name is converted into
decomposed unicode and written to disk. No conversion is done if
the file name is already decomposed unicode.
Calling open("\xc3\x84", ...) with a precomposed "Ä" yields the same
result as open("\x41\xcc\x88",...) with a decomposed "Ä".
As a consequence, readdir() returns the file names in decomposed
unicode, even if the user expects precomposed unicode. Unlike on
HFS+, Mac OS X stores files on a VFAT drive (e.g. an USB drive) in
precomposed unicode, but readdir() still returns file names in
decomposed unicode. When a git repository is stored on a network
share using SAMBA, file names are send over the wire and written to
disk on the remote system in precomposed unicode, but Mac OS X
readdir() returns decomposed unicode to be compatible with its
behaviour on HFS+ and VFAT.
The unicode decomposition causes many problems:
- The names "git add" and other commands get from the end user may
often be precomposed form (the decomposed form is not easily input
from the keyboard), but when the commands read from the filesystem
to see what it is going to update the index with already is on the
filesystem, readdir() will give decomposed form, which is different.
- Similarly "git log", "git mv" and all other commands that need to
compare pathnames found on the command line (often but not always
precomposed form; a command line input resulting from globbing may
be in decomposed) with pathnames found in the tree objects (should
be precomposed form to be compatible with other systems and for
consistency in general).
- The same for names stored in the index, which should be
precomposed, that may need to be compared with the names read from
readdir().
NFS mounted from Linux is fully transparent and does not suffer from
the above.
As Mac OS X treats precomposed and decomposed file names as equal,
we can
- wrap readdir() on Mac OS X to return the precomposed form, and
- normalize decomposed form given from the command line also to the
precomposed form,
to ensure that all pathnames used in Git are always in the
precomposed form. This behaviour can be requested by setting
"core.precomposedunicode" configuration variable to true.
The code in compat/precomposed_utf8.c implements basically 4 new
functions: precomposed_utf8_opendir(), precomposed_utf8_readdir(),
precomposed_utf8_closedir() and precompose_argv(). The first three
are to wrap opendir(3), readdir(3), and closedir(3) functions.
The argv[] conversion allows to use the TAB filename completion done
by the shell on command line. It tolerates other tools which use
readdir() to feed decomposed file names into git.
When creating a new git repository with "git init" or "git clone",
"core.precomposedunicode" will be set "false".
The user needs to activate this feature manually. She typically
sets core.precomposedunicode to "true" on HFS and VFAT, or file
systems mounted via SAMBA.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-08 21:50:25 +08:00
|
|
|
COMPAT_OBJS += compat/precompose_utf8.o
|
|
|
|
BASIC_CFLAGS += -DPRECOMPOSE_UNICODE
|
2005-09-08 03:22:56 +08:00
|
|
|
endif
|
2005-10-10 03:52:35 +08:00
|
|
|
ifeq ($(uname_S),SunOS)
|
2005-09-06 07:24:03 +08:00
|
|
|
NEEDS_SOCKET = YesPlease
|
2005-09-12 13:25:49 +08:00
|
|
|
NEEDS_NSL = YesPlease
|
2005-09-24 01:41:40 +08:00
|
|
|
SHELL_PATH = /bin/bash
|
2009-06-06 07:36:15 +08:00
|
|
|
SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
|
2005-09-24 01:41:40 +08:00
|
|
|
NO_STRCASESTR = YesPlease
|
2007-09-07 06:32:54 +08:00
|
|
|
NO_MEMMEM = YesPlease
|
2007-11-17 02:59:58 +08:00
|
|
|
NO_MKDTEMP = YesPlease
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
2009-06-17 03:08:21 +08:00
|
|
|
NO_REGEX = YesPlease
|
2010-10-04 10:48:11 +08:00
|
|
|
NO_FNMATCH_CASEFOLD = YesPlease
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
NO_MSGFMT_EXTENDED_OPTIONS = YesPlease
|
2012-08-07 11:07:42 +08:00
|
|
|
HAVE_DEV_TTY = YesPlease
|
2010-05-14 17:31:45 +08:00
|
|
|
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
|
2009-06-06 07:36:16 +08:00
|
|
|
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
|
2010-05-14 17:31:38 +08:00
|
|
|
GIT_TEST_CMP = cmp
|
2009-05-23 13:55:31 +08:00
|
|
|
endif
|
2005-12-03 07:08:28 +08:00
|
|
|
ifeq ($(uname_R),5.8)
|
2006-01-26 04:38:36 +08:00
|
|
|
NO_UNSETENV = YesPlease
|
2005-12-03 07:08:28 +08:00
|
|
|
NO_SETENV = YesPlease
|
2007-02-20 08:22:56 +08:00
|
|
|
NO_STRTOUMAX = YesPlease
|
2010-05-14 17:31:38 +08:00
|
|
|
GIT_TEST_CMP = cmp
|
2005-12-03 07:08:28 +08:00
|
|
|
endif
|
2006-04-12 02:42:26 +08:00
|
|
|
ifeq ($(uname_R),5.9)
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_SETENV = YesPlease
|
2007-02-20 08:22:56 +08:00
|
|
|
NO_STRTOUMAX = YesPlease
|
2010-05-14 17:31:38 +08:00
|
|
|
GIT_TEST_CMP = cmp
|
2006-04-12 02:42:26 +08:00
|
|
|
endif
|
2009-05-28 10:17:05 +08:00
|
|
|
INSTALL = /usr/ucb/install
|
2005-09-24 01:41:40 +08:00
|
|
|
TAR = gtar
|
2009-06-19 23:10:39 +08:00
|
|
|
BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H
|
2005-09-06 07:24:03 +08:00
|
|
|
endif
|
2005-10-10 03:52:35 +08:00
|
|
|
ifeq ($(uname_O),Cygwin)
|
2010-04-03 15:47:00 +08:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
|
2010-04-02 06:43:54 +08:00
|
|
|
NO_D_TYPE_IN_DIRENT = YesPlease
|
|
|
|
NO_D_INO_IN_DIRENT = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_MKSTEMPS = YesPlease
|
|
|
|
NO_SYMLINK_HEAD = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
OLD_ICONV = UnfortunatelyYes
|
|
|
|
endif
|
2012-06-27 02:19:32 +08:00
|
|
|
NO_THREAD_SAFE_PREAD = YesPlease
|
2005-09-29 07:37:37 +08:00
|
|
|
NEEDS_LIBICONV = YesPlease
|
2006-12-14 19:15:57 +08:00
|
|
|
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
|
2006-12-31 12:53:55 +08:00
|
|
|
NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
|
2009-11-20 02:46:24 +08:00
|
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
2005-11-18 03:29:47 +08:00
|
|
|
# There are conflicting reports about this.
|
|
|
|
# On some boxes NO_MMAP is needed, and not so elsewhere.
|
2006-12-28 07:12:31 +08:00
|
|
|
# Try commenting this out if you suspect MMAP is more efficient
|
|
|
|
NO_MMAP = YesPlease
|
2005-09-29 10:08:37 +08:00
|
|
|
X = .exe
|
2009-10-28 03:11:55 +08:00
|
|
|
COMPAT_OBJS += compat/cygwin.o
|
|
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
2011-04-08 02:22:18 +08:00
|
|
|
SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
|
2005-09-21 00:27:13 +08:00
|
|
|
endif
|
2006-01-27 02:04:30 +08:00
|
|
|
ifeq ($(uname_S),FreeBSD)
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
2009-12-27 06:32:36 +08:00
|
|
|
OLD_ICONV = YesPlease
|
2007-09-11 00:43:35 +08:00
|
|
|
NO_MEMMEM = YesPlease
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -I/usr/local/include
|
|
|
|
BASIC_LDFLAGS += -L/usr/local/lib
|
2008-03-05 07:15:39 +08:00
|
|
|
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
|
2009-03-22 16:08:48 +08:00
|
|
|
USE_ST_TIMESPEC = YesPlease
|
2008-10-26 19:52:47 +08:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
|
2008-11-03 07:43:20 +08:00
|
|
|
PTHREAD_LIBS = -pthread
|
2008-10-26 19:52:47 +08:00
|
|
|
NO_UINTMAX_T = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
endif
|
2010-03-22 03:01:50 +08:00
|
|
|
PYTHON_PATH = /usr/local/bin/python
|
2010-04-13 17:07:13 +08:00
|
|
|
HAVE_PATHS_H = YesPlease
|
2006-01-27 02:04:30 +08:00
|
|
|
endif
|
2005-10-10 03:52:35 +08:00
|
|
|
ifeq ($(uname_S),OpenBSD)
|
2005-10-11 02:51:11 +08:00
|
|
|
NO_STRCASESTR = YesPlease
|
2007-09-07 06:32:54 +08:00
|
|
|
NO_MEMMEM = YesPlease
|
2009-05-14 14:47:41 +08:00
|
|
|
USE_ST_TIMESPEC = YesPlease
|
2005-10-01 14:23:26 +08:00
|
|
|
NEEDS_LIBICONV = YesPlease
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -I/usr/local/include
|
|
|
|
BASIC_LDFLAGS += -L/usr/local/lib
|
2010-04-13 17:07:13 +08:00
|
|
|
HAVE_PATHS_H = YesPlease
|
2005-11-13 17:46:13 +08:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_S),NetBSD)
|
2006-05-12 01:35:31 +08:00
|
|
|
ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
endif
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -I/usr/pkg/include
|
2008-08-17 12:56:24 +08:00
|
|
|
BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
|
2009-04-26 21:49:00 +08:00
|
|
|
USE_ST_TIMESPEC = YesPlease
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
2010-04-13 17:07:13 +08:00
|
|
|
HAVE_PATHS_H = YesPlease
|
2005-10-01 14:23:26 +08:00
|
|
|
endif
|
2005-12-07 06:20:16 +08:00
|
|
|
ifeq ($(uname_S),AIX)
|
2010-06-10 16:59:52 +08:00
|
|
|
DEFAULT_PAGER = more
|
2005-12-07 06:20:16 +08:00
|
|
|
NO_STRCASESTR=YesPlease
|
2007-09-07 06:32:54 +08:00
|
|
|
NO_MEMMEM = YesPlease
|
2008-05-07 16:35:55 +08:00
|
|
|
NO_MKDTEMP = YesPlease
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
2006-06-24 22:01:25 +08:00
|
|
|
NO_STRLCPY = YesPlease
|
2009-03-05 01:47:40 +08:00
|
|
|
NO_NSEC = YesPlease
|
2008-05-07 16:35:55 +08:00
|
|
|
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
|
|
|
INTERNAL_QSORT = UnfortunatelyYes
|
2005-12-07 06:20:16 +08:00
|
|
|
NEEDS_LIBICONV=YesPlease
|
2008-05-07 16:35:55 +08:00
|
|
|
BASIC_CFLAGS += -D_LARGE_FILES
|
2010-01-30 09:22:19 +08:00
|
|
|
ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
|
2008-11-15 20:08:14 +08:00
|
|
|
NO_PTHREADS = YesPlease
|
2010-05-14 17:31:34 +08:00
|
|
|
else
|
|
|
|
PTHREAD_LIBS = -lpthread
|
2008-11-15 20:08:14 +08:00
|
|
|
endif
|
2010-05-14 17:31:44 +08:00
|
|
|
ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3)
|
|
|
|
INLINE=''
|
2008-11-15 20:08:14 +08:00
|
|
|
endif
|
2010-05-14 17:31:38 +08:00
|
|
|
GIT_TEST_CMP = cmp
|
2005-12-07 06:20:16 +08:00
|
|
|
endif
|
2007-08-02 16:56:42 +08:00
|
|
|
ifeq ($(uname_S),GNU)
|
|
|
|
# GNU/Hurd
|
|
|
|
NO_STRLCPY=YesPlease
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
2010-04-13 17:07:13 +08:00
|
|
|
HAVE_PATHS_H = YesPlease
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
LIBC_CONTAINS_LIBINTL = YesPlease
|
2007-08-02 16:56:42 +08:00
|
|
|
endif
|
2009-07-11 01:10:46 +08:00
|
|
|
ifeq ($(uname_S),IRIX)
|
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_MKSTEMPS = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
2009-10-09 08:09:37 +08:00
|
|
|
# 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.
|
2009-07-11 01:10:46 +08:00
|
|
|
NO_MMAP = YesPlease
|
2010-09-10 03:15:58 +08:00
|
|
|
NO_REGEX = YesPlease
|
2010-12-23 07:58:51 +08:00
|
|
|
NO_FNMATCH_CASEFOLD = YesPlease
|
2009-07-11 01:10:46 +08:00
|
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
|
|
|
SHELL_PATH = /usr/gnu/bin/bash
|
|
|
|
NEEDS_LIBGEN = YesPlease
|
|
|
|
endif
|
2006-02-17 22:23:41 +08:00
|
|
|
ifeq ($(uname_S),IRIX64)
|
|
|
|
NO_SETENV=YesPlease
|
2009-07-11 02:31:19 +08:00
|
|
|
NO_UNSETENV = YesPlease
|
2006-02-17 22:23:41 +08:00
|
|
|
NO_STRCASESTR=YesPlease
|
2007-09-07 06:32:54 +08:00
|
|
|
NO_MEMMEM = YesPlease
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
2009-07-11 02:31:19 +08:00
|
|
|
NO_MKDTEMP = YesPlease
|
2009-10-09 08:09:37 +08:00
|
|
|
# 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.
|
2009-07-11 02:31:19 +08:00
|
|
|
NO_MMAP = YesPlease
|
2010-09-10 03:15:58 +08:00
|
|
|
NO_REGEX = YesPlease
|
2010-12-23 07:58:51 +08:00
|
|
|
NO_FNMATCH_CASEFOLD = YesPlease
|
2009-07-11 02:31:19 +08:00
|
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
2006-02-17 22:23:41 +08:00
|
|
|
SHELL_PATH=/usr/gnu/bin/bash
|
2009-07-11 02:31:19 +08:00
|
|
|
NEEDS_LIBGEN = YesPlease
|
2006-02-17 22:23:41 +08:00
|
|
|
endif
|
2008-01-25 02:35:20 +08:00
|
|
|
ifeq ($(uname_S),HP-UX)
|
2010-05-14 17:31:47 +08:00
|
|
|
INLINE = __inline
|
2008-01-25 02:35:20 +08:00
|
|
|
NO_IPV6=YesPlease
|
|
|
|
NO_SETENV=YesPlease
|
|
|
|
NO_STRCASESTR=YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
2008-01-25 02:35:20 +08:00
|
|
|
NO_STRLCPY = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_HSTRERROR = YesPlease
|
|
|
|
NO_SYS_SELECT_H = YesPlease
|
2011-03-07 19:43:11 +08:00
|
|
|
NO_FNMATCH_CASEFOLD = YesPlease
|
2008-08-24 06:07:55 +08:00
|
|
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
2010-05-14 17:31:47 +08:00
|
|
|
NO_NSEC = YesPlease
|
|
|
|
ifeq ($(uname_R),B.11.00)
|
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
2010-05-14 17:31:48 +08:00
|
|
|
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
|
2010-05-14 17:31:47 +08:00
|
|
|
endif
|
2010-05-14 17:31:38 +08:00
|
|
|
GIT_TEST_CMP = cmp
|
2008-01-25 02:35:20 +08:00
|
|
|
endif
|
2009-11-08 04:08:01 +08:00
|
|
|
ifeq ($(uname_S),Windows)
|
2009-09-16 16:20:31 +08:00
|
|
|
GIT_VERSION := $(GIT_VERSION).MSVC
|
2009-09-16 16:20:28 +08:00
|
|
|
pathsep = ;
|
|
|
|
NO_PREAD = YesPlease
|
2009-10-22 01:04:51 +08:00
|
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
2009-09-16 16:20:28 +08:00
|
|
|
NO_LIBGEN_H = YesPlease
|
2011-10-25 00:02:09 +08:00
|
|
|
NO_SYS_POLL_H = YesPlease
|
2009-09-16 16:20:28 +08:00
|
|
|
NO_SYMLINK_HEAD = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
2011-12-13 05:12:56 +08:00
|
|
|
NO_UNIX_SOCKETS = YesPlease
|
2009-09-16 16:20:28 +08:00
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
2010-08-14 07:59:40 +08:00
|
|
|
NO_STRTOK_R = YesPlease
|
2010-10-03 17:56:39 +08:00
|
|
|
NO_FNMATCH = YesPlease
|
2009-09-16 16:20:28 +08:00
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
# NEEDS_LIBICONV = YesPlease
|
|
|
|
NO_ICONV = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
NO_STRTOULL = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
NO_MKSTEMPS = YesPlease
|
|
|
|
SNPRINTF_RETURNS_BOGUS = 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_CURL = YesPlease
|
2010-01-16 04:12:15 +08:00
|
|
|
NO_PYTHON = YesPlease
|
2009-10-23 02:26:29 +08:00
|
|
|
BLK_SHA1 = YesPlease
|
2010-11-04 09:35:24 +08:00
|
|
|
NO_POSIX_GOODIES = UnfortunatelyYes
|
2010-06-05 03:29:08 +08:00
|
|
|
NATIVE_CRLF = YesPlease
|
2012-06-07 04:28:16 +08:00
|
|
|
DEFAULT_HELP_FORMAT = html
|
2009-09-16 16:20:28 +08:00
|
|
|
|
|
|
|
CC = compat/vcbuild/scripts/clink.pl
|
|
|
|
AR = compat/vcbuild/scripts/lib.pl
|
|
|
|
CFLAGS =
|
2009-10-08 23:21:44 +08:00
|
|
|
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
|
2010-12-13 13:49:52 +08:00
|
|
|
COMPAT_OBJS = compat/msvc.o compat/winansi.o \
|
2010-11-24 02:38:29 +08:00
|
|
|
compat/win32/pthread.o compat/win32/syslog.o \
|
2011-10-25 00:02:09 +08:00
|
|
|
compat/win32/poll.o compat/win32/dirent.o
|
2010-10-03 17:56:39 +08:00
|
|
|
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
|
2009-09-16 16:20:28 +08:00
|
|
|
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
|
2010-12-05 02:55:51 +08:00
|
|
|
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib
|
2010-01-24 18:10:30 +08:00
|
|
|
PTHREAD_LIBS =
|
2009-09-16 16:20:28 +08:00
|
|
|
lib =
|
|
|
|
ifndef DEBUG
|
|
|
|
BASIC_CFLAGS += -GL -Os -MT
|
|
|
|
BASIC_LDFLAGS += -LTCG
|
|
|
|
AR += -LTCG
|
|
|
|
else
|
|
|
|
BASIC_CFLAGS += -Zi -MTd
|
|
|
|
endif
|
|
|
|
X = .exe
|
2009-11-08 04:08:01 +08:00
|
|
|
endif
|
2010-10-27 16:39:52 +08:00
|
|
|
ifeq ($(uname_S),Interix)
|
|
|
|
NO_INITGROUPS = YesPlease
|
|
|
|
NO_IPV6 = YesPlease
|
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
NO_NSEC = YesPlease
|
|
|
|
NO_MKSTEMPS = YesPlease
|
|
|
|
ifeq ($(uname_R),3.5)
|
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
2011-06-15 19:34:18 +08:00
|
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
|
|
|
NO_FNMATCH_CASEFOLD = YesPlease
|
2010-10-27 16:39:52 +08:00
|
|
|
endif
|
|
|
|
ifeq ($(uname_R),5.2)
|
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_INET_PTON = YesPlease
|
2011-06-15 19:34:18 +08:00
|
|
|
NO_SOCKADDR_STORAGE = YesPlease
|
|
|
|
NO_FNMATCH_CASEFOLD = YesPlease
|
2010-10-27 16:39:52 +08:00
|
|
|
endif
|
|
|
|
endif
|
2011-07-20 06:55:47 +08:00
|
|
|
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
|
2007-12-02 04:24:59 +08:00
|
|
|
ifneq (,$(findstring MINGW,$(uname_S)))
|
2009-05-23 16:04:48 +08:00
|
|
|
pathsep = ;
|
2007-12-02 04:24:59 +08:00
|
|
|
NO_PREAD = YesPlease
|
2009-10-22 01:04:50 +08:00
|
|
|
NEEDS_CRYPTO_WITH_SSL = YesPlease
|
2009-05-31 16:35:51 +08:00
|
|
|
NO_LIBGEN_H = YesPlease
|
2011-10-25 00:02:09 +08:00
|
|
|
NO_SYS_POLL_H = YesPlease
|
2007-12-02 04:24:59 +08:00
|
|
|
NO_SYMLINK_HEAD = YesPlease
|
2011-12-13 05:12:56 +08:00
|
|
|
NO_UNIX_SOCKETS = YesPlease
|
2007-12-02 04:24:59 +08:00
|
|
|
NO_SETENV = YesPlease
|
|
|
|
NO_UNSETENV = YesPlease
|
|
|
|
NO_STRCASESTR = YesPlease
|
|
|
|
NO_STRLCPY = YesPlease
|
2010-08-14 07:59:40 +08:00
|
|
|
NO_STRTOK_R = YesPlease
|
2010-10-03 17:56:39 +08:00
|
|
|
NO_FNMATCH = YesPlease
|
2007-12-02 04:24:59 +08:00
|
|
|
NO_MEMMEM = YesPlease
|
|
|
|
NEEDS_LIBICONV = YesPlease
|
|
|
|
OLD_ICONV = YesPlease
|
|
|
|
NO_STRTOUMAX = YesPlease
|
|
|
|
NO_MKDTEMP = YesPlease
|
2009-05-31 16:35:50 +08:00
|
|
|
NO_MKSTEMPS = YesPlease
|
2007-12-02 04:24:59 +08:00
|
|
|
NO_SVN_TESTS = YesPlease
|
|
|
|
NO_PERL_MAKEMAKER = YesPlease
|
2009-01-18 20:00:15 +08:00
|
|
|
RUNTIME_PREFIX = YesPlease
|
2008-08-19 03:57:16 +08:00
|
|
|
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
|
2009-03-05 01:47:40 +08:00
|
|
|
NO_NSEC = YesPlease
|
2009-03-13 23:50:45 +08:00
|
|
|
USE_WIN32_MMAP = YesPlease
|
2009-06-01 00:15:23 +08:00
|
|
|
USE_NED_ALLOCATOR = YesPlease
|
2009-04-20 16:17:00 +08:00
|
|
|
UNRELIABLE_FSTAT = UnfortunatelyYes
|
2009-04-28 06:32:25 +08:00
|
|
|
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
2009-06-17 03:07:40 +08:00
|
|
|
NO_REGEX = YesPlease
|
2010-01-16 04:12:15 +08:00
|
|
|
NO_PYTHON = YesPlease
|
2009-10-23 02:26:29 +08:00
|
|
|
BLK_SHA1 = YesPlease
|
2010-09-29 05:08:38 +08:00
|
|
|
ETAGS_TARGET = ETAGS
|
2010-11-04 09:35:24 +08:00
|
|
|
NO_INET_PTON = YesPlease
|
|
|
|
NO_INET_NTOP = YesPlease
|
|
|
|
NO_POSIX_GOODIES = UnfortunatelyYes
|
2010-10-03 17:56:39 +08:00
|
|
|
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/win32
|
2007-12-09 03:57:25 +08:00
|
|
|
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
|
2010-12-04 08:10:34 +08:00
|
|
|
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
|
2010-11-04 09:35:21 +08:00
|
|
|
compat/win32/pthread.o compat/win32/syslog.o \
|
2011-10-25 00:02:09 +08:00
|
|
|
compat/win32/poll.o compat/win32/dirent.o
|
2007-12-02 04:24:59 +08:00
|
|
|
EXTLIBS += -lws2_32
|
2010-01-24 18:10:30 +08:00
|
|
|
PTHREAD_LIBS =
|
2007-12-02 04:24:59 +08:00
|
|
|
X = .exe
|
2011-04-08 02:22:18 +08:00
|
|
|
SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
|
2009-06-01 00:15:25 +08:00
|
|
|
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
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
HAVE_LIBCHARSET_H = YesPlease
|
2009-06-01 00:15:25 +08:00
|
|
|
else
|
|
|
|
NO_CURL = YesPlease
|
|
|
|
endif
|
2007-12-02 04:24:59 +08:00
|
|
|
endif
|
2005-09-08 03:22:56 +08:00
|
|
|
|
2006-07-03 07:56:48 +08:00
|
|
|
-include config.mak.autogen
|
2005-10-12 06:22:47 +08:00
|
|
|
-include config.mak
|
2005-09-08 03:22:56 +08:00
|
|
|
|
2011-05-09 16:24:55 +08:00
|
|
|
ifndef sysconfdir
|
|
|
|
ifeq ($(prefix),/usr)
|
|
|
|
sysconfdir = /etc
|
|
|
|
else
|
|
|
|
sysconfdir = etc
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2010-01-26 23:57:15 +08:00
|
|
|
ifdef CHECK_HEADER_DEPENDENCIES
|
2011-11-18 17:58:21 +08:00
|
|
|
COMPUTE_HEADER_DEPENDENCIES = no
|
2010-01-26 23:57:15 +08:00
|
|
|
USE_COMPUTED_HEADER_DEPENDENCIES =
|
2011-11-18 17:58:21 +08:00
|
|
|
endif
|
|
|
|
|
2011-08-19 02:34:39 +08:00
|
|
|
ifndef COMPUTE_HEADER_DEPENDENCIES
|
2011-11-18 17:58:21 +08:00
|
|
|
COMPUTE_HEADER_DEPENDENCIES = auto
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(COMPUTE_HEADER_DEPENDENCIES),auto)
|
2011-08-30 16:27:35 +08:00
|
|
|
dep_check = $(shell $(CC) $(ALL_CFLAGS) \
|
|
|
|
-c -MF /dev/null -MMD -MP -x c /dev/null -o /dev/null 2>&1; \
|
|
|
|
echo $$?)
|
2011-08-19 02:34:39 +08:00
|
|
|
ifeq ($(dep_check),0)
|
2011-11-18 17:58:21 +08:00
|
|
|
override COMPUTE_HEADER_DEPENDENCIES = yes
|
|
|
|
else
|
|
|
|
override COMPUTE_HEADER_DEPENDENCIES = no
|
2011-08-19 02:34:39 +08:00
|
|
|
endif
|
2010-01-26 23:57:15 +08:00
|
|
|
endif
|
|
|
|
|
2011-11-18 17:58:21 +08:00
|
|
|
ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
|
2010-01-26 23:57:15 +08:00
|
|
|
USE_COMPUTED_HEADER_DEPENDENCIES = YesPlease
|
2011-11-18 17:58:21 +08:00
|
|
|
else
|
|
|
|
ifneq ($(COMPUTE_HEADER_DEPENDENCIES),no)
|
|
|
|
$(error please set COMPUTE_HEADER_DEPENDENCIES to yes, no, or auto \
|
|
|
|
(not "$(COMPUTE_HEADER_DEPENDENCIES)"))
|
|
|
|
endif
|
2010-01-26 23:57:15 +08:00
|
|
|
endif
|
|
|
|
|
2009-06-06 07:36:15 +08:00
|
|
|
ifdef SANE_TOOL_PATH
|
2009-06-09 00:41:49 +08:00
|
|
|
SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH))
|
|
|
|
BROKEN_PATH_FIX = 's|^\# @@BROKEN_PATH_FIX@@$$|git_broken_path_fix $(SANE_TOOL_PATH_SQ)|'
|
2009-06-06 07:36:15 +08:00
|
|
|
PATH := $(SANE_TOOL_PATH):${PATH}
|
|
|
|
else
|
2009-06-09 00:41:49 +08:00
|
|
|
BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d'
|
2009-06-06 07:36:15 +08:00
|
|
|
endif
|
|
|
|
|
2010-05-14 17:31:43 +08:00
|
|
|
ifneq (,$(INLINE))
|
|
|
|
BASIC_CFLAGS += -Dinline=$(INLINE)
|
|
|
|
endif
|
|
|
|
|
2010-05-14 17:31:42 +08:00
|
|
|
ifneq (,$(SOCKLEN_T))
|
|
|
|
BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)
|
|
|
|
endif
|
|
|
|
|
2006-12-13 01:01:47 +08:00
|
|
|
ifeq ($(uname_S),Darwin)
|
|
|
|
ifndef NO_FINK
|
|
|
|
ifeq ($(shell test -d /sw/lib && echo y),y)
|
|
|
|
BASIC_CFLAGS += -I/sw/include
|
|
|
|
BASIC_LDFLAGS += -L/sw/lib
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifndef NO_DARWIN_PORTS
|
|
|
|
ifeq ($(shell test -d /opt/local/lib && echo y),y)
|
|
|
|
BASIC_CFLAGS += -I/opt/local/include
|
|
|
|
BASIC_LDFLAGS += -L/opt/local/lib
|
|
|
|
endif
|
|
|
|
endif
|
2009-01-27 03:03:59 +08:00
|
|
|
PTHREAD_LIBS =
|
2006-12-13 01:01:47 +08:00
|
|
|
endif
|
|
|
|
|
2008-08-17 12:56:24 +08:00
|
|
|
ifndef CC_LD_DYNPATH
|
|
|
|
ifdef NO_R_TO_GCC_LINKER
|
|
|
|
# Some gcc does not accept and pass -R to the linker to specify
|
|
|
|
# the runtime dynamic library path.
|
|
|
|
CC_LD_DYNPATH = -Wl,-rpath,
|
|
|
|
else
|
|
|
|
CC_LD_DYNPATH = -R
|
|
|
|
endif
|
2006-12-28 06:17:35 +08:00
|
|
|
endif
|
|
|
|
|
2009-05-31 16:35:51 +08:00
|
|
|
ifdef NO_LIBGEN_H
|
|
|
|
COMPAT_CFLAGS += -DNO_LIBGEN_H
|
|
|
|
COMPAT_OBJS += compat/basename.o
|
|
|
|
endif
|
|
|
|
|
2011-05-10 05:52:05 +08:00
|
|
|
ifdef USE_LIBPCRE
|
|
|
|
BASIC_CFLAGS += -DUSE_LIBPCRE
|
|
|
|
ifdef LIBPCREDIR
|
|
|
|
BASIC_CFLAGS += -I$(LIBPCREDIR)/include
|
|
|
|
EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)
|
|
|
|
endif
|
|
|
|
EXTLIBS += -lpcre
|
|
|
|
endif
|
|
|
|
|
2007-09-11 11:02:45 +08:00
|
|
|
ifdef NO_CURL
|
|
|
|
BASIC_CFLAGS += -DNO_CURL
|
2010-01-19 23:39:12 +08:00
|
|
|
REMOTE_CURL_PRIMARY =
|
|
|
|
REMOTE_CURL_ALIASES =
|
|
|
|
REMOTE_CURL_NAMES =
|
2007-09-11 11:02:45 +08:00
|
|
|
else
|
2005-09-24 01:41:40 +08:00
|
|
|
ifdef CURLDIR
|
2007-08-01 12:30:35 +08:00
|
|
|
# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -I$(CURLDIR)/include
|
2007-08-01 12:30:35 +08:00
|
|
|
CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
|
2005-09-24 01:41:40 +08:00
|
|
|
else
|
|
|
|
CURL_LIBCURL = -lcurl
|
|
|
|
endif
|
2011-07-20 06:55:47 +08:00
|
|
|
ifdef NEEDS_SSL_WITH_CURL
|
|
|
|
CURL_LIBCURL += -lssl
|
|
|
|
ifdef NEEDS_CRYPTO_WITH_SSL
|
|
|
|
CURL_LIBCURL += -lcrypto
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifdef NEEDS_IDN_WITH_CURL
|
|
|
|
CURL_LIBCURL += -lidn
|
|
|
|
endif
|
|
|
|
|
2010-01-19 23:39:12 +08:00
|
|
|
REMOTE_CURL_PRIMARY = git-remote-http$X
|
|
|
|
REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
|
|
|
|
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
|
2010-01-26 23:54:23 +08:00
|
|
|
PROGRAM_OBJS += http-fetch.o
|
|
|
|
PROGRAMS += $(REMOTE_CURL_NAMES)
|
2005-11-19 09:08:36 +08:00
|
|
|
curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
|
|
|
|
ifeq "$(curl_check)" "070908"
|
|
|
|
ifndef NO_EXPAT
|
2010-01-26 23:54:23 +08:00
|
|
|
PROGRAM_OBJS += http-push.o
|
2005-11-19 09:08:36 +08:00
|
|
|
endif
|
2005-11-03 03:19:24 +08:00
|
|
|
endif
|
2006-04-05 22:22:40 +08:00
|
|
|
ifndef NO_EXPAT
|
2009-01-29 04:43:57 +08:00
|
|
|
ifdef EXPATDIR
|
|
|
|
BASIC_CFLAGS += -I$(EXPATDIR)/include
|
|
|
|
EXPAT_LIBEXPAT = -L$(EXPATDIR)/$(lib) $(CC_LD_DYNPATH)$(EXPATDIR)/$(lib) -lexpat
|
|
|
|
else
|
|
|
|
EXPAT_LIBEXPAT = -lexpat
|
|
|
|
endif
|
2006-04-05 22:22:40 +08:00
|
|
|
endif
|
2005-09-24 01:41:40 +08:00
|
|
|
endif
|
|
|
|
|
2007-07-30 02:35:45 +08:00
|
|
|
ifdef ZLIB_PATH
|
|
|
|
BASIC_CFLAGS += -I$(ZLIB_PATH)/include
|
2007-08-01 12:30:35 +08:00
|
|
|
EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
|
2007-07-30 02:35:45 +08:00
|
|
|
endif
|
|
|
|
EXTLIBS += -lz
|
|
|
|
|
2005-07-29 23:50:51 +08:00
|
|
|
ifndef NO_OPENSSL
|
2005-09-08 08:26:23 +08:00
|
|
|
OPENSSL_LIBSSL = -lssl
|
2005-10-01 04:31:16 +08:00
|
|
|
ifdef OPENSSLDIR
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -I$(OPENSSLDIR)/include
|
2007-08-01 12:30:35 +08:00
|
|
|
OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
|
2005-10-01 04:31:16 +08:00
|
|
|
else
|
|
|
|
OPENSSL_LINK =
|
|
|
|
endif
|
2009-09-08 21:54:38 +08:00
|
|
|
ifdef NEEDS_CRYPTO_WITH_SSL
|
2011-07-20 06:55:47 +08:00
|
|
|
OPENSSL_LIBSSL += -lcrypto
|
2009-09-08 21:54:38 +08:00
|
|
|
endif
|
2005-07-29 23:50:51 +08:00
|
|
|
else
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -DNO_OPENSSL
|
2009-08-18 08:09:56 +08:00
|
|
|
BLK_SHA1 = 1
|
2005-09-08 08:26:23 +08:00
|
|
|
OPENSSL_LIBSSL =
|
2005-07-29 23:50:51 +08:00
|
|
|
endif
|
2010-12-09 06:54:13 +08:00
|
|
|
ifdef NO_OPENSSL
|
|
|
|
LIB_4_CRYPTO =
|
|
|
|
else
|
2005-09-08 03:22:56 +08:00
|
|
|
ifdef NEEDS_SSL_WITH_CRYPTO
|
2005-10-01 04:31:16 +08:00
|
|
|
LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl
|
2005-09-08 03:22:56 +08:00
|
|
|
else
|
2005-10-01 04:31:16 +08:00
|
|
|
LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
|
2005-09-08 03:22:56 +08:00
|
|
|
endif
|
2010-12-09 06:54:13 +08:00
|
|
|
endif
|
2005-09-08 03:22:56 +08:00
|
|
|
ifdef NEEDS_LIBICONV
|
2005-10-01 04:31:16 +08:00
|
|
|
ifdef ICONVDIR
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -I$(ICONVDIR)/include
|
2007-08-01 12:30:35 +08:00
|
|
|
ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
|
2005-10-01 04:31:16 +08:00
|
|
|
else
|
|
|
|
ICONV_LINK =
|
|
|
|
endif
|
2006-06-25 09:35:12 +08:00
|
|
|
EXTLIBS += $(ICONV_LINK) -liconv
|
2005-09-08 03:22:56 +08:00
|
|
|
endif
|
2009-07-11 01:10:45 +08:00
|
|
|
ifdef NEEDS_LIBGEN
|
|
|
|
EXTLIBS += -lgen
|
|
|
|
endif
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
ifndef NO_GETTEXT
|
|
|
|
ifndef LIBC_CONTAINS_LIBINTL
|
|
|
|
EXTLIBS += -lintl
|
|
|
|
endif
|
|
|
|
endif
|
2005-09-06 07:24:03 +08:00
|
|
|
ifdef NEEDS_SOCKET
|
2006-06-25 09:35:12 +08:00
|
|
|
EXTLIBS += -lsocket
|
2005-09-06 07:24:03 +08:00
|
|
|
endif
|
2005-09-12 13:25:49 +08:00
|
|
|
ifdef NEEDS_NSL
|
2006-06-25 09:35:12 +08:00
|
|
|
EXTLIBS += -lnsl
|
2005-09-12 13:25:49 +08:00
|
|
|
endif
|
2009-06-06 07:36:10 +08:00
|
|
|
ifdef NEEDS_RESOLV
|
|
|
|
EXTLIBS += -lresolv
|
|
|
|
endif
|
2006-01-20 09:13:57 +08:00
|
|
|
ifdef NO_D_TYPE_IN_DIRENT
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT
|
2006-01-20 09:13:57 +08:00
|
|
|
endif
|
2006-01-20 09:13:51 +08:00
|
|
|
ifdef NO_D_INO_IN_DIRENT
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
|
2006-01-20 09:13:51 +08:00
|
|
|
endif
|
2008-08-19 03:57:16 +08:00
|
|
|
ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
|
|
|
|
BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
|
|
|
|
endif
|
2009-03-09 05:22:51 +08:00
|
|
|
ifdef USE_NSEC
|
|
|
|
BASIC_CFLAGS += -DUSE_NSEC
|
|
|
|
endif
|
2009-03-09 04:04:28 +08:00
|
|
|
ifdef USE_ST_TIMESPEC
|
|
|
|
BASIC_CFLAGS += -DUSE_ST_TIMESPEC
|
|
|
|
endif
|
2011-06-19 09:07:03 +08:00
|
|
|
ifdef NO_NORETURN
|
|
|
|
BASIC_CFLAGS += -DNO_NORETURN
|
|
|
|
endif
|
2009-03-05 01:47:40 +08:00
|
|
|
ifdef NO_NSEC
|
|
|
|
BASIC_CFLAGS += -DNO_NSEC
|
|
|
|
endif
|
2008-03-05 23:46:13 +08:00
|
|
|
ifdef SNPRINTF_RETURNS_BOGUS
|
|
|
|
COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS
|
|
|
|
COMPAT_OBJS += compat/snprintf.o
|
|
|
|
endif
|
2008-02-09 10:32:47 +08:00
|
|
|
ifdef FREAD_READS_DIRECTORIES
|
|
|
|
COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES
|
|
|
|
COMPAT_OBJS += compat/fopen.o
|
|
|
|
endif
|
2006-05-02 15:40:24 +08:00
|
|
|
ifdef NO_SYMLINK_HEAD
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -DNO_SYMLINK_HEAD
|
2006-05-02 15:40:24 +08:00
|
|
|
endif
|
2011-02-23 07:41:21 +08:00
|
|
|
ifdef GETTEXT_POISON
|
|
|
|
BASIC_CFLAGS += -DGETTEXT_POISON
|
|
|
|
endif
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
ifdef NO_GETTEXT
|
|
|
|
BASIC_CFLAGS += -DNO_GETTEXT
|
2012-01-24 08:31:09 +08:00
|
|
|
USE_GETTEXT_SCHEME ?= fallthrough
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
endif
|
2005-09-19 09:30:50 +08:00
|
|
|
ifdef NO_STRCASESTR
|
2005-12-06 03:54:29 +08:00
|
|
|
COMPAT_CFLAGS += -DNO_STRCASESTR
|
2005-12-03 07:08:28 +08:00
|
|
|
COMPAT_OBJS += compat/strcasestr.o
|
|
|
|
endif
|
2006-06-24 22:01:25 +08:00
|
|
|
ifdef NO_STRLCPY
|
|
|
|
COMPAT_CFLAGS += -DNO_STRLCPY
|
|
|
|
COMPAT_OBJS += compat/strlcpy.o
|
|
|
|
endif
|
2007-02-20 08:22:56 +08:00
|
|
|
ifdef NO_STRTOUMAX
|
|
|
|
COMPAT_CFLAGS += -DNO_STRTOUMAX
|
2011-11-02 23:46:22 +08:00
|
|
|
COMPAT_OBJS += compat/strtoumax.o compat/strtoimax.o
|
2007-02-20 08:22:56 +08:00
|
|
|
endif
|
|
|
|
ifdef NO_STRTOULL
|
|
|
|
COMPAT_CFLAGS += -DNO_STRTOULL
|
|
|
|
endif
|
2010-08-14 07:59:40 +08:00
|
|
|
ifdef NO_STRTOK_R
|
|
|
|
COMPAT_CFLAGS += -DNO_STRTOK_R
|
|
|
|
COMPAT_OBJS += compat/strtok_r.o
|
|
|
|
endif
|
2010-10-03 17:56:39 +08:00
|
|
|
ifdef NO_FNMATCH
|
|
|
|
COMPAT_CFLAGS += -Icompat/fnmatch
|
|
|
|
COMPAT_CFLAGS += -DNO_FNMATCH
|
|
|
|
COMPAT_OBJS += compat/fnmatch/fnmatch.o
|
2010-10-04 10:48:11 +08:00
|
|
|
else
|
|
|
|
ifdef NO_FNMATCH_CASEFOLD
|
|
|
|
COMPAT_CFLAGS += -Icompat/fnmatch
|
|
|
|
COMPAT_CFLAGS += -DNO_FNMATCH_CASEFOLD
|
|
|
|
COMPAT_OBJS += compat/fnmatch/fnmatch.o
|
|
|
|
endif
|
2010-10-03 17:56:39 +08:00
|
|
|
endif
|
2005-12-03 07:08:28 +08:00
|
|
|
ifdef NO_SETENV
|
2005-12-06 03:54:29 +08:00
|
|
|
COMPAT_CFLAGS += -DNO_SETENV
|
2005-12-03 07:08:28 +08:00
|
|
|
COMPAT_OBJS += compat/setenv.o
|
2005-09-19 09:30:50 +08:00
|
|
|
endif
|
2007-10-21 04:03:49 +08:00
|
|
|
ifdef NO_MKDTEMP
|
|
|
|
COMPAT_CFLAGS += -DNO_MKDTEMP
|
|
|
|
COMPAT_OBJS += compat/mkdtemp.o
|
|
|
|
endif
|
2009-05-31 16:35:50 +08:00
|
|
|
ifdef NO_MKSTEMPS
|
|
|
|
COMPAT_CFLAGS += -DNO_MKSTEMPS
|
|
|
|
endif
|
2006-08-29 18:51:14 +08:00
|
|
|
ifdef NO_UNSETENV
|
2006-01-26 04:38:36 +08:00
|
|
|
COMPAT_CFLAGS += -DNO_UNSETENV
|
|
|
|
COMPAT_OBJS += compat/unsetenv.o
|
|
|
|
endif
|
2008-01-25 02:34:46 +08:00
|
|
|
ifdef NO_SYS_SELECT_H
|
|
|
|
BASIC_CFLAGS += -DNO_SYS_SELECT_H
|
|
|
|
endif
|
2010-10-27 16:39:52 +08:00
|
|
|
ifdef NO_SYS_POLL_H
|
|
|
|
BASIC_CFLAGS += -DNO_SYS_POLL_H
|
|
|
|
endif
|
|
|
|
ifdef NO_INTTYPES_H
|
|
|
|
BASIC_CFLAGS += -DNO_INTTYPES_H
|
|
|
|
endif
|
|
|
|
ifdef NO_INITGROUPS
|
|
|
|
BASIC_CFLAGS += -DNO_INITGROUPS
|
|
|
|
endif
|
2005-10-09 06:54:36 +08:00
|
|
|
ifdef NO_MMAP
|
2005-12-06 03:54:29 +08:00
|
|
|
COMPAT_CFLAGS += -DNO_MMAP
|
2005-12-03 07:08:28 +08:00
|
|
|
COMPAT_OBJS += compat/mmap.o
|
2009-03-13 23:50:45 +08:00
|
|
|
else
|
|
|
|
ifdef USE_WIN32_MMAP
|
|
|
|
COMPAT_CFLAGS += -DUSE_WIN32_MMAP
|
|
|
|
COMPAT_OBJS += compat/win32mmap.o
|
|
|
|
endif
|
2005-10-09 06:54:36 +08:00
|
|
|
endif
|
2009-04-28 06:32:25 +08:00
|
|
|
ifdef OBJECT_CREATION_USES_RENAMES
|
|
|
|
COMPAT_CFLAGS += -DOBJECT_CREATION_MODE=1
|
2009-04-25 17:57:14 +08:00
|
|
|
endif
|
2007-01-10 05:04:12 +08:00
|
|
|
ifdef NO_PREAD
|
|
|
|
COMPAT_CFLAGS += -DNO_PREAD
|
|
|
|
COMPAT_OBJS += compat/pread.o
|
2012-06-27 02:19:32 +08:00
|
|
|
NO_THREAD_SAFE_PREAD = YesPlease
|
|
|
|
endif
|
|
|
|
ifdef NO_THREAD_SAFE_PREAD
|
|
|
|
BASIC_CFLAGS += -DNO_THREAD_SAFE_PREAD
|
2007-01-10 05:04:12 +08:00
|
|
|
endif
|
2006-12-14 19:15:57 +08:00
|
|
|
ifdef NO_FAST_WORKING_DIRECTORY
|
|
|
|
BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
|
|
|
|
endif
|
2006-12-31 12:53:55 +08:00
|
|
|
ifdef NO_TRUSTABLE_FILEMODE
|
|
|
|
BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE
|
|
|
|
endif
|
2005-09-29 07:52:21 +08:00
|
|
|
ifdef NO_IPV6
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -DNO_IPV6
|
2006-01-20 09:13:32 +08:00
|
|
|
endif
|
2008-10-26 19:52:37 +08:00
|
|
|
ifdef NO_UINTMAX_T
|
|
|
|
BASIC_CFLAGS += -Duintmax_t=uint32_t
|
|
|
|
endif
|
2006-01-20 09:13:32 +08:00
|
|
|
ifdef NO_SOCKADDR_STORAGE
|
|
|
|
ifdef NO_IPV6
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in
|
2006-01-20 09:13:32 +08:00
|
|
|
else
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6
|
2006-01-20 09:13:32 +08:00
|
|
|
endif
|
2005-09-29 07:52:21 +08:00
|
|
|
endif
|
2006-05-22 05:37:00 +08:00
|
|
|
ifdef NO_INET_NTOP
|
|
|
|
LIB_OBJS += compat/inet_ntop.o
|
2010-11-04 09:35:11 +08:00
|
|
|
BASIC_CFLAGS += -DNO_INET_NTOP
|
2006-05-22 05:37:00 +08:00
|
|
|
endif
|
2006-09-26 22:47:43 +08:00
|
|
|
ifdef NO_INET_PTON
|
|
|
|
LIB_OBJS += compat/inet_pton.o
|
2010-11-04 09:35:11 +08:00
|
|
|
BASIC_CFLAGS += -DNO_INET_PTON
|
2006-09-26 22:47:43 +08:00
|
|
|
endif
|
2011-12-13 05:12:56 +08:00
|
|
|
ifndef NO_UNIX_SOCKETS
|
|
|
|
LIB_OBJS += unix-socket.o
|
|
|
|
LIB_H += unix-socket.h
|
|
|
|
PROGRAM_OBJS += credential-cache.o
|
|
|
|
PROGRAM_OBJS += credential-cache--daemon.o
|
|
|
|
endif
|
2005-04-22 03:33:22 +08:00
|
|
|
|
2006-02-16 16:38:01 +08:00
|
|
|
ifdef NO_ICONV
|
2006-06-25 09:47:03 +08:00
|
|
|
BASIC_CFLAGS += -DNO_ICONV
|
2006-02-16 16:38:01 +08:00
|
|
|
endif
|
|
|
|
|
2007-03-04 02:29:03 +08:00
|
|
|
ifdef OLD_ICONV
|
|
|
|
BASIC_CFLAGS += -DOLD_ICONV
|
|
|
|
endif
|
|
|
|
|
2007-11-07 11:24:28 +08:00
|
|
|
ifdef NO_DEFLATE_BOUND
|
|
|
|
BASIC_CFLAGS += -DNO_DEFLATE_BOUND
|
|
|
|
endif
|
|
|
|
|
2010-11-04 09:35:24 +08:00
|
|
|
ifdef NO_POSIX_GOODIES
|
|
|
|
BASIC_CFLAGS += -DNO_POSIX_GOODIES
|
|
|
|
endif
|
|
|
|
|
2009-08-06 07:13:20 +08:00
|
|
|
ifdef BLK_SHA1
|
|
|
|
SHA1_HEADER = "block-sha1/sha1.h"
|
|
|
|
LIB_OBJS += block-sha1/sha1.o
|
2010-01-26 23:44:47 +08:00
|
|
|
LIB_H += block-sha1/sha1.h
|
2009-08-06 07:13:20 +08:00
|
|
|
else
|
2005-09-21 00:27:13 +08:00
|
|
|
ifdef PPC_SHA1
|
|
|
|
SHA1_HEADER = "ppc/sha1.h"
|
|
|
|
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
|
2010-01-26 23:44:47 +08:00
|
|
|
LIB_H += ppc/sha1.h
|
2005-09-21 00:27:13 +08:00
|
|
|
else
|
|
|
|
SHA1_HEADER = <openssl/sha.h>
|
2006-06-25 09:35:12 +08:00
|
|
|
EXTLIBS += $(LIB_4_CRYPTO)
|
2005-09-21 00:27:13 +08:00
|
|
|
endif
|
|
|
|
endif
|
2006-12-04 17:50:04 +08:00
|
|
|
ifdef NO_PERL_MAKEMAKER
|
|
|
|
export NO_PERL_MAKEMAKER
|
|
|
|
endif
|
2007-06-14 02:54:32 +08:00
|
|
|
ifdef NO_HSTRERROR
|
|
|
|
COMPAT_CFLAGS += -DNO_HSTRERROR
|
|
|
|
COMPAT_OBJS += compat/hstrerror.o
|
|
|
|
endif
|
2007-09-07 06:32:54 +08:00
|
|
|
ifdef NO_MEMMEM
|
|
|
|
COMPAT_CFLAGS += -DNO_MEMMEM
|
|
|
|
COMPAT_OBJS += compat/memmem.o
|
|
|
|
endif
|
2008-02-06 05:10:44 +08:00
|
|
|
ifdef INTERNAL_QSORT
|
|
|
|
COMPAT_CFLAGS += -DINTERNAL_QSORT
|
|
|
|
COMPAT_OBJS += compat/qsort.o
|
|
|
|
endif
|
Compute prefix at runtime if RUNTIME_PREFIX is set
This commit adds support for relocatable binaries (called
RUNTIME_PREFIX). Such binaries can be moved together with the
system configuration files to a different directory, as long as the
relative paths from the binary to the configuration files is
preserved. This functionality is essential on Windows where we
deliver git binaries with an installer that allows to freely choose
the installation location.
If RUNTIME_PREFIX is unset we use the static prefix. This will be
the default on Unix. Thus, the behavior on Unix will remain
identical to the old implementation, which used to add the prefix
in the Makefile.
If RUNTIME_PREFIX is set the prefix is computed from the location
of the executable. In this case, system_path() tries to strip
known directories that executables can be located in from the path
of the executable. If the path is successfully stripped it is used
as the prefix. For example, if the executable is
"/msysgit/bin/git" and BINDIR is "bin", then the prefix computed is
"/msysgit".
If the runtime prefix computation fails, we fall back to the static
prefix specified in the makefile. This can be the case if the
executable is not installed at a known location. Note that our
test system sets GIT_CONFIG_NOSYSTEM to tell git to ignore global
configuration files during testing. Hence testing does not trigger
the fall back.
Note that RUNTIME_PREFIX only works on Windows, though adding
support on Unix should not be too hard. The implementation
requires argv0_path to be set to an absolute path. argv0_path must
point to the directory of the executable. We use assert() to
verify this in debug builds. On Windows, the wrapper for main()
(see compat/mingw.h) guarantees that argv0_path is correctly
initialized. On Unix, further work is required before
RUNTIME_PREFIX can be enabled.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18 20:00:14 +08:00
|
|
|
ifdef RUNTIME_PREFIX
|
|
|
|
COMPAT_CFLAGS += -DRUNTIME_PREFIX
|
|
|
|
endif
|
2007-03-07 07:44:49 +08:00
|
|
|
|
2008-11-15 20:08:14 +08:00
|
|
|
ifdef NO_PTHREADS
|
|
|
|
BASIC_CFLAGS += -DNO_PTHREADS
|
|
|
|
else
|
2010-05-14 17:31:34 +08:00
|
|
|
BASIC_CFLAGS += $(PTHREAD_CFLAGS)
|
2008-11-15 20:08:14 +08:00
|
|
|
EXTLIBS += $(PTHREAD_LIBS)
|
2008-02-23 10:11:56 +08:00
|
|
|
LIB_OBJS += thread-utils.o
|
2007-09-06 14:13:11 +08:00
|
|
|
endif
|
2010-01-30 09:22:19 +08:00
|
|
|
|
2010-04-13 17:07:13 +08:00
|
|
|
ifdef HAVE_PATHS_H
|
|
|
|
BASIC_CFLAGS += -DHAVE_PATHS_H
|
|
|
|
endif
|
|
|
|
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
ifdef HAVE_LIBCHARSET_H
|
|
|
|
BASIC_CFLAGS += -DHAVE_LIBCHARSET_H
|
2012-02-13 00:23:36 +08:00
|
|
|
EXTLIBS += $(CHARSET_LIB)
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
endif
|
|
|
|
|
add generic terminal prompt function
When we need to prompt the user for input interactively, we
want to access their terminal directly. We can't rely on
stdio because it may be connected to pipes or files, rather
than the terminal. Instead, we use "getpass()", because it
abstracts the idea of prompting and reading from the
terminal. However, it has some problems:
1. It never echoes the typed characters, which makes it OK
for passwords but annoying for other input (like usernames).
2. Some implementations of getpass() have an extremely
small input buffer (e.g., Solaris 8 is reported to
support only 8 characters).
3. Some implementations of getpass() will fall back to
reading from stdin (e.g., glibc). We explicitly don't
want this, because our stdin may be connected to a pipe
speaking a particular protocol, and reading will
disrupt the protocol flow (e.g., the remote-curl
helper).
4. Some implementations of getpass() turn off signals, so
that hitting "^C" on the terminal does not break out of
the password prompt. This can be a mild annoyance.
Instead, let's provide an abstract "git_terminal_prompt"
function that addresses these concerns. This patch includes
an implementation based on /dev/tty, enabled by setting
HAVE_DEV_TTY. The fallback is to use getpass() as before.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-10 18:41:01 +08:00
|
|
|
ifdef HAVE_DEV_TTY
|
|
|
|
BASIC_CFLAGS += -DHAVE_DEV_TTY
|
|
|
|
endif
|
|
|
|
|
2008-03-05 07:15:39 +08:00
|
|
|
ifdef DIR_HAS_BSD_GROUP_SEMANTICS
|
|
|
|
COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS
|
|
|
|
endif
|
2009-04-20 16:17:00 +08:00
|
|
|
ifdef UNRELIABLE_FSTAT
|
|
|
|
BASIC_CFLAGS += -DUNRELIABLE_FSTAT
|
|
|
|
endif
|
2009-06-17 03:07:40 +08:00
|
|
|
ifdef NO_REGEX
|
|
|
|
COMPAT_CFLAGS += -Icompat/regex
|
|
|
|
COMPAT_OBJS += compat/regex/regex.o
|
|
|
|
endif
|
2007-09-06 14:13:11 +08:00
|
|
|
|
2009-06-01 00:15:23 +08:00
|
|
|
ifdef USE_NED_ALLOCATOR
|
2010-09-11 17:59:18 +08:00
|
|
|
COMPAT_CFLAGS += -Icompat/nedmalloc
|
2009-06-01 00:15:23 +08:00
|
|
|
COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
|
|
|
|
endif
|
|
|
|
|
2010-06-01 08:35:20 +08:00
|
|
|
ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
|
|
|
|
export GIT_TEST_CMP_USE_COPIED_CONTEXT
|
|
|
|
endif
|
|
|
|
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
ifndef NO_MSGFMT_EXTENDED_OPTIONS
|
|
|
|
MSGFMT += --check --statistics
|
|
|
|
endif
|
|
|
|
|
2012-04-07 05:01:23 +08:00
|
|
|
ifneq (,$(XDL_FAST_HASH))
|
|
|
|
BASIC_CFLAGS += -DXDL_FAST_HASH
|
|
|
|
endif
|
|
|
|
|
2007-03-28 19:12:07 +08:00
|
|
|
ifeq ($(TCLTK_PATH),)
|
|
|
|
NO_TCLTK=NoThanks
|
|
|
|
endif
|
|
|
|
|
2009-04-04 03:32:20 +08:00
|
|
|
ifeq ($(PERL_PATH),)
|
|
|
|
NO_PERL=NoThanks
|
|
|
|
endif
|
|
|
|
|
2009-11-18 09:42:31 +08:00
|
|
|
ifeq ($(PYTHON_PATH),)
|
|
|
|
NO_PYTHON=NoThanks
|
|
|
|
endif
|
|
|
|
|
2007-04-05 04:42:33 +08:00
|
|
|
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
|
2007-03-07 07:44:49 +08:00
|
|
|
QUIET_SUBDIR1 =
|
|
|
|
|
2007-03-07 07:05:34 +08:00
|
|
|
ifneq ($(findstring $(MAKEFLAGS),w),w)
|
|
|
|
PRINT_DIR = --no-print-directory
|
|
|
|
else # "make -w"
|
|
|
|
NO_SUBDIR = :
|
|
|
|
endif
|
|
|
|
|
2007-03-07 07:44:49 +08:00
|
|
|
ifneq ($(findstring $(MAKEFLAGS),s),s)
|
2007-03-06 15:09:14 +08:00
|
|
|
ifndef V
|
2007-03-07 06:37:18 +08:00
|
|
|
QUIET_CC = @echo ' ' CC $@;
|
2007-03-06 14:35:01 +08:00
|
|
|
QUIET_AR = @echo ' ' AR $@;
|
|
|
|
QUIET_LINK = @echo ' ' LINK $@;
|
|
|
|
QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
|
|
|
|
QUIET_GEN = @echo ' ' GEN $@;
|
2009-08-07 13:08:09 +08:00
|
|
|
QUIET_LNCP = @echo ' ' LN/CP $@;
|
2011-02-23 07:41:23 +08:00
|
|
|
QUIET_XGETTEXT = @echo ' ' XGETTEXT $@;
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
QUIET_MSGFMT = @echo ' ' MSGFMT $@;
|
2010-07-26 03:52:40 +08:00
|
|
|
QUIET_GCOV = @echo ' ' GCOV $@;
|
2011-04-22 03:14:42 +08:00
|
|
|
QUIET_SP = @echo ' ' SP $<;
|
2007-04-05 04:42:33 +08:00
|
|
|
QUIET_SUBDIR0 = +@subdir=
|
2007-03-07 07:05:34 +08:00
|
|
|
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
|
|
|
|
$(MAKE) $(PRINT_DIR) -C $$subdir
|
2007-03-06 15:09:14 +08:00
|
|
|
export V
|
2007-03-07 06:37:18 +08:00
|
|
|
export QUIET_GEN
|
2007-03-07 07:44:49 +08:00
|
|
|
export QUIET_BUILT_IN
|
|
|
|
endif
|
2007-03-06 14:35:01 +08:00
|
|
|
endif
|
2005-09-21 00:27:13 +08:00
|
|
|
|
2012-05-03 06:12:10 +08:00
|
|
|
ifdef NO_INSTALL_HARDLINKS
|
|
|
|
export NO_INSTALL_HARDLINKS
|
|
|
|
endif
|
|
|
|
|
2012-02-06 14:00:17 +08:00
|
|
|
### profile feedback build
|
|
|
|
#
|
|
|
|
|
|
|
|
# Can adjust this to be a global directory if you want to do extended
|
|
|
|
# data gathering
|
|
|
|
PROFILE_DIR := $(CURDIR)
|
|
|
|
|
2012-02-09 16:22:26 +08:00
|
|
|
ifeq ("$(PROFILE)","GEN")
|
2012-02-06 14:00:17 +08:00
|
|
|
CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1
|
|
|
|
EXTLIBS += -lgcov
|
|
|
|
export CCACHE_DISABLE=t
|
|
|
|
V=1
|
2012-02-09 16:22:26 +08:00
|
|
|
else
|
|
|
|
ifneq ("$(PROFILE)","")
|
2012-02-06 14:00:17 +08:00
|
|
|
CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1
|
|
|
|
export CCACHE_DISABLE=t
|
|
|
|
V=1
|
|
|
|
endif
|
2012-02-09 16:22:26 +08:00
|
|
|
endif
|
2012-02-06 14:00:17 +08:00
|
|
|
|
2006-07-09 15:44:30 +08:00
|
|
|
# Shell quote (do not use $(call) to accommodate ancient setups);
|
2006-02-18 19:40:22 +08:00
|
|
|
|
|
|
|
SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
|
2007-02-14 19:48:14 +08:00
|
|
|
ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG))
|
2010-09-01 06:42:43 +08:00
|
|
|
ETC_GITATTRIBUTES_SQ = $(subst ','\'',$(ETC_GITATTRIBUTES))
|
2006-02-18 19:40:22 +08:00
|
|
|
|
|
|
|
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
|
|
|
bindir_SQ = $(subst ','\'',$(bindir))
|
2009-01-18 20:00:09 +08:00
|
|
|
bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
|
2007-12-07 02:33:01 +08:00
|
|
|
mandir_SQ = $(subst ','\'',$(mandir))
|
2007-12-10 17:35:29 +08:00
|
|
|
infodir_SQ = $(subst ','\'',$(infodir))
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
localedir_SQ = $(subst ','\'',$(localedir))
|
2006-02-18 19:40:22 +08:00
|
|
|
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
|
|
|
|
template_dir_SQ = $(subst ','\'',$(template_dir))
|
2007-12-02 13:07:55 +08:00
|
|
|
htmldir_SQ = $(subst ','\'',$(htmldir))
|
2006-06-15 06:36:00 +08:00
|
|
|
prefix_SQ = $(subst ','\'',$(prefix))
|
2010-05-28 14:25:52 +08:00
|
|
|
gitwebdir_SQ = $(subst ','\'',$(gitwebdir))
|
2006-02-18 19:40:22 +08:00
|
|
|
|
|
|
|
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
|
|
|
|
PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
|
2009-11-18 09:42:31 +08:00
|
|
|
PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
|
2007-03-28 19:12:07 +08:00
|
|
|
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
|
2010-06-06 00:36:13 +08:00
|
|
|
DIFF_SQ = $(subst ','\'',$(DIFF))
|
2006-02-18 19:40:22 +08:00
|
|
|
|
2006-06-25 09:35:12 +08:00
|
|
|
LIBS = $(GITLIBS) $(EXTLIBS)
|
|
|
|
|
2007-02-14 19:48:14 +08:00
|
|
|
BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
|
2007-11-14 04:05:05 +08:00
|
|
|
$(COMPAT_CFLAGS)
|
2005-12-03 07:08:28 +08:00
|
|
|
LIB_OBJS += $(COMPAT_OBJS)
|
2006-06-25 09:47:03 +08:00
|
|
|
|
2009-10-31 09:44:41 +08:00
|
|
|
# Quote for C
|
|
|
|
|
|
|
|
ifdef DEFAULT_EDITOR
|
|
|
|
DEFAULT_EDITOR_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_EDITOR)))"
|
|
|
|
DEFAULT_EDITOR_CQ_SQ = $(subst ','\'',$(DEFAULT_EDITOR_CQ))
|
|
|
|
|
|
|
|
BASIC_CFLAGS += -DDEFAULT_EDITOR='$(DEFAULT_EDITOR_CQ_SQ)'
|
|
|
|
endif
|
|
|
|
|
2009-10-31 09:45:34 +08:00
|
|
|
ifdef DEFAULT_PAGER
|
|
|
|
DEFAULT_PAGER_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_PAGER)))"
|
|
|
|
DEFAULT_PAGER_CQ_SQ = $(subst ','\'',$(DEFAULT_PAGER_CQ))
|
|
|
|
|
|
|
|
BASIC_CFLAGS += -DDEFAULT_PAGER='$(DEFAULT_PAGER_CQ_SQ)'
|
|
|
|
endif
|
|
|
|
|
2012-03-31 09:33:21 +08:00
|
|
|
ifdef SHELL_PATH
|
|
|
|
SHELL_PATH_CQ = "$(subst ",\",$(subst \,\\,$(SHELL_PATH)))"
|
|
|
|
SHELL_PATH_CQ_SQ = $(subst ','\'',$(SHELL_PATH_CQ))
|
|
|
|
|
|
|
|
BASIC_CFLAGS += -DSHELL_PATH='$(SHELL_PATH_CQ_SQ)'
|
|
|
|
endif
|
|
|
|
|
2012-06-03 03:01:12 +08:00
|
|
|
GIT_USER_AGENT_SQ = $(subst ','\'',$(GIT_USER_AGENT))
|
|
|
|
GIT_USER_AGENT_CQ = "$(subst ",\",$(subst \,\\,$(GIT_USER_AGENT)))"
|
|
|
|
GIT_USER_AGENT_CQ_SQ = $(subst ','\'',$(GIT_USER_AGENT_CQ))
|
2012-06-21 02:31:51 +08:00
|
|
|
GIT-USER-AGENT: FORCE
|
|
|
|
@if test x'$(GIT_USER_AGENT_SQ)' != x"`cat GIT-USER-AGENT 2>/dev/null`"; then \
|
|
|
|
echo '$(GIT_USER_AGENT_SQ)' >GIT-USER-AGENT; \
|
|
|
|
fi
|
2012-06-03 03:01:12 +08:00
|
|
|
|
2012-06-07 04:28:16 +08:00
|
|
|
ifdef DEFAULT_HELP_FORMAT
|
|
|
|
BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"'
|
|
|
|
endif
|
|
|
|
|
2006-06-25 09:47:03 +08:00
|
|
|
ALL_CFLAGS += $(BASIC_CFLAGS)
|
|
|
|
ALL_LDFLAGS += $(BASIC_LDFLAGS)
|
|
|
|
|
2010-05-14 17:31:36 +08:00
|
|
|
export DIFF TAR INSTALL DESTDIR SHELL_PATH
|
2006-06-25 09:35:12 +08:00
|
|
|
|
|
|
|
|
2005-07-29 23:50:24 +08:00
|
|
|
### Build rules
|
|
|
|
|
2008-08-08 03:03:42 +08:00
|
|
|
SHELL = $(SHELL_PATH)
|
|
|
|
|
2012-02-06 14:00:17 +08:00
|
|
|
all:: shell_compatibility_test
|
|
|
|
|
|
|
|
ifeq "$(PROFILE)" "BUILD"
|
|
|
|
ifeq ($(filter all,$(MAKECMDGOALS)),all)
|
|
|
|
all:: profile-clean
|
|
|
|
$(MAKE) PROFILE=GEN all
|
|
|
|
$(MAKE) PROFILE=GEN -j1 test
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
all:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
|
2007-01-11 04:24:54 +08:00
|
|
|
ifneq (,$X)
|
2009-10-27 19:23:33 +08:00
|
|
|
$(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
|
2007-01-11 04:24:54 +08:00
|
|
|
endif
|
2005-05-01 04:19:56 +08:00
|
|
|
|
2007-01-11 04:24:54 +08:00
|
|
|
all::
|
2007-03-28 19:00:23 +08:00
|
|
|
ifndef NO_TCLTK
|
2008-07-28 15:02:48 +08:00
|
|
|
$(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) gitexecdir='$(gitexec_instdir_SQ)' all
|
2007-11-18 02:51:16 +08:00
|
|
|
$(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all
|
2007-03-28 19:00:23 +08:00
|
|
|
endif
|
2009-04-04 03:32:20 +08:00
|
|
|
ifndef NO_PERL
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' localedir='$(localedir_SQ)' all
|
2009-11-18 09:42:32 +08:00
|
|
|
endif
|
|
|
|
ifndef NO_PYTHON
|
|
|
|
$(QUIET_SUBDIR0)git_remote_helpers $(QUIET_SUBDIR1) PYTHON_PATH='$(PYTHON_PATH_SQ)' prefix='$(prefix_SQ)' all
|
2009-04-04 03:32:20 +08:00
|
|
|
endif
|
2010-03-20 22:48:08 +08:00
|
|
|
$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)'
|
2005-08-06 13:36:15 +08:00
|
|
|
|
2008-08-08 03:06:26 +08:00
|
|
|
please_set_SHELL_PATH_to_a_more_modern_shell:
|
|
|
|
@$$(:)
|
|
|
|
|
|
|
|
shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
|
|
|
|
|
2006-01-13 13:42:25 +08:00
|
|
|
strip: $(PROGRAMS) git$X
|
|
|
|
$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
|
|
|
|
|
2012-07-07 12:19:09 +08:00
|
|
|
### Target-specific flags and dependencies
|
|
|
|
|
|
|
|
# The generic compilation pattern rule and automatically
|
|
|
|
# computed header dependencies (falling back to a dependency on
|
|
|
|
# LIB_H) are enough to describe how most targets should be built,
|
|
|
|
# but some targets are special enough to need something a little
|
|
|
|
# different.
|
|
|
|
#
|
|
|
|
# - When a source file "foo.c" #includes a generated header file,
|
|
|
|
# we need to list that dependency for the "foo.o" target.
|
|
|
|
#
|
|
|
|
# We also list it from other targets that are built from foo.c
|
|
|
|
# like "foo.sp" and "foo.s", even though that is easy to forget
|
|
|
|
# to do because the generated header is already present around
|
|
|
|
# after a regular build attempt.
|
|
|
|
#
|
|
|
|
# - Some code depends on configuration kept in makefile
|
|
|
|
# variables. The target-specific variable EXTRA_CPPFLAGS can
|
|
|
|
# be used to convey that information to the C preprocessor
|
|
|
|
# using -D options.
|
|
|
|
#
|
|
|
|
# The "foo.o" target should have a corresponding dependency on
|
|
|
|
# a file that changes when the value of the makefile variable
|
|
|
|
# changes. For example, targets making use of the
|
|
|
|
# $(GIT_VERSION) variable depend on GIT-VERSION-FILE.
|
|
|
|
#
|
|
|
|
# Technically the ".sp" and ".s" targets do not need this
|
|
|
|
# dependency because they are force-built, but they get the
|
|
|
|
# same dependency for consistency. This way, you do not have to
|
|
|
|
# know how each target is implemented. And it means the
|
|
|
|
# dependencies here will not need to change if the force-build
|
|
|
|
# details change some day.
|
|
|
|
|
2012-06-21 02:31:55 +08:00
|
|
|
git.sp git.s git.o: GIT-PREFIX
|
2012-06-03 02:51:42 +08:00
|
|
|
git.sp git.s git.o: EXTRA_CPPFLAGS = \
|
2011-05-01 16:16:25 +08:00
|
|
|
'-DGIT_HTML_PATH="$(htmldir_SQ)"' \
|
|
|
|
'-DGIT_MAN_PATH="$(mandir_SQ)"' \
|
|
|
|
'-DGIT_INFO_PATH="$(infodir_SQ)"'
|
2007-06-13 16:28:21 +08:00
|
|
|
|
2011-06-22 18:50:56 +08:00
|
|
|
git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
|
2007-07-10 09:30:39 +08:00
|
|
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
|
2006-04-22 01:27:34 +08:00
|
|
|
$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
|
2005-09-08 12:26:52 +08:00
|
|
|
|
Makefile: apply dependencies consistently to sparse/asm targets
When a C file "foo.c" depends on a generated header file, we
note the dependency for the "foo.o" target. However, we
should also note it for other targets that are built from
foo.c, like "foo.sp" and "foo.s". These tend to be missed
because the latter two are not part of the default build,
and are typically built after a regular build which will
generate the header. Let's be consistent about including
them in dependencies.
This also makes us more consistent with nearby lines which
tack on EXTRA_CPPFLAGS when building certain files. These
flags may sometimes require extra dependencies to be added
(e.g., like GIT-VERSION-FILE; this is not the case for any
of the updated lines in this patch, but it is establishing a
style that will be used in later patches). Technically the
".sp" and ".s" targets do not care about these dependencies,
because they are force-built (".sp" because it is a phony
target, and ".s" because we explicitly force a rebuild).
Since the blocks in question are about communicating "things
built from foo.c depend on these flags", it frees the reader
from having to know or care more about how those targets are
implemented, and why it is OK for only "foo.o" to depend on
GIT-VERSION-FILE while "foo.sp" and "foo.s" both are
impacted by $(GIT_VERSION). And it helps future-proof us if
those force-build details should ever change.
This patch explicitly does not update the static header
dependencies used when COMPUTED_HEADER_DEPENDENCIES is off.
They are similar to the GIT-VERSION-FILE case above, in that
technically "foo.s" would depend on its included headers,
but it is irrelevant because we force-build it anyway. So it
would be tempting to update them in the same way (for
readability and future-proofing). However, those rules are
meant as a fallback to the computed header dependencies,
which do not handle ".s" and ".sp" at all (and are a much
harder problem to solve, as gcc is the one generating those
dependency lists).
So let's leave that harder problem until (and if) somebody
wants to change the ".sp" and ".s" rules, and keep the
static header dependencies consistent with the computed
ones.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21 02:31:33 +08:00
|
|
|
help.sp help.s help.o: common-cmds.h
|
2010-11-27 00:00:39 +08:00
|
|
|
|
2012-06-21 02:31:55 +08:00
|
|
|
builtin/help.sp builtin/help.s builtin/help.o: common-cmds.h GIT-PREFIX
|
2011-04-22 03:14:42 +08:00
|
|
|
builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
|
2010-01-06 16:05:04 +08:00
|
|
|
'-DGIT_HTML_PATH="$(htmldir_SQ)"' \
|
|
|
|
'-DGIT_MAN_PATH="$(mandir_SQ)"' \
|
|
|
|
'-DGIT_INFO_PATH="$(infodir_SQ)"'
|
2006-04-22 12:56:13 +08:00
|
|
|
|
2012-06-21 02:32:22 +08:00
|
|
|
version.sp version.s version.o: GIT-VERSION-FILE GIT-USER-AGENT
|
2012-06-03 02:51:42 +08:00
|
|
|
version.sp version.s version.o: EXTRA_CPPFLAGS = \
|
2012-06-21 02:31:51 +08:00
|
|
|
'-DGIT_VERSION="$(GIT_VERSION)"' \
|
|
|
|
'-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)'
|
2012-06-03 02:51:42 +08:00
|
|
|
|
2006-04-11 08:37:58 +08:00
|
|
|
$(BUILT_INS): git$X
|
2008-08-25 23:33:03 +08:00
|
|
|
$(QUIET_BUILT_IN)$(RM) $@ && \
|
|
|
|
ln git$X $@ 2>/dev/null || \
|
|
|
|
ln -s git$X $@ 2>/dev/null || \
|
|
|
|
cp git$X $@
|
2006-04-11 08:37:58 +08:00
|
|
|
|
2007-12-02 15:39:19 +08:00
|
|
|
common-cmds.h: ./generate-cmdlist.sh command-list.txt
|
2007-06-13 17:00:01 +08:00
|
|
|
|
2007-04-06 06:03:48 +08:00
|
|
|
common-cmds.h: $(wildcard Documentation/git-*.txt)
|
2007-03-06 14:35:01 +08:00
|
|
|
$(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
|
2006-03-10 00:24:19 +08:00
|
|
|
|
2012-06-21 02:32:16 +08:00
|
|
|
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
|
2012-06-21 02:32:19 +08:00
|
|
|
$(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
|
|
|
|
$(gitwebdir_SQ):$(PERL_PATH_SQ)
|
2010-02-01 03:46:53 +08:00
|
|
|
define cmd_munge_script
|
|
|
|
$(RM) $@ $@+ && \
|
|
|
|
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
|
|
|
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
|
2010-06-06 00:36:13 +08:00
|
|
|
-e 's|@@DIFF@@|$(DIFF_SQ)|' \
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
-e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \
|
2010-02-01 03:46:53 +08:00
|
|
|
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
|
2012-01-24 06:04:29 +08:00
|
|
|
-e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \
|
2010-02-01 03:46:53 +08:00
|
|
|
-e $(BROKEN_PATH_FIX) \
|
2012-06-21 02:32:19 +08:00
|
|
|
-e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
|
|
|
|
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
|
2010-02-01 03:46:53 +08:00
|
|
|
$@.sh >$@+
|
|
|
|
endef
|
|
|
|
|
2012-06-21 02:32:16 +08:00
|
|
|
GIT-SCRIPT-DEFINES: FORCE
|
|
|
|
@FLAGS='$(SCRIPT_DEFINES)'; \
|
|
|
|
if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
|
|
|
|
echo 1>&2 " * new script parameters"; \
|
|
|
|
echo "$$FLAGS" >$@; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh GIT-SCRIPT-DEFINES
|
2010-02-01 03:46:53 +08:00
|
|
|
$(QUIET_GEN)$(cmd_munge_script) && \
|
2007-03-06 14:35:01 +08:00
|
|
|
chmod +x $@+ && \
|
Don't write directly to a make target ($@).
Otherwise, if make is suspended, or killed with prejudice, or if the
system crashes, you could be left with an up-to-date, yet corrupt,
generated file.
I left off the `clean' addition, because I believe "make clean" should
not remove wildcard patterns like "*+", on the off-chance that someone
uses names like that for files they care about. Besides, in practice,
those temporary files are left behind so rarely that they're not a bother,
and they're removed again as part of the next build.
[jc: sign-off?]
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-26 00:52:01 +08:00
|
|
|
mv $@+ $@
|
2005-09-09 09:50:33 +08:00
|
|
|
|
2012-06-21 02:32:16 +08:00
|
|
|
$(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
|
2010-02-01 03:46:53 +08:00
|
|
|
$(QUIET_GEN)$(cmd_munge_script) && \
|
|
|
|
mv $@+ $@
|
|
|
|
|
2009-04-04 03:32:20 +08:00
|
|
|
ifndef NO_PERL
|
2006-12-04 17:50:04 +08:00
|
|
|
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
|
|
|
|
|
2012-07-28 04:04:20 +08:00
|
|
|
perl/perl.mak: perl/PM.stamp
|
|
|
|
|
|
|
|
perl/PM.stamp: FORCE
|
2012-08-07 05:06:14 +08:00
|
|
|
$(QUIET_GEN)$(FIND) perl -type f -name '*.pm' | sort >$@+ && \
|
2012-07-28 04:04:20 +08:00
|
|
|
{ cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@; } && \
|
|
|
|
$(RM) $@+
|
|
|
|
|
2012-06-21 02:31:55 +08:00
|
|
|
perl/perl.mak: GIT-CFLAGS GIT-PREFIX perl/Makefile perl/Makefile.PL
|
2007-03-07 06:37:18 +08:00
|
|
|
$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
|
2006-12-04 17:50:04 +08:00
|
|
|
|
2012-06-21 02:32:22 +08:00
|
|
|
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl GIT-VERSION-FILE
|
2007-07-15 01:51:44 +08:00
|
|
|
$(QUIET_GEN)$(RM) $@ $@+ && \
|
2007-09-25 14:42:16 +08:00
|
|
|
INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
|
2006-07-08 04:04:35 +08:00
|
|
|
sed -e '1{' \
|
|
|
|
-e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
|
|
|
|
-e ' h' \
|
2010-05-31 01:12:41 +08:00
|
|
|
-e ' s=.*=use lib (split(/$(pathsep)/, $$ENV{GITPERLLIB} || "'"$$INSTLIBDIR"'"));=' \
|
2006-07-08 04:04:35 +08:00
|
|
|
-e ' H' \
|
|
|
|
-e ' x' \
|
|
|
|
-e '}' \
|
2005-10-05 03:41:35 +08:00
|
|
|
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
|
2007-03-06 14:35:01 +08:00
|
|
|
$@.perl >$@+ && \
|
|
|
|
chmod +x $@+ && \
|
Don't write directly to a make target ($@).
Otherwise, if make is suspended, or killed with prejudice, or if the
system crashes, you could be left with an up-to-date, yet corrupt,
generated file.
I left off the `clean' addition, because I believe "make clean" should
not remove wildcard patterns like "*+", on the off-chance that someone
uses names like that for files they care about. Besides, in practice,
those temporary files are left behind so rarely that they're not a bother,
and they're removed again as part of the next build.
[jc: sign-off?]
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-26 00:52:01 +08:00
|
|
|
mv $@+ $@
|
2005-09-09 09:50:33 +08:00
|
|
|
|
2010-01-31 06:30:40 +08:00
|
|
|
|
|
|
|
.PHONY: gitweb
|
|
|
|
gitweb:
|
|
|
|
$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
|
|
|
|
|
2012-06-21 02:32:19 +08:00
|
|
|
git-instaweb: git-instaweb.sh gitweb GIT-SCRIPT-DEFINES
|
|
|
|
$(QUIET_GEN)$(cmd_munge_script) && \
|
2007-03-06 14:35:01 +08:00
|
|
|
chmod +x $@+ && \
|
2006-07-02 06:14:14 +08:00
|
|
|
mv $@+ $@
|
2009-04-04 03:32:20 +08:00
|
|
|
else # NO_PERL
|
|
|
|
$(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
|
|
|
|
$(QUIET_GEN)$(RM) $@ $@+ && \
|
|
|
|
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
|
|
|
-e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \
|
|
|
|
unimplemented.sh >$@+ && \
|
|
|
|
chmod +x $@+ && \
|
|
|
|
mv $@+ $@
|
|
|
|
endif # NO_PERL
|
2006-07-02 06:14:14 +08:00
|
|
|
|
2009-11-18 09:42:32 +08:00
|
|
|
ifndef NO_PYTHON
|
2012-06-21 02:31:55 +08:00
|
|
|
$(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS GIT-PREFIX
|
2009-11-18 09:42:32 +08:00
|
|
|
$(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py
|
|
|
|
$(QUIET_GEN)$(RM) $@ $@+ && \
|
|
|
|
INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C git_remote_helpers -s \
|
|
|
|
--no-print-directory prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' \
|
|
|
|
instlibdir` && \
|
2010-04-09 23:57:45 +08:00
|
|
|
sed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \
|
|
|
|
-e 's|\(os\.getenv("GITPYTHONLIB"\)[^)]*)|\1,"@@INSTLIBDIR@@")|' \
|
2009-11-18 09:42:32 +08:00
|
|
|
-e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
|
|
|
|
$@.py >$@+ && \
|
|
|
|
chmod +x $@+ && \
|
|
|
|
mv $@+ $@
|
|
|
|
else # NO_PYTHON
|
|
|
|
$(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh
|
|
|
|
$(QUIET_GEN)$(RM) $@ $@+ && \
|
|
|
|
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
|
|
|
-e 's|@@REASON@@|NO_PYTHON=$(NO_PYTHON)|g' \
|
|
|
|
unimplemented.sh >$@+ && \
|
|
|
|
chmod +x $@+ && \
|
|
|
|
mv $@+ $@
|
|
|
|
endif # NO_PYTHON
|
|
|
|
|
2012-06-21 02:32:22 +08:00
|
|
|
configure: configure.ac GIT-VERSION-FILE
|
2007-07-15 01:51:44 +08:00
|
|
|
$(QUIET_GEN)$(RM) $@ $<+ && \
|
2006-08-09 00:35:23 +08:00
|
|
|
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
|
2007-03-06 14:35:01 +08:00
|
|
|
$< > $<+ && \
|
|
|
|
autoconf -o $@ $<+ && \
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) $<+
|
2006-08-09 00:35:23 +08:00
|
|
|
|
2012-07-19 15:50:02 +08:00
|
|
|
ifdef AUTOCONFIGURED
|
|
|
|
config.status: configure
|
|
|
|
$(QUIET_GEN)if test -f config.status; then \
|
|
|
|
./config.status --recheck; \
|
|
|
|
else \
|
|
|
|
./configure; \
|
|
|
|
fi
|
|
|
|
reconfigure config.mak.autogen: config.status
|
|
|
|
$(QUIET_GEN)./config.status
|
|
|
|
.PHONY: reconfigure # This is a convenience target.
|
|
|
|
endif
|
|
|
|
|
2011-03-28 02:13:22 +08:00
|
|
|
XDIFF_OBJS += xdiff/xdiffi.o
|
|
|
|
XDIFF_OBJS += xdiff/xprepare.o
|
|
|
|
XDIFF_OBJS += xdiff/xutils.o
|
|
|
|
XDIFF_OBJS += xdiff/xemit.o
|
|
|
|
XDIFF_OBJS += xdiff/xmerge.o
|
|
|
|
XDIFF_OBJS += xdiff/xpatience.o
|
2012-01-28 03:04:28 +08:00
|
|
|
XDIFF_OBJS += xdiff/xhistogram.o
|
2011-03-28 02:13:22 +08:00
|
|
|
|
|
|
|
VCSSVN_OBJS += vcs-svn/line_buffer.o
|
vcs-svn: learn to maintain a sliding view of a file
Each section of a Subversion-format delta only requires examining (and
keeping in random-access memory) a small portion of the preimage. At
any moment, this portion starts at a certain file offset and has a
well-defined length, and as the delta is applied, the portion advances
from the beginning to the end of the preimage. Add a move_window
function to keep track of this view into the preimage.
You can use it like this:
buffer_init(f, NULL);
struct sliding_view window = SLIDING_VIEW_INIT(f);
move_window(&window, 3, 7); /* (1) */
move_window(&window, 5, 5); /* (2) */
move_window(&window, 12, 2); /* (3) */
strbuf_release(&window.buf);
buffer_deinit(f);
The data structure is called sliding_view instead of _window to
prevent confusion with svndiff0 Windows.
In this example, (1) reads 10 bytes and discards the first 3;
(2) discards the first 2, which are not needed any more; and (3) skips
2 bytes and reads 2 new bytes to work with.
When move_window returns, the file position indicator is at position
window->off + window->width and the data from positions window->off to
the current file position are stored in window->buf.
This function performs only sequential access from the input file and
never seeks, so it can be safely used on pipes and sockets.
On end-of-file, move_window silently reads less than the caller
requested. On other errors, it prints a message and returns -1.
Helped-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-01-03 11:54:58 +08:00
|
|
|
VCSSVN_OBJS += vcs-svn/sliding_window.o
|
2011-03-28 02:13:22 +08:00
|
|
|
VCSSVN_OBJS += vcs-svn/repo_tree.o
|
|
|
|
VCSSVN_OBJS += vcs-svn/fast_export.o
|
2010-12-25 19:11:32 +08:00
|
|
|
VCSSVN_OBJS += vcs-svn/svndiff.o
|
2011-03-28 02:13:22 +08:00
|
|
|
VCSSVN_OBJS += vcs-svn/svndump.o
|
|
|
|
|
2012-07-07 11:39:18 +08:00
|
|
|
TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
|
|
|
|
OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
|
|
|
|
$(XDIFF_OBJS) \
|
|
|
|
$(VCSSVN_OBJS) \
|
|
|
|
git.o
|
|
|
|
ifndef NO_CURL
|
|
|
|
OBJECTS += http.o http-walker.o remote-curl.o
|
|
|
|
endif
|
2010-01-26 23:52:11 +08:00
|
|
|
|
2010-02-01 05:23:53 +08:00
|
|
|
dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
|
2010-02-01 05:37:25 +08:00
|
|
|
dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
|
2010-01-26 23:49:33 +08:00
|
|
|
|
2011-11-18 17:58:21 +08:00
|
|
|
ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
|
2010-01-26 23:52:49 +08:00
|
|
|
$(dep_dirs):
|
2011-09-12 03:40:18 +08:00
|
|
|
@mkdir -p $@
|
2010-01-26 23:52:49 +08:00
|
|
|
|
|
|
|
missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs))
|
2010-02-01 05:23:53 +08:00
|
|
|
dep_file = $(dir $@).depend/$(notdir $@).d
|
2010-01-26 23:57:15 +08:00
|
|
|
dep_args = -MF $(dep_file) -MMD -MP
|
|
|
|
ifdef CHECK_HEADER_DEPENDENCIES
|
|
|
|
$(error cannot compute header dependencies outside a normal build. \
|
|
|
|
Please unset CHECK_HEADER_DEPENDENCIES and try again)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2011-11-18 17:58:21 +08:00
|
|
|
ifneq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
|
2010-01-26 23:57:15 +08:00
|
|
|
ifndef CHECK_HEADER_DEPENDENCIES
|
2010-01-26 23:52:49 +08:00
|
|
|
dep_dirs =
|
|
|
|
missing_dep_dirs =
|
2010-01-26 23:57:15 +08:00
|
|
|
dep_args =
|
|
|
|
endif
|
2010-01-26 23:52:49 +08:00
|
|
|
endif
|
|
|
|
|
2010-01-26 23:57:15 +08:00
|
|
|
ifdef CHECK_HEADER_DEPENDENCIES
|
|
|
|
ifndef PRINT_HEADER_DEPENDENCIES
|
|
|
|
missing_deps = $(filter-out $(notdir $^), \
|
|
|
|
$(notdir $(shell $(MAKE) -s $@ \
|
|
|
|
CHECK_HEADER_DEPENDENCIES=YesPlease \
|
|
|
|
USE_COMPUTED_HEADER_DEPENDENCIES=YesPlease \
|
|
|
|
PRINT_HEADER_DEPENDENCIES=YesPlease)))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ASM_SRC := $(wildcard $(OBJECTS:o=S))
|
|
|
|
ASM_OBJ := $(ASM_SRC:S=o)
|
|
|
|
C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))
|
|
|
|
|
2010-01-26 23:51:24 +08:00
|
|
|
.SUFFIXES:
|
|
|
|
|
2010-01-26 23:57:15 +08:00
|
|
|
ifdef PRINT_HEADER_DEPENDENCIES
|
|
|
|
$(C_OBJ): %.o: %.c FORCE
|
|
|
|
echo $^
|
|
|
|
$(ASM_OBJ): %.o: %.S FORCE
|
|
|
|
echo $^
|
|
|
|
|
|
|
|
ifndef CHECK_HEADER_DEPENDENCIES
|
|
|
|
$(error cannot print header dependencies during a normal build. \
|
|
|
|
Please set CHECK_HEADER_DEPENDENCIES and try again)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef PRINT_HEADER_DEPENDENCIES
|
|
|
|
ifdef CHECK_HEADER_DEPENDENCIES
|
|
|
|
$(C_OBJ): %.o: %.c $(dep_files) FORCE
|
|
|
|
@set -e; echo CHECK $@; \
|
|
|
|
missing_deps="$(missing_deps)"; \
|
|
|
|
if test "$$missing_deps"; \
|
|
|
|
then \
|
|
|
|
echo missing dependencies: $$missing_deps; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
$(ASM_OBJ): %.o: %.S $(dep_files) FORCE
|
|
|
|
@set -e; echo CHECK $@; \
|
|
|
|
missing_deps="$(missing_deps)"; \
|
|
|
|
if test "$$missing_deps"; \
|
|
|
|
then \
|
|
|
|
echo missing dependencies: $$missing_deps; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef CHECK_HEADER_DEPENDENCIES
|
2010-01-26 23:52:49 +08:00
|
|
|
$(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs)
|
2010-03-20 11:20:12 +08:00
|
|
|
$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
|
2010-01-26 23:52:49 +08:00
|
|
|
$(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs)
|
2010-03-20 11:20:12 +08:00
|
|
|
$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
|
2010-01-26 23:57:15 +08:00
|
|
|
endif
|
2010-01-26 23:52:49 +08:00
|
|
|
|
2010-01-06 16:06:58 +08:00
|
|
|
%.s: %.c GIT-CFLAGS FORCE
|
2012-07-23 07:47:26 +08:00
|
|
|
$(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
|
2010-01-26 23:57:15 +08:00
|
|
|
|
|
|
|
ifdef USE_COMPUTED_HEADER_DEPENDENCIES
|
2010-01-26 23:52:49 +08:00
|
|
|
# Take advantage of gcc's on-the-fly dependency generation
|
|
|
|
# See <http://gcc.gnu.org/gcc-3.0/features.html>.
|
2010-01-26 23:57:15 +08:00
|
|
|
dep_files_present := $(wildcard $(dep_files))
|
|
|
|
ifneq ($(dep_files_present),)
|
|
|
|
include $(dep_files_present)
|
2010-01-26 23:52:49 +08:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
# Dependencies on header files, for platforms that do not support
|
|
|
|
# the gcc -MMD option.
|
|
|
|
#
|
|
|
|
# Dependencies on automatically generated headers such as common-cmds.h
|
|
|
|
# should _not_ be included here, since they are necessary even when
|
|
|
|
# building an object for the first time.
|
2010-08-10 06:04:29 +08:00
|
|
|
|
2012-07-07 11:39:18 +08:00
|
|
|
$(OBJECTS): $(LIB_H)
|
2010-01-26 23:52:49 +08:00
|
|
|
endif
|
2005-05-19 22:27:14 +08:00
|
|
|
|
2012-06-21 02:31:55 +08:00
|
|
|
exec_cmd.sp exec_cmd.s exec_cmd.o: GIT-PREFIX
|
2011-04-22 03:14:42 +08:00
|
|
|
exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
|
2010-01-06 16:05:04 +08:00
|
|
|
'-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
|
|
|
|
'-DBINDIR="$(bindir_relative_SQ)"' \
|
|
|
|
'-DPREFIX="$(prefix_SQ)"'
|
2009-01-18 20:00:09 +08:00
|
|
|
|
2012-06-21 02:31:55 +08:00
|
|
|
builtin/init-db.sp builtin/init-db.s builtin/init-db.o: GIT-PREFIX
|
2011-04-22 03:14:42 +08:00
|
|
|
builtin/init-db.sp builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
|
2010-01-06 16:05:04 +08:00
|
|
|
-DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
|
2006-01-11 10:12:17 +08:00
|
|
|
|
2012-06-21 02:31:55 +08:00
|
|
|
config.sp config.s config.o: GIT-PREFIX
|
2011-04-22 03:14:42 +08:00
|
|
|
config.sp config.s config.o: EXTRA_CPPFLAGS = \
|
|
|
|
-DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
|
2007-11-14 04:05:05 +08:00
|
|
|
|
2012-06-21 02:31:55 +08:00
|
|
|
attr.sp attr.s attr.o: GIT-PREFIX
|
2011-04-22 03:14:42 +08:00
|
|
|
attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \
|
|
|
|
-DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"'
|
2010-09-01 06:42:43 +08:00
|
|
|
|
2012-06-21 02:31:55 +08:00
|
|
|
gettext.sp gettext.s gettext.o: GIT-PREFIX
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
|
|
|
|
-DGIT_LOCALE_PATH='"$(localedir_SQ)"'
|
|
|
|
|
2006-04-04 20:33:18 +08:00
|
|
|
ifdef NO_EXPAT
|
2011-04-22 03:14:42 +08:00
|
|
|
http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
|
2006-04-04 20:33:18 +08:00
|
|
|
endif
|
|
|
|
|
2010-08-17 17:24:39 +08:00
|
|
|
ifdef NO_REGEX
|
2011-04-22 03:14:42 +08:00
|
|
|
compat/regex/regex.sp compat/regex/regex.o: EXTRA_CPPFLAGS = \
|
|
|
|
-DGAWK -DNO_MBSUPPORT
|
2010-08-17 17:24:39 +08:00
|
|
|
endif
|
|
|
|
|
2010-09-11 17:59:18 +08:00
|
|
|
ifdef USE_NED_ALLOCATOR
|
2011-04-22 03:14:42 +08:00
|
|
|
compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
|
2010-09-11 17:59:18 +08:00
|
|
|
-DNDEBUG -DOVERRIDE_STRDUP -DREPLACE_SYSTEM_ALLOCATOR
|
|
|
|
endif
|
|
|
|
|
2011-06-22 18:50:56 +08:00
|
|
|
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
|
2007-03-06 14:35:01 +08:00
|
|
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
|
2005-07-30 01:21:53 +08:00
|
|
|
|
2011-06-22 18:50:56 +08:00
|
|
|
git-imap-send$X: imap-send.o GIT-LDFLAGS $(GITLIBS)
|
2008-07-10 05:29:00 +08:00
|
|
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
|
2010-11-25 04:03:53 +08:00
|
|
|
$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
|
2006-03-10 13:32:50 +08:00
|
|
|
|
2011-06-22 18:50:56 +08:00
|
|
|
git-http-fetch$X: revision.o http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
|
2009-08-05 13:01:59 +08:00
|
|
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
|
2009-08-07 12:21:33 +08:00
|
|
|
$(LIBS) $(CURL_LIBCURL)
|
2011-06-22 18:50:56 +08:00
|
|
|
git-http-push$X: revision.o http.o http-push.o GIT-LDFLAGS $(GITLIBS)
|
2007-03-06 14:35:01 +08:00
|
|
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
|
2006-02-18 19:40:22 +08:00
|
|
|
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
|
|
|
|
|
2012-09-19 23:21:16 +08:00
|
|
|
git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB)
|
|
|
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \
|
|
|
|
$(VCSSVN_LIB)
|
|
|
|
|
2009-12-09 23:26:34 +08:00
|
|
|
$(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
|
|
|
|
$(QUIET_LNCP)$(RM) $@ && \
|
|
|
|
ln $< $@ 2>/dev/null || \
|
|
|
|
ln -s $< $@ 2>/dev/null || \
|
|
|
|
cp $< $@
|
|
|
|
|
2011-06-22 18:50:56 +08:00
|
|
|
$(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)
|
2009-08-05 13:01:56 +08:00
|
|
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
|
|
|
|
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
|
|
|
|
|
2005-07-29 23:50:24 +08:00
|
|
|
$(LIB_FILE): $(LIB_OBJS)
|
2007-07-15 01:51:44 +08:00
|
|
|
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
|
2005-07-29 23:50:24 +08:00
|
|
|
|
Use a *real* built-in diff generator
This uses a simplified libxdiff setup to generate unified diffs _without_
doing fork/execve of GNU "diff".
This has several huge advantages, for example:
Before:
[torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null
real 0m24.818s
user 0m13.332s
sys 0m8.664s
After:
[torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null
real 0m4.563s
user 0m2.944s
sys 0m1.580s
and the fact that this should be a lot more portable (ie we can ignore all
the issues with doing fork/execve under Windows).
Perhaps even more importantly, this allows us to do diffs without actually
ever writing out the git file contents to a temporary file (and without
any of the shell quoting issues on filenames etc etc).
NOTE! THIS PATCH DOES NOT DO THAT OPTIMIZATION YET! I was lazy, and the
current "diff-core" code actually will always write the temp-files,
because it used to be something that you simply had to do. So this current
one actually writes a temp-file like before, and then reads it into memory
again just to do the diff. Stupid.
But if this basic infrastructure is accepted, we can start switching over
diff-core to not write temp-files, which should speed things up even
further, especially when doing big tree-to-tree diffs.
Now, in the interest of full disclosure, I should also point out a few
downsides:
- the libxdiff algorithm is different, and I bet GNU diff has gotten a
lot more testing. And the thing is, generating a diff is not an exact
science - you can get two different diffs (and you will), and they can
both be perfectly valid. So it's not possible to "validate" the
libxdiff output by just comparing it against GNU diff.
- GNU diff does some nice eye-candy, like trying to figure out what the
last function was, and adding that information to the "@@ .." line.
libxdiff doesn't do that.
- The libxdiff thing has some known deficiencies. In particular, it gets
the "\No newline at end of file" case wrong. So this is currently for
the experimental branch only. I hope Davide will help fix it.
That said, I think the huge performance advantage, and the fact that it
integrates better is definitely worth it. But it should go into a
development branch at least due to the missing newline issue.
Technical note: this is based on libxdiff-0.17, but I did some surgery to
get rid of the extraneous fat - stuff that git doesn't need, and seriously
cutting down on mmfile_t, which had much more capabilities than the diff
algorithm either needed or used. In this version, "mmfile_t" is just a
trivial <pointer,length> tuple.
That said, I tried to keep the differences to simple removals, so that you
can do a diff between this and the libxdiff origin, and you'll basically
see just things getting deleted. Even the mmfile_t simplifications are
left in a state where the diffs should be readable.
Apologies to Davide, whom I'd love to get feedback on this all from (I
wrote my own "fill_mmfile()" for the new simpler mmfile_t format: the old
complex format had a helper function for that, but I did my surgery with
the goal in mind that eventually we _should_ just do
mmfile_t mf;
buf = read_sha1_file(sha1, type, &size);
mf->ptr = buf;
mf->size = size;
.. use "mf" directly ..
which was really a nightmare with the old "helpful" mmfile_t, and really
is that easy with the new cut-down interfaces).
[ Btw, as any hawk-eye can see from the diff, this was actually generated
with itself, so it is "self-hosting". That's about all the testing it
has gotten, along with the above kernel diff, which eye-balls correctly,
but shows the newline issue when you double-check it with "git-apply" ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-25 12:13:22 +08:00
|
|
|
$(XDIFF_LIB): $(XDIFF_OBJS)
|
2007-07-15 01:51:44 +08:00
|
|
|
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS)
|
Use a *real* built-in diff generator
This uses a simplified libxdiff setup to generate unified diffs _without_
doing fork/execve of GNU "diff".
This has several huge advantages, for example:
Before:
[torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null
real 0m24.818s
user 0m13.332s
sys 0m8.664s
After:
[torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null
real 0m4.563s
user 0m2.944s
sys 0m1.580s
and the fact that this should be a lot more portable (ie we can ignore all
the issues with doing fork/execve under Windows).
Perhaps even more importantly, this allows us to do diffs without actually
ever writing out the git file contents to a temporary file (and without
any of the shell quoting issues on filenames etc etc).
NOTE! THIS PATCH DOES NOT DO THAT OPTIMIZATION YET! I was lazy, and the
current "diff-core" code actually will always write the temp-files,
because it used to be something that you simply had to do. So this current
one actually writes a temp-file like before, and then reads it into memory
again just to do the diff. Stupid.
But if this basic infrastructure is accepted, we can start switching over
diff-core to not write temp-files, which should speed things up even
further, especially when doing big tree-to-tree diffs.
Now, in the interest of full disclosure, I should also point out a few
downsides:
- the libxdiff algorithm is different, and I bet GNU diff has gotten a
lot more testing. And the thing is, generating a diff is not an exact
science - you can get two different diffs (and you will), and they can
both be perfectly valid. So it's not possible to "validate" the
libxdiff output by just comparing it against GNU diff.
- GNU diff does some nice eye-candy, like trying to figure out what the
last function was, and adding that information to the "@@ .." line.
libxdiff doesn't do that.
- The libxdiff thing has some known deficiencies. In particular, it gets
the "\No newline at end of file" case wrong. So this is currently for
the experimental branch only. I hope Davide will help fix it.
That said, I think the huge performance advantage, and the fact that it
integrates better is definitely worth it. But it should go into a
development branch at least due to the missing newline issue.
Technical note: this is based on libxdiff-0.17, but I did some surgery to
get rid of the extraneous fat - stuff that git doesn't need, and seriously
cutting down on mmfile_t, which had much more capabilities than the diff
algorithm either needed or used. In this version, "mmfile_t" is just a
trivial <pointer,length> tuple.
That said, I tried to keep the differences to simple removals, so that you
can do a diff between this and the libxdiff origin, and you'll basically
see just things getting deleted. Even the mmfile_t simplifications are
left in a state where the diffs should be readable.
Apologies to Davide, whom I'd love to get feedback on this all from (I
wrote my own "fill_mmfile()" for the new simpler mmfile_t format: the old
complex format had a helper function for that, but I did my surgery with
the goal in mind that eventually we _should_ just do
mmfile_t mf;
buf = read_sha1_file(sha1, type, &size);
mf->ptr = buf;
mf->size = size;
.. use "mf" directly ..
which was really a nightmare with the old "helpful" mmfile_t, and really
is that easy with the new cut-down interfaces).
[ Btw, as any hawk-eye can see from the diff, this was actually generated
with itself, so it is "self-hosting". That's about all the testing it
has gotten, along with the above kernel diff, which eye-balls correctly,
but shows the newline issue when you double-check it with "git-apply" ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-25 12:13:22 +08:00
|
|
|
|
2010-08-10 06:04:29 +08:00
|
|
|
$(VCSSVN_LIB): $(VCSSVN_OBJS)
|
|
|
|
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(VCSSVN_OBJS)
|
Use a *real* built-in diff generator
This uses a simplified libxdiff setup to generate unified diffs _without_
doing fork/execve of GNU "diff".
This has several huge advantages, for example:
Before:
[torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null
real 0m24.818s
user 0m13.332s
sys 0m8.664s
After:
[torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null
real 0m4.563s
user 0m2.944s
sys 0m1.580s
and the fact that this should be a lot more portable (ie we can ignore all
the issues with doing fork/execve under Windows).
Perhaps even more importantly, this allows us to do diffs without actually
ever writing out the git file contents to a temporary file (and without
any of the shell quoting issues on filenames etc etc).
NOTE! THIS PATCH DOES NOT DO THAT OPTIMIZATION YET! I was lazy, and the
current "diff-core" code actually will always write the temp-files,
because it used to be something that you simply had to do. So this current
one actually writes a temp-file like before, and then reads it into memory
again just to do the diff. Stupid.
But if this basic infrastructure is accepted, we can start switching over
diff-core to not write temp-files, which should speed things up even
further, especially when doing big tree-to-tree diffs.
Now, in the interest of full disclosure, I should also point out a few
downsides:
- the libxdiff algorithm is different, and I bet GNU diff has gotten a
lot more testing. And the thing is, generating a diff is not an exact
science - you can get two different diffs (and you will), and they can
both be perfectly valid. So it's not possible to "validate" the
libxdiff output by just comparing it against GNU diff.
- GNU diff does some nice eye-candy, like trying to figure out what the
last function was, and adding that information to the "@@ .." line.
libxdiff doesn't do that.
- The libxdiff thing has some known deficiencies. In particular, it gets
the "\No newline at end of file" case wrong. So this is currently for
the experimental branch only. I hope Davide will help fix it.
That said, I think the huge performance advantage, and the fact that it
integrates better is definitely worth it. But it should go into a
development branch at least due to the missing newline issue.
Technical note: this is based on libxdiff-0.17, but I did some surgery to
get rid of the extraneous fat - stuff that git doesn't need, and seriously
cutting down on mmfile_t, which had much more capabilities than the diff
algorithm either needed or used. In this version, "mmfile_t" is just a
trivial <pointer,length> tuple.
That said, I tried to keep the differences to simple removals, so that you
can do a diff between this and the libxdiff origin, and you'll basically
see just things getting deleted. Even the mmfile_t simplifications are
left in a state where the diffs should be readable.
Apologies to Davide, whom I'd love to get feedback on this all from (I
wrote my own "fill_mmfile()" for the new simpler mmfile_t format: the old
complex format had a helper function for that, but I did my surgery with
the goal in mind that eventually we _should_ just do
mmfile_t mf;
buf = read_sha1_file(sha1, type, &size);
mf->ptr = buf;
mf->size = size;
.. use "mf" directly ..
which was really a nightmare with the old "helpful" mmfile_t, and really
is that easy with the new cut-down interfaces).
[ Btw, as any hawk-eye can see from the diff, this was actually generated
with itself, so it is "self-hosting". That's about all the testing it
has gotten, along with the above kernel diff, which eye-balls correctly,
but shows the newline issue when you double-check it with "git-apply" ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-25 12:13:22 +08:00
|
|
|
|
2012-03-31 16:44:53 +08:00
|
|
|
export DEFAULT_EDITOR DEFAULT_PAGER
|
|
|
|
|
2005-07-29 23:50:24 +08:00
|
|
|
doc:
|
|
|
|
$(MAKE) -C Documentation all
|
|
|
|
|
2008-09-10 16:19:34 +08:00
|
|
|
man:
|
|
|
|
$(MAKE) -C Documentation man
|
|
|
|
|
|
|
|
html:
|
|
|
|
$(MAKE) -C Documentation html
|
|
|
|
|
2007-08-06 18:22:57 +08:00
|
|
|
info:
|
|
|
|
$(MAKE) -C Documentation info
|
|
|
|
|
2008-12-11 06:44:50 +08:00
|
|
|
pdf:
|
|
|
|
$(MAKE) -C Documentation pdf
|
|
|
|
|
2011-02-23 07:41:23 +08:00
|
|
|
XGETTEXT_FLAGS = \
|
|
|
|
--force-po \
|
|
|
|
--add-comments \
|
|
|
|
--msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \
|
|
|
|
--from-code=UTF-8
|
2011-04-11 03:37:01 +08:00
|
|
|
XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \
|
|
|
|
--keyword=_ --keyword=N_ --keyword="Q_:1,2"
|
2012-07-25 22:53:07 +08:00
|
|
|
XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
|
|
|
|
--keyword=gettextln --keyword=eval_gettextln
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl
|
2012-07-07 11:39:18 +08:00
|
|
|
LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
|
2011-05-14 21:47:45 +08:00
|
|
|
LOCALIZED_SH := $(SCRIPT_SH)
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
LOCALIZED_PERL := $(SCRIPT_PERL)
|
|
|
|
|
|
|
|
ifdef XGETTEXT_INCLUDE_TESTS
|
|
|
|
LOCALIZED_C += t/t0200/test.c
|
|
|
|
LOCALIZED_SH += t/t0200/test.sh
|
|
|
|
LOCALIZED_PERL += t/t0200/test.perl
|
|
|
|
endif
|
2011-02-23 07:41:23 +08:00
|
|
|
|
|
|
|
po/git.pot: $(LOCALIZED_C)
|
2011-05-14 21:47:45 +08:00
|
|
|
$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)
|
|
|
|
$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \
|
|
|
|
$(LOCALIZED_SH)
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \
|
|
|
|
$(LOCALIZED_PERL)
|
2011-02-23 07:41:23 +08:00
|
|
|
mv $@+ $@
|
|
|
|
|
|
|
|
pot: po/git.pot
|
|
|
|
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
POFILES := $(wildcard po/*.po)
|
|
|
|
MOFILES := $(patsubst po/%.po,po/build/locale/%/LC_MESSAGES/git.mo,$(POFILES))
|
|
|
|
|
|
|
|
ifndef NO_GETTEXT
|
|
|
|
all:: $(MOFILES)
|
|
|
|
endif
|
|
|
|
|
|
|
|
po/build/locale/%/LC_MESSAGES/git.mo: po/%.po
|
|
|
|
$(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $<
|
|
|
|
|
2011-10-18 15:26:18 +08:00
|
|
|
FIND_SOURCE_FILES = ( git ls-files '*.[hcS]' 2>/dev/null || \
|
|
|
|
$(FIND) . \( -name .git -type d -prune \) \
|
|
|
|
-o \( -name '*.[hcS]' -type f -print \) )
|
|
|
|
|
2010-09-29 05:08:38 +08:00
|
|
|
$(ETAGS_TARGET): FORCE
|
|
|
|
$(RM) $(ETAGS_TARGET)
|
2011-10-18 15:26:18 +08:00
|
|
|
$(FIND_SOURCE_FILES) | xargs etags -a -o $(ETAGS_TARGET)
|
2006-03-18 18:07:12 +08:00
|
|
|
|
2010-09-29 05:08:38 +08:00
|
|
|
tags: FORCE
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) tags
|
2011-10-18 15:26:18 +08:00
|
|
|
$(FIND_SOURCE_FILES) | xargs ctags -a
|
2005-07-29 23:50:24 +08:00
|
|
|
|
2007-10-06 22:24:42 +08:00
|
|
|
cscope:
|
|
|
|
$(RM) cscope*
|
2011-10-18 15:26:18 +08:00
|
|
|
$(FIND_SOURCE_FILES) | xargs cscope -b
|
2007-10-06 22:24:42 +08:00
|
|
|
|
2006-06-15 06:36:00 +08:00
|
|
|
### Detect prefix changes
|
2012-06-21 02:31:55 +08:00
|
|
|
TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\
|
|
|
|
$(localedir_SQ)
|
|
|
|
|
|
|
|
GIT-PREFIX: FORCE
|
|
|
|
@FLAGS='$(TRACK_PREFIX)'; \
|
|
|
|
if test x"$$FLAGS" != x"`cat GIT-PREFIX 2>/dev/null`" ; then \
|
|
|
|
echo 1>&2 " * new prefix flags"; \
|
|
|
|
echo "$$FLAGS" >GIT-PREFIX; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):$(USE_GETTEXT_SCHEME)
|
2006-06-15 06:36:00 +08:00
|
|
|
|
2010-01-06 16:06:58 +08:00
|
|
|
GIT-CFLAGS: FORCE
|
2006-06-15 06:36:00 +08:00
|
|
|
@FLAGS='$(TRACK_CFLAGS)'; \
|
|
|
|
if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \
|
2012-06-21 02:31:55 +08:00
|
|
|
echo 1>&2 " * new build flags"; \
|
2006-06-15 06:36:00 +08:00
|
|
|
echo "$$FLAGS" >GIT-CFLAGS; \
|
|
|
|
fi
|
|
|
|
|
2011-06-22 18:50:56 +08:00
|
|
|
TRACK_LDFLAGS = $(subst ','\'',$(ALL_LDFLAGS))
|
|
|
|
|
|
|
|
GIT-LDFLAGS: FORCE
|
|
|
|
@FLAGS='$(TRACK_LDFLAGS)'; \
|
|
|
|
if test x"$$FLAGS" != x"`cat GIT-LDFLAGS 2>/dev/null`" ; then \
|
|
|
|
echo 1>&2 " * new link flags"; \
|
|
|
|
echo "$$FLAGS" >GIT-LDFLAGS; \
|
|
|
|
fi
|
|
|
|
|
2008-07-26 03:35:10 +08:00
|
|
|
# We need to apply sq twice, once to protect from the shell
|
|
|
|
# that runs GIT-BUILD-OPTIONS, and then again to protect it
|
|
|
|
# and the first level quoting from the shell that runs "echo".
|
2010-01-06 16:06:58 +08:00
|
|
|
GIT-BUILD-OPTIONS: FORCE
|
2008-07-26 03:35:10 +08:00
|
|
|
@echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
|
2009-11-17 16:42:39 +08:00
|
|
|
@echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@
|
2010-05-14 17:31:36 +08:00
|
|
|
@echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@
|
2010-06-10 05:23:59 +08:00
|
|
|
@echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@
|
2008-07-26 03:35:10 +08:00
|
|
|
@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
|
2009-02-25 16:32:09 +08:00
|
|
|
@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
|
2011-05-16 15:11:53 +08:00
|
|
|
@echo USE_LIBPCRE=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@
|
2009-04-04 03:33:59 +08:00
|
|
|
@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
|
2009-12-07 13:32:50 +08:00
|
|
|
@echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@
|
2012-02-17 18:25:09 +08:00
|
|
|
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@
|
|
|
|
ifdef GIT_TEST_OPTS
|
|
|
|
@echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@
|
|
|
|
endif
|
2010-06-12 00:40:25 +08:00
|
|
|
ifdef GIT_TEST_CMP
|
|
|
|
@echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@
|
|
|
|
endif
|
|
|
|
ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
|
|
|
|
@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@
|
|
|
|
endif
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
@echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@
|
2011-02-23 07:41:21 +08:00
|
|
|
@echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@
|
2012-02-17 18:25:09 +08:00
|
|
|
ifdef GIT_PERF_REPEAT_COUNT
|
|
|
|
@echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@
|
|
|
|
endif
|
|
|
|
ifdef GIT_PERF_REPO
|
|
|
|
@echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@
|
|
|
|
endif
|
|
|
|
ifdef GIT_PERF_LARGE_REPO
|
|
|
|
@echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@
|
|
|
|
endif
|
|
|
|
ifdef GIT_PERF_MAKE_OPTS
|
|
|
|
@echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@
|
|
|
|
endif
|
2008-02-25 03:40:45 +08:00
|
|
|
|
2007-03-28 19:22:02 +08:00
|
|
|
### Detect Tck/Tk interpreter path changes
|
|
|
|
ifndef NO_TCLTK
|
|
|
|
TRACK_VARS = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)')
|
|
|
|
|
2010-01-06 16:06:58 +08:00
|
|
|
GIT-GUI-VARS: FORCE
|
2007-03-28 19:22:02 +08:00
|
|
|
@VARS='$(TRACK_VARS)'; \
|
|
|
|
if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
|
|
|
|
echo 1>&2 " * new Tcl/Tk interpreter location"; \
|
|
|
|
echo "$$VARS" >$@; \
|
|
|
|
fi
|
|
|
|
endif
|
|
|
|
|
2009-12-03 13:14:05 +08:00
|
|
|
test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
|
|
|
|
|
|
|
|
all:: $(TEST_PROGRAMS) $(test_bindir_programs)
|
|
|
|
|
|
|
|
bin-wrappers/%: wrap-for-bin.sh
|
|
|
|
@mkdir -p bin-wrappers
|
|
|
|
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
|
|
|
-e 's|@@BUILD_DIR@@|$(shell pwd)|' \
|
|
|
|
-e 's|@@PROG@@|$(@F)|' < $< > $@ && \
|
|
|
|
chmod +x $@
|
2007-04-29 06:32:49 +08:00
|
|
|
|
2006-02-18 20:01:18 +08:00
|
|
|
# GNU make supports exporting all variables by "export" without parameters.
|
|
|
|
# However, the environment gets quite big, and some programs have problems
|
|
|
|
# with that.
|
|
|
|
|
2006-07-07 19:26:31 +08:00
|
|
|
export NO_SVN_TESTS
|
2006-02-18 20:01:18 +08:00
|
|
|
|
2010-01-27 00:08:44 +08:00
|
|
|
### Testing rules
|
|
|
|
|
2007-04-29 06:32:49 +08:00
|
|
|
test: all
|
2005-07-29 23:50:24 +08:00
|
|
|
$(MAKE) -C t/ all
|
|
|
|
|
2012-02-17 18:25:09 +08:00
|
|
|
perf: all
|
|
|
|
$(MAKE) -C t/perf/ all
|
|
|
|
|
|
|
|
.PHONY: test perf
|
|
|
|
|
2009-01-17 23:50:13 +08:00
|
|
|
test-ctype$X: ctype.o
|
|
|
|
|
2007-05-31 07:18:24 +08:00
|
|
|
test-date$X: date.o ctype.o
|
2005-07-29 23:50:24 +08:00
|
|
|
|
2007-05-31 07:18:24 +08:00
|
|
|
test-delta$X: diff-delta.o patch-delta.o
|
2005-07-29 23:50:24 +08:00
|
|
|
|
2010-08-10 06:39:43 +08:00
|
|
|
test-line-buffer$X: vcs-svn/lib.a
|
|
|
|
|
2011-08-11 17:15:38 +08:00
|
|
|
test-parse-options$X: parse-options.o parse-options-cb.o
|
2007-11-14 07:16:36 +08:00
|
|
|
|
2010-08-10 06:55:00 +08:00
|
|
|
test-svn-fe$X: vcs-svn/lib.a
|
|
|
|
|
2010-01-26 23:45:54 +08:00
|
|
|
.PRECIOUS: $(TEST_OBJS)
|
2007-08-31 10:14:31 +08:00
|
|
|
|
2011-06-22 18:50:56 +08:00
|
|
|
test-%$X: test-%.o GIT-LDFLAGS $(GITLIBS)
|
2010-08-10 06:34:42 +08:00
|
|
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
|
2007-04-12 01:59:51 +08:00
|
|
|
|
2006-06-24 15:59:49 +08:00
|
|
|
check-sha1:: test-sha1$X
|
|
|
|
./test-sha1.sh
|
|
|
|
|
2011-04-22 03:14:42 +08:00
|
|
|
SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))
|
|
|
|
|
|
|
|
$(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
|
|
|
|
$(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \
|
|
|
|
$(SPARSE_FLAGS) $<
|
|
|
|
|
|
|
|
.PHONY: sparse $(SP_OBJ)
|
|
|
|
sparse: $(SP_OBJ)
|
|
|
|
|
2007-01-05 02:33:48 +08:00
|
|
|
check: common-cmds.h
|
2011-04-08 02:22:18 +08:00
|
|
|
@if sparse; \
|
2008-11-12 05:12:17 +08:00
|
|
|
then \
|
2011-04-22 03:14:42 +08:00
|
|
|
echo 2>&1 "Use 'make sparse' instead"; \
|
|
|
|
$(MAKE) --no-print-directory sparse; \
|
2008-11-12 05:12:17 +08:00
|
|
|
else \
|
|
|
|
echo 2>&1 "Did you mean 'make test'?"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2005-07-29 23:50:24 +08:00
|
|
|
|
Start deprecating "git-command" in favor of "git command"
I realize that a lot of people use the "git-xyzzy" format, and we have
various historical reasons for it, but I also think that most people have
long since started thinking of the git command as a single command with
various subcommands, and we've long had the documentation talk about it
that way.
Slowly migrating away from the git-xyzzy format would allow us to
eventually no longer install hundreds of binaries (even if most of them
are symlinks or hardlinks) in users $PATH, and the _original_ reasons for
it (implementation issues and bash completion) are really long long gone.
Using "git xyzzy" also has some fundamental advantages, like the ability
to specify things like paging ("git -p xyzzy") and making the whole notion
of aliases act like other git commands (which they already do, but they do
*not* have a "git-xyzzy" form!)
Anyway, while actually removing the "git-xyzzy" things is not practical
right now, we can certainly start slowly to deprecate it internally inside
git itself - in the shell scripts we use, and the test vectors.
This patch adds a "remove-dashes" makefile target, which does that. It
isn't particularly efficient or smart, but it *does* successfully rewrite
a lot of our shell scripts to use the "git xyzzy" form for all built-in
commands.
(For non-builtins, the "git xyzzy" format implies an extra execve(), so
this script leaves those alone).
So apply this patch, and then run
make remove-dashes
make test
git commit -a
to generate a much larger patch that actually starts this transformation.
(The only half-way subtle thing about this is that it also fixes up
git-filter-branch.sh for the new world order by adding quoting around
the use of "git-commit-tree" as an argument. It doesn't need it in that
format, but when changed into "git commit-tree" it is no longer a single
word, and the quoting maintains the old behaviour).
NOTE! This does not yet mean that you can actually stop installing the
"git-xyzzy" binaries for the builtins. There are some remaining places
that want to use the old form, this just removes the most obvious ones
that can easily be done automatically.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-01 02:49:17 +08:00
|
|
|
remove-dashes:
|
2008-07-11 08:12:06 +08:00
|
|
|
./fixup-builtins $(BUILT_INS) $(PROGRAMS) $(SCRIPTS)
|
2005-07-29 23:50:24 +08:00
|
|
|
|
|
|
|
### Installation rules
|
|
|
|
|
2009-02-05 16:04:17 +08:00
|
|
|
ifneq ($(filter /%,$(firstword $(template_dir))),)
|
2008-01-02 05:15:21 +08:00
|
|
|
template_instdir = $(template_dir)
|
2009-01-18 20:00:09 +08:00
|
|
|
else
|
|
|
|
template_instdir = $(prefix)/$(template_dir)
|
2008-01-02 05:15:21 +08:00
|
|
|
endif
|
|
|
|
export template_instdir
|
|
|
|
|
2009-02-05 16:04:17 +08:00
|
|
|
ifneq ($(filter /%,$(firstword $(gitexecdir))),)
|
2008-07-24 03:12:18 +08:00
|
|
|
gitexec_instdir = $(gitexecdir)
|
2009-01-18 20:00:09 +08:00
|
|
|
else
|
|
|
|
gitexec_instdir = $(prefix)/$(gitexecdir)
|
2008-07-24 03:12:18 +08:00
|
|
|
endif
|
|
|
|
gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir))
|
|
|
|
export gitexec_instdir
|
|
|
|
|
2011-08-18 15:23:46 +08:00
|
|
|
ifneq ($(filter /%,$(firstword $(mergetoolsdir))),)
|
|
|
|
mergetools_instdir = $(mergetoolsdir)
|
|
|
|
else
|
|
|
|
mergetools_instdir = $(prefix)/$(mergetoolsdir)
|
|
|
|
endif
|
|
|
|
mergetools_instdir_SQ = $(subst ','\'',$(mergetools_instdir))
|
|
|
|
|
2009-12-03 13:14:05 +08:00
|
|
|
install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X)
|
|
|
|
|
2005-11-22 07:44:15 +08:00
|
|
|
install: all
|
2007-12-02 01:05:40 +08:00
|
|
|
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
|
2008-07-24 03:12:18 +08:00
|
|
|
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
|
|
|
|
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
|
2010-02-01 03:46:53 +08:00
|
|
|
$(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
|
2009-12-03 13:14:05 +08:00
|
|
|
$(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'
|
2006-07-30 00:25:03 +08:00
|
|
|
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
|
2011-08-18 15:23:46 +08:00
|
|
|
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'
|
2011-10-09 17:17:07 +08:00
|
|
|
$(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
ifndef NO_GETTEXT
|
|
|
|
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)'
|
|
|
|
(cd po/build/locale && $(TAR) cf - .) | \
|
|
|
|
(cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xof -)
|
|
|
|
endif
|
2009-04-23 13:42:28 +08:00
|
|
|
ifndef NO_PERL
|
2007-12-10 17:31:02 +08:00
|
|
|
$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
|
2010-06-21 21:02:44 +08:00
|
|
|
$(MAKE) -C gitweb install
|
2009-04-23 13:42:28 +08:00
|
|
|
endif
|
2009-11-18 09:42:32 +08:00
|
|
|
ifndef NO_PYTHON
|
|
|
|
$(MAKE) -C git_remote_helpers prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
|
|
|
|
endif
|
2007-03-28 19:00:23 +08:00
|
|
|
ifndef NO_TCLTK
|
2007-11-18 02:51:16 +08:00
|
|
|
$(MAKE) -C gitk-git install
|
2008-07-24 03:12:18 +08:00
|
|
|
$(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
|
2007-03-28 19:00:23 +08:00
|
|
|
endif
|
2007-01-11 04:24:54 +08:00
|
|
|
ifneq (,$X)
|
2009-04-28 20:28:31 +08:00
|
|
|
$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
|
2007-01-11 04:24:54 +08:00
|
|
|
endif
|
2009-12-09 23:26:34 +08:00
|
|
|
|
2008-07-22 03:19:51 +08:00
|
|
|
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
|
2008-07-24 03:12:18 +08:00
|
|
|
execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
|
2009-07-11 11:17:33 +08:00
|
|
|
{ test "$$bindir/" = "$$execdir/" || \
|
2010-07-24 01:50:45 +08:00
|
|
|
for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
|
|
|
|
$(RM) "$$execdir/$$p" && \
|
2012-05-03 06:12:10 +08:00
|
|
|
test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
|
2010-07-24 01:50:45 +08:00
|
|
|
ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
|
|
|
|
cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
|
|
|
|
done; \
|
|
|
|
} && \
|
2010-07-24 01:50:44 +08:00
|
|
|
for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
|
|
|
|
$(RM) "$$bindir/$$p" && \
|
2012-05-03 06:12:10 +08:00
|
|
|
test -z "$(NO_INSTALL_HARDLINKS)" && \
|
2010-07-24 01:50:44 +08:00
|
|
|
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
|
|
|
|
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
|
|
|
|
cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
|
|
|
|
done && \
|
2010-07-03 02:50:28 +08:00
|
|
|
for p in $(BUILT_INS); do \
|
2009-01-20 09:44:03 +08:00
|
|
|
$(RM) "$$execdir/$$p" && \
|
2012-05-03 06:12:10 +08:00
|
|
|
test -z "$(NO_INSTALL_HARDLINKS)" && \
|
Makefile: install 'git' in execdir
When a git command executes a subcommand, it uses the "git
foo" form, which relies on finding "git" in the PATH.
Normally this should not be a problem, since the same "git"
that was used to invoke git in the first place will be
found. And if somebody invokes a "git" outside of the PATH
(e.g., by giving its absolute path), this case is already
covered: we put that absolute path onto the front of PATH.
However, if one is using "sudo", then sudo will execute the
"git" from the PATH, but pass along a restricted PATH that
may not contain the original "git" directory. In this case,
executing a subcommand will fail.
To solve this, we put the "git" wrapper itself into the
execdir; this directory is prepended to the PATH when git
starts, so the wrapper will always be found.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-09 14:37:35 +08:00
|
|
|
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
|
|
|
|
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
|
|
|
|
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
|
2010-07-03 02:50:28 +08:00
|
|
|
done && \
|
Makefile: work around ksh's failure to handle missing list argument to for loop
ksh does not like it when the list argument is missing in a 'for' loop.
This can happen when NO_CURL is set which causes REMOTE_CURL_ALIASES to be
unset. In this case, the 'for' loop in the Makefile is expanded to look
like this:
for p in ; do
and ksh complains like this:
/bin/ksh: syntax error at line 15 : `;' unexpected
The existing attempt to work around this issue, introduced by 70b89f87,
tried to protect the 'for' loop by first testing whether REMOTE_CURL_ALIASES
was empty, but this does not work since, as Johannes Sixt explains, "Before
the test for emptyness can happen, the complete statement must be parsed,
but ksh finds a syntax error in the statement and, therefore, cannot even
begin to execute the statement. (ksh doesn't follow POSIX in this regard,
where this would not be a syntax error.)".
Make's $(foreach) function could be used to avoid this shell glitch, but
since it has already caused a problem once before by generating a command
line that exceeded the maximum argument list length on IRIX, let's adopt
Bruce Stephens's suggestion for working around this issue in the same way
the OpenSSL folks have done it. This solution first assigns the contents
of the REMOTE_CURL_ALIASES make variable to a shell variable and then
supplies the shell variable as the list argument in the 'for' loop. This
satisfies ksh and has the expected behavior even if $(REMOTE_CURL_ALIASES)
is empty.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-07 05:56:51 +08:00
|
|
|
remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
|
|
|
|
for p in $$remote_curl_aliases; do \
|
2009-12-09 23:26:34 +08:00
|
|
|
$(RM) "$$execdir/$$p" && \
|
2012-05-03 06:12:10 +08:00
|
|
|
test -z "$(NO_INSTALL_HARDLINKS)" && \
|
2009-12-09 23:26:34 +08:00
|
|
|
ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
|
|
|
|
ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
|
|
|
|
cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \
|
Makefile: work around ksh's failure to handle missing list argument to for loop
ksh does not like it when the list argument is missing in a 'for' loop.
This can happen when NO_CURL is set which causes REMOTE_CURL_ALIASES to be
unset. In this case, the 'for' loop in the Makefile is expanded to look
like this:
for p in ; do
and ksh complains like this:
/bin/ksh: syntax error at line 15 : `;' unexpected
The existing attempt to work around this issue, introduced by 70b89f87,
tried to protect the 'for' loop by first testing whether REMOTE_CURL_ALIASES
was empty, but this does not work since, as Johannes Sixt explains, "Before
the test for emptyness can happen, the complete statement must be parsed,
but ksh finds a syntax error in the statement and, therefore, cannot even
begin to execute the statement. (ksh doesn't follow POSIX in this regard,
where this would not be a syntax error.)".
Make's $(foreach) function could be used to avoid this shell glitch, but
since it has already caused a problem once before by generating a command
line that exceeded the maximum argument list length on IRIX, let's adopt
Bruce Stephens's suggestion for working around this issue in the same way
the OpenSSL folks have done it. This solution first assigns the contents
of the REMOTE_CURL_ALIASES make variable to a shell variable and then
supplies the shell variable as the list argument in the 'for' loop. This
satisfies ksh and has the expected behavior even if $(REMOTE_CURL_ALIASES)
is empty.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-07 05:56:51 +08:00
|
|
|
done && \
|
2008-07-22 03:19:58 +08:00
|
|
|
./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
|
2005-07-29 23:50:24 +08:00
|
|
|
|
2010-05-02 04:36:15 +08:00
|
|
|
install-gitweb:
|
|
|
|
$(MAKE) -C gitweb install
|
|
|
|
|
2005-07-29 23:50:24 +08:00
|
|
|
install-doc:
|
|
|
|
$(MAKE) -C Documentation install
|
|
|
|
|
2008-11-03 01:53:03 +08:00
|
|
|
install-man:
|
|
|
|
$(MAKE) -C Documentation install-man
|
|
|
|
|
2008-06-10 16:34:25 +08:00
|
|
|
install-html:
|
|
|
|
$(MAKE) -C Documentation install-html
|
|
|
|
|
2007-08-06 18:22:57 +08:00
|
|
|
install-info:
|
|
|
|
$(MAKE) -C Documentation install-info
|
|
|
|
|
2008-12-11 06:44:50 +08:00
|
|
|
install-pdf:
|
|
|
|
$(MAKE) -C Documentation install-pdf
|
|
|
|
|
2006-12-24 00:26:09 +08:00
|
|
|
quick-install-doc:
|
|
|
|
$(MAKE) -C Documentation quick-install
|
2005-07-29 23:50:24 +08:00
|
|
|
|
2008-11-03 01:53:03 +08:00
|
|
|
quick-install-man:
|
|
|
|
$(MAKE) -C Documentation quick-install-man
|
|
|
|
|
2008-09-10 04:44:17 +08:00
|
|
|
quick-install-html:
|
|
|
|
$(MAKE) -C Documentation quick-install-html
|
|
|
|
|
2005-07-29 23:50:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
### Maintainer's dist rules
|
|
|
|
|
2012-06-21 02:32:22 +08:00
|
|
|
git.spec: git.spec.in GIT-VERSION-FILE
|
Don't write directly to a make target ($@).
Otherwise, if make is suspended, or killed with prejudice, or if the
system crashes, you could be left with an up-to-date, yet corrupt,
generated file.
I left off the `clean' addition, because I believe "make clean" should
not remove wildcard patterns like "*+", on the off-chance that someone
uses names like that for files they care about. Besides, in practice,
those temporary files are left behind so rarely that they're not a bother,
and they're removed again as part of the next build.
[jc: sign-off?]
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-26 00:52:01 +08:00
|
|
|
sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+
|
|
|
|
mv $@+ $@
|
2005-07-08 04:09:50 +08:00
|
|
|
|
2005-11-17 13:32:44 +08:00
|
|
|
GIT_TARNAME=git-$(GIT_VERSION)
|
2008-02-24 13:38:04 +08:00
|
|
|
dist: git.spec git-archive$(X) configure
|
2006-10-05 17:26:12 +08:00
|
|
|
./git-archive --format=tar \
|
|
|
|
--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
|
2005-07-08 04:09:50 +08:00
|
|
|
@mkdir -p $(GIT_TARNAME)
|
2007-06-19 05:30:36 +08:00
|
|
|
@cp git.spec configure $(GIT_TARNAME)
|
2006-01-10 10:07:01 +08:00
|
|
|
@echo $(GIT_VERSION) > $(GIT_TARNAME)/version
|
2007-02-13 07:20:34 +08:00
|
|
|
@$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version
|
2006-01-10 10:07:01 +08:00
|
|
|
$(TAR) rf $(GIT_TARNAME).tar \
|
2007-02-13 07:20:34 +08:00
|
|
|
$(GIT_TARNAME)/git.spec \
|
2007-06-19 05:30:36 +08:00
|
|
|
$(GIT_TARNAME)/configure \
|
2007-02-13 07:20:34 +08:00
|
|
|
$(GIT_TARNAME)/version \
|
2007-03-13 01:40:31 +08:00
|
|
|
$(GIT_TARNAME)/git-gui/version
|
2007-07-15 01:51:44 +08:00
|
|
|
@$(RM) -r $(GIT_TARNAME)
|
2005-07-15 09:20:50 +08:00
|
|
|
gzip -f -9 $(GIT_TARNAME).tar
|
2005-07-08 04:09:50 +08:00
|
|
|
|
|
|
|
rpm: dist
|
2009-11-12 05:59:52 +08:00
|
|
|
$(RPMBUILD) \
|
|
|
|
--define "_source_filedigest_algorithm md5" \
|
|
|
|
--define "_binary_filedigest_algorithm md5" \
|
|
|
|
-ta $(GIT_TARNAME).tar.gz
|
2005-07-08 04:09:50 +08:00
|
|
|
|
2006-05-18 18:57:04 +08:00
|
|
|
htmldocs = git-htmldocs-$(GIT_VERSION)
|
|
|
|
manpages = git-manpages-$(GIT_VERSION)
|
|
|
|
dist-doc:
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) -r .doc-tmp-dir
|
2006-05-18 18:57:04 +08:00
|
|
|
mkdir .doc-tmp-dir
|
|
|
|
$(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
|
|
|
|
cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .
|
|
|
|
gzip -n -9 -f $(htmldocs).tar
|
|
|
|
:
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) -r .doc-tmp-dir
|
2007-04-20 11:47:04 +08:00
|
|
|
mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7
|
2006-05-25 20:37:46 +08:00
|
|
|
$(MAKE) -C Documentation DESTDIR=./ \
|
2006-06-30 05:26:54 +08:00
|
|
|
man1dir=../.doc-tmp-dir/man1 \
|
2007-04-20 11:47:04 +08:00
|
|
|
man5dir=../.doc-tmp-dir/man5 \
|
2006-06-30 05:26:54 +08:00
|
|
|
man7dir=../.doc-tmp-dir/man7 \
|
2006-05-18 18:57:04 +08:00
|
|
|
install
|
|
|
|
cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .
|
|
|
|
gzip -n -9 -f $(manpages).tar
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) -r .doc-tmp-dir
|
2006-05-18 18:57:04 +08:00
|
|
|
|
2005-07-29 23:50:24 +08:00
|
|
|
### Cleaning rules
|
2005-07-15 09:21:57 +08:00
|
|
|
|
2007-10-05 05:49:19 +08:00
|
|
|
distclean: clean
|
|
|
|
$(RM) configure
|
2012-07-19 15:50:01 +08:00
|
|
|
$(RM) config.log config.status config.cache
|
|
|
|
$(RM) config.mak.autogen config.mak.append
|
|
|
|
$(RM) -r autom4te.cache
|
2007-10-05 05:49:19 +08:00
|
|
|
|
2012-02-06 14:00:17 +08:00
|
|
|
profile-clean:
|
|
|
|
$(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
|
|
|
|
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
|
|
|
|
|
|
|
|
clean: profile-clean
|
2010-08-13 05:30:47 +08:00
|
|
|
$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
|
|
|
|
builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
|
2010-02-01 03:46:53 +08:00
|
|
|
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) $(TEST_PROGRAMS)
|
2009-12-03 13:14:05 +08:00
|
|
|
$(RM) -r bin-wrappers
|
2010-01-26 23:52:49 +08:00
|
|
|
$(RM) -r $(dep_dirs)
|
i18n: add infrastructure for translating Git with gettext
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.
This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.
This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.
The rest of the commit message goes into detail about various
sub-parts of this commit.
= Installation
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.
= Perl
Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
a further elaboration on this topic.
= Shell
Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
= About libcharset.h and langinfo.h
We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
=Credits
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.
[jc: squashed a small Makefile fix from Ramsay]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-18 07:14:42 +08:00
|
|
|
$(RM) -r po/build/
|
2010-09-29 05:08:38 +08:00
|
|
|
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope*
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
|
|
|
|
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
|
|
|
|
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
|
2005-05-23 02:27:28 +08:00
|
|
|
$(MAKE) -C Documentation/ clean
|
2009-04-04 03:32:20 +08:00
|
|
|
ifndef NO_PERL
|
2010-05-09 01:36:15 +08:00
|
|
|
$(MAKE) -C gitweb clean
|
2006-12-04 17:50:04 +08:00
|
|
|
$(MAKE) -C perl clean
|
2009-11-18 09:42:32 +08:00
|
|
|
endif
|
|
|
|
ifndef NO_PYTHON
|
|
|
|
$(MAKE) -C git_remote_helpers clean
|
2009-04-04 03:32:20 +08:00
|
|
|
endif
|
Introduce Git.pm (v4)
This patch introduces a very basic and barebone Git.pm module
with a sketch of how the generic interface would look like;
most functions are missing, but this should give some good base.
I will continue expanding it.
Most desirable now is more careful error reporting, generic_in() for feeding
input to Git commands and the repository() constructor doing some poking
with git-rev-parse to get the git directory and subdirectory prefix.
Those three are basically the prerequisities for converting git-mv.
I will send them as follow-ups to this patch.
Currently Git.pm just wraps up exec()s of Git commands, but even that
is not trivial to get right and various Git perl scripts do it in
various inconsistent ways. In addition to Git.pm, there is now also
Git.xs which provides barebone Git.xs for directly interfacing with
libgit.a, and as an example providing the hash_object() function using
libgit.
This adds the Git module, integrates it to the build system and as
an example converts the git-fmt-merge-msg.perl script to it (the result
is not very impressive since its advantage is not quite apparent in this
one, but I just picked up the simplest Git user around).
Compared to v3, only very minor things were fixed in this patch (some
whitespaces, a missing export, tiny bug in git-fmt-merge-msg.perl);
at first I wanted to post them as a separate patch but since this
is still only in pu, I decided that it will be cleaner to just resend
the patch.
My current working state is available all the time at
http://pasky.or.cz/~xpasky/git-perl/Git.pm
and an irregularily updated API documentation is at
http://pasky.or.cz/~xpasky/git-perl/Git.html
Many thanks to Jakub Narebski, Junio and others for their feedback.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-24 10:34:29 +08:00
|
|
|
$(MAKE) -C templates/ clean
|
2005-08-03 08:24:11 +08:00
|
|
|
$(MAKE) -C t/ clean
|
2007-03-28 19:00:23 +08:00
|
|
|
ifndef NO_TCLTK
|
2007-11-18 02:51:16 +08:00
|
|
|
$(MAKE) -C gitk-git clean
|
2007-03-28 19:00:23 +08:00
|
|
|
$(MAKE) -C git-gui clean
|
|
|
|
endif
|
2011-06-22 18:50:56 +08:00
|
|
|
$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
|
2012-06-21 02:32:16 +08:00
|
|
|
$(RM) GIT-USER-AGENT GIT-PREFIX GIT-SCRIPT-DEFINES
|
2005-12-28 06:40:17 +08:00
|
|
|
|
2012-02-06 14:00:17 +08:00
|
|
|
.PHONY: all install profile-clean clean strip
|
2008-08-08 03:06:26 +08:00
|
|
|
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
|
2010-09-29 05:08:38 +08:00
|
|
|
.PHONY: FORCE cscope
|
2005-12-20 09:59:58 +08:00
|
|
|
|
2006-04-13 15:17:19 +08:00
|
|
|
### Check documentation
|
|
|
|
#
|
|
|
|
check-docs::
|
2010-02-01 03:46:53 +08:00
|
|
|
@(for v in $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git gitk; \
|
2006-04-13 15:17:19 +08:00
|
|
|
do \
|
|
|
|
case "$$v" in \
|
|
|
|
git-merge-octopus | git-merge-ours | git-merge-recursive | \
|
2008-07-05 22:43:51 +08:00
|
|
|
git-merge-resolve | git-merge-subtree | \
|
2008-01-18 14:52:40 +08:00
|
|
|
git-fsck-objects | git-init-db | \
|
2010-03-11 07:31:34 +08:00
|
|
|
git-remote-* | git-stage | \
|
2007-12-15 14:02:57 +08:00
|
|
|
git-?*--?* ) continue ;; \
|
2006-04-13 15:17:19 +08:00
|
|
|
esac ; \
|
|
|
|
test -f "Documentation/$$v.txt" || \
|
|
|
|
echo "no doc: $$v"; \
|
2007-12-02 15:39:19 +08:00
|
|
|
sed -e '/^#/d' command-list.txt | \
|
2007-02-14 14:45:22 +08:00
|
|
|
grep -q "^$$v[ ]" || \
|
2006-04-13 15:17:19 +08:00
|
|
|
case "$$v" in \
|
|
|
|
git) ;; \
|
|
|
|
*) echo "no link: $$v";; \
|
|
|
|
esac ; \
|
2007-11-09 10:38:27 +08:00
|
|
|
done; \
|
|
|
|
( \
|
2007-12-02 15:39:19 +08:00
|
|
|
sed -e '/^#/d' \
|
2007-11-09 10:38:27 +08:00
|
|
|
-e 's/[ ].*//' \
|
2007-12-02 15:39:19 +08:00
|
|
|
-e 's/^/listed /' command-list.txt; \
|
2007-11-09 10:38:27 +08:00
|
|
|
ls -1 Documentation/git*txt | \
|
|
|
|
sed -e 's|Documentation/|documented |' \
|
|
|
|
-e 's/\.txt//'; \
|
|
|
|
) | while read how cmd; \
|
|
|
|
do \
|
|
|
|
case "$$how,$$cmd" in \
|
|
|
|
*,git-citool | \
|
|
|
|
*,git-gui | \
|
2007-12-04 13:44:29 +08:00
|
|
|
*,git-help | \
|
2007-11-09 10:38:27 +08:00
|
|
|
documented,gitattributes | \
|
|
|
|
documented,gitignore | \
|
|
|
|
documented,gitmodules | \
|
2007-12-13 18:20:01 +08:00
|
|
|
documented,gitcli | \
|
2007-11-09 10:38:27 +08:00
|
|
|
documented,git-tools | \
|
2008-06-16 04:43:32 +08:00
|
|
|
documented,gitcore-tutorial | \
|
|
|
|
documented,gitcvs-migration | \
|
|
|
|
documented,gitdiffcore | \
|
|
|
|
documented,gitglossary | \
|
|
|
|
documented,githooks | \
|
|
|
|
documented,gitrepository-layout | \
|
2010-07-26 16:40:58 +08:00
|
|
|
documented,gitrevisions | \
|
2008-06-16 04:43:32 +08:00
|
|
|
documented,gittutorial | \
|
|
|
|
documented,gittutorial-2 | \
|
2010-02-01 03:46:53 +08:00
|
|
|
documented,git-bisect-lk2009 | \
|
2010-03-11 07:31:34 +08:00
|
|
|
documented,git-remote-helpers | \
|
2010-02-01 03:46:53 +08:00
|
|
|
documented,gitworkflows | \
|
2007-11-09 10:38:27 +08:00
|
|
|
sentinel,not,matching,is,ok ) continue ;; \
|
|
|
|
esac; \
|
2010-02-01 03:46:53 +08:00
|
|
|
case " $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git gitk " in \
|
2007-11-09 10:38:27 +08:00
|
|
|
*" $$cmd "*) ;; \
|
|
|
|
*) echo "removed but $$how: $$cmd" ;; \
|
|
|
|
esac; \
|
|
|
|
done ) | sort
|
2006-11-06 03:26:21 +08:00
|
|
|
|
|
|
|
### Make sure built-ins do not have dups and listed in git.c
|
|
|
|
#
|
|
|
|
check-builtins::
|
|
|
|
./check-builtins.sh
|
2008-01-15 07:10:38 +08:00
|
|
|
|
2009-02-19 19:13:35 +08:00
|
|
|
### Test suite coverage testing
|
|
|
|
#
|
|
|
|
.PHONY: coverage coverage-clean coverage-build coverage-report
|
|
|
|
|
|
|
|
coverage:
|
|
|
|
$(MAKE) coverage-build
|
|
|
|
$(MAKE) coverage-report
|
|
|
|
|
2010-07-26 03:52:40 +08:00
|
|
|
object_dirs := $(sort $(dir $(OBJECTS)))
|
2009-02-19 19:13:35 +08:00
|
|
|
coverage-clean:
|
2010-07-26 03:52:40 +08:00
|
|
|
$(RM) $(addsuffix *.gcov,$(object_dirs))
|
|
|
|
$(RM) $(addsuffix *.gcda,$(object_dirs))
|
|
|
|
$(RM) $(addsuffix *.gcno,$(object_dirs))
|
|
|
|
$(RM) coverage-untested-functions
|
2010-07-26 03:52:42 +08:00
|
|
|
$(RM) -r cover_db/
|
2010-07-26 03:52:43 +08:00
|
|
|
$(RM) -r cover_db_html/
|
2009-02-19 19:13:35 +08:00
|
|
|
|
|
|
|
COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
|
|
|
|
COVERAGE_LDFLAGS = $(CFLAGS) -O0 -lgcov
|
2010-07-26 03:52:40 +08:00
|
|
|
GCOVFLAGS = --preserve-paths --branch-probabilities --all-blocks
|
2009-02-19 19:13:35 +08:00
|
|
|
|
|
|
|
coverage-build: coverage-clean
|
|
|
|
$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all
|
|
|
|
$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
|
|
|
|
-j1 test
|
|
|
|
|
|
|
|
coverage-report:
|
2010-07-26 03:52:40 +08:00
|
|
|
$(QUIET_GCOV)for dir in $(object_dirs); do \
|
2010-07-26 15:43:41 +08:00
|
|
|
$(GCOV) $(GCOVFLAGS) --object-directory=$$dir $$dir*.c || exit; \
|
2010-07-26 03:52:40 +08:00
|
|
|
done
|
2010-07-26 03:52:41 +08:00
|
|
|
|
|
|
|
coverage-untested-functions: coverage-report
|
2009-02-19 19:13:35 +08:00
|
|
|
grep '^function.*called 0 ' *.c.gcov \
|
|
|
|
| sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \
|
2010-07-26 03:52:40 +08:00
|
|
|
> coverage-untested-functions
|
2010-07-26 03:52:42 +08:00
|
|
|
|
|
|
|
cover_db: coverage-report
|
|
|
|
gcov2perl -db cover_db *.gcov
|
2010-07-26 03:52:43 +08:00
|
|
|
|
|
|
|
cover_db_html: cover_db
|
|
|
|
cover -report html -outputdir cover_db_html cover_db
|
2011-06-19 09:07:05 +08:00
|
|
|
|