root/trunk/autogen.sh

Revision 159, 0.9 kB (checked in by takkaria, 1 year ago)

#145: move m4/ contents into acinclude.m4, re-run autoconf and such.

  • Property svn:executable set to *
Line 
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 ACLOCAL=${ACLOCAL:-aclocal}
13 AUTOHEADER=${AUTOHEADER:-autoheader}
14
15 run_or_die ()
16 {
17     COMMAND=$1
18
19     # check for empty commands
20     if test -z "$COMMAND" ; then
21         echo "*warning* no command specified"
22         return 1
23     fi
24
25     shift;
26
27     OPTIONS="$@"
28
29     # print a message
30     echo -n "*info* running $COMMAND"
31     if test -n "$OPTIONS" ; then
32         echo " ($OPTIONS)"
33     else
34         echo
35     fi
36
37     # run or die
38     $COMMAND $OPTIONS ; RESULT=$?
39     if test $RESULT -ne 0 ; then
40         echo "*error* $COMMAND failed. (exit code = $RESULT)"
41         exit 1
42     fi
43
44     return 0
45 }
46
47 cd $TOP_DIR
48
49 run_or_die $ACLOCAL
50 run_or_die $AUTOHEADER
51 run_or_die $AUTOCONF
52
53 cd $LAST_DIR
Note: See TracBrowser for help on using the browser.