0
|
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
|
51
|
11 AUTOCONF=${AUTOCONF:-autoconf}
|
|
12 AUTOMAKE=${AUTOMAKE:-automake-1.9}
|
|
13 ACLOCAL=${ACLOCAL:-aclocal-1.9}
|
|
14 AUTOHEADER=${AUTOHEADER:-autoheader}
|
0
|
15 AUTOPOINT=${AUTOPOINT:-autopoint}
|
51
|
16 LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
|
0
|
17
|
|
18 dump_help_screen ()
|
|
19 {
|
|
20 echo "Usage: gen-auto-scripts.sh [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
|
|
29 parse_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
|
|
48 run_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
|
|
80 parse_options "$@"
|
|
81
|
|
82 cd $TOP_DIR
|
|
83
|
|
84 run_or_die $AUTOPOINT -f
|
|
85 run_or_die $LIBTOOLIZE -f -c
|
51
|
86 run_or_die $ACLOCAL -I m4
|
0
|
87 run_or_die $AUTOHEADER
|
|
88 run_or_die $AUTOCONF
|
|
89 run_or_die $AUTOMAKE -a -c
|
|
90
|
|
91 cd $LAST_DIR
|
|
92
|