From: Junio C Hamano Date: Thu, 26 May 2011 16:42:12 +0000 (-0700) Subject: Merge branch 'kk/maint-prefix-in-config-mak' into maint X-Git-Tag: v1.7.5.3~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/05318994e7fcb6a652a8329bf7ba7f8d6696ee3c?hp=-c Merge branch 'kk/maint-prefix-in-config-mak' into maint * kk/maint-prefix-in-config-mak: Honor $(prefix) set in config.mak* when defining ETC_GIT* Revert "Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir" Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir --- 05318994e7fcb6a652a8329bf7ba7f8d6696ee3c diff --combined Makefile index d0c577b1b3,95c0d51606..d2e2ea1c4f --- a/Makefile +++ b/Makefile @@@ -45,6 -45,11 +45,6 @@@ all: # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks # d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7). # -# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) -# do not support the 'size specifiers' introduced by C99, namely ll, hh, -# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). -# some C compilers supported these specifiers prior to C99 as an extension. -# # Define NO_STRCASESTR if you don't have strcasestr. # # Define NO_MEMMEM if you don't have memmem. @@@ -211,11 -216,6 +211,11 @@@ # # Define NO_REGEX if you have no or inferior regex support in your C library. # +# Define GETTEXT_POISON if you are debugging the choice of strings marked +# 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. +# # Define JSMIN to point to JavaScript minifier that functions as # a filter to have gitweb.js minified. # @@@ -274,8 -274,7 +274,7 @@@ STRIP ?= stri # mandir # infodir # htmldir - # ETC_GITCONFIG (but not sysconfdir) - # ETC_GITATTRIBUTES + # sysconfdir # can be specified as a relative path some/where/else; # this is interpreted as relative to $(prefix) and "git" at # runtime figures out where they are based on the path to the executable. @@@ -291,15 -290,8 +290,8 @@@ sharedir = $(prefix)/shar gitwebdir = $(sharedir)/gitweb template_dir = share/git-core/templates htmldir = share/doc/git-doc - ifeq ($(prefix),/usr) - sysconfdir = /etc ETC_GITCONFIG = $(sysconfdir)/gitconfig ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes - else - sysconfdir = $(prefix)/etc - ETC_GITCONFIG = etc/gitconfig - ETC_GITATTRIBUTES = etc/gitattributes - endif lib = lib # DESTDIR= pathsep = : @@@ -316,7 -308,6 +308,7 @@@ INSTALL = instal RPMBUILD = rpmbuild TCL_PATH = tclsh TCLTK_PATH = wish +XGETTEXT = xgettext PTHREAD_LIBS = -lpthread PTHREAD_CFLAGS = GCOV = gcov @@@ -516,7 -507,6 +508,7 @@@ LIB_H += diff. LIB_H += dir.h LIB_H += exec_cmd.h LIB_H += fsck.h +LIB_H += gettext.h LIB_H += git-compat-util.h LIB_H += graph.h LIB_H += grep.h @@@ -873,6 -863,7 +865,6 @@@ ifeq ($(uname_S),SunOS NO_UNSETENV = YesPlease NO_SETENV = YesPlease NO_STRLCPY = YesPlease - NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease GIT_TEST_CMP = cmp endif @@@ -883,18 -874,21 +875,18 @@@ NO_UNSETENV = YesPlease NO_SETENV = YesPlease NO_STRLCPY = YesPlease - NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease GIT_TEST_CMP = cmp endif ifeq ($(uname_R),5.8) NO_UNSETENV = YesPlease NO_SETENV = YesPlease - NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease GIT_TEST_CMP = cmp endif ifeq ($(uname_R),5.9) NO_UNSETENV = YesPlease NO_SETENV = YesPlease - NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease GIT_TEST_CMP = cmp endif @@@ -1074,6 -1068,7 +1066,6 @@@ ifeq ($(uname_S),Windows NO_MEMMEM = YesPlease # NEEDS_LIBICONV = YesPlease NO_ICONV = YesPlease - NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease NO_STRTOULL = YesPlease NO_MKDTEMP = YesPlease @@@ -1150,6 -1145,7 +1142,6 @@@ ifneq (,$(findstring MINGW,$(uname_S)) NO_MEMMEM = YesPlease NEEDS_LIBICONV = YesPlease OLD_ICONV = YesPlease - NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease NO_MKDTEMP = YesPlease NO_MKSTEMPS = YesPlease @@@ -1192,6 -1188,14 +1184,14 @@@ endi -include config.mak.autogen -include config.mak + ifndef sysconfdir + ifeq ($(prefix),/usr) + sysconfdir = /etc + else + sysconfdir = etc + endif + endif + ifdef CHECK_HEADER_DEPENDENCIES COMPUTE_HEADER_DEPENDENCIES = USE_COMPUTED_HEADER_DEPENDENCIES = @@@ -1352,6 -1356,9 +1352,6 @@@ endi ifdef NO_NSEC BASIC_CFLAGS += -DNO_NSEC endif -ifdef NO_C99_FORMAT - BASIC_CFLAGS += -DNO_C99_FORMAT -endif ifdef SNPRINTF_RETURNS_BOGUS COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS COMPAT_OBJS += compat/snprintf.o @@@ -1363,10 -1370,6 +1363,10 @@@ endi ifdef NO_SYMLINK_HEAD BASIC_CFLAGS += -DNO_SYMLINK_HEAD endif +ifdef GETTEXT_POISON + LIB_OBJS += gettext.o + BASIC_CFLAGS += -DGETTEXT_POISON +endif ifdef NO_STRCASESTR COMPAT_CFLAGS += -DNO_STRCASESTR COMPAT_OBJS += compat/strcasestr.o @@@ -1578,7 -1581,6 +1578,7 @@@ ifndef QUIET_BUILT_IN = @echo ' ' BUILTIN $@; QUIET_GEN = @echo ' ' GEN $@; QUIET_LNCP = @echo ' ' LN/CP $@; + QUIET_XGETTEXT = @echo ' ' XGETTEXT $@; QUIET_GCOV = @echo ' ' GCOV $@; QUIET_SUBDIR0 = +@subdir= QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ @@@ -1747,7 -1749,33 +1747,7 @@@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % gitweb: $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all -ifdef JSMIN -GITWEB_PROGRAMS += gitweb/static/gitweb.min.js -GITWEB_JS = gitweb/static/gitweb.min.js -else -GITWEB_JS = gitweb/static/gitweb.js -endif -ifdef CSSMIN -GITWEB_PROGRAMS += gitweb/static/gitweb.min.css -GITWEB_CSS = gitweb/static/gitweb.min.css -else -GITWEB_CSS = gitweb/static/gitweb.css -endif -OTHER_PROGRAMS += gitweb/gitweb.cgi $(GITWEB_PROGRAMS) -gitweb/gitweb.cgi: gitweb/gitweb.perl $(GITWEB_PROGRAMS) - $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@) - -ifdef JSMIN -gitweb/static/gitweb.min.js: gitweb/static/gitweb.js - $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@) -endif # JSMIN -ifdef CSSMIN -gitweb/static/gitweb.min.css: gitweb/static/gitweb.css - $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@) -endif # CSSMIN - - -git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/static/gitweb.css gitweb/static/gitweb.js +git-instaweb: git-instaweb.sh gitweb $(QUIET_GEN)$(RM) $@ $@+ && \ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ @@@ -2020,21 -2048,6 +2020,21 @@@ info pdf: $(MAKE) -C Documentation pdf +XGETTEXT_FLAGS = \ + --force-po \ + --add-comments \ + --msgid-bugs-address="Git Mailing List " \ + --from-code=UTF-8 +XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \ + --keyword=_ --keyword=N_ --keyword="Q_:1,2" +LOCALIZED_C := $(C_OBJ:o=c) + +po/git.pot: $(LOCALIZED_C) + $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \ + mv $@+ $@ + +pot: po/git.pot + $(ETAGS_TARGET): FORCE $(RM) $(ETAGS_TARGET) $(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET) @@@ -2076,7 -2089,6 +2076,7 @@@ endi ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@ endif + @echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@ ### Detect Tck/Tk interpreter path changes ifndef NO_TCLTK @@@ -2137,7 -2149,7 +2137,7 @@@ check-sha1:: test-sha1$ check: common-cmds.h if sparse; \ then \ - for i in *.c; \ + for i in $(patsubst %.o, %.c, $(GIT_OBJS)); \ do \ sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \ done; \ @@@ -2302,7 -2314,6 +2302,7 @@@ dist-doc distclean: clean $(RM) configure + $(RM) po/git.pot clean: $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \