summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2018-06-15 02:25:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-15 19:50:45 (GMT)
commitfdb1fbbc7d313253ca9fac5b0be3d0573dcb5419 (patch)
tree12805316fc3adbccc23b14515f4c97509b4782e3 /Makefile
parenta42a58d7b62cc1d6301440e81a83feed9d7c118c (diff)
downloadgit-fdb1fbbc7d313253ca9fac5b0be3d0573dcb5419.zip
git-fdb1fbbc7d313253ca9fac5b0be3d0573dcb5419.tar.gz
git-fdb1fbbc7d313253ca9fac5b0be3d0573dcb5419.tar.bz2
Makefile: make NO_ICONV really mean "no iconv"
The Makefile tweak NO_ICONV is meant to allow Git to be built without iconv in case iconv is not installed or is otherwise dysfunctional. However, NO_ICONV's disabling of iconv is incomplete and can incorrectly allow "-liconv" to slip into the linker flags when NEEDS_LIBICONV is defined, which breaks the build when iconv is not installed. On some platforms, iconv lives directly in libc, whereas, on others it resides in libiconv. For the latter case, NEEDS_LIBICONV instructs the Makefile to add "-liconv" to the linker flags. config.mak.uname automatically defines NEEDS_LIBICONV for platforms which require it. The adding of "-liconv" is done unconditionally, despite NO_ICONV. Work around this problem by making NO_ICONV take precedence over NEEDS_LIBICONV. Reported by: Mahmoud Al-Qudsi <mqudsi@neosmart.net> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 12 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 7f40f76..4d3c930 100644
--- a/Makefile
+++ b/Makefile
@@ -1288,17 +1288,19 @@ ifdef APPLE_COMMON_CRYPTO
LIB_4_CRYPTO += -framework Security -framework CoreFoundation
endif
endif
-ifdef NEEDS_LIBICONV
- ifdef ICONVDIR
- BASIC_CFLAGS += -I$(ICONVDIR)/include
- ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
- else
- ICONV_LINK =
- endif
- ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
- ICONV_LINK += -lintl
+ifndef NO_ICONV
+ ifdef NEEDS_LIBICONV
+ ifdef ICONVDIR
+ BASIC_CFLAGS += -I$(ICONVDIR)/include
+ ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
+ else
+ ICONV_LINK =
+ endif
+ ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
+ ICONV_LINK += -lintl
+ endif
+ EXTLIBS += $(ICONV_LINK) -liconv
endif
- EXTLIBS += $(ICONV_LINK) -liconv
endif
ifdef NEEDS_LIBGEN
EXTLIBS += -lgen