summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 828ea97)
raw | patch | inline | side by side (parent: 828ea97)
author | Дилян Палаузов <dilyan.palauzov@aegee.org> | |
Sun, 12 Feb 2012 16:23:36 +0000 (17:23 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 13 Feb 2012 08:11:01 +0000 (00:11 -0800) |
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>
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>
Makefile | patch | blob | history | |
config.mak.in | patch | blob | history | |
configure.ac | patch | blob | history |
diff --git a/Makefile b/Makefile
index a782409306df85985e1f465eab4bd3cd7fa2cc83..3b2b804fa3567ade9be49f84cee68591fd4f4d00 100644 (file)
--- a/Makefile
+++ b/Makefile
# 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.
#
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 10698c8292e639fc5adc4492a4bcac0c82c403bc..b2ba7104ebc87c0f2fe261f16461793fcc8b8cd3 100644 (file)
--- a/config.mak.in
+++ b/config.mak.in
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 630dbdd19d74fc6ffab529d8d5854043a8f18fd2..24190de616eae048fbd24839259fc8f160c52d21 100644 (file)
--- a/configure.ac
+++ b/configure.ac
[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,