]> jfr.im git - irc/charybdis-ircd/charybdis.git/blame - autogen.sh
charybdis is officially discontinued
[irc/charybdis-ircd/charybdis.git] / autogen.sh
CommitLineData
9ea48ec3
WP
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}
efc4b18c 16#SHTOOLIZE=${SHTOOLIZE:-shtoolize}
9ea48ec3
WP
17
18dump_help_screen ()
19{
20 echo "Usage: $0 [options]"
21 echo
22 echo "options:"
23 echo " -n skip CVS changelog creation"
24 echo " -h,--help show this help screen"
25 echo
26 exit 0
27}
28
29parse_options ()
30{
31 while test "$1" != "" ; do
32 case $1 in
33 -h|--help)
34 dump_help_screen
35 ;;
36 -n)
37 SKIP_CVS_CHANGELOG=yes
38 ;;
39 *)
40 echo Invalid argument - $1
41 dump_help_screen
42 ;;
43 esac
44 shift
45 done
46}
47
48run_or_die ()
49{
50 COMMAND=$1
51
52 # check for empty commands
53 if test -z "$COMMAND" ; then
54 echo "*warning* no command specified"
55 return 1
56 fi
57
58 shift;
59
60 OPTIONS="$@"
61
62 # print a message
63 echo -n "*info* running $COMMAND"
64 if test -n "$OPTIONS" ; then
65 echo " ($OPTIONS)"
66 else
67 echo
68 fi
69
70 # run or die
71 $COMMAND $OPTIONS ; RESULT=$?
72 if test $RESULT -ne 0 ; then
73 echo "*error* $COMMAND failed. (exit code = $RESULT)"
74 exit 1
75 fi
76
77 return 0
78}
79
80parse_options "$@"
81
c83f2f5e 82echo "Building librb autotools files."
f9b3182c 83
c83f2f5e 84cd "$TOP_DIR"/librb
52854df4 85sh autogen.sh
f9b3182c
WP
86
87echo "Building main autotools files."
88
a4cac7ee 89cd "$LAST_DIR"
9ea48ec3
WP
90
91run_or_die $ACLOCAL -I m4
92run_or_die $LIBTOOLIZE --force --copy
93run_or_die $AUTOHEADER
94run_or_die $AUTOCONF
a4cac7ee 95run_or_die $AUTOMAKE --add-missing --copy
efc4b18c 96#run_or_die $SHTOOLIZE all