Mercurial > ~mikael > mcabber > hg
comparison mcabber/hgcset.sh @ 2041:e8f2db654e67
Fix building from separate directory
This patch allows the following build sequence:
$ mkdir build; cd build; ../configure args; make; make install
author | Myhailo Danylenko <isbear@ukrpost.net> |
---|---|
date | Thu, 22 Nov 2012 00:59:19 +0200 |
parents | 41c26b7d2890 |
children |
comparison
equal
deleted
inserted
replaced
2040:e87ced7d1059 | 2041:e8f2db654e67 |
---|---|
1 #! /bin/sh | 1 #! /bin/sh |
2 | 2 |
3 if [ ! -f logprint.h ]; then | 3 srcdir="$1" |
4 echo "You are not in the mcabber directory" >&2 | 4 builddir="$2" |
5 | |
6 if [ ! -f "$srcdir/logprint.h" ]; then | |
7 echo "Unable to find mcabber sources!" >&2 | |
5 exit 1 | 8 exit 1 |
6 fi | 9 fi |
10 | |
11 cd "$srcdir" | |
7 | 12 |
8 if which hg > /dev/null 2>&1; then | 13 if which hg > /dev/null 2>&1; then |
9 cs=$(hg id 2> /dev/null | cut -d' ' -f1) | 14 cs=$(hg id 2> /dev/null | cut -d' ' -f1) |
10 if test $? -eq 0; then | 15 if test $? -eq 0; then |
11 if [ x"$cs" != x ]; then | 16 if [ x"$cs" != x ]; then |
12 grep -q "$cs" hgcset.h > /dev/null 2>&1 || \ | 17 grep -q "$cs" "$builddir/hgcset.h" > /dev/null 2>&1 || \ |
13 echo "#define HGCSET \"$cs\"" > hgcset.h | 18 echo "#define HGCSET \"$cs\"" > "$builddir/hgcset.h" |
14 exit 0 | 19 exit 0 |
15 fi | 20 fi |
16 fi | 21 fi |
17 fi | 22 fi |
18 | 23 |
19 echo > hgcset.h | 24 echo > "$builddir/hgcset.h" |