-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfigure.ac
More file actions
84 lines (71 loc) · 2.52 KB
/
configure.ac
File metadata and controls
84 lines (71 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright 2005-2008 David Snyder <dasnyderx(at)yahoo(dot)com>
# Copyright 2019-2022 Joao Eriberto Mota Filho <eriberto@eriberto.pro.br>
# Copyright 2022 Sam James <sam@gentoo.org>
#
# This file is under the same terms described by
# LICENSE file for the main source code (rdate.c).
AC_PREREQ([2.69])
AC_INIT([openrdate],[1.11],[https://github.com/resurrecting-open-source-projects/openrdate/issues])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/rdate.c])
AC_CONFIG_HEADERS([config.h])
AC_ARG_VAR([kernel_version], [the version of the kernel to build against])
AC_CANONICAL_HOST
# Checks for programs.
AC_PROG_CC
if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall"
fi
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_EGREP
AM_PROG_AR
# Checks for libraries.
AC_CHECK_LIB([c], [fork])
AC_CHECK_LIB([util], [malloc])
#
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h limits.h netdb.h \
netinet/in.h stdlib.h string.h sys/param.h sys/socket.h \
sys/time.h unistd.h util.h])
AC_CHECK_HEADERS([bsd/stdlib.h], [], \
[echo "ERROR: previous header not found."; exit -1])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([gettimeofday memset select socket])
# Check for uname prog
AC_PATH_PROG([UNAME], [uname],
[:])
# Determine the particulars of the host
case "${host}" in
*-*-linux*)
AC_DEFINE([__LINUX__], [1], [Define Linux compile-time condition.])
# See whether to use sysctl depending on the linux kernel version
# See http://lwn.net/Articles/247243/
if test "x${kernel_version}" = "x" && test "x${UNAME}" != "x:" ; then
UNAMEOUT=`nice ${UNAME} -r 2> /dev/null`
if test "x${UNAMEOUT}" != "x"; then
NO_SYSCTL=`echo ${UNAMEOUT} | ${AWK} -F '.' '{ if ($1 >= 2 &&
$2 >= 6 &&
$3 >= 19)
print "1";
else print "0"; }'`
if test "x${NO_SYSCTL}" = "x1"; then
AC_DEFINE([__NO_SYSCTL__], [1], [Do not use the sysctl calls.])
fi
fi
fi
break;;
default) ;;
esac
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT