fp@365: #------------------------------------------------------------------------------
fp@1363: #
fp@2414: # $Id$
fp@1363: #
fp@2589: # 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@2393: #
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@2589:
fp@2589: #
fp@2589: # Release procedure
fp@2589: # - Update Ethernet drivers up to release kernel version
fp@2589: # - Write NEWS entry with changes since last release
fp@2589: # - Check for complete Doxygen comments
fp@2589: # - Update version number in documentation
fp@2589: # - Update the ChangeLog -> hg log -bstable-1.5 --style=changelog > ChangeLog
fp@2589: # - Update version number below
fp@2589: # - make dist-bzip2
fp@2589: #
fp@2589: AC_INIT([ethercat],[1.5.2],[fp@igh-essen.com])
fp@387: AC_CONFIG_AUX_DIR([autoconf])
fp@2589: 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@2589: AM_PROG_CC_C_O
fp@2589: m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
fp@922: AC_PROG_CXX
fp@1242: AC_PROG_LIBTOOL
fp@2589:
fp@2589: #------------------------------------------------------------------------------
fp@2589: # Kernel modules
fp@2589: #------------------------------------------------------------------------------
fp@2589:
fp@2589: AC_MSG_CHECKING([whether to build kernel modules])
fp@2589:
fp@2589: AC_ARG_ENABLE([kernel],
fp@2589: AS_HELP_STRING([--enable-kernel],
fp@2589: [Enable building kernel modules]),
fp@2589: [
fp@2589: case "${enableval}" in
fp@2589: yes) enablekernel=1
fp@2589: ;;
fp@2589: no) enablekernel=0
fp@2589: ;;
fp@2589: *) AC_MSG_ERROR([Invalid value for --enable-generic])
fp@2589: ;;
fp@2589: esac
fp@2589: ],
fp@2589: [enablekernel=1]
fp@2589: )
fp@2589:
fp@2589: if test "x$enablekernel" = "x1"; then
fp@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
fp@2589:
fp@2589: AM_CONDITIONAL(ENABLE_KERNEL, test "x$enablekernel" = "x1")
fp@2589: AC_SUBST(ENABLE_KERNEL,[$enablekernel])
fp@922:
fp@444: #------------------------------------------------------------------------------
fp@365: # Linux sources
fp@365: #------------------------------------------------------------------------------
fp@365:
fp@2589: if test "x$enablekernel" = "x1"; then
fp@2589:
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@2389: if test ${kernelrelease%%.*} -gt 2; then
fp@2389: regex="^[[0-9]]+\.[[0-9]]+"
fp@2389: else
fp@2389: regex="^[[0-9]]+\.[[0-9]]+\.[[0-9]]+"
fp@2389: fi
fp@2389:
fp@2389: # Extract numbers from kernel release
fp@2389: 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@2589: fi
fp@2589:
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@2589: [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@2589: [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@2076: # e1000e driver
fp@2076: #------------------------------------------------------------------------------
fp@2076:
fp@2076: AC_ARG_ENABLE([e1000e],
fp@2076: AS_HELP_STRING([--enable-e1000e],
fp@2076: [Enable e1000e driver]),
fp@2076: [
fp@2076: case "${enableval}" in
fp@2076: yes) enablee1000e=1
fp@2076: ;;
fp@2076: no) enablee1000e=0
fp@2076: ;;
fp@2076: *) AC_MSG_ERROR([Invalid value for --enable-e1000e])
fp@2076: ;;
fp@2076: esac
fp@2076: ],
fp@2076: [enablee1000e=0] # disabled by default
fp@2076: )
fp@2076:
fp@2076: AM_CONDITIONAL(ENABLE_E1000E, test "x$enablee1000e" = "x1")
fp@2076: AC_SUBST(ENABLE_E1000E,[$enablee1000e])
fp@2076:
fp@2076: AC_ARG_WITH([e1000e-kernel],
fp@2076: AC_HELP_STRING(
fp@2076: [--with-e1000e-kernel=],
fp@2076: [e1000e kernel (only if differing)]
fp@2076: ),
fp@2076: [
fp@2076: kernele1000e=[$withval]
fp@2076: ],
fp@2076: [
fp@2076: kernele1000e=$linuxversion
fp@2076: ]
fp@2076: )
fp@2076:
fp@2589: e1000elayout=0
fp@2589:
fp@2076: if test "x${enablee1000e}" = "x1"; then
fp@2076: AC_MSG_CHECKING([for kernel for e1000e driver])
fp@2076:
fp@2076: kernels=`ls -1 ${srcdir}/devices/e1000e/ | grep -oE "^netdev-.*" | cut -d "-" -f 2 | uniq`
fp@2076: found=0
fp@2076: for k in $kernels; do
fp@2076: if test "$kernele1000e" = "$k"; then
fp@2076: found=1
fp@2076: fi
fp@2076: done
fp@2076: if test $found -ne 1; then
fp@2076: AC_MSG_ERROR([kernel $kernele1000e not available for e1000e driver!])
fp@2076: fi
fp@2076:
fp@2076: AC_MSG_RESULT([$kernele1000e])
fp@2589:
fp@2589: # check for e1000e file layout (changed in kernel 3.4 and 3.10)
fp@2589: AC_MSG_CHECKING([for e1000e source layout])
fp@2589:
fp@2589: file34="${srcdir}/devices/e1000e/80003es2lan-$kernele1000e-ethercat.c"
fp@2589: file310="${srcdir}/devices/e1000e/ptp-$kernele1000e-ethercat.c"
fp@2589:
fp@2589: if test -r "$file310"; then
fp@2589: AC_MSG_RESULT([>= 3.10])
fp@2589: e1000elayout=2
fp@2589: elif test -r "$file34"; then
fp@2589: AC_MSG_RESULT([>= 3.4])
fp@2589: e1000elayout=1
fp@2589: else
fp@2589: AC_MSG_RESULT([before 3.4])
fp@2589: fi
fp@2589:
fp@2076: fi
fp@2076:
fp@2076: AC_SUBST(KERNEL_E1000E,[$kernele1000e])
fp@2589: AC_SUBST(E1000E_LAYOUT, [$e1000elayout])
fp@2076:
fp@2076: #------------------------------------------------------------------------------
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@2589: # CCAT driver
fp@2589: #------------------------------------------------------------------------------
fp@2589:
fp@2589: AC_MSG_CHECKING([whether to build the CCAT driver])
fp@2589:
fp@2589: AC_ARG_ENABLE([ccat],
fp@2589: AS_HELP_STRING([--enable-ccat],
fp@2589: [Enable CCAT driver]),
fp@2589: [
fp@2589: case "${enableval}" in
fp@2589: yes) enableccat=1
fp@2589: ;;
fp@2589: no) enableccat=0
fp@2589: ;;
fp@2589: *) AC_MSG_ERROR([Invalid value for --enable-ccat])
fp@2589: ;;
fp@2589: esac
fp@2589: ],
fp@2589: [enableccat=0] # disabled by default
fp@2589: )
fp@2589:
fp@2589: if test "x${enableccat}" = "x1"; then
fp@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
fp@2589:
fp@2589: AM_CONDITIONAL(ENABLE_CCAT, test "x$enableccat" = "x1")
fp@2589: AC_SUBST(ENABLE_CCAT,[$enableccat])
fp@2589:
fp@2589: #------------------------------------------------------------------------------
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@2589: [RTAI path, for RTDM interface and RTAI examples]
fp@485: ),
fp@485: [
fp@485: rtaidir=[$withval]
ab@2058: rtai=1
fp@485: ],
fp@485: [
fp@485: rtaidir=""
ab@2058: 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@2589:
fp@2589: rtai_lxrt_cflags=`$rtaidir/bin/rtai-config --lxrt-cflags`
fp@2589: rtai_lxrt_ldflags=`$rtaidir/bin/rtai-config --lxrt-ldflags`
fp@732: fi
fp@732:
fp@732: AC_SUBST(RTAI_DIR,[$rtaidir])
ab@2058: AM_CONDITIONAL(ENABLE_RTAI, test "x$rtai" = "x1")
ab@2058: AC_SUBST(ENABLE_RTAI,[$rtai])
ab@2054:
fp@2589: AC_SUBST(RTAI_LXRT_CFLAGS,[$rtai_lxrt_cflags])
fp@2589: AC_SUBST(RTAI_LXRT_LDFLAGS,[$rtai_lxrt_ldflags])
fp@2589:
ab@2054: #------------------------------------------------------------------------------
ab@2054: # Xenomai path (optional)
ab@2054: #------------------------------------------------------------------------------
ab@2054:
ab@2054: AC_ARG_WITH([xenomai-dir],
ab@2054: AC_HELP_STRING(
ab@2054: [--with-xenomai-dir=],
fp@2589: [Xenomai path, for RTDM interface and Xenomai examples]
ab@2054: ),
ab@2054: [
ab@2054: xenomaidir=[$withval]
ab@2058: xeno=1
ab@2054: ],
ab@2054: [
ab@2054: xenomaidir=""
ab@2058: xeno=0
ab@2054: ]
ab@2054: )
ab@2054:
ab@2054: AC_MSG_CHECKING([for Xenomai path])
ab@2054:
ab@2054: if test -z "${xenomaidir}"; then
ab@2054: AC_MSG_RESULT([not specified.])
ab@2054: else
ab@2054: if test \! -r ${xenomaidir}/include/xeno_config.h; then
ab@2054: AC_MSG_ERROR([no Xenomai installation found in ${xenomaidir}!])
ab@2054: fi
ab@2054: AC_MSG_RESULT([$xenomaidir])
fp@2589:
fp@2589: xeno_native_cflags=`$xenomaidir/bin/xeno-config --skin native --cflags`
fp@2589: xeno_native_ldflags=`$xenomaidir/bin/xeno-config --skin native --ldflags`
fp@2589: xeno_posix_cflags=`$xenomaidir/bin/xeno-config --skin posix --cflags`
fp@2589: xeno_posix_ldflags=`$xenomaidir/bin/xeno-config --skin posix --ldflags`
fp@2589: xeno_rtdm_cflags=`$xenomaidir/bin/xeno-config --skin rtdm --cflags`
fp@2589: xeno_rtdm_ldflags=`$xenomaidir/bin/xeno-config --skin rtdm --ldflags`
ab@2054: fi
ab@2054:
ab@2054: AC_SUBST(XENOMAI_DIR,[$xenomaidir])
ab@2058: AM_CONDITIONAL(ENABLE_XENOMAI, test "x$xeno" = "x1")
ab@2058: AC_SUBST(ENABLE_XENOMAI,[$xeno])
ab@2054:
fp@2589: AC_SUBST(XENOMAI_NATIVE_CFLAGS,[$xeno_native_cflags])
fp@2589: AC_SUBST(XENOMAI_NATIVE_LDFLAGS,[$xeno_native_ldflags])
fp@2589: AC_SUBST(XENOMAI_POSIX_CFLAGS,[$xeno_posix_cflags])
fp@2589: AC_SUBST(XENOMAI_POSIX_LDFLAGS,[$xeno_posix_ldflags])
fp@2589: AC_SUBST(XENOMAI_RTDM_CFLAGS,[$xeno_rtdm_cflags])
fp@2589: AC_SUBST(XENOMAI_RTDM_LDFLAGS,[$xeno_rtdm_ldflags])
fp@2589:
fp@2589: #------------------------------------------------------------------------------
fp@2589: # RTDM interface (optional)
ab@2054: #------------------------------------------------------------------------------
ab@2054:
ab@2054: AC_ARG_ENABLE([rtdm],
ab@2054: AC_HELP_STRING(
ab@2054: [--enable-rtdm],
fp@2589: [Enable RTDM interface, depends on RTAI or Xenomai]
ab@2054: ),
ab@2054: [
ab@2054: case "${enableval}" in
ab@2054: yes) rtdm=1
ab@2054: ;;
ab@2054: no) rtdm=0
ab@2054: ;;
ab@2054: *) AC_MSG_ERROR([Invalid value for --enable-rtdm])
ab@2054: ;;
ab@2054: esac
ab@2054: ],
ab@2054: [rtdm=0]
ab@2054: )
ab@2054:
fp@2589: AC_MSG_CHECKING([whether to build RTDM interface])
fp@2589:
ab@2054: if test "x${rtdm}" = "x1"; then
fp@2589: AC_DEFINE([EC_RTDM], [1], [RTDM interface enabled])
fp@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
fp@2589:
ab@2054: AM_CONDITIONAL(ENABLE_RTDM, test "x$rtdm" = "x1")
ab@2054: AC_SUBST(ENABLE_RTDM,[$rtdm])
ab@2054:
fp@485: #------------------------------------------------------------------------------
fp@392: # Debug interface
fp@392: #------------------------------------------------------------------------------
fp@392:
fp@2589: AC_MSG_CHECKING([whether to build the debug interface])
fp@2589:
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@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
fp@2589:
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@2589: AC_MSG_CHECKING([whether to build the debug ring])
fp@2589:
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@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@692: fi
fp@692:
fp@692: #------------------------------------------------------------------------------
fp@1327: # Ethernet over EtherCAT support
fp@715: #------------------------------------------------------------------------------
fp@715:
fp@2589: AC_MSG_CHECKING([whether to build with EoE support])
fp@2589:
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@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
fp@2589:
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@2589: AC_MSG_CHECKING([whether to use the CPU timestamp counter])
fp@2589:
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@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@1040: fi
fp@1040:
fp@1040: #------------------------------------------------------------------------------
fp@1773: # High-resolution timer support
fp@1773: #------------------------------------------------------------------------------
fp@1773:
fp@2589: AC_MSG_CHECKING([whether to use high-resolution timers for scheduling])
fp@2589:
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@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
ch1010277@2045:
ch1010277@2045: #------------------------------------------------------------------------------
fp@1934: # Read alias address from register
fp@1934: #------------------------------------------------------------------------------
fp@1934:
fp@2589: AC_MSG_CHECKING([whether to read alias addresses from registers])
fp@2589:
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@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
ch1010277@2028:
ch1010277@2028: #------------------------------------------------------------------------------
gavinl@2617: # Force the reference clock to OP even if unconfigured
gavinl@2617: #------------------------------------------------------------------------------
gavinl@2617:
gavinl@2617: AC_MSG_CHECKING([whether to force the reference clock to OP])
gavinl@2617:
gavinl@2617: AC_ARG_ENABLE([refclkop],
gavinl@2617: AS_HELP_STRING([--enable-refclkop],
gavinl@2617: [Force reference clock to OP (default: no)]),
gavinl@2617: [
gavinl@2617: case "${enableval}" in
gavinl@2617: yes) refclkop=1
gavinl@2617: ;;
gavinl@2617: no) refclkop=0
gavinl@2617: ;;
gavinl@2617: *) AC_MSG_ERROR([Invalid value for --enable-refclkop])
gavinl@2617: ;;
gavinl@2617: esac
gavinl@2617: ],
gavinl@2617: [refclkop=0]
gavinl@2617: )
gavinl@2617:
gavinl@2617: if test "x${refclkop}" = "x1"; then
gavinl@2617: AC_DEFINE([EC_REFCLKOP], [1], [Force refclk to OP])
gavinl@2617: AC_MSG_RESULT([yes])
gavinl@2617: else
gavinl@2617: AC_MSG_RESULT([no])
gavinl@2617: fi
gavinl@2617:
gavinl@2617: #------------------------------------------------------------------------------
fp@1253: # Command-line tool
fp@1253: #-----------------------------------------------------------------------------
fp@1253:
fp@2589: AC_MSG_CHECKING([whether to build the command-line tool])
fp@2589:
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@2589: if test "x${tool}" = "x1"; then
fp@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
fp@2589:
fp@1253: AM_CONDITIONAL(BUILD_TOOL, test "x$tool" = "x1")
fp@1253:
fp@1253: #------------------------------------------------------------------------------
fp@1242: # Userspace library generation
fp@1242: #------------------------------------------------------------------------------
fp@1242:
fp@2589: AC_MSG_CHECKING([whether to build the userspace library])
fp@2589:
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@2589: if test "x${userlib}" = "x1"; then
fp@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
fp@2589:
fp@1242: AM_CONDITIONAL(ENABLE_USERLIB, test "x$userlib" = "x1")
fp@1242:
fp@1242: #------------------------------------------------------------------------------
fp@1565: # TTY driver
fp@1565: #------------------------------------------------------------------------------
fp@1565:
fp@2589: AC_MSG_CHECKING([whether to build the tty driver])
fp@2589:
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@2589: if test "x${tty}" = "x1"; then
fp@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
fp@2589:
fp@1565: AM_CONDITIONAL(ENABLE_TTY, test "x$tty" = "x1")
fp@1565: AC_SUBST(ENABLE_TTY,[$tty])
fp@1565:
fp@1565: #------------------------------------------------------------------------------
fp@2151: # Slave identification wildcards
fp@2151: #------------------------------------------------------------------------------
fp@2151:
fp@2589: AC_MSG_CHECKING([whether to allow identification wildcards])
fp@2589:
fp@2151: AC_ARG_ENABLE([wildcards],
fp@2151: AS_HELP_STRING([--enable-wildcards],
fp@2151: [Enable vendor ID / product code wildcards (default: no)]),
fp@2151: [
fp@2151: case "${enableval}" in
fp@2151: yes) wildcards=1
fp@2151: ;;
fp@2151: no) wildcards=0
fp@2151: ;;
fp@2151: *) AC_MSG_ERROR([Invalid value for --enable-wildcards])
fp@2151: ;;
fp@2151: esac
fp@2151: ],
fp@2151: [wildcards=0]
fp@2151: )
fp@2151:
fp@2151: if test "x${wildcards}" = "x1"; then
fp@2151: AC_DEFINE([EC_IDENT_WILDCARDS], [1],
fp@2151: [Use vendor id / product code wildcards])
fp@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
fp@2589:
fp@2589: #------------------------------------------------------------------------------
fp@2589: # Redundancy (number of devices)
fp@2589: #------------------------------------------------------------------------------
fp@2589:
fp@2589: AC_ARG_WITH([devices],
fp@2589: AC_HELP_STRING(
fp@2589: [--with-devices=],
fp@2589: [Number of Ethernet devices per master. Default: 1]
fp@2589: ),
fp@2589: [
fp@2589: devices=[$withval]
fp@2589: ],
fp@2589: [
fp@2589: devices=1
fp@2589: ]
fp@2589: )
fp@2589:
fp@2589: AC_MSG_CHECKING([for number of Ethernet devices])
fp@2589:
fp@2589: if test "${devices}" -lt 1; then
fp@2589: AC_MSG_ERROR([Number must be greater zero!])
fp@2589: else
fp@2589: if test "${devices}" -gt 1; then
fp@2589: AC_MSG_RESULT([$devices (Redundancy enabled)])
fp@2589: else
fp@2589: AC_MSG_RESULT([$devices (Redundancy disabled)])
fp@2589: fi
fp@2589: fi
fp@2589:
fp@2589: AC_DEFINE_UNQUOTED([EC_MAX_NUM_DEVICES], $devices,
fp@2589: [Max. number of Ethernet devices per master])
fp@2589:
fp@2589: #------------------------------------------------------------------------------
fp@2589: # SII assignment
fp@2589: #------------------------------------------------------------------------------
fp@2589:
fp@2589: AC_MSG_CHECKING([whether to assign the SII to PDI])
fp@2589:
fp@2589: AC_ARG_ENABLE([sii-assign],
fp@2589: AS_HELP_STRING([--enable-sii-assign],
fp@2589: [Enable SII assignment to PDI (default: no)]),
fp@2589: [
fp@2589: case "${enableval}" in
fp@2589: yes) siiassign=1
fp@2589: ;;
fp@2589: no) siiassign=0
fp@2589: ;;
fp@2589: *) AC_MSG_ERROR([Invalid value for --enable-sii-assign])
fp@2589: ;;
fp@2589: esac
fp@2589: ],
fp@2589: [siiassign=0]
fp@2589: )
fp@2589:
fp@2589: if test "x${siiassign}" = "x1"; then
fp@2589: AC_DEFINE([EC_SII_ASSIGN], [1], [Assign SII to PDI])
fp@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2589: fi
fp@2589:
fp@2589: #------------------------------------------------------------------------------
fp@2589: # syslog output in realtime context
fp@2589: #------------------------------------------------------------------------------
fp@2589:
fp@2589: AC_MSG_CHECKING([whether to syslog in realtime context])
fp@2589:
fp@2589: AC_ARG_ENABLE([rt-syslog],
fp@2589: AS_HELP_STRING([--enable-rt-syslog],
fp@2589: [Enable RT syslog (default: yes)]),
fp@2589: [
fp@2589: case "${enableval}" in
fp@2589: yes) rtsyslog=1
fp@2589: ;;
fp@2589: no) rtsyslog=0
fp@2589: ;;
fp@2589: *) AC_MSG_ERROR([Invalid value for --enable-rt-syslog])
fp@2589: ;;
fp@2589: esac
fp@2589: ],
fp@2589: [rtsyslog=1]
fp@2589: )
fp@2589:
fp@2589: if test "x${rtsyslog}" = "x1"; then
fp@2589: AC_DEFINE([EC_RT_SYSLOG], [1], [Output to syslog in RT context])
fp@2589: AC_MSG_RESULT([yes])
fp@2589: else
fp@2589: AC_MSG_RESULT([no])
fp@2151: fi
fp@2151:
fp@2151: #------------------------------------------------------------------------------
fp@2600: # use loop control registers to open slave ports
fp@2600: #------------------------------------------------------------------------------
fp@2600:
fp@2600: AC_MSG_CHECKING([whether to use loop control registers])
fp@2600:
fp@2600: AC_ARG_ENABLE([loop-control],
fp@2600: AS_HELP_STRING([--enable-loop-control],
fp@2600: [Use loop control registers (default: no)]),
fp@2600: [
fp@2600: case "${enableval}" in
fp@2600: yes) loopctl=1
fp@2600: ;;
fp@2600: no) loopctl=0
fp@2600: ;;
fp@2600: *) AC_MSG_ERROR([Invalid value for --enable-loop-control])
fp@2600: ;;
fp@2600: esac
fp@2600: ],
fp@2600: [loopctl=0]
fp@2600: )
fp@2600:
fp@2600: if test "x${loopctl}" = "x1"; then
fp@2600: AC_DEFINE([EC_LOOP_CONTROL], [1], [Use loop control registers])
fp@2600: AC_MSG_RESULT([yes])
fp@2600: else
fp@2600: AC_MSG_RESULT([no])
fp@2600: fi
fp@2600:
fp@2600: #------------------------------------------------------------------------------
fp@485:
ha@385: AC_CONFIG_FILES([
fp@757: Doxyfile
fp@732: Kbuild
fp@392: Makefile
fp@882: devices/Kbuild
fp@882: devices/Makefile
fp@2589: devices/ccat/Kbuild
fp@2589: devices/ccat/Makefile
fp@882: devices/e1000/Kbuild
fp@882: devices/e1000/Makefile
fp@2076: devices/e1000e/Kbuild
fp@2076: devices/e1000e/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@2189: examples/rtai_rtdm/Makefile
fp@2589: examples/rtai_rtdm_dc/Makefile
fp@1810: examples/tty/Kbuild
fp@1567: examples/tty/Makefile
fp@1242: examples/user/Makefile
ab@2054: examples/xenomai/Makefile
ab@2056: 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@2189: script/ethercat.service
fp@2189: 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: #------------------------------------------------------------------------------