3 # ngIRCd -- The Next Generation IRC Daemon
4 # Copyright (c)2001-2004 Alexander Barton <alex@barton.de>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 # Please read the file COPYING, README and AUTHORS for more information.
12 # $Id: autogen.sh,v 1.9 2004/03/15 18:59:12 alex Exp $
17 [ $# -eq 2 ] || exit 1
23 type "${name}" >/dev/null 2>&1
29 while [ $minor -ge 0 ]; do
30 type "${name}${major}${minor}" >/dev/null 2>&1
32 echo "${name}${major}${minor}"
35 type "${name}-${major}.${minor}" >/dev/null 2>&1
37 echo "${name}-${major}.${minor}" >/dev/null 2>&1
40 minor=`expr $minor - 1`
47 echo "Error: $* not found!"
48 echo "Please install recent versions of GNU autoconf and GNU automake."
52 # Reset locale settings to suppress warning messages of Perl
56 # We want to use GNU automake 1.7, if available (WANT_AUTOMAKE is used by
57 # the wrapper scripts of Gentoo Linux):
61 # Try to detect the needed tools when no environment variable already
63 echo "Searching tools ..."
64 [ -z "$ACLOCAL" ] && ACLOCAL=`Search aclocal 1`
65 [ -z "$AUTOHEADER" ] && AUTOHEADER=`Search autoheader 2`
66 [ -z "$AUTOMAKE" ] && AUTOMAKE=`Search automake 1`
67 [ -z "$AUTOCONF" ] && AUTOCONF=`Search autoconf 2`
69 # Some debugging output ...
70 if [ -n "$DEBUG" ]; then
71 echo "ACLOCAL=$ACLOCAL"
72 echo "AUTOHEADER=$AUTOHEADER"
73 echo "AUTOMAKE=$AUTOMAKE"
74 echo "AUTOCONF=$AUTOCONF"
77 # Verify that all tools have been found
78 [ -z "$AUTOCONF" ] && Notfounf autoconf
79 [ -z "$AUTOHEADER" ] && Notfound autoheader
80 [ -z "$AUTOMAKE" ] && Notfound automake
81 [ -z "$AUTOCONF" ] && Notfound autoconf
83 export AUTOCONF AUTOHEADER AUTOMAKE AUTOCONF
86 echo "Generating files ..."
89 $AUTOMAKE --add-missing && \
93 # Success: if we got some parameters we call ./configure and pass
95 if [ -n "$*" -a -x ./configure ]; then
96 echo "Calling generated \"configure\" script ..."
100 echo "Okay, autogen.sh done; now run the \"configure\" script."
105 echo "Error! Check your installation of GNU automake and autoconf!"