]> rtime.felk.cvut.cz Git - sojka/can-utils.git/blob - configure.ac
can-utils: AOSP build clean up
[sojka/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 #AM_MISSING_PROG(PERL, perl, $missing_dir)
21 # libtool, old:
22 AC_LIBTOOL_WIN32_DLL
23 #AC_LIBTOOL_TAGS([])
24 AC_PROG_LIBTOOL
25 # libtool, new:
26 # LT_INIT(win32-dll)
27
28 AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])
29 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes]]))
30
31 #
32 # Checks for header files.
33 #
34 AC_CHECK_HEADERS([ \
35         fcntl.h \
36         limits.h \
37         locale.h \
38         stdint.h \
39         stdlib.h \
40         string.h \
41         syslog.h \
42         termios.h \
43         unistd.h \
44         \
45         netinet/in.h \
46         \
47         sys/ioctl.h \
48         sys/socket.h \
49         sys/time.h \
50 ])
51
52
53 #
54 # Checks for typedefs, structures, and compiler characteristics.
55 #
56 AC_C_INLINE
57 AC_TYPE_PID_T
58 AC_TYPE_UINT64_T
59
60
61 #
62 # Checks for library functions.
63 #
64 AC_FUNC_FORK
65 AC_FUNC_MKTIME
66 AC_CHECK_FUNCS([ \
67         alarm \
68         gettimeofday \
69         localtime_r \
70         memset \
71         select \
72         setlocale \
73         socket \
74         strchr \
75         strerror \
76         strstr \
77         strtoul \
78 ])
79
80
81 AC_CHECK_DECL(SO_RXQ_OVFL,,
82     [AC_DEFINE([SO_RXQ_OVFL], [40], [SO_RXQ_OVFL])]
83 )
84 AC_CHECK_DECL(PF_CAN,,
85     [AC_DEFINE([PF_CAN], [29], [PF_CAN])]
86 )
87 AC_CHECK_DECL(AF_CAN,,
88     [AC_DEFINE([AF_CAN], [PF_CAN], [AF_CAN])]
89 )
90
91
92 #
93 # Debugging
94 #
95 AC_MSG_CHECKING([whether to enable debugging])
96 AC_ARG_ENABLE(debug,
97     AS_HELP_STRING([--enable-debug], [enable debugging [[default=no]]]),
98         [case "$enableval" in
99         (y | yes) CONFIG_DEBUG=yes ;;
100         (*) CONFIG_DEBUG=no ;;
101     esac],
102     [CONFIG_DEBUG=no])
103 AC_MSG_RESULT([${CONFIG_DEBUG}])
104 if test "${CONFIG_DEBUG}" = "yes"; then
105     CFLAGS="${CFLAGS} -Wsign-compare -Wfloat-equal -Wformat-security -g -O1"
106     AC_DEFINE(DEBUG, 1, [debugging])
107 else
108     CFLAGS="${CFLAGS} -O2"
109 fi
110
111
112 AC_CONFIG_FILES([
113         GNUmakefile
114         ])
115 AC_OUTPUT