Subject: [PATCH] Honor sysconfdir when set as an configure option

From: Kacper Kornet <[email-masked]>
Date: Thu, 28 Apr 2011 22:01:13 +0200

./configure can be run with option --sysconfdir=...
and Makefile should respect that choice.

Signed-off-by: Kacper Kornet <[email-masked]>
---
 Makefile      |    8 ++++----
 config.mak.in |    2 ++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index bf912b9..9d6cffa 100644
--- a/Makefile
+++ b/Makefile
@@ -1186,11 +1186,11 @@ endif
 -include config.mak
 
 ifeq ($(prefix),/usr)
-sysconfdir = /etc
-git_etcdir = /etc
+sysconfdir ?= /etc
+git_etcdir ?= /etc
 else
-sysconfdir = $(prefix)/etc
-git_etcdir = etc
+sysconfdir ?= $(prefix)/etc
+git_etcdir ?= etc
 endif
 
 ifdef CHECK_HEADER_DEPENDENCIES
diff --git a/config.mak.in b/config.mak.in
index e378534..ac5912d 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -15,6 +15,8 @@ TCLTK_PATH = @TCLTK_PATH@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 bindir = @bindir@
+sysconfdir = @sysconfdir@
+git_etcdir = @sysconfdir@
 gitexecdir = @libexecdir@/git-core
 datarootdir = @datarootdir@
 template_dir = @datadir@/git-core/templates
-- 
1.7.5

-- 
  Kacper Kornet