Newer
Older
#------------------------------------------------------------------------------
# $Id$
#------------------------------------------------------------------------------
AC_CONFIG_AUX_DIR([autoconf])
AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-bzip2])
AC_PREFIX_DEFAULT([/opt/etherlab])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([config.h.in])
#------------------------------------------------------------------------------
# Linux sources
#------------------------------------------------------------------------------
Florian Pose
committed
AC_ARG_WITH([linux-dir],
Florian Pose
committed
[--with-linux-dir=<DIR>],
[Linux kernel sources @<:@running kernel@:>@]
Florian Pose
committed
[
sourcedir=[$withval]
],
[
version=[`uname -r`]
modulesdir=/lib/modules/${version}
if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then
echo
AC_MSG_ERROR([Invalid modules directory ${modulesdir}])
fi
sourcedir=`cd ${modulesdir}/build && pwd -P`
]
Florian Pose
committed
AC_MSG_CHECKING([for Linux kernel sources])
if test \! -r ${sourcedir}/.config; then
Florian Pose
committed
AC_MSG_ERROR([No configured Linux kernel sources in $sourcedir])
AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
Florian Pose
committed
AC_MSG_RESULT($LINUX_SOURCE_DIR)
#------------------------------------------------------------------------------
# Depmod
#------------------------------------------------------------------------------
AC_PATH_PROG([DEPMOD], [depmod],, [$PATH:/sbin:/usr/sbin:/usr/local/sbin])
if test -z "$DEPMOD"; then
AC_MSG_WARN([depmod was not found!]);
fi
#------------------------------------------------------------------------------
# Debug interface
#------------------------------------------------------------------------------
AC_ARG_ENABLE([debug-if],
Florian Pose
committed
AS_HELP_STRING([--enable-dbg-if],
[Create a debug interface for each master @<:@NO@:>@]),
[
case "${enableval}" in
yes) dbg=1
AC_DEFINE([EC_DBG_IF], [1], [Debug interfaces enabled])
;;
no) dbg=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-dbg-if])
;;
esac
],
[dbg=0]
Florian Pose
committed
AM_CONDITIONAL(EC_DBG_IF, test "x$dbg" = x1)
AC_SUBST([EC_DBG_IF],${dbg})
#------------------------------------------------------------------------------
Richard Hacker
committed
AC_CONFIG_FILES([
Makefile
master/Makefile
devices/Makefile
Richard Hacker
committed
script/Makefile
Richard Hacker
committed
examples/mini/Makefile
Richard Hacker
committed
])
AC_OUTPUT
#------------------------------------------------------------------------------