@matheusbsbs / matheus-bagliano / commits / 2910bf56a4
Fork 0

Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir

Definitions of ETC_GITCONFIG, ETC_GITATTRIBUTES and sysconfdir depend on value of prefix. As prefix can be changed in config.mak.autogen, all if blocks with conditions based on prefix should be placed after the file is included in Makefile. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Kacper Kornet committed Apr 28, 2011 at 21:27 UTC 2910bf56a4ffc13c398fb04ba32910cb3b724091
1 file changed +10 -9
Makefile
+10 -9
@@ -291,15 +291,8 @@ sharedir = $(prefix)/share
291 gitwebdir = $(sharedir)/gitweb
292 template_dir = share/git-core/templates
293 htmldir = share/doc/git-doc
294 -ifeq ($(prefix),/usr)
295 -sysconfdir = /etc
296 -ETC_GITCONFIG = $(sysconfdir)/gitconfig
297 -ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
298 -else
299 -sysconfdir = $(prefix)/etc
300 -ETC_GITCONFIG = etc/gitconfig
301 -ETC_GITATTRIBUTES = etc/gitattributes
302 -endif
294 +ETC_GITCONFIG = $(git_etcdir)/gitconfig
295 +ETC_GITATTRIBUTES = $(git_etcdir)/gitattributes
296 lib = lib
297 # DESTDIR=
298 pathsep = :
@@ -1196,6 +1189,14 @@ endif
1189 -include config.mak.autogen
1190 -include config.mak
1191
1192 +ifeq ($(prefix),/usr)
1193 +sysconfdir = /etc
1194 +git_etcdir = /etc
1195 +else
1196 +sysconfdir = $(prefix)/etc
1197 +git_etcdir = etc
1198 +endif
1199 +
1200 ifdef CHECK_HEADER_DEPENDENCIES
1201 COMPUTE_HEADER_DEPENDENCIES =
1202 USE_COMPUTED_HEADER_DEPENDENCIES =