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>
Junio C Hamano committed
Sep 23, 2005 at 10:41 UTC
229a7ed7ab3111b99fe6fb05c50c6687ae64c2b1
3 files changed
+34
-22
Makefile
+26
-17
@@ -27,8 +27,6 @@
27
# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
28
# Patrick Mauritz).
29
#
30
-# Define NO_GETDOMAINNAME if your library lack it (SunOS, Patrick Mauritz).
31
-#
30
# Define WITH_OWN_SUBPROCESS_PY if you want to use with python 2.3.
31
#
32
# Define COLLISION_CHECK below if you believe that SHA1's
@@ -63,6 +61,7 @@ GIT_PYTHON_DIR = $(prefix)/share/git-core/python
61
62
CC = gcc
63
AR = ar
64
+TAR = tar
65
INSTALL = install
66
RPMBUILD = rpmbuild
67
@@ -133,17 +132,6 @@ ifdef WITH_SEND_EMAIL
132
SCRIPT_PERL += git-send-email.perl
133
endif
134
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
-
135
LIB_FILE=libgit.a
136
137
LIB_H = \
@@ -166,6 +154,9 @@ LIB_OBJS = \
154
LIBS = $(LIB_FILE)
155
LIBS += -lz
156
157
+#
158
+# Platform specific tweaks
159
+#
160
ifeq ($(shell uname -s),Darwin)
161
NEEDS_SSL_WITH_CRYPTO = YesPlease
162
NEEDS_LIBICONV = YesPlease
@@ -173,12 +164,28 @@ endif
164
ifeq ($(shell uname -s),SunOS)
165
NEEDS_SOCKET = YesPlease
166
NEEDS_NSL = YesPlease
167
+ SHELL_PATH = /bin/bash
168
+ NO_STRCASESTR = YesPlease
169
+ CURLDIR = /opt/sfw
170
+ INSTALL = ginstall
171
+ TAR = gtar
172
PLATFORM_DEFINES += -D__EXTENSIONS__
173
endif
174
ifneq (,$(findstring arm,$(shell uname -m)))
175
ARM_SHA1 = YesPlease
176
endif
177
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
+
189
ifndef SHELL_PATH
190
SHELL_PATH = /bin/sh
191
endif
@@ -245,6 +252,7 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
252
$(patsubst %.py,%,$(SCRIPT_PYTHON)) \
253
gitk
254
255
+export TAR INSTALL DESTDIR
256
### Build rules
257
258
all: $(PROGRAMS) $(SCRIPTS)
@@ -254,7 +262,8 @@ all:
262
263
git: git.sh Makefile
264
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 >$@+
267
chmod +x $@+
268
mv $@+ $@
269
@@ -356,7 +365,7 @@ dist: git-core.spec git-tar-tree
365
./git-tar-tree HEAD $(GIT_TARNAME) > $(GIT_TARNAME).tar
366
@mkdir -p $(GIT_TARNAME)
367
@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
369
@rm -rf $(GIT_TARNAME)
370
gzip -f -9 $(GIT_TARNAME).tar
371
@@ -365,7 +374,7 @@ rpm: dist
374
375
deb: dist
376
rm -rf $(GIT_TARNAME)
368
- tar zxf $(GIT_TARNAME).tar.gz
377
+ $(TAR) zxf $(GIT_TARNAME).tar.gz
378
dpkg-source -b $(GIT_TARNAME)
379
cd $(GIT_TARNAME) && fakeroot debian/rules binary
380
@@ -380,5 +389,5 @@ clean:
389
rm -f git-core_$(GIT_VERSION)-*.deb git-core_$(GIT_VERSION)-*.dsc
390
rm -f git-tk_$(GIT_VERSION)-*.deb
391
$(MAKE) -C Documentation/ clean
383
- $(MAKE) -C templates/ clean
392
+ $(MAKE) -C templates clean
393
$(MAKE) -C t/ clean
git-clone.sh
+2
-1
@@ -139,7 +139,8 @@ yes,yes)
139
then
140
HEAD=HEAD
141
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
144
;;
145
*)
146
case "$repo" in
templates/Makefile
+6
-4
@@ -1,8 +1,9 @@
1
# make and install sample templates
2
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/
7
# DESTDIR=
8
9
all: boilerplates custom
@@ -35,4 +36,5 @@ clean:
36
37
install: all
38
$(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 -)