1 Star 1 Fork 0

吕冬/etherlab

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
configure.ac 31.61 KB
一键复制 编辑 原始数据 按行查看 历史
Nikola Zivkovic 提交于 2019-04-17 12:18 . Prepare release v1.5.2-sncn-7
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174
#------------------------------------------------------------------------------
#
# $Id$
#
# Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
# The IgH EtherCAT Master is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# The IgH EtherCAT Master is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ---
#
# The license mentioned above concerns the source code only. Using the
# EtherCAT technology and brand is only permitted in compliance with the
# industrial property and similar rights of Beckhoff Automation GmbH.
#
#------------------------------------------------------------------------------
AC_PREREQ(2.59)
#
# Release procedure
# - Update Ethernet drivers up to release kernel version
# - Write NEWS entry with changes since last release
# - Check for complete Doxygen comments
# - Update version number in documentation
# - Update the ChangeLog -> hg log -bstable-1.5 --style=changelog > ChangeLog
# - Update version number below
# - make dist-bzip2
#
AC_INIT([ethercat],[1.5.2-sncn-7],[fp@igh-essen.com])
AC_CONFIG_AUX_DIR([autoconf])
AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 subdir-objects])
AC_PREFIX_DEFAULT([/opt/etherlab])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_MACRO_DIR([m4])
# get separate version of libethercat_wrapper
LIBETHERCAT_WRAPPER_VERSION=`cat libethercat_wrapper/Version`
AC_SUBST(LIBETHERCAT_WRAPPER_VERSION)
#------------------------------------------------------------------------------
# Global
#------------------------------------------------------------------------------
AM_PROG_CC_C_O
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_CXX
AC_PROG_LIBTOOL
#------------------------------------------------------------------------------
# Kernel modules
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build kernel modules])
AC_ARG_ENABLE([kernel],
AS_HELP_STRING([--enable-kernel],
[Enable building kernel modules]),
[
case "${enableval}" in
yes) enablekernel=1
;;
no) enablekernel=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-generic])
;;
esac
],
[enablekernel=1]
)
if test "x$enablekernel" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_KERNEL, test "x$enablekernel" = "x1")
AC_SUBST(ENABLE_KERNEL,[$enablekernel])
#------------------------------------------------------------------------------
# Linux sources
#------------------------------------------------------------------------------
if test "x$enablekernel" = "x1"; then
AC_ARG_WITH([linux-dir],
AC_HELP_STRING(
[--with-linux-dir=<DIR>],
[Linux kernel sources @<:@running kernel@:>@]
),
[
sourcedir=[$withval]
],
[
version=[`uname -r`]
modulesdir=/lib/modules/${version}
if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then
echo
AC_MSG_ERROR([Failed to find Linux sources. Use --with-linux-dir!])
fi
sourcedir=`cd ${modulesdir}/build && pwd -P`
]
)
AC_MSG_CHECKING([for Linux kernel sources])
if test \! -r ${sourcedir}/.config; then
echo
AC_MSG_ERROR([No configured Linux kernel sources in $sourcedir])
fi
# Try to get kernel release string
if test -r ${sourcedir}/include/config/kernel.release; then
kernelrelease=`cat $sourcedir/include/config/kernel.release`
elif test -r ${sourcedir}/.kernelrelease; then
kernelrelease=`cat $sourcedir/.kernelrelease`
elif test -r ${sourcedir}/include/linux/utsrelease.h; then
hdr=${sourcedir}/include/linux/utsrelease.h
kernelrelease=`grep UTS_RELEASE $hdr | cut -d " " -f 3- | tr -d \"`
elif test -r ${sourcedir}/include/linux/version.h; then
hdr=${sourcedir}/include/linux/version.h
kernelrelease=`grep UTS_RELEASE $hdr | cut -d " " -f 3- | tr -d \"`
fi
if test -z "$kernelrelease"; then
echo
AC_MSG_ERROR([Failed to extract Linux kernel version!])
fi
if test ${kernelrelease%%.*} -gt 2; then
regex="^[[0-9]]+\.[[0-9]]+"
else
regex="^[[0-9]]+\.[[0-9]]+\.[[0-9]]+"
fi
# Extract numbers from kernel release
linuxversion=`echo $kernelrelease | grep -oE "$regex"`
AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
AC_MSG_RESULT([$LINUX_SOURCE_DIR (Kernel $linuxversion)])
fi
#------------------------------------------------------------------------------
# Linux module installation subdirectory
#------------------------------------------------------------------------------
AC_ARG_WITH([module-dir],
AC_HELP_STRING(
[--with-module-dir=<DIR>],
[Linux module installation dir. Default: ethercat]
),
[moddir=[$withval]],
[moddir="ethercat"]
)
AC_SUBST(INSTALL_MOD_DIR,[$moddir])
AC_MSG_CHECKING([for Linux modules installation directory])
AC_MSG_RESULT([$INSTALL_MOD_DIR])
#------------------------------------------------------------------------------
# Generic Ethernet driver
#------------------------------------------------------------------------------
AC_ARG_ENABLE([generic],
AS_HELP_STRING([--enable-generic],
[Enable generic Ethernet driver]),
[
case "${enableval}" in
yes) enablegeneric=1
;;
no) enablegeneric=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-generic])
;;
esac
],
[enablegeneric=$enablekernel]
)
AM_CONDITIONAL(ENABLE_GENERIC, test "x$enablegeneric" = "x1")
AC_SUBST(ENABLE_GENERIC,[$enablegeneric])
#------------------------------------------------------------------------------
# 8139too driver
#------------------------------------------------------------------------------
AC_ARG_ENABLE([8139too],
AS_HELP_STRING([--enable-8139too],
[Enable 8139too driver]),
[
case "${enableval}" in
yes) enable8139too=1
;;
no) enable8139too=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-8139too])
;;
esac
],
[enable8139too=0] # disabled by default
)
AM_CONDITIONAL(ENABLE_8139TOO, test "x$enable8139too" = "x1")
AC_SUBST(ENABLE_8139TOO,[$enable8139too])
AC_ARG_WITH([8139too-kernel],
AC_HELP_STRING(
[--with-8139too-kernel=<X.Y.Z>],
[8139too kernel (only if differing)]
),
[
kernel8139too=[$withval]
],
[
kernel8139too=$linuxversion
]
)
if test "x${enable8139too}" = "x1"; then
AC_MSG_CHECKING([for kernel for 8139too driver])
kernels=`ls -1 ${srcdir}/devices/ | grep -oE "^8139too-.*-" | cut -d "-" -f 2 | uniq`
found=0
for k in $kernels; do
if test "$kernel8139too" = "$k"; then
found=1
fi
done
if test $found -ne 1; then
AC_MSG_ERROR([kernel $kernel8139too not available for 8139too driver!])
fi
AC_MSG_RESULT([$kernel8139too])
fi
AC_SUBST(KERNEL_8139TOO,[$kernel8139too])
#------------------------------------------------------------------------------
# e100 driver
#------------------------------------------------------------------------------
AC_ARG_ENABLE([e100],
AS_HELP_STRING([--enable-e100],
[Enable e100 driver]),
[
case "${enableval}" in
yes) enablee100=1
;;
no) enablee100=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-e100])
;;
esac
],
[enablee100=0] # disabled by default
)
AM_CONDITIONAL(ENABLE_E100, test "x$enablee100" = "x1")
AC_SUBST(ENABLE_E100,[$enablee100])
AC_ARG_WITH([e100-kernel],
AC_HELP_STRING(
[--with-e100-kernel=<X.Y.Z>],
[e100 kernel (only if differing)]
),
[
kernele100=[$withval]
],
[
kernele100=$linuxversion
]
)
if test "x${enablee100}" = "x1"; then
AC_MSG_CHECKING([for kernel for e100 driver])
kernels=`ls -1 ${srcdir}/devices/ | grep -oE "^e100-.*-" | cut -d "-" -f 2 | uniq`
found=0
for k in $kernels; do
if test "$kernele100" = "$k"; then
found=1
fi
done
if test $found -ne 1; then
AC_MSG_ERROR([kernel $kernele100 not available for e100 driver!])
fi
AC_MSG_RESULT([$kernele100])
fi
AC_SUBST(KERNEL_E100,[$kernele100])
#------------------------------------------------------------------------------
# e1000 driver
#------------------------------------------------------------------------------
AC_ARG_ENABLE([e1000],
AS_HELP_STRING([--enable-e1000],
[Enable e1000 driver]),
[
case "${enableval}" in
yes) enablee1000=1
;;
no) enablee1000=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-e1000])
;;
esac
],
[enablee1000=0] # disabled by default
)
AM_CONDITIONAL(ENABLE_E1000, test "x$enablee1000" = "x1")
AC_SUBST(ENABLE_E1000,[$enablee1000])
AC_ARG_WITH([e1000-kernel],
AC_HELP_STRING(
[--with-e1000-kernel=<X.Y.Z>],
[e1000 kernel (only if differing)]
),
[
kernele1000=[$withval]
],
[
kernele1000=$linuxversion
]
)
if test "x${enablee1000}" = "x1"; then
AC_MSG_CHECKING([for kernel for e1000 driver])
kernels=`ls -1 ${srcdir}/devices/e1000/ | grep -oE "^e1000_main-.*" | cut -d "-" -f 2 | uniq`
found=0
for k in $kernels; do
if test "$kernele1000" = "$k"; then
found=1
fi
done
if test $found -ne 1; then
AC_MSG_ERROR([kernel $kernele1000 not available for e1000 driver!])
fi
AC_MSG_RESULT([$kernele1000])
fi
AC_SUBST(KERNEL_E1000,[$kernele1000])
#------------------------------------------------------------------------------
# e1000e driver
#------------------------------------------------------------------------------
AC_ARG_ENABLE([e1000e],
AS_HELP_STRING([--enable-e1000e],
[Enable e1000e driver]),
[
case "${enableval}" in
yes) enablee1000e=1
;;
no) enablee1000e=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-e1000e])
;;
esac
],
[enablee1000e=0] # disabled by default
)
AM_CONDITIONAL(ENABLE_E1000E, test "x$enablee1000e" = "x1")
AC_SUBST(ENABLE_E1000E,[$enablee1000e])
AC_ARG_WITH([e1000e-kernel],
AC_HELP_STRING(
[--with-e1000e-kernel=<X.Y.Z>],
[e1000e kernel (only if differing)]
),
[
kernele1000e=[$withval]
],
[
kernele1000e=$linuxversion
]
)
e1000elayout=0
if test "x${enablee1000e}" = "x1"; then
AC_MSG_CHECKING([for kernel for e1000e driver])
kernels=`ls -1 ${srcdir}/devices/e1000e/ | grep -oE "^netdev-.*" | cut -d "-" -f 2 | uniq`
found=0
for k in $kernels; do
if test "$kernele1000e" = "$k"; then
found=1
fi
done
if test $found -ne 1; then
AC_MSG_ERROR([kernel $kernele1000e not available for e1000e driver!])
fi
AC_MSG_RESULT([$kernele1000e])
# check for e1000e file layout (changed in kernel 3.4 and 3.10)
AC_MSG_CHECKING([for e1000e source layout])
file34="${srcdir}/devices/e1000e/80003es2lan-$kernele1000e-ethercat.c"
file310="${srcdir}/devices/e1000e/ptp-$kernele1000e-ethercat.c"
if test -r "$file310"; then
AC_MSG_RESULT([>= 3.10])
e1000elayout=2
elif test -r "$file34"; then
AC_MSG_RESULT([>= 3.4])
e1000elayout=1
else
AC_MSG_RESULT([before 3.4])
fi
fi
AC_SUBST(KERNEL_E1000E,[$kernele1000e])
AC_SUBST(E1000E_LAYOUT, [$e1000elayout])
#------------------------------------------------------------------------------
# r8169 driver
#------------------------------------------------------------------------------
AC_ARG_ENABLE([r8169],
AS_HELP_STRING([--enable-r8169],
[Enable r8169 driver]),
[
case "${enableval}" in
yes) enable_r8169=1
;;
no) enable_r8169=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-r8169])
;;
esac
],
[enable_r8169=0] # disabled by default
)
AM_CONDITIONAL(ENABLE_R8169, test "x$enable_r8169" = "x1")
AC_SUBST(ENABLE_R8169,[$enable_r8169])
AC_ARG_WITH([r8169-kernel],
AC_HELP_STRING(
[--with-r8169-kernel=<X.Y.Z>],
[r8169 kernel (only if differing)]
),
[
kernel_r8169=[$withval]
],
[
kernel_r8169=$linuxversion
]
)
if test "x${enable_r8169}" = "x1"; then
AC_MSG_CHECKING([for kernel for r8169 driver])
kernels=`ls -1 ${srcdir}/devices/ | grep -oE "^r8169-.*-" | cut -d "-" -f 2 | uniq`
found=0
for k in $kernels; do
if test "$kernel_r8169" = "$k"; then
found=1
fi
done
if test $found -ne 1; then
AC_MSG_ERROR([kernel $kernel_r8169 not available for r8169 driver!])
fi
AC_MSG_RESULT([$kernel_r8169])
fi
AC_SUBST(KERNEL_R8169,[$kernel_r8169])
#------------------------------------------------------------------------------
# CCAT driver
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the CCAT driver])
AC_ARG_ENABLE([ccat],
AS_HELP_STRING([--enable-ccat],
[Enable CCAT driver]),
[
case "${enableval}" in
yes) enableccat=1
;;
no) enableccat=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-ccat])
;;
esac
],
[enableccat=0] # disabled by default
)
if test "x${enableccat}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_CCAT, test "x$enableccat" = "x1")
AC_SUBST(ENABLE_CCAT,[$enableccat])
#------------------------------------------------------------------------------
# RTAI path (optional)
#------------------------------------------------------------------------------
AC_ARG_WITH([rtai-dir],
AC_HELP_STRING(
[--with-rtai-dir=<DIR>],
[RTAI path, for RTDM interface and RTAI examples]
),
[
rtaidir=[$withval]
rtai=1
],
[
rtaidir=""
rtai=0
]
)
AC_MSG_CHECKING([for RTAI path])
if test -z "${rtaidir}"; then
AC_MSG_RESULT([not specified.])
else
if test \! -r ${rtaidir}/include/rtai.h; then
AC_MSG_ERROR([no RTAI installation found in ${rtaidir}!])
fi
AC_MSG_RESULT([$rtaidir])
rtai_lxrt_cflags=`$rtaidir/bin/rtai-config --lxrt-cflags`
rtai_lxrt_ldflags=`$rtaidir/bin/rtai-config --lxrt-ldflags`
fi
AC_SUBST(RTAI_DIR,[$rtaidir])
AM_CONDITIONAL(ENABLE_RTAI, test "x$rtai" = "x1")
AC_SUBST(ENABLE_RTAI,[$rtai])
AC_SUBST(RTAI_LXRT_CFLAGS,[$rtai_lxrt_cflags])
AC_SUBST(RTAI_LXRT_LDFLAGS,[$rtai_lxrt_ldflags])
#------------------------------------------------------------------------------
# Xenomai path (optional)
#------------------------------------------------------------------------------
AC_ARG_WITH([xenomai-dir],
AC_HELP_STRING(
[--with-xenomai-dir=<DIR>],
[Xenomai path, for RTDM interface and Xenomai examples]
),
[
xenomaidir=[$withval]
xeno=1
],
[
xenomaidir=""
xeno=0
]
)
AC_MSG_CHECKING([for Xenomai path])
if test -z "${xenomaidir}"; then
AC_MSG_RESULT([not specified.])
else
if test \! -r ${xenomaidir}/include/xeno_config.h; then
AC_MSG_ERROR([no Xenomai installation found in ${xenomaidir}!])
fi
AC_MSG_RESULT([$xenomaidir])
xeno_native_cflags=`$xenomaidir/bin/xeno-config --skin native --cflags`
xeno_native_ldflags=`$xenomaidir/bin/xeno-config --skin native --ldflags`
xeno_posix_cflags=`$xenomaidir/bin/xeno-config --skin posix --cflags`
xeno_posix_ldflags=`$xenomaidir/bin/xeno-config --skin posix --ldflags`
xeno_rtdm_cflags=`$xenomaidir/bin/xeno-config --skin rtdm --cflags`
xeno_rtdm_ldflags=`$xenomaidir/bin/xeno-config --skin rtdm --ldflags`
fi
AC_SUBST(XENOMAI_DIR,[$xenomaidir])
AM_CONDITIONAL(ENABLE_XENOMAI, test "x$xeno" = "x1")
AC_SUBST(ENABLE_XENOMAI,[$xeno])
AC_SUBST(XENOMAI_NATIVE_CFLAGS,[$xeno_native_cflags])
AC_SUBST(XENOMAI_NATIVE_LDFLAGS,[$xeno_native_ldflags])
AC_SUBST(XENOMAI_POSIX_CFLAGS,[$xeno_posix_cflags])
AC_SUBST(XENOMAI_POSIX_LDFLAGS,[$xeno_posix_ldflags])
AC_SUBST(XENOMAI_RTDM_CFLAGS,[$xeno_rtdm_cflags])
AC_SUBST(XENOMAI_RTDM_LDFLAGS,[$xeno_rtdm_ldflags])
#------------------------------------------------------------------------------
# RTDM interface (optional)
#------------------------------------------------------------------------------
AC_ARG_ENABLE([rtdm],
AC_HELP_STRING(
[--enable-rtdm],
[Enable RTDM interface, depends on RTAI or Xenomai]
),
[
case "${enableval}" in
yes) rtdm=1
;;
no) rtdm=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-rtdm])
;;
esac
],
[rtdm=0]
)
AC_MSG_CHECKING([whether to build RTDM interface])
if test "x${rtdm}" = "x1"; then
AC_DEFINE([EC_RTDM], [1], [RTDM interface enabled])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_RTDM, test "x$rtdm" = "x1")
AC_SUBST(ENABLE_RTDM,[$rtdm])
#------------------------------------------------------------------------------
# Debug interface
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the debug interface])
AC_ARG_ENABLE([debug-if],
AS_HELP_STRING([--enable-debug-if],
[Create a debug interface for each master @<:@NO@:>@]),
[
case "${enableval}" in
yes) dbg=1
;;
no) dbg=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-debug-if])
;;
esac
],
[dbg=0]
)
if test "x${dbg}" = "x1"; then
AC_DEFINE([EC_DEBUG_IF], [1], [Debug interfaces enabled])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_DEBUG_IF, test "x$dbg" = "x1")
AC_SUBST(ENABLE_DEBUG_IF,[$dbg])
#------------------------------------------------------------------------------
# Debug ring
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the debug ring])
AC_ARG_ENABLE([debug-ring],
AS_HELP_STRING([--enable-debug-ring],
[Create a debug ring to record frames @<:@NO@:>@]),
[
case "${enableval}" in
yes) debugring=1
;;
no) debugring=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-debug-ring])
;;
esac
],
[debugring=0]
)
if test "x${debugring}" = "x1"; then
AC_DEFINE([EC_DEBUG_RING], [1], [Debug ring enabled])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Ethernet over EtherCAT support
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build with EoE support])
AC_ARG_ENABLE([eoe],
AS_HELP_STRING([--enable-eoe],
[Enable EoE support (default: yes)]),
[
case "${enableval}" in
yes) eoe=1
;;
no) eoe=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-eoe])
;;
esac
],
[eoe=1]
)
if test "x${eoe}" = "x1"; then
AC_DEFINE([EC_EOE], [1], [EoE support enabled])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_EOE, test "x$eoe" = "x1")
AC_SUBST(ENABLE_EOE,[$eoe])
#------------------------------------------------------------------------------
# CPU timestamp counter support
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to use the CPU timestamp counter])
AC_ARG_ENABLE([cycles],
AS_HELP_STRING([--enable-cycles],
[Use CPU timestamp counter (default: no)]),
[
case "${enableval}" in
yes) cycles=1
;;
no) cycles=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-cycles])
;;
esac
],
[cycles=0]
)
if test "x${cycles}" = "x1"; then
AC_DEFINE([EC_HAVE_CYCLES], [1], [Use CPU timestamp counter])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# High-resolution timer support
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to use high-resolution timers for scheduling])
AC_ARG_ENABLE([hrtimer],
AS_HELP_STRING([--enable-hrtimer],
[Use high-resolution timer for scheduling (default: no)]),
[
case "${enableval}" in
yes) hrtimer=1
;;
no) hrtimer=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-hrtimer])
;;
esac
],
[hrtimer=0]
)
if test "x${hrtimer}" = "x1"; then
AC_DEFINE([EC_USE_HRTIMER], [1], [Use hrtimer for scheduling])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Read alias address from register
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to read alias addresses from registers])
AC_ARG_ENABLE([regalias],
AS_HELP_STRING([--enable-regalias],
[Read alias adresses from register (default: no)]),
[
case "${enableval}" in
yes) regalias=1
;;
no) regalias=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-regalias])
;;
esac
],
[regalias=0]
)
if test "x${regalias}" = "x1"; then
AC_DEFINE([EC_REGALIAS], [1], [Read alias adresses from register])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Force the reference clock to OP even if unconfigured
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to force the reference clock to OP])
AC_ARG_ENABLE([refclkop],
AS_HELP_STRING([--enable-refclkop],
[Force reference clock to OP (default: no)]),
[
case "${enableval}" in
yes) refclkop=1
;;
no) refclkop=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-refclkop])
;;
esac
],
[refclkop=0]
)
if test "x${refclkop}" = "x1"; then
AC_DEFINE([EC_REFCLKOP], [1], [Force refclk to OP])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Command-line tool
#-----------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the command-line tool])
AC_ARG_ENABLE([tool],
AS_HELP_STRING([--enable-tool],
[Build command-line tool (default: yes)]),
[
case "${enableval}" in
yes) tool=1
;;
no) tool=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-tool])
;;
esac
],
[tool=1]
)
if test "x${tool}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(BUILD_TOOL, test "x$tool" = "x1")
#------------------------------------------------------------------------------
# Userspace library generation
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the userspace library])
AC_ARG_ENABLE([userlib],
AS_HELP_STRING([--enable-userlib],
[Generation of the userspace library (default: yes)]),
[
case "${enableval}" in
yes) userlib=1
;;
no) userlib=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-userlib])
;;
esac
],
[userlib=1]
)
if test "x${userlib}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_USERLIB, test "x$userlib" = "x1")
#------------------------------------------------------------------------------
# Generate ethercat wrapper library
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the ethercat wrapper library])
AC_ARG_ENABLE([ethercat_wrapper],
AS_HELP_STRING([--enable-libethercat_wrapper],
[Generation of the ethercat wrapper library (default: yes)]),
[
case "${enableval}" in
yes) ethercat_wrapper=1
;;
no) ethercat_wrapper=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-libethercat_wrapper])
;;
esac
],
[ethercat_wrapper=1]
)
if test "x${ethercat_wrapper}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_USERLIB, test "x$ethercat_wrapper" = "x1")
#------------------------------------------------------------------------------
# TTY driver
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the tty driver])
AC_ARG_ENABLE([tty],
AS_HELP_STRING([--enable-tty],
[Generation of the ec_tty module (default: no)]),
[
case "${enableval}" in
yes) tty=1
;;
no) tty=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-tty])
;;
esac
],
[tty=0]
)
if test "x${tty}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_TTY, test "x$tty" = "x1")
AC_SUBST(ENABLE_TTY,[$tty])
#------------------------------------------------------------------------------
# Slave identification wildcards
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to allow identification wildcards])
AC_ARG_ENABLE([wildcards],
AS_HELP_STRING([--enable-wildcards],
[Enable vendor ID / product code wildcards (default: no)]),
[
case "${enableval}" in
yes) wildcards=1
;;
no) wildcards=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-wildcards])
;;
esac
],
[wildcards=0]
)
if test "x${wildcards}" = "x1"; then
AC_DEFINE([EC_IDENT_WILDCARDS], [1],
[Use vendor id / product code wildcards])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Redundancy (number of devices)
#------------------------------------------------------------------------------
AC_ARG_WITH([devices],
AC_HELP_STRING(
[--with-devices=<NUMBER>],
[Number of Ethernet devices per master. Default: 1]
),
[
devices=[$withval]
],
[
devices=1
]
)
AC_MSG_CHECKING([for number of Ethernet devices])
if test "${devices}" -lt 1; then
AC_MSG_ERROR([Number must be greater zero!])
else
if test "${devices}" -gt 1; then
AC_MSG_RESULT([$devices (Redundancy enabled)])
else
AC_MSG_RESULT([$devices (Redundancy disabled)])
fi
fi
AC_DEFINE_UNQUOTED([EC_MAX_NUM_DEVICES], $devices,
[Max. number of Ethernet devices per master])
#------------------------------------------------------------------------------
# SII assignment
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to assign the SII to PDI])
AC_ARG_ENABLE([sii-assign],
AS_HELP_STRING([--enable-sii-assign],
[Enable SII assignment to PDI (default: no)]),
[
case "${enableval}" in
yes) siiassign=1
;;
no) siiassign=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-sii-assign])
;;
esac
],
[siiassign=0]
)
if test "x${siiassign}" = "x1"; then
AC_DEFINE([EC_SII_ASSIGN], [1], [Assign SII to PDI])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# syslog output in realtime context
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to syslog in realtime context])
AC_ARG_ENABLE([rt-syslog],
AS_HELP_STRING([--enable-rt-syslog],
[Enable RT syslog (default: yes)]),
[
case "${enableval}" in
yes) rtsyslog=1
;;
no) rtsyslog=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-rt-syslog])
;;
esac
],
[rtsyslog=1]
)
if test "x${rtsyslog}" = "x1"; then
AC_DEFINE([EC_RT_SYSLOG], [1], [Output to syslog in RT context])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# use loop control registers to open slave ports
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to use loop control registers])
AC_ARG_ENABLE([loop-control],
AS_HELP_STRING([--enable-loop-control],
[Use loop control registers (default: no)]),
[
case "${enableval}" in
yes) loopctl=1
;;
no) loopctl=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-loop-control])
;;
esac
],
[loopctl=0]
)
if test "x${loopctl}" = "x1"; then
AC_DEFINE([EC_LOOP_CONTROL], [1], [Use loop control registers])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
AC_CONFIG_FILES([
Doxyfile
Kbuild
Makefile
devices/Kbuild
devices/Makefile
devices/ccat/Kbuild
devices/ccat/Makefile
devices/e1000/Kbuild
devices/e1000/Makefile
devices/e1000e/Kbuild
devices/e1000e/Makefile
ethercat.spec
examples/Kbuild
examples/Makefile
examples/dc_rtai/Kbuild
examples/dc_rtai/Makefile
examples/dc_user/Makefile
examples/mini/Kbuild
examples/mini/Makefile
examples/rtai/Kbuild
examples/rtai/Makefile
examples/rtai_rtdm/Makefile
examples/rtai_rtdm_dc/Makefile
examples/tty/Kbuild
examples/tty/Makefile
examples/user/Makefile
examples/xenomai/Makefile
examples/xenomai_posix/Makefile
include/Makefile
lib/Makefile
libethercat_wrapper/Makefile
m4/Makefile
master/Kbuild
master/Makefile
script/Makefile
script/ethercat.service
script/ethercatctl
script/init.d/Makefile
script/init.d/ethercat
script/sysconfig/Makefile
tool/Makefile
tty/Kbuild
tty/Makefile
])
AC_OUTPUT
#------------------------------------------------------------------------------
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/flvd/etherlab.git
git@gitee.com:flvd/etherlab.git
flvd
etherlab
etherlab
master

搜索帮助