2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([can-utils], [trunk], [socketcan-core@lists.berlios.de])
6 AC_CONFIG_SRCDIR([lib.c])
7 AC_CONFIG_MACRO_DIR([config/m4])
8 AC_CONFIG_AUX_DIR([config/autoconf])
14 CFLAGS="${CFLAGS} -Wall"
17 # Checks for programs.
20 #AM_MISSING_PROG(PERL, perl, $missing_dir)
28 AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])
32 # Checks for header files.
54 # Checks for typedefs, structures, and compiler characteristics.
62 # Checks for library functions.
82 # check for SOCKETCAN specific defines and headers
84 AC_ARG_WITH(linux-headers,
85 AS_HELP_STRING([--with-linux-headers=/path/to/kernel/include], [path to linux kernel headers]),
88 AC_MSG_ERROR([You must supply a PATH as argument to --with-linux-headers]) ;;
90 LINUX_HEADERS_DIR="$(cd "${withval}" && pwd)"
91 if test $? -ne 0; then
92 AC_MSG_ERROR(["${withval}" seems to be an invalid path!])
97 maybe_linux_headers_dir="../kernel/2.6/include"
98 if test -z "${LINUX_HEADERS_DIR}" -a -e "${maybe_linux_headers_dir}"; then
99 LINUX_HEADERS_DIR="$(cd "${maybe_linux_headers_dir}" && pwd)"
101 if test -n "${LINUX_HEADERS_DIR}"; then
102 linux_CFLAGS="-I${LINUX_HEADERS_DIR}"
104 CPPFLAGS="${CPPFLAGS} ${linux_CFLAGS}"
105 AC_SUBST(linux_CFLAGS)
113 #ifdef HAVE_SYS_SOCKET_H
114 #include <sys/socket.h>
118 AM_CONDITIONAL(CONFIG_GW, [test "${ac_cv_header_linux_can_gw_h}" = "yes"])
119 AM_CONDITIONAL(CONFIG_ISOTP, [test "${ac_cv_header_linux_can_isotp_h}" = "yes"])
122 AC_CHECK_DECL(SO_RXQ_OVFL,,
123 [AC_DEFINE([SO_RXQ_OVFL], [40], [SO_RXQ_OVFL])]
125 AC_CHECK_DECL(PF_CAN,,
126 [AC_DEFINE([PF_CAN], [29], [PF_CAN])]
128 AC_CHECK_DECL(AF_CAN,,
129 [AC_DEFINE([AF_CAN], [PF_CAN], [AF_CAN])]
136 AC_MSG_CHECKING([whether to enable debugging])
138 AS_HELP_STRING([--enable-debug], [enable debugging [[default=no]]]),
139 [case "$enableval" in
140 (y | yes) CONFIG_DEBUG=yes ;;
141 (*) CONFIG_DEBUG=no ;;
144 AC_MSG_RESULT([${CONFIG_DEBUG}])
145 if test "${CONFIG_DEBUG}" = "yes"; then
146 CFLAGS="${CFLAGS} -Wsign-compare -Wfloat-equal -Wformat-security -g -O1"
147 AC_DEFINE(DEBUG, 1, [debugging])
149 CFLAGS="${CFLAGS} -O2"