#!/bin/sh # DDD=' -DUSE_SYMLINK_HEAD=0' # PATH=/usr/bin:/bin G=/opt/packrat/playpen/public/in-place/git/index/gitweb_config.perl for i in active maint master next do GIT="$HOME/git-$i/bin/git" test -f "$GIT" && break done test -f "$GIT" || { echo >&2 "No git to bootstrap" } PATH=/usr/bin:/bin LANG=C LC_ALL=C export PATH LANG LC_ALL # for now... #GIT_SVN_NO_LIB=1 #export GIT_SVN_NO_LIB old_style_def_fix=b79d18c92d9f4841a6a1a29b7b2373a8ff9871e1 head=`$GIT symbolic-ref HEAD 2>/dev/null` && branch=`expr "$head" : 'refs/heads/\(.*\)'` || branch=detached case "$branch" in next | maint | master | pu) prefix="$HOME/git-$branch" ;; snap) v=`$GIT describe HEAD` expr "$v" : '.*-g[0-9a-f]*$' >/dev/null && { echo >&2 "You are on 'snap' but $v is not an official version." exit 1 } prefix="$HOME/git-snap-$v" ;; *) prefix="$HOME/git-test" ;; esac d="prefix=$prefix" : ${O=-O2} while case $# in 0) break ;; esac do case "$1" in -pedantic) o= && rev=$($GIT rev-parse HEAD) && case "$($GIT merge-base "$old_style_def_fix" "$rev")" in $old_style_def_fix) o=-Wold-style-definition ;; esac O="$O -Werror $o -std=c99 -Wno-pointer-to-int-cast" # O="$O -fwrapv -fno-strict-overflow" ;; --) shift break ;; -*) echo >&2 "Eh $1?" exit 1 ;; *) break ;; esac shift done sh -c 'git describe --abbrev=4 HEAD' >/dev/null 2>&1 || { $GIT describe --abbrev=4 HEAD | sed -e 's/-/./g' >version } make $d \ GITWEB_CONFIG=$G \ PYTHON_PATH=/usr/bin/python2.4 \ ETC_GITCONFIG=$prefix/etc/gitconfig \ CFLAGS="$O -Wall -Wdeclaration-after-statement -g" \ "$@" status=$? rm -f version exit $status