Merge branch 'dp/i18n-libcharset' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 21 Feb 2012 22:57:14 +0000 (14:57 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Feb 2012 22:57:14 +0000 (14:57 -0800)
* dp/i18n-libcharset:
Makefile: introduce CHARSET_LIB to link with -lcharset

1  2 
Makefile
diff --combined Makefile
index 3815f66c41525df04005f3ad00e6175fc235cc64,3b2b804fa3567ade9be49f84cee68591fd4f4d00..99a7a2b972502411a3dae5e05f6cbcf35a1720c6
+++ b/Makefile
@@@ -53,6 -53,10 +53,10 @@@ all:
  # FreeBSD can use either, but MinGW and some others need to use
  # libcharset.h's locale_charset() instead.
  #
+ # 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
+ #
  # Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't
  # need -lintl when linking.
  #
@@@ -339,7 -343,7 +343,7 @@@ pathsep = 
  
  export prefix bindir sharedir sysconfdir gitwebdir localedir
  
 -CC = gcc
 +CC = cc
  AR = ar
  RM = rm -f
  DIFF = diff
@@@ -452,9 -456,6 +456,9 @@@ PROGRAM_OBJS += http-backend.
  PROGRAM_OBJS += sh-i18n--envsubst.o
  PROGRAM_OBJS += credential-store.o
  
 +# Binary suffix, set to .exe for Windows builds
 +X =
 +
  PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
  
  TEST_PROGRAMS_NEED_X += test-chmtime
@@@ -1695,6 -1696,7 +1699,7 @@@ endi
  
  ifdef HAVE_LIBCHARSET_H
        BASIC_CFLAGS += -DHAVE_LIBCHARSET_H
+       EXTLIBS += $(CHARSET_LIB)
  endif
  
  ifdef HAVE_DEV_TTY
@@@ -1771,26 -1773,6 +1776,26 @@@ ifdef ASCIIDOC
        export ASCIIDOC7
  endif
  
 +### profile feedback build
 +#
 +
 +# Can adjust this to be a global directory if you want to do extended
 +# data gathering
 +PROFILE_DIR := $(CURDIR)
 +
 +ifeq ("$(PROFILE)","GEN")
 +      CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1
 +      EXTLIBS += -lgcov
 +      export CCACHE_DISABLE=t
 +      V=1
 +else
 +ifneq ("$(PROFILE)","")
 +      CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1
 +      export CCACHE_DISABLE=t
 +      V=1
 +endif
 +endif
 +
  # Shell quote (do not use $(call) to accommodate ancient setups);
  
  SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
@@@ -1847,17 -1829,7 +1852,17 @@@ export DIFF TAR INSTALL DESTDIR SHELL_P
  
  SHELL = $(SHELL_PATH)
  
 -all:: shell_compatibility_test $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
 +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
  ifneq (,$X)
        $(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';)
  endif
@@@ -2585,11 -2557,7 +2590,11 @@@ distclean: clea
        $(RM) configure
        $(RM) po/git.pot
  
 -clean:
 +profile-clean:
 +      $(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
 +      $(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
 +
 +clean: profile-clean
        $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
                builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
        $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
@@@ -2619,7 -2587,7 +2624,7 @@@ ifndef NO_TCLT
  endif
        $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
  
 -.PHONY: all install clean strip
 +.PHONY: all install profile-clean clean strip
  .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
  .PHONY: FORCE cscope
  
@@@ -2729,3 -2697,18 +2734,3 @@@ cover_db: coverage-repor
  cover_db_html: cover_db
        cover -report html -outputdir cover_db_html cover_db
  
 -### profile feedback build
 -#
 -.PHONY: profile-all profile-clean
 -
 -PROFILE_GEN_CFLAGS := $(CFLAGS) -fprofile-generate -DNO_NORETURN=1
 -PROFILE_USE_CFLAGS := $(CFLAGS) -fprofile-use -fprofile-correction -DNO_NORETURN=1
 -
 -profile-clean:
 -      $(RM) $(addsuffix *.gcda,$(object_dirs))
 -      $(RM) $(addsuffix *.gcno,$(object_dirs))
 -
 -profile-all: profile-clean
 -      $(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" all
 -      $(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" -j1 test
 -      $(MAKE) CFLAGS="$(PROFILE_USE_CFLAGS)" all