Skip to content

Commit bef19da

Browse files
schielegitster
authored andcommitted
add option to find zlib in custom path
Some systems do not provide zlib development headers and libraries in default search path of the compiler. For these systems we should allow specifying the location by --with-zlib=PATH or by setting ZLIB_PATH in the makefile. Signed-off-by: Robert Schiele <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 18508c3 commit bef19da

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ BUILTIN_OBJS = \
373373
builtin-pack-refs.o
374374

375375
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
376-
EXTLIBS = -lz
376+
EXTLIBS =
377377

378378
#
379379
# Platform specific tweaks
@@ -518,6 +518,12 @@ ifndef NO_CURL
518518
endif
519519
endif
520520

521+
ifdef ZLIB_PATH
522+
BASIC_CFLAGS += -I$(ZLIB_PATH)/include
523+
EXTLIBS += -L$(ZLIB_PATH)/lib $(CC_LD_DYNPATH)$(ZLIB_PATH)/lib
524+
endif
525+
EXTLIBS += -lz
526+
521527
ifndef NO_OPENSSL
522528
OPENSSL_LIBSSL = -lssl
523529
ifdef OPENSSLDIR

configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ GIT_ARG_SET_PATH(shell)
7575
# Define PERL_PATH to provide path to Perl.
7676
GIT_ARG_SET_PATH(perl)
7777
#
78+
# Define ZLIB_PATH to provide path to zlib.
79+
GIT_ARG_SET_PATH(zlib)
80+
#
7881
# Declare the with-tcltk/without-tcltk options.
7982
AC_ARG_WITH(tcltk,
8083
AS_HELP_STRING([--with-tcltk],[use Tcl/Tk GUI (default is YES)])

0 commit comments

Comments
 (0)