Skip to content

Commit 229a7ed

Browse files
author
Junio C Hamano
committed
Solaris: give a bit more built-in defaults.
Taking the make command line Peter Eriksen uses, give defaults to SHELL_PATH, TAR, CURLDIR, NO_STRCASESTR, and INSTALL. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 6d9bbc5 commit 229a7ed

File tree

3 files changed

+34
-22
lines changed

3 files changed

+34
-22
lines changed

Makefile

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
2828
# Patrick Mauritz).
2929
#
30-
# Define NO_GETDOMAINNAME if your library lack it (SunOS, Patrick Mauritz).
31-
#
3230
# Define WITH_OWN_SUBPROCESS_PY if you want to use with python 2.3.
3331
#
3432
# Define COLLISION_CHECK below if you believe that SHA1's
@@ -63,6 +61,7 @@ GIT_PYTHON_DIR = $(prefix)/share/git-core/python
6361

6462
CC = gcc
6563
AR = ar
64+
TAR = tar
6665
INSTALL = install
6766
RPMBUILD = rpmbuild
6867

@@ -133,17 +132,6 @@ ifdef WITH_SEND_EMAIL
133132
SCRIPT_PERL += git-send-email.perl
134133
endif
135134

136-
ifndef NO_CURL
137-
ifdef CURLDIR
138-
# This is still problematic -- gcc does not want -R.
139-
CFLAGS += -I$(CURLDIR)/include
140-
CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
141-
else
142-
CURL_LIBCURL = -lcurl
143-
endif
144-
PROGRAMS += git-http-fetch
145-
endif
146-
147135
LIB_FILE=libgit.a
148136

149137
LIB_H = \
@@ -166,19 +154,38 @@ LIB_OBJS = \
166154
LIBS = $(LIB_FILE)
167155
LIBS += -lz
168156

157+
#
158+
# Platform specific tweaks
159+
#
169160
ifeq ($(shell uname -s),Darwin)
170161
NEEDS_SSL_WITH_CRYPTO = YesPlease
171162
NEEDS_LIBICONV = YesPlease
172163
endif
173164
ifeq ($(shell uname -s),SunOS)
174165
NEEDS_SOCKET = YesPlease
175166
NEEDS_NSL = YesPlease
167+
SHELL_PATH = /bin/bash
168+
NO_STRCASESTR = YesPlease
169+
CURLDIR = /opt/sfw
170+
INSTALL = ginstall
171+
TAR = gtar
176172
PLATFORM_DEFINES += -D__EXTENSIONS__
177173
endif
178174
ifneq (,$(findstring arm,$(shell uname -m)))
179175
ARM_SHA1 = YesPlease
180176
endif
181177

178+
ifndef NO_CURL
179+
ifdef CURLDIR
180+
# This is still problematic -- gcc does not want -R.
181+
CFLAGS += -I$(CURLDIR)/include
182+
CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
183+
else
184+
CURL_LIBCURL = -lcurl
185+
endif
186+
PROGRAMS += git-http-fetch
187+
endif
188+
182189
ifndef SHELL_PATH
183190
SHELL_PATH = /bin/sh
184191
endif
@@ -245,6 +252,7 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
245252
$(patsubst %.py,%,$(SCRIPT_PYTHON)) \
246253
gitk
247254

255+
export TAR INSTALL DESTDIR
248256
### Build rules
249257

250258
all: $(PROGRAMS) $(SCRIPTS)
@@ -254,7 +262,8 @@ all:
254262

255263
git: git.sh Makefile
256264
rm -f $@+ $@
257-
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.sh >$@+
265+
sed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
266+
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.sh >$@+
258267
chmod +x $@+
259268
mv $@+ $@
260269

@@ -356,7 +365,7 @@ dist: git-core.spec git-tar-tree
356365
./git-tar-tree HEAD $(GIT_TARNAME) > $(GIT_TARNAME).tar
357366
@mkdir -p $(GIT_TARNAME)
358367
@cp git-core.spec $(GIT_TARNAME)
359-
tar rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git-core.spec
368+
$(TAR) rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git-core.spec
360369
@rm -rf $(GIT_TARNAME)
361370
gzip -f -9 $(GIT_TARNAME).tar
362371

@@ -365,7 +374,7 @@ rpm: dist
365374

366375
deb: dist
367376
rm -rf $(GIT_TARNAME)
368-
tar zxf $(GIT_TARNAME).tar.gz
377+
$(TAR) zxf $(GIT_TARNAME).tar.gz
369378
dpkg-source -b $(GIT_TARNAME)
370379
cd $(GIT_TARNAME) && fakeroot debian/rules binary
371380

@@ -380,5 +389,5 @@ clean:
380389
rm -f git-core_$(GIT_VERSION)-*.deb git-core_$(GIT_VERSION)-*.dsc
381390
rm -f git-tk_$(GIT_VERSION)-*.deb
382391
$(MAKE) -C Documentation/ clean
383-
$(MAKE) -C templates/ clean
392+
$(MAKE) -C templates clean
384393
$(MAKE) -C t/ clean

git-clone.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ yes,yes)
139139
then
140140
HEAD=HEAD
141141
fi
142-
tar Ccf "$repo" - refs $HEAD | tar Cxf "$D/.git" - || exit 1
142+
(cd "$repo" && tar cf - refs $HEAD) |
143+
(cd "$D/.git" && tar xf -) || exit 1
143144
;;
144145
*)
145146
case "$repo" in

templates/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# make and install sample templates
22

3-
INSTALL=install
4-
prefix=$(HOME)
5-
template_dir=$(prefix)/share/git-core/templates/
3+
INSTALL ?= install
4+
TAR ?= tar
5+
prefix ?= $(HOME)
6+
template_dir ?= $(prefix)/share/git-core/templates/
67
# DESTDIR=
78

89
all: boilerplates custom
@@ -35,4 +36,5 @@ clean:
3536

3637
install: all
3738
$(INSTALL) -d -m755 $(DESTDIR)$(template_dir)
38-
tar Ccf blt - . | tar Cxf $(DESTDIR)$(template_dir) -
39+
(cd blt && $(TAR) cf - .) | \
40+
(cd $(DESTDIR)$(template_dir) && $(TAR) xf -)

0 commit comments

Comments
 (0)