summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorДилян Палаузов <dilyan.palauzov@aegee.org>2012-02-12 17:23:36 +0100
committerJunio C Hamano <gitster@pobox.com>2012-02-13 00:11:01 -0800
commitb5225286b226759262c0637058528af03226fba6 (patch)
tree527324aee510bb76384c1e7684951c8ba91e43c8 /configure.ac
parent828ea97de486c1693d6e4f2c7347acb50235a85d (diff)
downloadgit-b5225286b226759262c0637058528af03226fba6.tar.gz
Makefile: introduce CHARSET_LIB to link with -lcharsetdp/i18n-libcharset
On some systems, the function locale_charset() may not be exported from libiconv but is available from libcharset, and we need -lcharset when linking. Introduce a make variable CHARSET_LIB that can be set to -lcharsetlib on such systems. Also autodetect this in the configure script by first looking for the symbol in libiconv, and then libcharset. Signed-off-by: Дилян Палаузов <dilyan.palauzov@aegee.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 10 insertions, 0 deletions
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,