1#! /bin/sh
2
3if [ "$USER" = "root" ]; then
4	echo "*** You cannot do this as "$USER" please use a normal user account."
5	exit 1
6fi
7if test ! -f configure.ac ; then
8	echo "*** Please invoke this script from directory containing configure.ac."
9	exit 1
10fi
11
12echo "running aclocal"
13aclocal
14rc=$?
15
16if test $rc -eq 0; then
17	echo "running libtool"
18	libtoolize --force --automake --copy
19	rc=$?
20else
21	echo "An error occured, autogen.sh stopping."
22	exit $rc
23fi
24
25if test $rc -eq 0; then
26	echo "libtool worked."
27else
28	echo "libtool not found. trying glibtool."
29	glibtoolize --force --automake --copy
30	rc=$?
31fi
32
33if test $rc -eq 0; then
34	echo "running automake"
35	automake --add-missing --copy
36	rc=$?
37else
38	echo "An error occured, autogen.sh stopping."
39	exit $rc
40fi
41
42if test $rc -eq 0; then
43	echo "running autoheader"
44	autoheader
45	rc=$?
46else
47	echo "An error occured, autogen.sh stopping."
48	exit $rc
49fi
50
51if test $rc -eq 0; then
52	echo "running autoconf"
53	autoconf
54	rc=$?
55else
56	echo "An error occured, autogen.sh stopping."
57	exit $rc
58fi
59
60echo "autogen.sh complete"
61exit $rc
62