Avoid threaded delta
[git] / Make
1 #!/bin/sh
2
3 # DDD=' -DUSE_SYMLINK_HEAD=0'
4 # PATH=/usr/bin:/bin
5
6 G=/opt/packrat/playpen/public/in-place/git/index/gitweb_config.perl
7 for i in active maint master next
8 do
9         GIT="$HOME/git-$i/bin/git"
10         test -f "$GIT" && break
11 done
12 test -f "$GIT" || {
13         echo >&2 "No git to bootstrap"
14 }
15 PATH=/usr/bin:/bin
16 LANG=C
17 LC_ALL=C
18 export PATH LANG LC_ALL
19
20 # for now...
21 #GIT_SVN_NO_LIB=1
22 #export GIT_SVN_NO_LIB
23
24 old_style_def_fix=b79d18c92d9f4841a6a1a29b7b2373a8ff9871e1
25
26 head=`$GIT symbolic-ref HEAD 2>/dev/null` &&
27 branch=`expr "$head" : 'refs/heads/\(.*\)'` || branch=detached
28
29 case "$branch" in
30 next | maint | master | pu | jch)
31         prefix="$HOME/git-$branch"
32         ;;
33 snap)
34         v=`$GIT describe HEAD`
35         expr "$v" : '.*-g[0-9a-f]*$' >/dev/null && {
36             echo >&2 "You are on 'snap' but $v is not an official version."
37             exit 1
38         }
39         prefix="$HOME/git-snap-$v"
40         ;;
41 *)
42         prefix="$HOME/git-test" ;;
43 esac
44 d="prefix=$prefix THREADED_DELTA_SEARCH="
45
46 : ${O=-O2}
47
48 Wall=-Wall
49 while case $# in 0) break ;; esac
50 do 
51         case "$1" in
52         -pedantic)
53                 o= &&
54                 rev=$($GIT rev-parse HEAD) &&
55                 case "$($GIT merge-base "$old_style_def_fix" "$rev")" in
56                 $old_style_def_fix)
57                         o=-Wold-style-definition ;;
58                 esac
59                 O="$O -Werror $o -std=c99 -Wno-pointer-to-int-cast"
60                 # O="$O -fwrapv -fno-strict-overflow"
61                 ;;
62         -loose)
63                 Wall=
64                 ;;
65         --)
66                 shift
67                 break
68                 ;;
69         -*)
70                 echo >&2 "Eh $1?"
71                 exit 1
72                 ;;
73         *)
74                 break
75                 ;;              
76         esac
77         shift
78 done
79
80 sh -c 'git describe --abbrev=4 HEAD' >/dev/null 2>&1 || {
81         $GIT describe --abbrev=4 HEAD | sed -e 's/-/./g' >version
82 }
83
84 CFLAGS="$O $Wall -Wdeclaration-after-statement -g"
85
86 make $d \
87      GITWEB_CONFIG=$G \
88      PYTHON_PATH=/usr/bin/python2.4 \
89      ETC_GITCONFIG=$prefix/etc/gitconfig \
90      CFLAGS="$CFLAGS" \
91      "$@"
92 status=$?
93 rm -f version
94 exit $status