diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-14 12:57:18 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-14 12:57:18 -0800 |
commit | 15c540fde9a72445c3ccfb6d81ce94ccf70b0016 (patch) | |
tree | 0f36ca58e4b721f36cdbc443cef69b7441e765fa | |
parent | d31f3785dcc10459540e2e185b6e25363f719256 (diff) | |
parent | b5225286b226759262c0637058528af03226fba6 (diff) | |
download | git-15c540fde9a72445c3ccfb6d81ce94ccf70b0016.tar.gz |
Merge branch 'dp/i18n-libcharset'
* dp/i18n-libcharset:
Makefile: introduce CHARSET_LIB to link with -lcharset
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | config.mak.in | 1 | ||||
-rw-r--r-- | configure.ac | 10 |
3 files changed, 16 insertions, 0 deletions
@@ -56,6 +56,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. # @@ -1701,6 +1705,7 @@ endif ifdef HAVE_LIBCHARSET_H BASIC_CFLAGS += -DHAVE_LIBCHARSET_H + EXTLIBS += $(CHARSET_LIB) endif ifdef HAVE_DEV_TTY diff --git a/config.mak.in b/config.mak.in index 10698c8292..b2ba7104eb 100644 --- a/config.mak.in +++ b/config.mak.in @@ -74,3 +74,4 @@ SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@ NO_PTHREADS=@NO_PTHREADS@ PTHREAD_CFLAGS=@PTHREAD_CFLAGS@ PTHREAD_LIBS=@PTHREAD_LIBS@ +CHARSET_LIB=@CHARSET_LIB@ diff --git a/configure.ac b/configure.ac index 630dbdd19d..24190de616 100644 --- a/configure.ac +++ b/configure.ac @@ -836,6 +836,16 @@ AC_CHECK_HEADER([libcharset.h], [HAVE_LIBCHARSET_H=YesPlease], [HAVE_LIBCHARSET_H=]) AC_SUBST(HAVE_LIBCHARSET_H) +# Define CHARSET_LIB if libiconv does not export the locale_charset symbol +# and libcharset does +CHARSET_LIB= +AC_CHECK_LIB([iconv], [locale_charset], + [], + [AC_CHECK_LIB([charset], [locale_charset], + [CHARSET_LIB=-lcharset]) + ] +) +AC_SUBST(CHARSET_LIB) # # Define NO_STRCASESTR if you don't have strcasestr. GIT_CHECK_FUNC(strcasestr, |