Update MaintNotes post 1.7.6.1
[alt-git.git] / Make
blob93ba9ae33f1c83a31deb30ad0b763d2d081f7de4
1 #!/bin/sh
3 case "$(git version 2>/dev/null)" in
4 "git version"*)
5 GIT=git ;;
6 *)
7 echo >&2 "No git to bootstrap"
8 exit 1 ;;
9 esac
11 inst_prefix=$(
12 IFS=:
13 for p in $PATH
15 probed=${p%/git-active/bin}
16 if test "$probed" != "$p"
17 then
18 echo "$probed"
19 exit
21 done
22 echo $HOME
25 LANG=C
26 old_style_def_fix=b79d18c92d9f4841a6a1a29b7b2373a8ff9871e1
28 : ${O=-O2}
30 for cv in PYTHON_PATH=python TCL_PATH=tclsh TCLTKPATH=wish
32 cmd=${cv#*=}
33 var=${cv%=*}
34 eval $(
35 if test -f "/usr/bin/$cmd"
36 then
37 break
39 for p in /usr/bin /usr/local/bin
41 if test -f "$p/$cmd"
42 then
43 echo "$var=$p/$cmd; export $var"
44 break
46 found=$(find "$p/$cmd"* -type f 2>/dev/null | head -n 1)
47 if test -f "$found"
48 then
49 echo "$var=$found; export $var"
50 break
52 done
54 done
56 Wall='-Wall -Wdeclaration-after-statement' tests= jobs= skip=
57 case `uname` in
58 OpenBSD)
59 NEEDS_CRYPTO_WITH_SSL=YesPlease ; export NEEDS_CRYPTO_WITH_SSL
60 skip="t9200 t9502"
61 SHELL_PATH=/usr/local/bin/bash; export SHELL_PATH
62 NO_PEDANTIC=CannotDo NO_JOBS=CannotDo
63 Wall=
65 FreeBSD)
66 OLD_ICONV=YesPlease; export OLD_ICONV
67 skip="t5560"
69 SunOS)
70 NEEDS_CRYPTO_WITH_SSL=YesPlease ; export NEEDS_CRYPTO_WITH_SSL
71 NO_PEDANTIC=CannotDo Wall=
73 esac
75 while case $# in 0) break ;; esac
76 do
77 case "$1" in
78 -pedantic | --pedantic)
79 o= &&
80 rev=$($GIT rev-parse HEAD) &&
81 case "$($GIT merge-base "$old_style_def_fix" "$rev")" in
82 $old_style_def_fix)
83 o=-Wold-style-definition ;;
84 esac
85 case "$NO_PEDANTIC" in
86 ?*) ;;
87 '')
88 O="$O -Werror $o -std=c99 -Wno-pointer-to-int-cast"
89 O="$O -Wpointer-arith -Woverflow -Wunused"
91 esac
92 # -Wvla
93 # O="$O -fwrapv -fno-strict-overflow"
95 -j*)
96 case "$NO_JOBS" in
97 ?*) jobs= ;;
98 '') jobs=$1 ;;
99 esac
101 -loose | --loose)
102 Wall=
104 --locale=*)
105 LANG=${1#*=}
107 --test=*)
108 tests=$(
109 cd t &&
110 for t in ${1#*=}
112 eval echo "t$t-*.sh"
113 done | tr '\012' ' '
117 shift
118 break
121 echo >&2 "Eh $1?"
122 exit 1
125 break
127 esac
128 shift
129 done
131 if test -z "$tests" && test -n "$skip"
132 then
133 : GIT_SKIP_TESTS="${GIT_SKIP_TESTS:-$skip}"
136 LC_ALL=$LANG
137 export LANG LC_ALL
139 head=`$GIT symbolic-ref HEAD 2>/dev/null` &&
140 branch=`expr "$head" : 'refs/heads/\(.*\)'` || branch=detached
142 case "$branch" in
143 next | maint | master | pu | jch)
144 prefix="$inst_prefix/git-$branch"
146 snap)
147 v=`$GIT describe HEAD`
148 expr "$v" : '.*-g[0-9a-f]*$' >/dev/null && {
149 echo >&2 "You are on 'snap' but $v is not an official version."
150 exit 1
152 prefix="$inst_prefix/git-snap-$v"
155 prefix="$inst_prefix/git-test" ;;
156 esac
157 d="prefix=$prefix"
159 sh -c 'git describe --abbrev=4 HEAD' >/dev/null 2>&1 || {
160 $GIT describe --abbrev=4 HEAD | sed -e 's/-/./g' >version
163 d="$d "'
164 MAN_BASE_URL="http://www.kernel.org/pub/software/scm/git/docs/"
165 ASCIIDOC_NO_ROFF=YesPlease
166 ASCIIDOC8=YesPlease
167 BLK_SHA1=YesPlease
168 GNU_ROFF=YesPlease'
170 # Platform hack
171 if test -z "${make:+set}" && {
172 test -x /usr/local/bin/gmake ||
173 test -x /usr/bin/gmake
175 then
176 make=gmake
178 if test -f /bin/ginstall
179 then
180 set INSTALL=ginstall "$@"
183 CFLAGS="$O $Wall -g"
184 OK_TO_USE_CFLAGS=Yes
185 if test -n "${NO_CFLAGS+set}"
186 then
187 unset OK_TO_USE_CFLAGS
190 ${make-make} $d \
191 ETC_GITCONFIG=$prefix/etc/gitconfig \
192 ${OK_TO_USE_CFLAGS+"CFLAGS=$CFLAGS"} \
193 ${tests:+"T=$tests"} \
194 $jobs \
195 "$@"
196 status=$?
197 rm -f version
198 exit $status