Blame
Date:
Sat Jan 2 12:36:45 2021 UTC
Message:
Update config.guess and config.sub to recent versions - config.guess: 2020-12-22 - config.sub: 2020-12-22
001
2001-12-11
alex
#!/bin/sh
002
2001-12-11
alex
#
003
2004-03-11
alex
# ngIRCd -- The Next Generation IRC Daemon
004
2016-10-21
alex
# Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors
005
2001-12-11
alex
#
006
2004-03-11
alex
# This program is free software; you can redistribute it and/or modify
007
2004-03-11
alex
# it under the terms of the GNU General Public License as published by
008
2004-03-11
alex
# the Free Software Foundation; either version 2 of the License, or
009
2004-03-11
alex
# (at your option) any later version.
010
2004-03-11
alex
# Please read the file COPYING, README and AUTHORS for more information.
011
2004-03-11
alex
#
012
2008-06-27
alex
# Usage:
013
2008-06-27
alex
# [VAR=<value>] ./autogen.sh [<configure-args>]
014
2004-03-11
alex
#
015
2004-03-15
alex
# This script generates the ./configure script using GNU automake and
016
2004-03-15
alex
# GNU autoconf. It tries to be smart in finding the correct/usable/available
017
2004-03-15
alex
# installed versions of these tools on your system.
018
2004-03-15
alex
#
019
2012-09-24
alex
# In addition, it enables or disables the "de-ANSI-fication" support of GNU
020
2012-09-24
alex
# automake, which is supported up to autoconf 1.11.x an has been removed
021
2012-09-24
alex
# in automake 1.12 -- make sure to use a version of automake supporting it
022
2012-09-24
alex
# when generating distribution archives!
023
2012-09-24
alex
#
024
2004-03-15
alex
# The following strategy is used for each of aclocal, autoheader, automake,
025
2004-03-15
alex
# and autoconf: first, "tool" (the regular name of the tool, e. g. "autoconf"
026
2004-03-15
alex
# or "automake") is checked. If this fails, "tool<major><minor>" (for example
027
2004-03-15
alex
# "automake16") and "tool-<major>.<minor>" (e. g. "autoconf-2.54") are tried
028
2004-03-15
alex
# with <major> being 2 for tool of GNU autoconf and 1 for tools of automake;
029
2004-03-15
alex
# <minor> is tried from 99 to 0. The first occurrence will be used.
030
2004-03-15
alex
#
031
2004-03-15
alex
# When you pass <configure-args> to autogen.sh it will call the generated
032
2004-03-15
alex
# ./configure script on success and pass these parameters to it.
033
2004-03-15
alex
#
034
2004-03-15
alex
# You can tweak the behaviour using these environment variables:
035
2004-03-15
alex
#
036
2004-04-05
alex
# - ACLOCAL=<cmd>, AUTOHEADER=<cmd>, AUTOMAKE=<cmd>, AUTOCONF=<cmd>
037
2004-03-15
alex
# Name and optionally path to the particular tool.
038
2004-03-15
alex
# - PREFIX=<path>
039
2004-03-15
alex
# Search the GNU autoconf and GNU automake tools in <path> first. If the
040
2004-03-15
alex
# generated ./configure script will be called, pass "--prefix=<path>" to it.
041
2004-04-05
alex
# - EXIST=<tool>
042
2004-04-05
alex
# Use <tool> to test for aclocal, autoheader etc. pp. ...
043
2004-04-05
alex
# When not specified, either "type" or "which" is used.
044
2004-03-15
alex
# - VERBOSE=1
045
2004-03-15
alex
# Output the detected names of the GNU automake and GNU autoconf tools.
046
2004-03-15
alex
# - GO=1
047
2004-03-15
alex
# Call ./configure even if no arguments have been passed to autogen.sh.
048
2004-03-15
alex
#
049
2004-03-15
alex
# Examples:
050
2004-03-15
alex
#
051
2004-03-15
alex
# - ./autogen.sh
052
2004-03-15
alex
# Generates the ./configure script.
053
2004-03-15
alex
# - GO=1 ./autogen.sh
054
2004-03-15
alex
# Generates the ./configure script and runs it as "./configure".
055
2004-03-15
alex
# - VERBOSE=1 ./autogen.sh --with-ident
056
2004-03-15
alex
# Show tool names, generates the ./configure script, and runs it with
057
2004-03-15
alex
# these arguments: "./configure --with-ident".
058
2004-03-15
alex
# - ACLOCAL=aclocal-1.6 GO=1 PREFIX=$HOME ./autogen.sh
059
2004-03-15
alex
# Uses "aclocal-1.6" as aclocal tool, generates the ./configure script,
060
2004-03-15
alex
# and runs it with these arguments: "./configure --prefix=$HOME".
061
2004-03-15
alex
#
062
2004-03-15
alex
063
2004-03-11
alex
Search()
064
2004-03-11
alex
{
065
2004-03-11
alex
[ $# -eq 2 ] || exit 1
066
2004-03-11
alex
067
2004-03-15
alex
searchlist="$1"
068
2004-03-11
alex
major="$2"
069
2004-03-11
alex
minor=99
070
2004-03-11
alex
071
2004-03-19
alex
[ -n "$PREFIX" ] && searchlist="${PREFIX}/$1 ${PREFIX}/bin/$1 $searchlist"
072
2004-03-19
alex
073
2004-03-15
alex
for name in $searchlist; do
074
2004-04-05
alex
$EXIST "${name}" >/dev/null 2>&1
075
2004-03-15
alex
if [ $? -eq 0 ]; then
076
2013-01-27
alex
"${name}" --version 2>&1 \
077
2013-01-27
alex
| grep -v "environment variable" >/dev/null 2>&1
078
2013-01-27
alex
if [ $? -eq 0 ]; then
079
2013-01-27
alex
echo "${name}"
080
2013-01-27
alex
return 0
081
2013-01-27
alex
fi
082
2004-03-15
alex
fi
083
2004-03-15
alex
done
084
2004-03-15
alex
085
2004-03-11
alex
while [ $minor -ge 0 ]; do
086
2004-03-15
alex
for name in $searchlist; do
087
2004-04-05
alex
$EXIST "${name}${major}${minor}" >/dev/null 2>&1
088
2004-03-15
alex
if [ $? -eq 0 ]; then
089
2004-03-15
alex
echo "${name}${major}${minor}"
090
2004-03-15
alex
return 0
091
2004-03-15
alex
fi
092
2004-04-05
alex
$EXIST "${name}-${major}.${minor}" >/dev/null 2>&1
093
2004-03-15
alex
if [ $? -eq 0 ]; then
094
2005-02-21
alex
echo "${name}-${major}.${minor}"
095
2004-03-15
alex
return 0
096
2004-03-15
alex
fi
097
2004-03-15
alex
done
098
2016-10-21
alex
minor=$(expr $minor - 1)
099
2004-03-11
alex
done
100
2004-03-11
alex
return 1
101
2004-03-11
alex
}
102
2004-03-11
alex
103
2004-03-11
alex
Notfound()
104
2004-03-11
alex
{
105
2004-03-11
alex
echo "Error: $* not found!"
106
2019-04-20
alex
echo 'Please install supported versions of GNU autoconf, GNU automake'
107
2019-04-20
alex
echo 'and pkg-config: see the INSTALL file for details.'
108
2004-03-11
alex
exit 1
109
2004-03-11
alex
}
110
2004-03-11
alex
111
2012-09-16
alex
Run()
112
2012-09-16
alex
{
113
2015-08-26
alex
[ "$VERBOSE" = "1" ] && echo " - running \"$*\" ..."
114
2015-08-26
alex
"$@"
115
2012-09-16
alex
}
116
2012-09-16
alex
117
2004-03-11
alex
# Reset locale settings to suppress warning messages of Perl
118
2004-03-11
alex
unset LC_ALL
119
2004-03-11
alex
unset LANG
120
2004-03-11
alex
121
2004-04-05
alex
# Which command should be used to detect the automake/autoconf tools?
122
2004-04-05
alex
[ -z "$EXIST" ] && existlist="type which" || existlist="$EXIST"
123
2004-04-05
alex
EXIST=""
124
2004-04-05
alex
for t in $existlist; do
125
2004-04-05
alex
$t /bin/ls >/dev/null 2>&1
126
2004-04-05
alex
if [ $? -eq 0 ]; then
127
2004-04-05
alex
rm -f /tmp/test.$$
128
2004-04-05
alex
$t /tmp/test.$$ >/dev/null 2>&1
129
2004-04-05
alex
[ $? -ne 0 ] && EXIST="$t"
130
2004-04-05
alex
fi
131
2004-04-05
alex
[ -n "$EXIST" ] && break
132
2004-04-05
alex
done
133
2004-04-05
alex
if [ -z "$EXIST" ]; then
134
2004-04-05
alex
echo "Didn't detect a working command to test for the autoconf/automake tools!"
135
2004-04-05
alex
echo "Searchlist: $existlist"
136
2004-04-05
alex
exit 1
137
2004-04-05
alex
fi
138
2004-04-05
alex
[ "$VERBOSE" = "1" ] && echo "Using \"$EXIST\" to test for tools."
139
2004-04-05
alex
140
2004-03-11
alex
# Try to detect the needed tools when no environment variable already
141
2007-10-07
alex
# specifies one:
142
2012-09-24
alex
echo "Searching for required tools ..."
143
2016-10-21
alex
[ -z "$ACLOCAL" ] && ACLOCAL=$(Search aclocal 1)
144
2012-09-16
alex
[ "$VERBOSE" = "1" ] && echo " - ACLOCAL=$ACLOCAL"
145
2016-10-21
alex
[ -z "$AUTOHEADER" ] && AUTOHEADER=$(Search autoheader 2)
146
2012-09-16
alex
[ "$VERBOSE" = "1" ] && echo " - AUTOHEADER=$AUTOHEADER"
147
2016-10-21
alex
[ -z "$AUTOMAKE" ] && AUTOMAKE=$(Search automake 1)
148
2012-09-16
alex
[ "$VERBOSE" = "1" ] && echo " - AUTOMAKE=$AUTOMAKE"
149
2016-10-21
alex
[ -z "$AUTOCONF" ] && AUTOCONF=$(Search autoconf 2)
150
2012-09-16
alex
[ "$VERBOSE" = "1" ] && echo " - AUTOCONF=$AUTOCONF"
151
2001-12-11
alex
152
2016-10-21
alex
AUTOCONF_VERSION=$(echo "$AUTOCONF" | cut -d'-' -f2-)
153
2016-10-21
alex
[ -n "$AUTOCONF_VERSION" ] && [ "$AUTOCONF_VERSION" != "autoconf" ] \
154
2013-01-27
alex
&& export AUTOCONF_VERSION || unset AUTOCONF_VERSION
155
2013-01-27
alex
[ "$VERBOSE" = "1" ] && echo " - AUTOCONF_VERSION=$AUTOCONF_VERSION"
156
2016-10-21
alex
AUTOMAKE_VERSION=$(echo $AUTOMAKE | cut -d'-' -f2-)
157
2016-10-21
alex
[ -n "$AUTOMAKE_VERSION" ] && [ "$AUTOMAKE_VERSION" != "automake" ] \
158
2013-01-27
alex
&& export AUTOMAKE_VERSION || unset AUTOMAKE_VERSION
159
2013-01-27
alex
[ "$VERBOSE" = "1" ] && echo " - AUTOMAKE_VERSION=$AUTOMAKE_VERSION"
160
2013-01-27
alex
161
2015-08-26
alex
[ $# -gt 0 ] && CONFIGURE_ARGS=" $*" || CONFIGURE_ARGS=""
162
2016-10-21
alex
[ -z "$GO" ] && [ -n "$CONFIGURE_ARGS" ] && GO=1
163
2004-03-11
alex
164
2004-03-11
alex
# Verify that all tools have been found
165
2019-04-20
alex
command -v pkg-config >/dev/null || Notfound pkg-config
166
2008-06-27
alex
[ -z "$ACLOCAL" ] && Notfound aclocal
167
2004-03-11
alex
[ -z "$AUTOHEADER" ] && Notfound autoheader
168
2004-03-11
alex
[ -z "$AUTOMAKE" ] && Notfound automake
169
2004-03-11
alex
[ -z "$AUTOCONF" ] && Notfound autoconf
170
2004-03-11
alex
171
2016-10-21
alex
AM_VERSION=$($AUTOMAKE --version | head -n 1 | sed -e 's/.* //g')
172
2012-09-24
alex
ifs=$IFS; IFS="."; set $AM_VERSION; IFS=$ifs
173
2016-12-05
alex
AM_MAJOR="$1"; AM_MINOR="$2"
174
2013-01-05
alex
echo "Detected automake $AM_VERSION ..."
175
2012-09-24
alex
176
2012-09-24
alex
AM_MAKEFILES="src/ipaddr/Makefile.ng src/ngircd/Makefile.ng src/testsuite/Makefile.ng src/tool/Makefile.ng"
177
2012-09-24
alex
178
2013-01-05
alex
# De-ANSI-fication?
179
2016-10-21
alex
if [ "$AM_MAJOR" -eq "1" ] && [ "$AM_MINOR" -lt "12" ]; then
180
2012-09-24
alex
# automake < 1.12 => automatic de-ANSI-fication support available
181
2013-01-05
alex
echo " - Enabling de-ANSI-fication support."
182
2012-09-24
alex
sed -e "s|^__ng_PROTOTYPES__|AM_C_PROTOTYPES|g" configure.ng >configure.ac
183
2012-09-24
alex
DEANSI_START=""
184
2012-09-24
alex
DEANSI_END=""
185
2012-09-24
alex
else
186
2012-09-24
alex
# automake >= 1.12 => no de-ANSI-fication support available
187
2013-01-05
alex
echo " - Disabling de-ANSI-fication support."
188
2012-09-24
alex
sed -e "s|^__ng_PROTOTYPES__|AC_C_PROTOTYPES|g" configure.ng >configure.ac
189
2012-09-24
alex
DEANSI_START="#"
190
2013-01-05
alex
DEANSI_END=" (disabled by ./autogen.sh script)"
191
2012-09-24
alex
fi
192
2013-01-05
alex
# Serial test harness?
193
2016-10-21
alex
if [ "$AM_MAJOR" -eq "1" ] && [ "$AM_MINOR" -ge "13" ]; then
194
2013-01-05
alex
# automake >= 1.13 => enforce "serial test harness"
195
2013-01-05
alex
echo " - Enforcing serial test harness."
196
2013-01-05
alex
SERIAL_TESTS="serial-tests"
197
2013-01-05
alex
else
198
2013-01-05
alex
# automake < 1.13 => no new test harness, nothing to do
199
2016-12-05
alex
# shellcheck disable=SC2034
200
2013-01-05
alex
SERIAL_TEST=""
201
2013-01-05
alex
fi
202
2013-01-05
alex
203
2013-01-05
alex
sed -e "s|^__ng_Makefile_am_template__|AUTOMAKE_OPTIONS = ${SERIAL_TESTS} ${DEANSI_START}ansi2knr${DEANSI_END}|g" \
204
2012-09-24
alex
src/portab/Makefile.ng >src/portab/Makefile.am
205
2012-09-24
alex
for makefile_ng in $AM_MAKEFILES; do
206
2016-10-21
alex
makefile_am=$(echo "$makefile_ng" | sed -e "s|\.ng\$|\.am|g")
207
2013-01-05
alex
sed -e "s|^__ng_Makefile_am_template__|AUTOMAKE_OPTIONS = ${SERIAL_TESTS} ${DEANSI_START}../portab/ansi2knr${DEANSI_END}|g" \
208
2012-09-24
alex
$makefile_ng >$makefile_am
209
2012-09-24
alex
done
210
2012-09-24
alex
211
2008-06-27
alex
export ACLOCAL AUTOHEADER AUTOMAKE AUTOCONF
212
2004-03-11
alex
213
2004-03-11
alex
# Generate files
214
2013-01-27
alex
echo "Generating files using \"$AUTOCONF\" and \"$AUTOMAKE\" ..."
215
2012-09-16
alex
Run $ACLOCAL && \
216
2012-09-16
alex
Run $AUTOCONF && \
217
2012-09-16
alex
Run $AUTOHEADER && \
218
2012-09-16
alex
Run $AUTOMAKE --add-missing --no-force
219
2004-03-11
alex
220
2016-10-21
alex
if [ $? -eq 0 ] && [ -x ./configure ]; then
221
2004-03-11
alex
# Success: if we got some parameters we call ./configure and pass
222
2004-03-11
alex
# all of them to it.
223
2016-10-21
alex
NAME=$(grep PACKAGE_STRING= configure | cut -d"'" -f2)
224
2004-03-19
alex
if [ "$GO" = "1" ]; then
225
2004-03-15
alex
[ -n "$PREFIX" ] && p=" --prefix=$PREFIX" || p=""
226
2012-09-24
alex
c="./configure${p}${CONFIGURE_ARGS}"
227
2010-10-24
alex
echo "Okay, autogen.sh for $NAME done."
228
2004-03-15
alex
echo "Calling \"$c\" ..."
229
2004-03-15
alex
$c
230
2004-03-11
alex
exit $?
231
2004-03-11
alex
else
232
2010-10-24
alex
echo "Okay, autogen.sh for $NAME done."
233
2010-10-24
alex
echo "Now run the \"./configure\" script."
234
2004-03-11
alex
exit 0
235
2004-03-11
alex
fi
236
2004-03-11
alex
else
237
2004-03-11
alex
# Failure!?
238
2004-03-11
alex
echo "Error! Check your installation of GNU automake and autoconf!"
239
2004-03-11
alex
exit 1
240
2004-03-11
alex
fi
241
2004-03-11
alex
242
2001-12-11
alex
# -eof-
IRCNow