forked from linux-can/can-utils
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
120 lines (104 loc) · 2.16 KB
/
configure.ac
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT([can-utils],[trunk],[linux-can@vger.kernel.org])
AC_CONFIG_SRCDIR([lib.c])
AC_CONFIG_MACRO_DIR([config/m4])
AC_CONFIG_AUX_DIR([config/autoconf])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
#AM_MAINTAINER_MODE
CFLAGS="${CFLAGS} -Wall"
#
# Checks for programs.
#
AC_PROG_CC
LT_INIT(win32-dll)
AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2 subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
#
# Checks for header files.
#
AC_CHECK_HEADERS([ \
fcntl.h \
limits.h \
locale.h \
stdint.h \
stdlib.h \
string.h \
syslog.h \
termios.h \
unistd.h \
\
netinet/in.h \
\
sys/ioctl.h \
sys/socket.h \
sys/time.h \
])
#
# Checks for typedefs, structures, and compiler characteristics.
#
AC_C_INLINE
AC_SYS_LARGEFILE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_UINT64_T
#
# Checks for library functions.
#
AC_FUNC_FORK
AC_FUNC_MKTIME
AC_CHECK_FUNCS([ \
alarm \
gettimeofday \
localtime_r \
memset \
select \
setlocale \
socket \
strchr \
strerror \
strstr \
strtoul \
])
# glibc versions before 2.17 needs to link with -lrt for clock_nanosleep
AC_SEARCH_LIBS([clock_nanosleep], [rt])
AC_CHECK_DECL(SO_RXQ_OVFL,,
[AC_DEFINE([SO_RXQ_OVFL], [40], [SO_RXQ_OVFL])]
)
AC_CHECK_DECL(PF_CAN,,
[AC_DEFINE([PF_CAN], [29], [PF_CAN])]
)
AC_CHECK_DECL(AF_CAN,,
[AC_DEFINE([AF_CAN], [PF_CAN], [AF_CAN])]
)
AC_CHECK_DECL(N_SLCAN,,
[AC_DEFINE([N_SLCAN], [17], [N_SLCAN])]
)
AC_CHECK_DECL(SCM_TIMESTAMPING_OPT_STATS,,
[AC_DEFINE([SCM_TIMESTAMPING_OPT_STATS], [54], [SCM_TIMESTAMPING_OPT_STATS])]
)
AC_DEFINE(_GNU_SOURCE)
#
# Debugging
#
AC_MSG_CHECKING([whether to enable debugging])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug], [enable debugging [[default=no]]]),
[case "$enableval" in
(y | yes) CONFIG_DEBUG=yes ;;
(*) CONFIG_DEBUG=no ;;
esac],
[CONFIG_DEBUG=no])
AC_MSG_RESULT([${CONFIG_DEBUG}])
if test "${CONFIG_DEBUG}" = "yes"; then
CFLAGS="${CFLAGS} -Wsign-compare -Wfloat-equal -Wformat-security -g -O1"
AC_DEFINE(DEBUG, 1, [debugging])
else
CFLAGS="${CFLAGS} -O2"
fi
AC_CONFIG_FILES([
GNUmakefile
])
AC_OUTPUT