]>
The Tcpdump Group git mirrors - tcpdump/blob - autogen.sh
3 : "${AUTORECONF:=autoreconf}"
4 : "${BUILD_YEAR2038:=no}"
6 AUTORECONFVERSION
=`$AUTORECONF --version 2>&1 | grep "^autoreconf" | sed 's/.*) *//'`
8 maj
=`echo "$AUTORECONFVERSION" | cut -d. -f1`
9 min
=`echo "$AUTORECONFVERSION" | cut -d. -f2`
10 # The minimum required version of autoconf is currently 2.69.
11 if [ "$maj" = "" ] ||
[ "$min" = "" ] || \
12 [ "$maj" -lt 2 ] ||
{ [ "$maj" -eq 2 ] && [ "$min" -lt 69 ]; }; then
14 Please install the 'autoconf' package version 2.69 or later.
15 If version 2.69 or later is already installed and there is no
16 autoconf default, it may be necessary to set the AUTORECONF
17 environment variable to enable the one to use, like:
18 AUTORECONF=autoreconf-2.69 ./autogen.sh
20 AUTORECONF=autoreconf-2.71 ./autogen.sh
25 echo "$AUTORECONF identification: $AUTORECONFVERSION"
27 # On Linux, if Autoconf version >= 2.72 and GNU C Library version >= 2.34,
28 # s/AC_SYS_LARGEFILE/AC_SYS_YEAR2038_RECOMMENDED/ to ensure time_t
30 if [ "$BUILD_YEAR2038" = yes ] && [ "`uname -s`" = Linux
]; then
31 if [ "$maj" -gt 2 ] ||
{ [ "$maj" -eq 2 ] && [ "$min" -ge 72 ]; }; then
32 GLIBC_VERSION
=`ldd --version|head -1|grep GLIBC|sed 's/.* //'`
33 maj_glibc
=`echo "$GLIBC_VERSION" | cut -d. -f1`
34 min_glibc
=`echo "$GLIBC_VERSION" | cut -d. -f2`
35 echo "GNU C Library identification: $GLIBC_VERSION"
36 if [ "$maj_glibc" -gt 2 ] ||
{ [ "$maj_glibc" -eq 2 ] && \
37 [ "$min_glibc" -ge 34 ]; }; then
38 CONFIGURE_AC_NEW
="configure.ac.new$$"
39 sed 's/^# \(AC_SYS_YEAR2038_RECOMMENDED\)/\1/' \
40 <configure.ac
>"$CONFIGURE_AC_NEW"
41 cmp -s configure.ac
"$CONFIGURE_AC_NEW" || \
42 cat "$CONFIGURE_AC_NEW" >configure.ac
43 rm -f "$CONFIGURE_AC_NEW"
44 echo 'Setup to ensure time_t is Y2038-safe.'
49 # configure.ac is an Autoconf 2.69 file, but it works as expected even with
50 # Autoconf 2.72. However, in Autoconf versions 2.70 and later obsolete
51 # construct warnings are enabled by default, which adds varying (depending on
52 # the branch) amount of noise to the build matrix output, so provide a means
54 env
${AUTOCONF_WARNINGS:+WARNINGS="$AUTOCONF_WARNINGS"} "$AUTORECONF" -f
56 # Autoconf 2.71 adds a blank line after the final "exit 0" on Linux, but not
57 # on OpenBSD. Remove this difference to make it easier to compare the result
58 # of "make releasetar" across different platforms. From sed one-liners:
59 # "delete all trailing blank lines at end of file (works on all seds)". Don't
60 # use mktemp(1) because AIX does not have it.
61 CONFIGURE_NEW
="configure.new$$"
62 sed -e :a
-e '/^\n*$/{$d;N;ba' -e '}' <configure
>"$CONFIGURE_NEW"
63 cmp -s configure
"$CONFIGURE_NEW" ||
cat "$CONFIGURE_NEW" >configure
64 rm -f "$CONFIGURE_NEW"