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