Makefile: introduce CHARSET_LIB to link with -lcharset
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>
This commit is contained in:

committed by
Junio C Hamano

parent
828ea97de4
commit
b5225286b2
10
configure.ac
10
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,
|
||||
|
Reference in New Issue
Block a user