Skip to content

Commit 10861be

Browse files
schielegitster
authored andcommitted
make the name of the library directory a config option
Introduce new makefile variable lib to hold the name of the lib directory ("lib" by default). Also introduce a switch for configure to specify this name with --with-lib=ARG. This is useful for systems that use a different name than "lib" (like "lib64" on some 64 bit Linux architectures). Signed-off-by: Robert Schiele <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4b7f59a commit 10861be

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ sysconfdir = /etc
151151
else
152152
sysconfdir = $(prefix)/etc
153153
endif
154+
lib = lib
154155
ETC_GITCONFIG = $(sysconfdir)/gitconfig
155156
# DESTDIR=
156157

@@ -500,9 +501,9 @@ endif
500501

501502
ifndef NO_CURL
502503
ifdef CURLDIR
503-
# Try "-Wl,-rpath=$(CURLDIR)/lib" in such a case.
504+
# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
504505
BASIC_CFLAGS += -I$(CURLDIR)/include
505-
CURL_LIBCURL = -L$(CURLDIR)/lib $(CC_LD_DYNPATH)$(CURLDIR)/lib -lcurl
506+
CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
506507
else
507508
CURL_LIBCURL = -lcurl
508509
endif
@@ -520,15 +521,15 @@ endif
520521

521522
ifdef ZLIB_PATH
522523
BASIC_CFLAGS += -I$(ZLIB_PATH)/include
523-
EXTLIBS += -L$(ZLIB_PATH)/lib $(CC_LD_DYNPATH)$(ZLIB_PATH)/lib
524+
EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
524525
endif
525526
EXTLIBS += -lz
526527

527528
ifndef NO_OPENSSL
528529
OPENSSL_LIBSSL = -lssl
529530
ifdef OPENSSLDIR
530531
BASIC_CFLAGS += -I$(OPENSSLDIR)/include
531-
OPENSSL_LINK = -L$(OPENSSLDIR)/lib $(CC_LD_DYNPATH)$(OPENSSLDIR)/lib
532+
OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
532533
else
533534
OPENSSL_LINK =
534535
endif
@@ -545,7 +546,7 @@ endif
545546
ifdef NEEDS_LIBICONV
546547
ifdef ICONVDIR
547548
BASIC_CFLAGS += -I$(ICONVDIR)/include
548-
ICONV_LINK = -L$(ICONVDIR)/lib $(CC_LD_DYNPATH)$(ICONVDIR)/lib
549+
ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
549550
else
550551
ICONV_LINK =
551552
endif

configure.ac

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ fi \
6969
## Site configuration related to programs (before tests)
7070
## --with-PACKAGE[=ARG] and --without-PACKAGE
7171
#
72+
# Set lib to alternative name of lib directory (e.g. lib64)
73+
AC_ARG_WITH([lib],
74+
[AS_HELP_STRING([--with-lib=ARG],
75+
[ARG specifies alternative name for lib directory])],
76+
[if test "$withval" = "no" -o "$withval" = "yes"; then \
77+
AC_MSG_WARN([You should provide name for --with-lib=ARG]); \
78+
else \
79+
GIT_CONF_APPEND_LINE(lib=$withval); \
80+
fi; \
81+
],[])
82+
#
7283
# Define SHELL_PATH to provide path to shell.
7384
GIT_ARG_SET_PATH(shell)
7485
#

0 commit comments

Comments
 (0)