]> jfr.im git - solanum.git/blame - autogen.sh
Merge branch 'master' of github.com:charybdis-ircd/charybdis
[solanum.git] / autogen.sh
CommitLineData
9ea48ec3
AC
1#! /bin/sh
2
3TOP_DIR=$(dirname $0)
4LAST_DIR=$PWD
5
6if test ! -f $TOP_DIR/configure.ac ; then
7 echo "You must execute this script from the top level directory."
8 exit 1
9fi
10
11AUTOCONF=${AUTOCONF:-autoconf}
12ACLOCAL=${ACLOCAL:-aclocal}
13AUTOMAKE=${AUTOMAKE:-automake}
14AUTOHEADER=${AUTOHEADER:-autoheader}
15LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
16
17dump_help_screen ()
18{
19 echo "Usage: $0 [options]"
20 echo
21 echo "options:"
22 echo " -n skip CVS changelog creation"
23 echo " -h,--help show this help screen"
24 echo
25 exit 0
26}
27
28parse_options ()
29{
30 while test "$1" != "" ; do
31 case $1 in
32 -h|--help)
33 dump_help_screen
34 ;;
35 -n)
36 SKIP_CVS_CHANGELOG=yes
37 ;;
38 *)
39 echo Invalid argument - $1
40 dump_help_screen
41 ;;
42 esac
43 shift
44 done
45}
46
47run_or_die ()
48{
49 COMMAND=$1
50
51 # check for empty commands
52 if test -z "$COMMAND" ; then
53 echo "*warning* no command specified"
54 return 1
55 fi
56
57 shift;
58
59 OPTIONS="$@"
60
61 # print a message
62 echo -n "*info* running $COMMAND"
63 if test -n "$OPTIONS" ; then
64 echo " ($OPTIONS)"
65 else
66 echo
67 fi
68
69 # run or die
70 $COMMAND $OPTIONS ; RESULT=$?
71 if test $RESULT -ne 0 ; then
72 echo "*error* $COMMAND failed. (exit code = $RESULT)"
73 exit 1
74 fi
75
76 return 0
77}
78
79parse_options "$@"
80
f9b3182c
AC
81echo "Building libratbox autotools files."
82
83cd "$TOP_DIR"/libratbox
84bash autogen.sh
85
86echo "Building main autotools files."
87
a4cac7ee 88cd "$LAST_DIR"
9ea48ec3
AC
89
90run_or_die $ACLOCAL -I m4
91run_or_die $LIBTOOLIZE --force --copy
92run_or_die $AUTOHEADER
93run_or_die $AUTOCONF
a4cac7ee 94run_or_die $AUTOMAKE --add-missing --copy