forked from linux-can/libsocketcan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
165 lines (144 loc) · 3.51 KB
/
configure.ac
File metadata and controls
165 lines (144 loc) · 3.51 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([libsocketcan], [0.0.12], [bugs@pengutronix.de])
AC_CONFIG_HEADERS([include/libsocketcan_config.h])
AC_CONFIG_SRCDIR([src/libsocketcan.c])
AC_CONFIG_MACRO_DIR([config/m4])
AC_CONFIG_AUX_DIR([config/autoconf])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
CFLAGS="${CFLAGS} -Wall"
#
# libtool library versioning stuff
#
# Library code modified: REVISION++
# Interfaces changed/added/removed: CURRENT++ REVISION=0
# Interfaces added: AGE++
# Interfaces removed: AGE=0
LT_CURRENT=5
LT_REVISION=1
LT_AGE=3
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
#
# Checks for programs.
#
AC_PROG_CC
LT_INIT(win32-dll)
AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
#
# Checks for libraries.
#
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([ \
arpa/inet.h \
limits.h \
netdb.h \
netinet/in.h \
stddef.h \
stdlib.h \
string.h \
sys/param.h \
sys/socket.h \
sys/time.h \
sys/un.h \
unistd.h \
utime.h \
net/if.h \
])
#
# Checks for typedefs, structures, and compiler characteristics.
#
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
#
# Checks for library functions.
#
AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS([gethostbyaddr gethostbyname gethostname gettimeofday memset mkdir socket utime])
#
# 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} -Werror -Wsign-compare -Wfloat-equal -Wformat-security -g -O1"
AC_DEFINE(DEBUG, 1, [debugging])
else
CFLAGS="${CFLAGS} -g -O2"
fi
#
# Error logging
#
AC_MSG_CHECKING([whether to enable error logging])
AC_ARG_ENABLE(error-log,
AS_HELP_STRING([--enable-error-log], [enable error log @<:@default=yes@:>@]),
[case "$enableval" in
y | yes) CONFIG_ERROR_LOG=yes ;;
*) CONFIG_ERROR_LOG=no ;;
esac],
[CONFIG_ERROR_LOG=yes])
AC_MSG_RESULT([${CONFIG_ERROR_LOG}])
if test "${CONFIG_ERROR_LOG}" = "no"; then
AC_DEFINE(DISABLE_ERROR_LOG, 1, [disable error logging])
fi
#
# Enable gcov
#
AC_MSG_CHECKING([whether to enable gcov])
AC_ARG_ENABLE([gcov],
[AS_HELP_STRING([--enable-gcov], [Enable gcov in build time (for debug, default is no)])],
[:],
[enable_gcov=no])
AC_MSG_RESULT([$enable_gcov])
if test "$enable_gcov" = "yes"; then
CFLAGS="${CFLAGS} -coverage"
fi
#
# Enable address-sanitizer
#
AC_MSG_CHECKING([whether to enable address-sanitizer])
AC_ARG_ENABLE([address-sanitizer],
[AS_HELP_STRING([--enable-address-sanitizer], [Enable address sanitizer in build time (for debug, default is no)])],
[:],
[enable_address_sanitizer=no])
AC_MSG_RESULT([$enable_address_sanitizer])
if test "$enable_address_sanitizer" = "yes"; then
CFLAGS="${CFLAGS} -fsanitize=address"
fi
#
# Enable unit test
#
AC_ARG_ENABLE([test],
[AS_HELP_STRING([--enable-test], [Enable unit test build (cmocka is required, default is no])],
[:],
[enable_test=no])
AM_CONDITIONAL([ENABLE_TEST], [test "$enable_test" = "yes"])
AS_CASE(
["$enable_test"],
[yes], [PKG_CHECK_MODULES([CMOCKA], [cmocka])],[])
AC_CONFIG_FILES([
GNUmakefile
config/libsocketcan.pc
config/GNUmakefile
include/GNUmakefile
src/GNUmakefile
test/GNUmakefile
])
AC_OUTPUT