Fix scope error with newer GCC.
[spiralsynthmodular.git] / autogen.sh
blobd16c7b5c5e2b889c596ddcfebab186a7bec72427
1 #!/bin/sh
3 # autogen.sh - Generates the initial makefiles from a pristine CVS tree
5 # $Id: autogen.sh,v 1.1 2002-10-30 22:38:35 nebogeo Exp $
7 # USAGE: autogen.sh [configure options]
9 # If environment variable DRYRUN is set, no configuring will be done -
10 # (e.g. in bash) DRYRUN=1 ./autogen.sh
11 # will not do any configuring but will emit the programs that would be run.
13 # This script is based on similar scripts used in various tools
14 # commonly made available via CVS and used with GNU automake.
15 # Try 'locate autogen.sh' on your system and see what you get.
18 PACKAGE=spiralsynthmodular
19 DIE=
21 if test "X$DRYRUN" != X; then
22 DRYRUN=echo
25 autoconf_vers=2.13
26 automake_vers=1.4
27 aclocal_vers=1.4
29 program=`basename $0`
31 if (autoconf --version) < /dev/null > /dev/null 2>&1 ; then
32 if (autoconf --version | awk 'NR==1 { if( $3 >= '$autoconf_vers') \
33 exit 1; exit 0; }');
34 then
35 echo "$program: ERROR: \`autoconf' is too old."
36 echo " (version $autoconf_vers or newer is required)"
37 DIE="yes"
39 else
40 echo
41 echo "$program: ERROR: You must have \`autoconf' installed to compile $PACKAGE."
42 echo " (version $autoconf_vers or newer is required)"
43 DIE="yes"
46 # Ensure that these are created by the versions on this system
47 # (indirectly via automake)
48 rm -f libtool ltmain.sh
49 if (automake --version) < /dev/null > /dev/null 2>&1 ; then
50 if (automake --version | awk 'NR==1 { if( $4 >= '$automake_vers') \
51 exit 1; exit 0; }');
52 then
53 echo "$program: ERROR: \`automake' is too old."
54 echo " (version $automake_vers or newer is required)"
55 DIE="yes"
57 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
58 if (aclocal --version | awk 'NR==1 { if( $4 >= '$aclocal_vers' ) \
59 exit 1; exit 0; }' );
60 then
61 echo "$program: ERROR: \`aclocal' is too old."
62 echo " (version $aclocal_vers or newer is required)"
63 DIE="yes"
65 else
66 echo
67 echo "$program: ERROR: Missing \`aclocal'"
68 echo " The version of automake installed doesn't appear recent enough."
69 DIE="yes"
71 else
72 echo
73 echo "$program: ERROR: You must have \`automake' installed to compile $PACKAGE."
74 echo " (version $automake_vers or newer is required)"
75 DIE="yes"
79 if test "X$DIE" != X; then
80 exit 1
83 if test -z "$*"; then
84 echo "$program: WARNING: Running \`configure' with no arguments."
85 echo "If you wish to pass any to it, please specify them on the"
86 echo "\`$0' command line."
89 am_opt=
91 for coin in `find $srcdir -name configure.in -print`
92 do
93 dir=`dirname $coin`
94 if test -f $dir/NO-AUTO-GEN; then
95 echo $program: Skipping $dir -- flagged as no auto-gen
96 else
97 echo $program: Processing directory $dir
98 ( cd $dir
99 aclocalinclude="$ACLOCAL_FLAGS"
100 echo "$program: Running aclocal $aclocalinclude"
101 $DRYRUN aclocal $aclocalinclude
102 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
103 echo "$program: Running autoheader"
104 $DRYRUN autoheader
106 echo "$program: Running automake $am_opt"
107 $DRYRUN automake --add-missing $am_opt
108 echo "$program: Running autoconf"
109 $DRYRUN autoconf
112 done
114 conf_flags=
116 echo "$program: Running ./configure $conf_flags $@"
117 if test "X$DRYRUN" = X; then
118 $DRYRUN ./configure $conf_flags "$@" \
119 && echo "$program: Now type \`make' to compile $PACKAGE" || exit 1
120 else
121 $DRYRUN ./configure $conf_flags "$@"