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.8 2004/03/11 22:21:20 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
39 minor=`expr $minor - 1`
46 echo "Error: $* not found!"
47 echo "Please install recent versions of GNU autoconf and GNU automake."
51 # Reset locale settings to suppress warning messages of Perl
55 # We want to use GNU automake 1.7, if available (WANT_AUTOMAKE is used by
56 # the wrapper scripts of Gentoo Linux):
60 # Try to detect the needed tools when no environment variable already
62 echo "Searching tools ..."
63 [ -z "$ACLOCAL" ] && ACLOCAL=`Search aclocal 1`
64 [ -z "$AUTOHEADER" ] && AUTOHEADER=`Search autoheader 2`
65 [ -z "$AUTOMAKE" ] && AUTOMAKE=`Search automake 1`
66 [ -z "$AUTOCONF" ] && AUTOCONF=`Search autoconf 2`
68 # Some debugging output ...
69 if [ -n "$DEBUG" ]; then
70 echo "ACLOCAL=$ACLOCAL"
71 echo "AUTOHEADER=$AUTOHEADER"
72 echo "AUTOMAKE=$AUTOMAKE"
73 echo "AUTOCONF=$AUTOCONF"
76 # Verify that all tools have been found
77 [ -z "$AUTOCONF" ] && Notfounf autoconf
78 [ -z "$AUTOHEADER" ] && Notfound autoheader
79 [ -z "$AUTOMAKE" ] && Notfound automake
80 [ -z "$AUTOCONF" ] && Notfound autoconf
82 export AUTOCONF AUTOHEADER AUTOMAKE AUTOCONF
85 echo "Generating files ..."
88 $AUTOMAKE --add-missing && \
92 # Success: if we got some parameters we call ./configure and pass
94 if [ -n "$*" -a -x ./configure ]; then
95 echo "Calling generated \"configure\" script ..."
99 echo "Okay, autogen.sh done; now run the \"configure\" script."
104 echo "Error! Check your installation of GNU automake and autoconf!"