fp@365: #------------------------------------------------------------------------------
fp@1363: #
fp@1363: # $Id$
fp@1363: #
fp@2348: # Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH
fp@1363: #
fp@1363: # This file is part of the IgH EtherCAT Master.
fp@1363: #
fp@1363: # The IgH EtherCAT Master is free software; you can redistribute it and/or
fp@1363: # modify it under the terms of the GNU General Public License version 2, as
fp@1363: # published by the Free Software Foundation.
fp@1363: #
fp@1363: # The IgH EtherCAT Master is distributed in the hope that it will be useful,
fp@1363: # but WITHOUT ANY WARRANTY; without even the implied warranty of
fp@1363: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
fp@1363: # Public License for more details.
fp@1363: #
fp@1363: # You should have received a copy of the GNU General Public License along
fp@1363: # with the IgH EtherCAT Master; if not, write to the Free Software
fp@1363: # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
fp@1363: #
fp@1363: # ---
fp@2384: #
fp@1363: # The license mentioned above concerns the source code only. Using the
fp@1363: # EtherCAT technology and brand is only permitted in compliance with the
fp@1363: # industrial property and similar rights of Beckhoff Automation GmbH.
fp@1363: #
fp@365: #------------------------------------------------------------------------------
fp@365:
fp@392: AC_PREREQ(2.59)
fp@2514:
fp@2514: #
fp@2514: # Release procedure
fp@2526: # - Update Ethernet drivers up to release kernel version
fp@2514: # - Write NEWS entry with changes since last release
fp@2514: # - Check for complete Doxygen comments
fp@2514: # - Update version number in documentation
fp@2526: # - Update the ChangeLog -> hg log -bstable-1.5 --style=changelog > ChangeLog
fp@2526: # - Update version number below
fp@2526: # - make dist-bzip2
fp@2526: #
fp@2526: AC_INIT([ethercat],[1.5.2],[fp@igh-essen.com])
fp@387: AC_CONFIG_AUX_DIR([autoconf])
p@2566: AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 subdir-objects])
fp@387: AC_PREFIX_DEFAULT([/opt/etherlab])
fp@392: AC_CONFIG_HEADERS([config.h])
fp@392: AC_CONFIG_SRCDIR([config.h.in])
fp@1432: AC_CONFIG_MACRO_DIR([m4])
fp@365:
fp@365: #------------------------------------------------------------------------------
fp@444: # Global
fp@444: #------------------------------------------------------------------------------
fp@444:
fp@2489: AM_PROG_CC_C_O
fp@2489: m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
fp@922: AC_PROG_CXX
fp@1242: AC_PROG_LIBTOOL
fp@922:
fp@444: #------------------------------------------------------------------------------
fp@2540: # Kernel modules
fp@2540: #------------------------------------------------------------------------------
fp@2540:
fp@2540: AC_MSG_CHECKING([whether to build kernel modules])
fp@2540:
fp@2540: AC_ARG_ENABLE([kernel],
fp@2540: AS_HELP_STRING([--enable-kernel],
fp@2540: [Enable building kernel modules]),
fp@2540: [
fp@2540: case "${enableval}" in
fp@2540: yes) enablekernel=1
fp@2540: ;;
fp@2540: no) enablekernel=0
fp@2540: ;;
fp@2540: *) AC_MSG_ERROR([Invalid value for --enable-generic])
fp@2540: ;;
fp@2540: esac
fp@2540: ],
fp@2540: [enablekernel=1]
fp@2540: )
fp@2540:
fp@2540: if test "x$enablekernel" = "x1"; then
fp@2540: AC_MSG_RESULT([yes])
fp@2540: else
fp@2540: AC_MSG_RESULT([no])
fp@2540: fi
fp@2540:
fp@2540: AM_CONDITIONAL(ENABLE_KERNEL, test "x$enablekernel" = "x1")
fp@2540: AC_SUBST(ENABLE_KERNEL,[$enablekernel])
fp@2540:
fp@2540: #------------------------------------------------------------------------------
fp@365: # Linux sources
fp@365: #------------------------------------------------------------------------------
fp@365:
fp@2540: if test "x$enablekernel" = "x1"; then
fp@2540:
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@477: AC_MSG_ERROR([Failed to find Linux sources. Use --with-linux-dir!])
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@477: echo
fp@477: AC_MSG_ERROR([No configured Linux kernel sources in $sourcedir])
fp@365: fi
fp@365:
fp@477: # Try to get kernel release string
fp@537: if test -r ${sourcedir}/include/config/kernel.release; then
fp@537: kernelrelease=`cat $sourcedir/include/config/kernel.release`
fp@537: elif test -r ${sourcedir}/.kernelrelease; then
fp@477: kernelrelease=`cat $sourcedir/.kernelrelease`
fp@507: elif test -r ${sourcedir}/include/linux/utsrelease.h; then
fp@507: hdr=${sourcedir}/include/linux/utsrelease.h
fp@507: kernelrelease=`grep UTS_RELEASE $hdr | cut -d " " -f 3- | tr -d \"`
fp@477: elif test -r ${sourcedir}/include/linux/version.h; then
fp@507: hdr=${sourcedir}/include/linux/version.h
fp@477: kernelrelease=`grep UTS_RELEASE $hdr | cut -d " " -f 3- | tr -d \"`
fp@477: fi
fp@477:
fp@477: if test -z "$kernelrelease"; then
fp@477: echo
fp@477: AC_MSG_ERROR([Failed to extract Linux kernel version!])
fp@477: fi
fp@477:
fp@2376: if test ${kernelrelease%%.*} -gt 2; then
fp@2376: regex="^[[0-9]]+\.[[0-9]]+"
fp@2376: else
fp@2376: regex="^[[0-9]]+\.[[0-9]]+\.[[0-9]]+"
fp@2376: fi
fp@2376:
fp@2376: # Extract numbers from kernel release
fp@2376: linuxversion=`echo $kernelrelease | grep -oE "$regex"`
fp@477:
fp@367: AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
fp@1825: AC_MSG_RESULT([$LINUX_SOURCE_DIR (Kernel $linuxversion)])
fp@1824:
fp@2540: fi
fp@2540:
fp@1824: #------------------------------------------------------------------------------
fp@1824: # Linux module installation subdirectory
fp@1824: #------------------------------------------------------------------------------
fp@1824:
fp@1824: AC_ARG_WITH([module-dir],
fp@1824: AC_HELP_STRING(
fp@1824: [--with-module-dir=],
fp@1824: [Linux module installation dir. Default: ethercat]
fp@1824: ),
fp@1824: [moddir=[$withval]],
fp@1824: [moddir="ethercat"]
fp@1824: )
fp@1824: AC_SUBST(INSTALL_MOD_DIR,[$moddir])
fp@1824:
fp@1825: AC_MSG_CHECKING([for Linux modules installation directory])
fp@1824: AC_MSG_RESULT([$INSTALL_MOD_DIR])
fp@367:
fp@367: #------------------------------------------------------------------------------
fp@1540: # Generic Ethernet driver
fp@1540: #------------------------------------------------------------------------------
fp@1540:
fp@1540: AC_ARG_ENABLE([generic],
fp@1540: AS_HELP_STRING([--enable-generic],
fp@1540: [Enable generic Ethernet driver]),
fp@1540: [
fp@1540: case "${enableval}" in
fp@1540: yes) enablegeneric=1
fp@1540: ;;
fp@1540: no) enablegeneric=0
fp@1540: ;;
fp@1540: *) AC_MSG_ERROR([Invalid value for --enable-generic])
fp@1540: ;;
fp@1540: esac
fp@1540: ],
fp@2540: [enablegeneric=$enablekernel]
fp@1540: )
fp@1540:
fp@1540: AM_CONDITIONAL(ENABLE_GENERIC, test "x$enablegeneric" = "x1")
fp@1540: AC_SUBST(ENABLE_GENERIC,[$enablegeneric])
fp@1540:
fp@1540: #------------------------------------------------------------------------------
fp@582: # 8139too driver
fp@582: #------------------------------------------------------------------------------
fp@582:
fp@582: AC_ARG_ENABLE([8139too],
fp@582: AS_HELP_STRING([--enable-8139too],
fp@582: [Enable 8139too driver]),
fp@582: [
fp@582: case "${enableval}" in
fp@582: yes) enable8139too=1
fp@582: ;;
fp@582: no) enable8139too=0
fp@582: ;;
fp@582: *) AC_MSG_ERROR([Invalid value for --enable-8139too])
fp@582: ;;
fp@582: esac
fp@582: ],
fp@2540: [enable8139too=$enablekernel]
fp@582: )
fp@582:
fp@582: AM_CONDITIONAL(ENABLE_8139TOO, test "x$enable8139too" = "x1")
fp@732: AC_SUBST(ENABLE_8139TOO,[$enable8139too])
fp@485:
fp@485: AC_ARG_WITH([8139too-kernel],
fp@485: AC_HELP_STRING(
fp@485: [--with-8139too-kernel=],
fp@485: [8139too kernel (only if differing)]
fp@485: ),
fp@485: [
fp@485: kernel8139too=[$withval]
fp@485: ],
fp@485: [
fp@485: kernel8139too=$linuxversion
fp@485: ]
fp@485: )
fp@485:
fp@582: if test "x${enable8139too}" = "x1"; then
fp@582: AC_MSG_CHECKING([for kernel for 8139too driver])
fp@582:
fp@945: kernels=`ls -1 ${srcdir}/devices/ | grep -oE "^8139too-.*-" | cut -d "-" -f 2 | uniq`
fp@582: found=0
fp@582: for k in $kernels; do
fp@582: if test "$kernel8139too" = "$k"; then
fp@582: found=1
fp@582: fi
fp@582: done
fp@582: if test $found -ne 1; then
fp@582: AC_MSG_ERROR([kernel $kernel8139too not available for 8139too driver!])
fp@582: fi
fp@582:
fp@582: AC_MSG_RESULT([$kernel8139too])
fp@582: fi
fp@582:
fp@732: AC_SUBST(KERNEL_8139TOO,[$kernel8139too])
fp@732:
fp@582: #------------------------------------------------------------------------------
fp@582: # e100 driver
fp@569: #------------------------------------------------------------------------------
fp@569:
fp@569: AC_ARG_ENABLE([e100],
fp@569: AS_HELP_STRING([--enable-e100],
fp@569: [Enable e100 driver]),
fp@569: [
fp@569: case "${enableval}" in
fp@569: yes) enablee100=1
fp@569: ;;
fp@569: no) enablee100=0
fp@569: ;;
fp@569: *) AC_MSG_ERROR([Invalid value for --enable-e100])
fp@569: ;;
fp@569: esac
fp@569: ],
fp@582: [enablee100=0] # disabled by default
fp@582: )
fp@582:
fp@582: AM_CONDITIONAL(ENABLE_E100, test "x$enablee100" = "x1")
fp@732: AC_SUBST(ENABLE_E100,[$enablee100])
fp@568:
fp@568: AC_ARG_WITH([e100-kernel],
fp@568: AC_HELP_STRING(
fp@568: [--with-e100-kernel=],
fp@568: [e100 kernel (only if differing)]
fp@568: ),
fp@568: [
fp@568: kernele100=[$withval]
fp@568: ],
fp@568: [
fp@568: kernele100=$linuxversion
fp@568: ]
fp@568: )
fp@568:
fp@582: if test "x${enablee100}" = "x1"; then
fp@569: AC_MSG_CHECKING([for kernel for e100 driver])
fp@569:
fp@945: kernels=`ls -1 ${srcdir}/devices/ | grep -oE "^e100-.*-" | cut -d "-" -f 2 | uniq`
fp@569: found=0
fp@569: for k in $kernels; do
fp@569: if test "$kernele100" = "$k"; then
fp@569: found=1
fp@569: fi
fp@569: done
fp@569: if test $found -ne 1; then
fp@569: AC_MSG_ERROR([kernel $kernele100 not available for e100 driver!])
fp@569: fi
fp@569:
fp@569: AC_MSG_RESULT([$kernele100])
fp@569: fi
fp@568:
fp@732: AC_SUBST(KERNEL_E100,[$kernele100])
fp@732:
fp@568: #------------------------------------------------------------------------------
fp@667: # e1000 driver
fp@667: #------------------------------------------------------------------------------
fp@667:
fp@667: AC_ARG_ENABLE([e1000],
fp@667: AS_HELP_STRING([--enable-e1000],
fp@667: [Enable e1000 driver]),
fp@667: [
fp@667: case "${enableval}" in
fp@667: yes) enablee1000=1
fp@667: ;;
fp@667: no) enablee1000=0
fp@667: ;;
fp@667: *) AC_MSG_ERROR([Invalid value for --enable-e1000])
fp@667: ;;
fp@667: esac
fp@667: ],
fp@667: [enablee1000=0] # disabled by default
fp@667: )
fp@667:
fp@667: AM_CONDITIONAL(ENABLE_E1000, test "x$enablee1000" = "x1")
fp@732: AC_SUBST(ENABLE_E1000,[$enablee1000])
fp@667:
fp@667: AC_ARG_WITH([e1000-kernel],
fp@667: AC_HELP_STRING(
fp@667: [--with-e1000-kernel=],
fp@667: [e1000 kernel (only if differing)]
fp@667: ),
fp@667: [
fp@667: kernele1000=[$withval]
fp@667: ],
fp@667: [
fp@667: kernele1000=$linuxversion
fp@667: ]
fp@667: )
fp@667:
fp@667: if test "x${enablee1000}" = "x1"; then
fp@667: AC_MSG_CHECKING([for kernel for e1000 driver])
fp@667:
fp@945: kernels=`ls -1 ${srcdir}/devices/e1000/ | grep -oE "^e1000_main-.*" | cut -d "-" -f 2 | uniq`
fp@667: found=0
fp@667: for k in $kernels; do
fp@667: if test "$kernele1000" = "$k"; then
fp@667: found=1
fp@667: fi
fp@667: done
fp@667: if test $found -ne 1; then
fp@667: AC_MSG_ERROR([kernel $kernele1000 not available for e1000 driver!])
fp@667: fi
fp@667:
fp@667: AC_MSG_RESULT([$kernele1000])
fp@667: fi
fp@667:
fp@732: AC_SUBST(KERNEL_E1000,[$kernele1000])
fp@732:
fp@667: #------------------------------------------------------------------------------
fp@2133: # e1000e driver
fp@2133: #------------------------------------------------------------------------------
fp@2133:
fp@2133: AC_ARG_ENABLE([e1000e],
fp@2133: AS_HELP_STRING([--enable-e1000e],
fp@2133: [Enable e1000e driver]),
fp@2133: [
fp@2133: case "${enableval}" in
fp@2133: yes) enablee1000e=1
fp@2133: ;;
fp@2133: no) enablee1000e=0
fp@2133: ;;
fp@2133: *) AC_MSG_ERROR([Invalid value for --enable-e1000e])
fp@2133: ;;
fp@2133: esac
fp@2133: ],
fp@2133: [enablee1000e=0] # disabled by default
fp@2133: )
fp@2133:
fp@2133: AM_CONDITIONAL(ENABLE_E1000E, test "x$enablee1000e" = "x1")
fp@2133: AC_SUBST(ENABLE_E1000E,[$enablee1000e])
fp@2133:
fp@2133: AC_ARG_WITH([e1000e-kernel],
fp@2133: AC_HELP_STRING(
fp@2133: [--with-e1000e-kernel=],
fp@2133: [e1000e kernel (only if differing)]
fp@2133: ),
fp@2133: [
fp@2133: kernele1000e=[$withval]
fp@2133: ],
fp@2133: [
fp@2133: kernele1000e=$linuxversion
fp@2133: ]
fp@2133: )
fp@2133:
fp@2585: e1000elayout=0
fp@2491:
fp@2133: if test "x${enablee1000e}" = "x1"; then
fp@2133: AC_MSG_CHECKING([for kernel for e1000e driver])
fp@2133:
fp@2133: kernels=`ls -1 ${srcdir}/devices/e1000e/ | grep -oE "^netdev-.*" | cut -d "-" -f 2 | uniq`
fp@2133: found=0
fp@2133: for k in $kernels; do
fp@2133: if test "$kernele1000e" = "$k"; then
fp@2133: found=1
fp@2133: fi
fp@2133: done
fp@2133: if test $found -ne 1; then
fp@2133: AC_MSG_ERROR([kernel $kernele1000e not available for e1000e driver!])
fp@2133: fi
fp@2133:
fp@2133: AC_MSG_RESULT([$kernele1000e])
fp@2491:
fp@2585: # check for e1000e file layout (changed in kernel 3.4 and 3.10)
fp@2491: AC_MSG_CHECKING([for e1000e source layout])
fp@2491:
fp@2491: file34="${srcdir}/devices/e1000e/80003es2lan-$kernele1000e-ethercat.c"
fp@2585: file310="${srcdir}/devices/e1000e/ptp-$kernele1000e-ethercat.c"
fp@2585:
fp@2585: if test -r "$file310"; then
fp@2585: AC_MSG_RESULT([>= 3.10])
fp@2585: e1000elayout=2
fp@2585: elif test -r "$file34"; then
fp@2491: AC_MSG_RESULT([>= 3.4])
fp@2585: e1000elayout=1
fp@2491: else
fp@2491: AC_MSG_RESULT([before 3.4])
fp@2491: fi
fp@2491:
fp@2133: fi
fp@2133:
fp@2133: AC_SUBST(KERNEL_E1000E,[$kernele1000e])
fp@2585: AC_SUBST(E1000E_LAYOUT, [$e1000elayout])
fp@2133:
fp@2133: #------------------------------------------------------------------------------
fp@2685: # igb driver
fp@2685: #------------------------------------------------------------------------------
fp@2685:
fp@2685: AC_ARG_ENABLE([igb],
fp@2685: AS_HELP_STRING([--enable-igb],
fp@2685: [Enable igb driver]),
fp@2685: [
fp@2685: case "${enableval}" in
fp@2685: yes) enableigb=1
fp@2685: ;;
fp@2685: no) enableigb=0
fp@2685: ;;
fp@2685: *) AC_MSG_ERROR([Invalid value for --enable-igb])
fp@2685: ;;
fp@2685: esac
fp@2685: ],
fp@2685: [enableigb=0] # disabled by default
fp@2685: )
fp@2685:
fp@2685: AM_CONDITIONAL(ENABLE_IGB, test "x$enableigb" = "x1")
fp@2685: AC_SUBST(ENABLE_IGB,[$enableigb])
fp@2685:
fp@2685: AC_ARG_WITH([igb-kernel],
fp@2685: AC_HELP_STRING(
fp@2685: [--with-igb-kernel=],
fp@2685: [igb kernel (only if differing)]
fp@2685: ),
fp@2685: [
fp@2685: kerneligb=[$withval]
fp@2685: ],
fp@2685: [
fp@2685: kerneligb=$linuxversion
fp@2685: ]
fp@2685: )
fp@2685:
fp@2685: if test "x${enableigb}" = "x1"; then
fp@2685: AC_MSG_CHECKING([for kernel for igb driver])
fp@2685:
fp@2685: if test ! -f "${srcdir}/devices/igb/igb_main-${kerneligb}-orig.c"; then
fp@2685: AC_MSG_ERROR([kernel $kerneligb not available for igb driver!])
fp@2685: fi
fp@2685:
fp@2685: AC_MSG_RESULT([$kerneligb])
fp@2685: fi
fp@2685:
fp@2685: AC_SUBST(KERNEL_IGB,[$kerneligb])
fp@2685:
fp@2685: #------------------------------------------------------------------------------
fp@1353: # r8169 driver
fp@1353: #------------------------------------------------------------------------------
fp@1353:
fp@1353: AC_ARG_ENABLE([r8169],
fp@1353: AS_HELP_STRING([--enable-r8169],
fp@1353: [Enable r8169 driver]),
fp@1353: [
fp@1353: case "${enableval}" in
fp@1353: yes) enable_r8169=1
fp@1353: ;;
fp@1353: no) enable_r8169=0
fp@1353: ;;
fp@1353: *) AC_MSG_ERROR([Invalid value for --enable-r8169])
fp@1353: ;;
fp@1353: esac
fp@1353: ],
fp@1353: [enable_r8169=0] # disabled by default
fp@1353: )
fp@1353:
fp@1353: AM_CONDITIONAL(ENABLE_R8169, test "x$enable_r8169" = "x1")
fp@1353: AC_SUBST(ENABLE_R8169,[$enable_r8169])
fp@1353:
fp@1353: AC_ARG_WITH([r8169-kernel],
fp@1353: AC_HELP_STRING(
fp@1353: [--with-r8169-kernel=],
fp@1353: [r8169 kernel (only if differing)]
fp@1353: ),
fp@1353: [
fp@1353: kernel_r8169=[$withval]
fp@1353: ],
fp@1353: [
fp@1353: kernel_r8169=$linuxversion
fp@1353: ]
fp@1353: )
fp@1353:
fp@1353: if test "x${enable_r8169}" = "x1"; then
fp@1353: AC_MSG_CHECKING([for kernel for r8169 driver])
fp@1353:
fp@1353: kernels=`ls -1 ${srcdir}/devices/ | grep -oE "^r8169-.*-" | cut -d "-" -f 2 | uniq`
fp@1353: found=0
fp@1353: for k in $kernels; do
fp@1353: if test "$kernel_r8169" = "$k"; then
fp@1353: found=1
fp@1353: fi
fp@1353: done
fp@1353: if test $found -ne 1; then
fp@1353: AC_MSG_ERROR([kernel $kernel_r8169 not available for r8169 driver!])
fp@1353: fi
fp@1353:
fp@1353: AC_MSG_RESULT([$kernel_r8169])
fp@1353: fi
fp@1353:
fp@1353: AC_SUBST(KERNEL_R8169,[$kernel_r8169])
fp@1353:
fp@1353: #------------------------------------------------------------------------------
fp@2563: # CCAT driver
fp@2563: #------------------------------------------------------------------------------
fp@2563:
fp@2563: AC_MSG_CHECKING([whether to build the CCAT driver])
fp@2563:
fp@2563: AC_ARG_ENABLE([ccat],
fp@2563: AS_HELP_STRING([--enable-ccat],
fp@2563: [Enable CCAT driver]),
fp@2563: [
fp@2563: case "${enableval}" in
fp@2563: yes) enableccat=1
fp@2563: ;;
fp@2563: no) enableccat=0
fp@2563: ;;
fp@2563: *) AC_MSG_ERROR([Invalid value for --enable-ccat])
fp@2563: ;;
fp@2563: esac
fp@2563: ],
fp@2563: [enableccat=0] # disabled by default
fp@2563: )
fp@2563:
fp@2563: if test "x${enableccat}" = "x1"; then
fp@2563: AC_MSG_RESULT([yes])
fp@2563: else
fp@2563: AC_MSG_RESULT([no])
fp@2563: fi
fp@2563:
fp@2563: AM_CONDITIONAL(ENABLE_CCAT, test "x$enableccat" = "x1")
fp@2563: AC_SUBST(ENABLE_CCAT,[$enableccat])
fp@2563:
fp@2563: #------------------------------------------------------------------------------
fp@485: # RTAI path (optional)
fp@485: #------------------------------------------------------------------------------
fp@485:
fp@485: AC_ARG_WITH([rtai-dir],
fp@485: AC_HELP_STRING(
fp@485: [--with-rtai-dir=],
fp@2433: [RTAI path, for RTDM interface and RTAI examples]
fp@485: ),
fp@485: [
fp@485: rtaidir=[$withval]
fp@2433: rtai=1
fp@485: ],
fp@485: [
fp@485: rtaidir=""
fp@2433: rtai=0
fp@485: ]
fp@485: )
fp@485:
fp@485: AC_MSG_CHECKING([for RTAI path])
fp@485:
fp@485: if test -z "${rtaidir}"; then
fp@485: AC_MSG_RESULT([not specified.])
fp@485: else
fp@485: if test \! -r ${rtaidir}/include/rtai.h; then
fp@485: AC_MSG_ERROR([no RTAI installation found in ${rtaidir}!])
fp@485: fi
fp@485: AC_MSG_RESULT([$rtaidir])
fp@2433:
fp@2433: rtai_lxrt_cflags=`$rtaidir/bin/rtai-config --lxrt-cflags`
fp@2433: rtai_lxrt_ldflags=`$rtaidir/bin/rtai-config --lxrt-ldflags`
fp@732: fi
fp@732:
fp@732: AC_SUBST(RTAI_DIR,[$rtaidir])
fp@2433: AM_CONDITIONAL(ENABLE_RTAI, test "x$rtai" = "x1")
fp@2433: AC_SUBST(ENABLE_RTAI,[$rtai])
fp@2433:
fp@2433: AC_SUBST(RTAI_LXRT_CFLAGS,[$rtai_lxrt_cflags])
fp@2433: AC_SUBST(RTAI_LXRT_LDFLAGS,[$rtai_lxrt_ldflags])
fp@2433:
fp@2433: #------------------------------------------------------------------------------
fp@2433: # Xenomai path (optional)
fp@2433: #------------------------------------------------------------------------------
fp@2433:
fp@2433: AC_ARG_WITH([xenomai-dir],
fp@2433: AC_HELP_STRING(
fp@2433: [--with-xenomai-dir=],
fp@2433: [Xenomai path, for RTDM interface and Xenomai examples]
fp@2433: ),
fp@2433: [
fp@2433: xenomaidir=[$withval]
fp@2433: xeno=1
fp@2433: ],
fp@2433: [
fp@2433: xenomaidir=""
fp@2433: xeno=0
fp@2433: ]
fp@2433: )
fp@2433:
fp@2433: AC_MSG_CHECKING([for Xenomai path])
fp@2433:
fp@2433: if test -z "${xenomaidir}"; then
fp@2433: AC_MSG_RESULT([not specified.])
fp@2433: else
fp@2433: if test \! -r ${xenomaidir}/include/xeno_config.h; then
fp@2433: AC_MSG_ERROR([no Xenomai installation found in ${xenomaidir}!])
fp@2433: fi
fp@2433: AC_MSG_RESULT([$xenomaidir])
fp@2433:
fp@2433: xeno_native_cflags=`$xenomaidir/bin/xeno-config --skin native --cflags`
fp@2433: xeno_native_ldflags=`$xenomaidir/bin/xeno-config --skin native --ldflags`
fp@2433: xeno_posix_cflags=`$xenomaidir/bin/xeno-config --skin posix --cflags`
fp@2433: xeno_posix_ldflags=`$xenomaidir/bin/xeno-config --skin posix --ldflags`
fp@2433: xeno_rtdm_cflags=`$xenomaidir/bin/xeno-config --skin rtdm --cflags`
fp@2433: xeno_rtdm_ldflags=`$xenomaidir/bin/xeno-config --skin rtdm --ldflags`
fp@2433: fi
fp@2433:
fp@2433: AC_SUBST(XENOMAI_DIR,[$xenomaidir])
fp@2433: AM_CONDITIONAL(ENABLE_XENOMAI, test "x$xeno" = "x1")
fp@2433: AC_SUBST(ENABLE_XENOMAI,[$xeno])
fp@2433:
fp@2433: AC_SUBST(XENOMAI_NATIVE_CFLAGS,[$xeno_native_cflags])
fp@2433: AC_SUBST(XENOMAI_NATIVE_LDFLAGS,[$xeno_native_ldflags])
fp@2433: AC_SUBST(XENOMAI_POSIX_CFLAGS,[$xeno_posix_cflags])
fp@2433: AC_SUBST(XENOMAI_POSIX_LDFLAGS,[$xeno_posix_ldflags])
fp@2433: AC_SUBST(XENOMAI_RTDM_CFLAGS,[$xeno_rtdm_cflags])
fp@2433: AC_SUBST(XENOMAI_RTDM_LDFLAGS,[$xeno_rtdm_ldflags])
fp@2433:
fp@2433: #------------------------------------------------------------------------------
fp@2433: # RTDM interface (optional)
fp@2433: #------------------------------------------------------------------------------
fp@2433:
fp@2433: AC_ARG_ENABLE([rtdm],
fp@2433: AC_HELP_STRING(
fp@2433: [--enable-rtdm],
fp@2433: [Enable RTDM interface, depends on RTAI or Xenomai]
fp@2433: ),
fp@2433: [
fp@2433: case "${enableval}" in
fp@2433: yes) rtdm=1
fp@2433: ;;
fp@2433: no) rtdm=0
fp@2433: ;;
fp@2433: *) AC_MSG_ERROR([Invalid value for --enable-rtdm])
fp@2433: ;;
fp@2433: esac
fp@2433: ],
fp@2433: [rtdm=0]
fp@2433: )
fp@2433:
fp@2433: AC_MSG_CHECKING([whether to build RTDM interface])
fp@2433:
fp@2433: if test "x${rtdm}" = "x1"; then
fp@2433: AC_DEFINE([EC_RTDM], [1], [RTDM interface enabled])
fp@2433: AC_MSG_RESULT([yes])
fp@2433: else
fp@2433: AC_MSG_RESULT([no])
fp@2433: fi
fp@2433:
fp@2433: AM_CONDITIONAL(ENABLE_RTDM, test "x$rtdm" = "x1")
fp@2433: AC_SUBST(ENABLE_RTDM,[$rtdm])
fp@485:
fp@485: #------------------------------------------------------------------------------
fp@392: # Debug interface
fp@392: #------------------------------------------------------------------------------
fp@392:
fp@2509: AC_MSG_CHECKING([whether to build the debug interface])
fp@2509:
fp@679: AC_ARG_ENABLE([debug-if],
fp@679: AS_HELP_STRING([--enable-debug-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: ;;
fp@440: no) dbg=0
fp@440: ;;
fp@679: *) AC_MSG_ERROR([Invalid value for --enable-debug-if])
fp@440: ;;
fp@440: esac
fp@440: ],
fp@440: [dbg=0]
fp@392: )
fp@440:
fp@679: if test "x${dbg}" = "x1"; then
fp@679: AC_DEFINE([EC_DEBUG_IF], [1], [Debug interfaces enabled])
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@2509: fi
fp@2509:
fp@679: AM_CONDITIONAL(ENABLE_DEBUG_IF, test "x$dbg" = "x1")
fp@732: AC_SUBST(ENABLE_DEBUG_IF,[$dbg])
fp@679:
fp@679: #------------------------------------------------------------------------------
fp@692: # Debug ring
fp@692: #------------------------------------------------------------------------------
fp@692:
fp@2509: AC_MSG_CHECKING([whether to build the debug ring])
fp@2509:
fp@692: AC_ARG_ENABLE([debug-ring],
fp@692: AS_HELP_STRING([--enable-debug-ring],
fp@692: [Create a debug ring to record frames @<:@NO@:>@]),
fp@692: [
fp@692: case "${enableval}" in
fp@692: yes) debugring=1
fp@692: ;;
fp@692: no) debugring=0
fp@692: ;;
fp@692: *) AC_MSG_ERROR([Invalid value for --enable-debug-ring])
fp@692: ;;
fp@692: esac
fp@692: ],
fp@692: [debugring=0]
fp@692: )
fp@692:
fp@692: if test "x${debugring}" = "x1"; then
fp@692: AC_DEFINE([EC_DEBUG_RING], [1], [Debug ring enabled])
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@692: fi
fp@692:
fp@692: #------------------------------------------------------------------------------
fp@1327: # Ethernet over EtherCAT support
fp@715: #------------------------------------------------------------------------------
fp@715:
fp@2509: AC_MSG_CHECKING([whether to build with EoE support])
fp@2509:
fp@715: AC_ARG_ENABLE([eoe],
fp@715: AS_HELP_STRING([--enable-eoe],
fp@715: [Enable EoE support (default: yes)]),
fp@715: [
fp@715: case "${enableval}" in
fp@715: yes) eoe=1
fp@715: ;;
fp@715: no) eoe=0
fp@715: ;;
fp@715: *) AC_MSG_ERROR([Invalid value for --enable-eoe])
fp@715: ;;
fp@715: esac
fp@715: ],
fp@715: [eoe=1]
fp@715: )
fp@715:
fp@715: if test "x${eoe}" = "x1"; then
fp@715: AC_DEFINE([EC_EOE], [1], [EoE support enabled])
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@2509: fi
fp@2509:
fp@715: AM_CONDITIONAL(ENABLE_EOE, test "x$eoe" = "x1")
fp@732: AC_SUBST(ENABLE_EOE,[$eoe])
fp@485:
fp@485: #------------------------------------------------------------------------------
fp@1040: # CPU timestamp counter support
fp@1040: #------------------------------------------------------------------------------
fp@1040:
fp@2509: AC_MSG_CHECKING([whether to use the CPU timestamp counter])
fp@2509:
fp@1040: AC_ARG_ENABLE([cycles],
fp@1040: AS_HELP_STRING([--enable-cycles],
fp@1040: [Use CPU timestamp counter (default: no)]),
fp@1040: [
fp@1040: case "${enableval}" in
fp@1040: yes) cycles=1
fp@1040: ;;
fp@1040: no) cycles=0
fp@1040: ;;
fp@1040: *) AC_MSG_ERROR([Invalid value for --enable-cycles])
fp@1040: ;;
fp@1040: esac
fp@1040: ],
fp@1040: [cycles=0]
fp@1040: )
fp@1040:
fp@1040: if test "x${cycles}" = "x1"; then
fp@1040: AC_DEFINE([EC_HAVE_CYCLES], [1], [Use CPU timestamp counter])
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@1040: fi
fp@1040:
fp@1040: #------------------------------------------------------------------------------
fp@1773: # High-resolution timer support
fp@1773: #------------------------------------------------------------------------------
fp@1773:
fp@2509: AC_MSG_CHECKING([whether to use high-resolution timers for scheduling])
fp@2509:
fp@1773: AC_ARG_ENABLE([hrtimer],
fp@1773: AS_HELP_STRING([--enable-hrtimer],
fp@1773: [Use high-resolution timer for scheduling (default: no)]),
fp@1773: [
fp@1773: case "${enableval}" in
fp@1773: yes) hrtimer=1
fp@1773: ;;
fp@1773: no) hrtimer=0
fp@1773: ;;
fp@1773: *) AC_MSG_ERROR([Invalid value for --enable-hrtimer])
fp@1773: ;;
fp@1773: esac
fp@1773: ],
fp@1773: [hrtimer=0]
fp@1773: )
fp@1773:
fp@1773: if test "x${hrtimer}" = "x1"; then
fp@1773: AC_DEFINE([EC_USE_HRTIMER], [1], [Use hrtimer for scheduling])
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@1773: fi
fp@1773:
fp@1773: #------------------------------------------------------------------------------
fp@1934: # Read alias address from register
fp@1934: #------------------------------------------------------------------------------
fp@1934:
fp@2509: AC_MSG_CHECKING([whether to read alias addresses from registers])
fp@2509:
fp@1934: AC_ARG_ENABLE([regalias],
fp@1934: AS_HELP_STRING([--enable-regalias],
fp@1934: [Read alias adresses from register (default: no)]),
fp@1934: [
fp@1934: case "${enableval}" in
fp@1934: yes) regalias=1
fp@1934: ;;
fp@1934: no) regalias=0
fp@1934: ;;
fp@1934: *) AC_MSG_ERROR([Invalid value for --enable-regalias])
fp@1934: ;;
fp@1934: esac
fp@1934: ],
fp@1934: [regalias=0]
fp@1934: )
fp@1934:
fp@1934: if test "x${regalias}" = "x1"; then
fp@1934: AC_DEFINE([EC_REGALIAS], [1], [Read alias adresses from register])
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@1934: fi
fp@1934:
fp@1934: #------------------------------------------------------------------------------
fp@1253: # Command-line tool
fp@1253: #-----------------------------------------------------------------------------
fp@1253:
fp@2509: AC_MSG_CHECKING([whether to build the command-line tool])
fp@2509:
fp@1253: AC_ARG_ENABLE([tool],
fp@1253: AS_HELP_STRING([--enable-tool],
fp@1253: [Build command-line tool (default: yes)]),
fp@1253: [
fp@1253: case "${enableval}" in
fp@1253: yes) tool=1
fp@1253: ;;
fp@1253: no) tool=0
fp@1253: ;;
fp@1253: *) AC_MSG_ERROR([Invalid value for --enable-tool])
fp@1253: ;;
fp@1253: esac
fp@1253: ],
fp@1253: [tool=1]
fp@1253: )
fp@1253:
fp@2509: if test "x${tool}" = "x1"; then
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@2509: fi
fp@2509:
fp@1253: AM_CONDITIONAL(BUILD_TOOL, test "x$tool" = "x1")
fp@1253:
fp@1253: #------------------------------------------------------------------------------
fp@1242: # Userspace library generation
fp@1242: #------------------------------------------------------------------------------
fp@1242:
fp@2509: AC_MSG_CHECKING([whether to build the userspace library])
fp@2509:
fp@1242: AC_ARG_ENABLE([userlib],
fp@1242: AS_HELP_STRING([--enable-userlib],
fp@1242: [Generation of the userspace library (default: yes)]),
fp@1242: [
fp@1242: case "${enableval}" in
fp@1242: yes) userlib=1
fp@1242: ;;
fp@1242: no) userlib=0
fp@1242: ;;
fp@1242: *) AC_MSG_ERROR([Invalid value for --enable-userlib])
fp@1242: ;;
fp@1242: esac
fp@1242: ],
fp@1242: [userlib=1]
fp@1242: )
fp@1242:
fp@2509: if test "x${userlib}" = "x1"; then
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@2509: fi
fp@2509:
fp@1242: AM_CONDITIONAL(ENABLE_USERLIB, test "x$userlib" = "x1")
fp@1242:
fp@1242: #------------------------------------------------------------------------------
fp@1565: # TTY driver
fp@1565: #------------------------------------------------------------------------------
fp@1565:
fp@2509: AC_MSG_CHECKING([whether to build the tty driver])
fp@2509:
fp@1565: AC_ARG_ENABLE([tty],
fp@1565: AS_HELP_STRING([--enable-tty],
fp@1565: [Generation of the ec_tty module (default: no)]),
fp@1565: [
fp@1565: case "${enableval}" in
fp@1565: yes) tty=1
fp@1565: ;;
fp@1565: no) tty=0
fp@1565: ;;
fp@1565: *) AC_MSG_ERROR([Invalid value for --enable-tty])
fp@1565: ;;
fp@1565: esac
fp@1565: ],
fp@1565: [tty=0]
fp@1565: )
fp@1565:
fp@2509: if test "x${tty}" = "x1"; then
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@2509: fi
fp@2509:
fp@1565: AM_CONDITIONAL(ENABLE_TTY, test "x$tty" = "x1")
fp@1565: AC_SUBST(ENABLE_TTY,[$tty])
fp@1565:
fp@1565: #------------------------------------------------------------------------------
fp@2295: # Slave identification wildcards
fp@2295: #------------------------------------------------------------------------------
fp@2295:
fp@2509: AC_MSG_CHECKING([whether to allow identification wildcards])
fp@2509:
fp@2295: AC_ARG_ENABLE([wildcards],
fp@2295: AS_HELP_STRING([--enable-wildcards],
fp@2295: [Enable vendor ID / product code wildcards (default: no)]),
fp@2295: [
fp@2295: case "${enableval}" in
fp@2295: yes) wildcards=1
fp@2295: ;;
fp@2295: no) wildcards=0
fp@2295: ;;
fp@2295: *) AC_MSG_ERROR([Invalid value for --enable-wildcards])
fp@2295: ;;
fp@2295: esac
fp@2295: ],
fp@2295: [wildcards=0]
fp@2295: )
fp@2295:
fp@2295: if test "x${wildcards}" = "x1"; then
fp@2295: AC_DEFINE([EC_IDENT_WILDCARDS], [1],
fp@2295: [Use vendor id / product code wildcards])
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@2295: fi
fp@2295:
fp@2295: #------------------------------------------------------------------------------
fp@2453: # Redundancy (number of devices)
fp@2453: #------------------------------------------------------------------------------
fp@2453:
fp@2453: AC_ARG_WITH([devices],
fp@2453: AC_HELP_STRING(
fp@2453: [--with-devices=],
fp@2453: [Number of Ethernet devices per master. Default: 1]
fp@2453: ),
fp@2453: [
fp@2453: devices=[$withval]
fp@2453: ],
fp@2453: [
fp@2453: devices=1
fp@2453: ]
fp@2453: )
fp@2453:
fp@2453: AC_MSG_CHECKING([for number of Ethernet devices])
fp@2453:
fp@2453: if test "${devices}" -lt 1; then
fp@2453: AC_MSG_ERROR([Number must be greater zero!])
fp@2453: else
fp@2453: if test "${devices}" -gt 1; then
fp@2453: AC_MSG_RESULT([$devices (Redundancy enabled)])
fp@2453: else
fp@2453: AC_MSG_RESULT([$devices (Redundancy disabled)])
fp@2453: fi
fp@2453: fi
fp@2453:
fp@2453: AC_DEFINE_UNQUOTED([EC_MAX_NUM_DEVICES], $devices,
fp@2453: [Max. number of Ethernet devices per master])
fp@2453:
fp@2453: #------------------------------------------------------------------------------
fp@2508: # SII assignment
fp@2508: #------------------------------------------------------------------------------
fp@2508:
fp@2509: AC_MSG_CHECKING([whether to assign the SII to PDI])
fp@2509:
fp@2508: AC_ARG_ENABLE([sii-assign],
fp@2508: AS_HELP_STRING([--enable-sii-assign],
fp@2508: [Enable SII assignment to PDI (default: no)]),
fp@2508: [
fp@2508: case "${enableval}" in
fp@2508: yes) siiassign=1
fp@2508: ;;
fp@2508: no) siiassign=0
fp@2508: ;;
fp@2508: *) AC_MSG_ERROR([Invalid value for --enable-sii-assign])
fp@2508: ;;
fp@2508: esac
fp@2508: ],
fp@2508: [siiassign=0]
fp@2508: )
fp@2508:
fp@2508: if test "x${siiassign}" = "x1"; then
fp@2508: AC_DEFINE([EC_SII_ASSIGN], [1], [Assign SII to PDI])
fp@2509: AC_MSG_RESULT([yes])
fp@2509: else
fp@2509: AC_MSG_RESULT([no])
fp@2508: fi
fp@2508:
fp@2508: #------------------------------------------------------------------------------
fp@2532: # syslog output in realtime context
fp@2532: #------------------------------------------------------------------------------
fp@2532:
fp@2532: AC_MSG_CHECKING([whether to syslog in realtime context])
fp@2532:
fp@2532: AC_ARG_ENABLE([rt-syslog],
fp@2532: AS_HELP_STRING([--enable-rt-syslog],
fp@2532: [Enable RT syslog (default: yes)]),
fp@2532: [
fp@2532: case "${enableval}" in
fp@2532: yes) rtsyslog=1
fp@2532: ;;
fp@2532: no) rtsyslog=0
fp@2532: ;;
fp@2532: *) AC_MSG_ERROR([Invalid value for --enable-rt-syslog])
fp@2532: ;;
fp@2532: esac
fp@2532: ],
fp@2532: [rtsyslog=1]
fp@2532: )
fp@2532:
fp@2532: if test "x${rtsyslog}" = "x1"; then
fp@2532: AC_DEFINE([EC_RT_SYSLOG], [1], [Output to syslog in RT context])
fp@2532: AC_MSG_RESULT([yes])
fp@2532: else
fp@2532: AC_MSG_RESULT([no])
fp@2532: fi
fp@2532:
fp@2532: #------------------------------------------------------------------------------
fp@485:
ha@385: AC_CONFIG_FILES([
fp@757: Doxyfile
fp@732: Kbuild
fp@392: Makefile
fp@882: devices/Kbuild
fp@882: devices/Makefile
p@2549: devices/ccat/Kbuild
p@2549: devices/ccat/Makefile
fp@882: devices/e1000/Kbuild
fp@882: devices/e1000/Makefile
fp@2133: devices/e1000e/Kbuild
fp@2133: devices/e1000e/Makefile
fp@2685: devices/igb/Kbuild
fp@2685: devices/igb/Makefile
fp@1810: ethercat.spec
fp@1286: examples/Kbuild
fp@882: examples/Makefile
fp@1414: examples/dc_rtai/Kbuild
fp@1414: examples/dc_rtai/Makefile
fp@1414: examples/dc_user/Makefile
fp@882: examples/mini/Kbuild
fp@882: examples/mini/Makefile
fp@882: examples/rtai/Kbuild
fp@882: examples/rtai/Makefile
fp@2433: examples/rtai_rtdm/Makefile
fp@2447: examples/rtai_rtdm_dc/Makefile
fp@1810: examples/tty/Kbuild
fp@1567: examples/tty/Makefile
fp@1242: examples/user/Makefile
fp@2433: examples/xenomai/Makefile
fp@2433: examples/xenomai_posix/Makefile
fp@882: include/Makefile
fp@1242: lib/Makefile
fp@1440: m4/Makefile
fp@732: master/Kbuild
fp@392: master/Makefile
ha@385: script/Makefile
fp@2309: script/ethercat.service
fp@2309: script/ethercatctl
fp@563: script/init.d/Makefile
fp@1185: script/init.d/ethercat
fp@563: script/sysconfig/Makefile
fp@1120: tool/Makefile
fp@1810: tty/Kbuild
fp@1565: tty/Makefile
ha@385: ])
fp@365: AC_OUTPUT
fp@365:
fp@365: #------------------------------------------------------------------------------