summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-09-01 14:09:36 -0500
committerFridrich Strba <fridrich@documentfoundation.org>2013-09-02 08:24:25 +0000
commit9f1834eee7278dd3ae5d3664c818bee147785ab4 (patch)
treec6e224061e32f5c107fbbddbf0ecdc749e15099c /autogen.sh
parent27a9dd758a7ecd9233710139b21565655f270b99 (diff)
add automatic git hook setting in autogen.sh
Change-Id: I95eb02dc2d347337d7b85f85d6459353278fb137 Reviewed-on: https://gerrit.libreoffice.org/5748 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh32
1 files changed, 25 insertions, 7 deletions
diff --git a/autogen.sh b/autogen.sh
index 02903a2..fcb084b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,20 @@
#!/bin/sh
+
+set_git_hooks()
+{
+ # assume that the current directory is the source tree
+ if [ -d ".git" ] ; then
+ for hook in $(ls -1 .git-hooks) ; do
+ cd .git/hooks
+ if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then
+ rm -f "${hook?}"
+ ln -sf "../../.git-hooks/${hook?}" "${hook?}"
+ fi
+ cd - > /dev/null
+ done
+ fi
+}
+
TESTLIBTOOLIZE="glibtoolize libtoolize"
LIBTOOLIZEFOUND="0"
@@ -9,6 +25,8 @@ test -z "$srcdir" && srcdir=.
olddir=`pwd`
cd $srcdir
+set_git_hooks
+
aclocal --version > /dev/null 2> /dev/null || {
echo "error: aclocal not found"
exit 1
@@ -19,16 +37,16 @@ automake --version > /dev/null 2> /dev/null || {
}
for i in $TESTLIBTOOLIZE; do
- if which $i > /dev/null 2>&1; then
- LIBTOOLIZE=$i
- LIBTOOLIZEFOUND="1"
- break
- fi
+ if which $i > /dev/null 2>&1; then
+ LIBTOOLIZE=$i
+ LIBTOOLIZEFOUND="1"
+ break
+ fi
done
if [ "$LIBTOOLIZEFOUND" = "0" ]; then
- echo "$0: need libtoolize tool to build libvisio" >&2
- exit 1
+ echo "$0: need libtoolize tool to build libvisio" >&2
+ exit 1
fi
amcheck=`automake --version | grep 'automake (GNU automake) 1.5'`