configure.ac: link with -liconv for locale_charset()
authorDmitry Marakasov <amdmi3@amdmi3.ru>
Tue, 11 Mar 2014 18:35:29 +0000 (22:35 +0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Mar 2014 20:33:15 +0000 (13:33 -0700)
On e.g. FreeBSD 10.x, the following situation is common:
- there's iconv implementation in libc, which has no locale_charset()
function
- there's GNU libiconv installed from Ports Collection

Git build process
- detects that iconv is in libc and thus -liconv is not needed for it
- detects locale_charset in -liconv, but for some reason doesn't add it
to CHARSET_LIB (as it would do with -lcharset if locale_charset() was
found there instead of -liconv)
- git doesn't build due to unresolved external locale_charset()

Fix this by adding -liconv to CHARSET_LIB if locale_charset() is
detected in this library.

Signed-off-by: Dmitry Marakasov <amdmi3@amdmi3.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
configure.ac
index 2f433939dc9d9001c7ace83bfeadf567eb90c30c..3f5c644afd2168e010f2333fd93e42fc37bffa67 100644 (file)
@@ -890,7 +890,7 @@ GIT_CONF_SUBST([HAVE_STRINGS_H])
 # and libcharset does
 CHARSET_LIB=
 AC_CHECK_LIB([iconv], [locale_charset],
-       [],
+       [CHARSET_LIB=-liconv],
        [AC_CHECK_LIB([charset], [locale_charset],
                      [CHARSET_LIB=-lcharset])])
 GIT_CONF_SUBST([CHARSET_LIB])