* src/input.c (input_init): Simplify.
[m4.git] / bootstrap
blob0f6172269d47bf448f5980c2c10b9d80014e0ddc
1 #! /bin/sh
3 # Helps bootstrapping M4, when checked out from CVS.
4 # Requires GNU Autoconf 2.59 or later, GNU Automake 1.9.6 or later,
5 # and a recent CVS checkout of gnulib.
7 : ${AUTORECONF=autoreconf}
8 : ${GNULIB_TOOL=gnulib-tool}
9 : ${SED=sed}
11 dirname="s,/[^/]*$,,"
12 basename="s,^.*/,,g"
14 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
15 # is ksh but when the shell is invoked as "sh" and the current value of
16 # the _XPG environment variable is not equal to 1 (one), the special
17 # positional parameter $0, within a function call, is the name of the
18 # function.
19 progpath="$0"
21 # The name of this program:
22 progname=`echo "$progpath" | $SED "$basename"`
24 # func_echo arg...
25 # Echo program name prefixed message.
26 func_echo ()
28 echo $progname: ${1+"$@"}
32 # func_error arg...
33 # Echo program name prefixed message to standard error.
34 func_error ()
36 echo $progname: ${1+"$@"} >&2
37 exit 1
40 ## ---------------------- ##
41 ## Import Gnulib modules. ##
42 ## ---------------------- ##
44 func_echo "running: ${GNULIB_TOOL} --update"
45 ${GNULIB_TOOL} --update || func_error "gnulib-tool failed"
47 ## ----------- ##
48 ## Autoreconf. ##
49 ## ----------- ##
51 func_echo "running: $AUTORECONF --force --verbose --install"
52 $AUTORECONF --force --verbose --install || func_error "autoreconf failed"
54 exit 0