threads / patch / 9251

patchzlib in custom location

Subject: [PATCH] zlib in custom location

## tl;dr

2 messages between Jul 27, 2007 and Jul 27, 2007. Diffs are folded; open one to read it.

replies: 1people: 1as markdown or json

Robert Schiele· Jul 27, 2007, 05:42 UTC · lore
Hi,

I have some systems with zlib in a custom location and thus did the following change to support a variable ZLIBDIR like it does already exist for OPENSSLDIR. Would be great to see this in the main tree.

commit d61424558cda558b0c7893f545d548c6d6f211ff
Author: Robert Schiele <rschiele@gmail.com>
Date:   Thu Jul 26 22:34:16 2007 -0700
    - add option to find zlib in custom path
Show changes to Makefile +7 −1
diff --git a/Makefile b/Makefile
index 73b487f..0179339 100644
--- a/Makefile
+++ b/Makefile
@@ -372,7 +372,7 @@ BUILTIN_OBJS = \
 	builtin-pack-refs.o
 
 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
-EXTLIBS = -lz
+EXTLIBS =
 
 #
 # Platform specific tweaks
@@ -517,6 +517,12 @@ ifndef NO_CURL
 	endif
 endif
 
+ifdef ZLIBDIR
+	BASIC_CFLAGS += -I$(ZLIBDIR)/include
+	EXTLIBS += -L$(ZLIBDIR)/lib $(CC_LD_DYNPATH)$(ZLIBDIR)/lib
+endif
+EXTLIBS += -lz
+
 ifndef NO_OPENSSL
 	OPENSSL_LIBSSL = -lssl
 	ifdef OPENSSLDIR

Robert
-- 
Robert Schiele
Dipl.-Wirtsch.informatiker	mailto:rschiele@gmail.com

"Quidquid latine dictum sit, altum sonatur."
Robert Schiele· Jul 27, 2007, 06:14 UTC · re: Robert Schiele · lore

Re: [PATCH] zlib in custom location

On Fri, Jul 27, 2007 at 07:42:51AM +0200, Robert Schiele wrote:
Show 5 quoted lines
> Hi,
> 
> I have some systems with zlib in a custom location and thus did the following
> change to support a variable ZLIBDIR like it does already exist for
> OPENSSLDIR.  Would be great to see this in the main tree.
Just to follow up this change I have another one:

Since some Linux archs use different names for the library directory than "lib" (like "lib64") I made this a config variable as well. Currently this is only an issue if you use custom directories for libraries used by git.

commit a1cffe56cc9092443cd8bd03b18eb7e222528e35
Author: Robert Schiele <rschiele@gmail.com>
Date:   Thu Jul 26 23:08:47 2007 -0700
    - make the name of the library directory a config option
Show changes to Makefile +7 −6
diff --git a/Makefile b/Makefile
index 0179339..64c0a59 100644
--- a/Makefile
+++ b/Makefile
@@ -151,6 +151,7 @@ sysconfdir = /etc
 else
 sysconfdir = $(prefix)/etc
 endif
+lib = lib
 ETC_GITCONFIG = $(sysconfdir)/gitconfig
 # DESTDIR=
 
@@ -170,7 +171,7 @@ GITWEB_FAVICON = git-favicon.png
 GITWEB_SITE_HEADER =
 GITWEB_SITE_FOOTER =
 
-export prefix bindir gitexecdir sharedir template_dir sysconfdir
+export prefix bindir gitexecdir sharedir template_dir sysconfdir lib
 
 CC = gcc
 AR = ar
@@ -499,9 +500,9 @@ endif
 
 ifndef NO_CURL
 	ifdef CURLDIR
-		# Try "-Wl,-rpath=$(CURLDIR)/lib" in such a case.
+		# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
 		BASIC_CFLAGS += -I$(CURLDIR)/include
-		CURL_LIBCURL = -L$(CURLDIR)/lib $(CC_LD_DYNPATH)$(CURLDIR)/lib -lcurl
+		CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
 	else
 		CURL_LIBCURL = -lcurl
 	endif
@@ -519,7 +520,7 @@ endif
 
 ifdef ZLIBDIR
 	BASIC_CFLAGS += -I$(ZLIBDIR)/include
-	EXTLIBS += -L$(ZLIBDIR)/lib $(CC_LD_DYNPATH)$(ZLIBDIR)/lib
+	EXTLIBS += -L$(ZLIBDIR)/$(lib) $(CC_LD_DYNPATH)$(ZLIBDIR)/$(lib)
 endif
 EXTLIBS += -lz
 
@@ -527,7 +528,7 @@ ifndef NO_OPENSSL
 	OPENSSL_LIBSSL = -lssl
 	ifdef OPENSSLDIR
 		BASIC_CFLAGS += -I$(OPENSSLDIR)/include
-		OPENSSL_LINK = -L$(OPENSSLDIR)/lib $(CC_LD_DYNPATH)$(OPENSSLDIR)/lib
+		OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
 	else
 		OPENSSL_LINK =
 	endif
@@ -544,7 +545,7 @@ endif
 ifdef NEEDS_LIBICONV
 	ifdef ICONVDIR
 		BASIC_CFLAGS += -I$(ICONVDIR)/include
-		ICONV_LINK = -L$(ICONVDIR)/lib $(CC_LD_DYNPATH)$(ICONVDIR)/lib
+		ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
 	else
 		ICONV_LINK =
 	endif

Robert
-- 
Robert Schiele
Dipl.-Wirtsch.informatiker	mailto:rschiele@gmail.com

"Quidquid latine dictum sit, altum sonatur."

← back to recent threads