]> rtime.felk.cvut.cz Git - can-utils.git/blob - configure.ac
candump: Enable HW timestamping before using it
[can-utils.git] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3 AC_PREREQ([2.59])
4
5 AC_INIT([can-utils],[trunk],[linux-can@vger.kernel.org])
6 AC_CONFIG_SRCDIR([lib.c])
7 AC_CONFIG_MACRO_DIR([config/m4])
8 AC_CONFIG_AUX_DIR([config/autoconf])
9 AC_CANONICAL_BUILD
10 AC_CANONICAL_HOST
11
12 #AM_MAINTAINER_MODE
13
14 CFLAGS="${CFLAGS} -Wall"
15
16 #
17 # Checks for programs.
18 #
19 AC_PROG_CC
20 LT_INIT(win32-dll)
21
22 AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])
23 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
24
25 #
26 # Checks for header files.
27 #
28 AC_CHECK_HEADERS([ \
29         fcntl.h \
30         limits.h \
31         locale.h \
32         stdint.h \
33         stdlib.h \
34         string.h \
35         syslog.h \
36         termios.h \
37         unistd.h \
38         \
39         netinet/in.h \
40         \
41         sys/ioctl.h \
42         sys/socket.h \
43         sys/time.h \
44 ])
45
46
47 #
48 # Checks for typedefs, structures, and compiler characteristics.
49 #
50 AC_C_INLINE
51 AC_SYS_LARGEFILE
52 AC_TYPE_OFF_T
53 AC_TYPE_PID_T
54 AC_TYPE_UINT64_T
55
56
57 #
58 # Checks for library functions.
59 #
60 AC_FUNC_FORK
61 AC_FUNC_MKTIME
62 AC_CHECK_FUNCS([ \
63         alarm \
64         gettimeofday \
65         localtime_r \
66         memset \
67         select \
68         setlocale \
69         socket \
70         strchr \
71         strerror \
72         strstr \
73         strtoul \
74 ])
75
76
77 AC_CHECK_DECL(SO_RXQ_OVFL,,
78     [AC_DEFINE([SO_RXQ_OVFL], [40], [SO_RXQ_OVFL])]
79 )
80 AC_CHECK_DECL(PF_CAN,,
81     [AC_DEFINE([PF_CAN], [29], [PF_CAN])]
82 )
83 AC_CHECK_DECL(AF_CAN,,
84     [AC_DEFINE([AF_CAN], [PF_CAN], [AF_CAN])]
85 )
86 AC_CHECK_DECL(N_SLCAN,,
87     [AC_DEFINE([N_SLCAN], [17], [N_SLCAN])]
88 )
89
90
91 #
92 # Debugging
93 #
94 AC_MSG_CHECKING([whether to enable debugging])
95 AC_ARG_ENABLE(debug,
96     AS_HELP_STRING([--enable-debug], [enable debugging [[default=no]]]),
97         [case "$enableval" in
98         (y | yes) CONFIG_DEBUG=yes ;;
99         (*) CONFIG_DEBUG=no ;;
100     esac],
101     [CONFIG_DEBUG=no])
102 AC_MSG_RESULT([${CONFIG_DEBUG}])
103 if test "${CONFIG_DEBUG}" = "yes"; then
104     CFLAGS="${CFLAGS} -Wsign-compare -Wfloat-equal -Wformat-security -g -O1"
105     AC_DEFINE(DEBUG, 1, [debugging])
106 else
107     CFLAGS="${CFLAGS} -O2"
108 fi
109
110
111 AC_CONFIG_FILES([
112         GNUmakefile
113         ])
114 AC_OUTPUT