summaryrefslogtreecommitdiff
path: root/autogen.sh
blob: 170897e4680e3e9d753e831b360f8f682ab9421f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
#
# $Id: autogen.sh 23241 2006-09-29 19:05:15Z kelnos $
#
# Copyright (c) 2002-2005
#         The Xfce development team. All rights reserved.
#
# Written for Xfce by Benedikt Meurer <benny@xfce.org>.
#

(type xdt-autogen) >/dev/null 2>&1 || {
  cat >&2 <<EOF
autogen.sh: You don't seem to have the Xfce development tools installed on
            your system, which are required to build this software.
            Please install the xfce4-dev-tools package first, available from
            http://xfce.org/~benny/projects/xfce4-dev-tools/.
EOF
  exit 1
}

# verify that po/LINGUAS is present
(test -f po/LINGUAS) >/dev/null 2>&1 || {
  cat >&2 <<EOF
autogen.sh: The file po/LINGUAS could not be found. Please check your snapshot
            or try to checkout again.
EOF
  exit 1
}

echo 'dnl *** This file is automatically generated from configure.ac.in ***' \
	>configure.ac
echo 'dnl *** DO NOT EDIT! ***' >>configure.ac
echo >>configure.ac

# substitute revision and linguas
linguas=$(sed -e '/^#/d' po/LINGUAS)
if [ -d .git/svn ]; then
    revision=$(git svn find-rev trunk 2>/dev/null ||
               git svn find-rev origin/trunk 2>/dev/null ||
               git svn find-rev HEAD 2>/dev/null ||
               git svn find-rev master 2>/dev/null)
elif [ -d .svn ]; then
    revision=$(LC_ALL=C svn info $0 | awk '/^Revision: / {printf "%05d\n", $2}')
else
    revision=UNKNOWN
fi
sed -e "s/@LINGUAS@/${linguas}/g" \
    -e "s/@REVISION@/${revision}/g" \
    < "configure.ac.in" >> "configure.ac"

xdt-autogen $@

# vi:set ts=2 sw=2 et ai: