]> jfr.im git - irc/rqf/shadowircd.git/blob - autogen.sh
Remove obsolete comment.
[irc/rqf/shadowircd.git] / autogen.sh
1 #! /bin/sh
2
3 TOP_DIR=$(dirname $0)
4 LAST_DIR=$PWD
5
6 if test ! -f $TOP_DIR/configure.ac ; then
7 echo "You must execute this script from the top level directory."
8 exit 1
9 fi
10
11 AUTOCONF=${AUTOCONF:-autoconf}
12 AUTOHEADER=${AUTOHEADER:-autoheader}
13 AUTOMAKE=${AUTOMAKE:-automake}
14
15 dump_help_screen ()
16 {
17 echo "Usage: $0 [options]"
18 echo
19 echo "options:"
20 echo " -h,--help show this help screen"
21 echo
22 exit 0
23 }
24
25 parse_options ()
26 {
27 while test "$1" != "" ; do
28 case $1 in
29 -h|--help)
30 dump_help_screen
31 ;;
32 *)
33 echo Invalid argument - $1
34 dump_help_screen
35 ;;
36 esac
37 shift
38 done
39 }
40
41 run_or_die ()
42 {
43 COMMAND=$1
44
45 # check for empty commands
46 if test -z "$COMMAND" ; then
47 echo "*warning* no command specified"
48 return 1
49 fi
50
51 shift;
52
53 OPTIONS="$@"
54
55 # print a message
56 echo -n "*info* running $COMMAND"
57 if test -n "$OPTIONS" ; then
58 echo " ($OPTIONS)"
59 else
60 echo
61 fi
62
63 # run or die
64 $COMMAND $OPTIONS ; RESULT=$?
65 if test $RESULT -ne 0 ; then
66 echo "*error* $COMMAND failed. (exit code = $RESULT)"
67 exit 1
68 fi
69
70 return 0
71 }
72
73 parse_options "$@"
74
75 cd $TOP_DIR
76
77 run_or_die $AUTOHEADER
78 run_or_die $AUTOCONF
79 run_or_die $AUTOMAKE
80
81 cd $TOP_DIR/libratbox
82
83 run_or_die $AUTOHEADER
84 run_or_die $AUTOCONF
85 run_or_die $AUTOMAKE
86
87 cd $LAST_DIR