diff --git a/.gitignore b/.gitignore index c0ebf884..0ab6798e 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ ethercat.spec examples/dc_user/ec_dc_user_example examples/user/ec_user_example lib/libethercat.la +lib/libethercat.pc libtool master/*.o.d script/ethercat.service diff --git a/Makefile.am b/Makefile.am index 8a8a8fcd..d8b19dfb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,6 +29,9 @@ ACLOCAL_AMFLAGS = -I m4 +AM_DISTCHECK_CONFIGURE_FLAGS = \ + --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) + SUBDIRS = \ include \ script @@ -68,16 +71,8 @@ noinst_HEADERS = \ globals.h EXTRA_DIST = \ - Doxyfile.in \ FEATURES \ - Kbuild.in \ README.EoE \ - ethercat.spec \ - ethercat.spec.in - -BUILT_SOURCES = \ - Doxyfile \ - Kbuild \ ethercat.spec modules: diff --git a/configure.ac b/configure.ac index e9517115..b19992cf 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,7 @@ AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 subdir-objects]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_MACRO_DIR([m4]) +PKG_PROG_PKG_CONFIG PKG_INSTALLDIR() #------------------------------------------------------------------------------ @@ -1078,6 +1079,35 @@ else AC_MSG_RESULT([no]) fi +#------------------------------------------------------------------------------ +# systemd service support +#------------------------------------------------------------------------------ + +AC_ARG_WITH([systemdsystemunitdir], + AS_HELP_STRING([--with-systemdsystemunitdir=DIR], + [Directory for systemd service files]), + , + [with_systemdsystemunitdir=auto] +) + +case "${with_systemdsystemunitdir}" in + yes) + with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) + if test "x$with_systemdsystemunitdir" = "x"; then + AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package]) + fi + ;; + no) + with_systemdsystemunitdir= + ;; + auto) + with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) + ;; +esac + +AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "x") +AC_SUBST(systemdsystemunitdir,[$with_systemdsystemunitdir]) + #------------------------------------------------------------------------------ AC_CONFIG_FILES([ diff --git a/devices/Makefile.am b/devices/Makefile.am index 8152d80e..a7925084 100644 --- a/devices/Makefile.am +++ b/devices/Makefile.am @@ -180,12 +180,6 @@ noinst_HEADERS = \ r8169-4.4-ethercat.c \ r8169-4.4-orig.c -EXTRA_DIST = \ - Kbuild.in - -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules diff --git a/devices/ccat/Makefile.am b/devices/ccat/Makefile.am index 305a2031..1ff5ea80 100644 --- a/devices/ccat/Makefile.am +++ b/devices/ccat/Makefile.am @@ -28,14 +28,10 @@ #------------------------------------------------------------------------------ EXTRA_DIST = \ - Kbuild.in \ module.h \ netdev.h \ update.h -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules diff --git a/devices/e1000/Makefile.am b/devices/e1000/Makefile.am index a8975ab3..9d69638f 100644 --- a/devices/e1000/Makefile.am +++ b/devices/e1000/Makefile.am @@ -28,7 +28,6 @@ #------------------------------------------------------------------------------ EXTRA_DIST = \ - Kbuild.in \ LICENSE \ e1000-2.6.13-ethercat.h \ e1000-2.6.13-orig.h \ @@ -354,9 +353,6 @@ EXTRA_DIST = \ e1000_param-4.4-orig.c -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules diff --git a/devices/e1000e/Makefile.am b/devices/e1000e/Makefile.am index c881eb3e..e89dc295 100644 --- a/devices/e1000e/Makefile.am +++ b/devices/e1000e/Makefile.am @@ -92,7 +92,6 @@ EXTRA_DIST = \ 82571-4.4-ethercat.h \ 82571-4.4-orig.c \ 82571-4.4-orig.h \ - Kbuild.in \ defines-2.6.32-ethercat.h \ defines-2.6.32-orig.h \ defines-2.6.33-ethercat.h \ @@ -461,9 +460,6 @@ EXTRA_DIST = \ regs-4.4-orig.h \ update.sh -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules diff --git a/devices/igb/Makefile.am b/devices/igb/Makefile.am index 9567b7d0..df5d43c8 100644 --- a/devices/igb/Makefile.am +++ b/devices/igb/Makefile.am @@ -110,9 +110,6 @@ EXTRA_DIST = \ igb_ptp-4.4-orig.c \ update.sh -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules diff --git a/documentation/ethercat_doc.tex b/documentation/ethercat_doc.tex index 2e10b0a0..fd71a197 100644 --- a/documentation/ethercat_doc.tex +++ b/documentation/ethercat_doc.tex @@ -8,10 +8,10 @@ % %------------------------------------------------------------------------------ -\documentclass[a4paper,12pt,BCOR6mm,bibtotoc,idxtotoc]{scrbook} +\documentclass[a4paper,12pt,BCOR=6mm,bibtotoc,idxtotoc]{scrbook} -\usepackage[latin1]{inputenc} -\usepackage[automark,headsepline]{scrpage2} +\usepackage[utf8]{inputenc} +\usepackage[automark,headsepline]{scrlayer-scrpage} \usepackage{graphicx} \usepackage{makeidx} \usepackage[refpage]{nomencl} @@ -28,12 +28,7 @@ \setlength{\parskip}{0.8ex plus 0.8ex minus 0.5ex} \setlength{\parindent}{0mm} -\setcounter{secnumdepth}{\subsubsectionlevel} - -\DeclareFontShape{OT1}{cmtt}{bx}{n} -{ - <5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88>cmttb10 -}{} +\setcounter{secnumdepth}{\subsubsectionnumdepth} \lstset{basicstyle=\ttfamily\small,numberstyle=\tiny,aboveskip=4mm, belowskip=2mm,escapechar=`,breaklines=true} @@ -3165,6 +3160,10 @@ interface) & \\ \lstinline+--with-devices+ & Number of Ethernet devices for redundant operation ($>1$ switches redundancy on) & 1\\ +\lstinline+--with-systemdsystemunitdir+ & Systemd unit directory ("no" +disables service file installation) +& auto \\ + \lstinline+--enable-debug-if+ & Create a debug interface for each master & no\\ \lstinline+--enable-debug-ring+ & Create a debug ring to record frames & no\\ diff --git a/documentation/ethercat_doc_fr.tex b/documentation/ethercat_doc_fr.tex index 9d19e7bd..62196f4f 100644 --- a/documentation/ethercat_doc_fr.tex +++ b/documentation/ethercat_doc_fr.tex @@ -1,4 +1,3 @@ - %------------------------------------------------------------------------------ % % IgH EtherCAT Master Documentation (French version) @@ -9,10 +8,10 @@ % %------------------------------------------------------------------------------ -\documentclass[a4paper,12pt,BCOR6mm,bibtotoc,idxtotoc]{scrbook} +\documentclass[a4paper,12pt,BCOR=6mm,bibtotoc,idxtotoc]{scrbook} -\usepackage[latin1]{inputenc} -\usepackage[automark,headsepline]{scrpage2} +\usepackage[utf8]{inputenc} +\usepackage[automark,headsepline]{scrlayer-scrpage} \usepackage[french]{babel} \usepackage{graphicx} \usepackage{makeidx} @@ -24,19 +23,13 @@ \usepackage{longtable} \usepackage{hyperref} - \hypersetup{pdfpagelabels,plainpages=false} \hypersetup{linkcolor=blue,colorlinks=true,urlcolor=blue} \setlength{\parskip}{0.8ex plus 0.8ex minus 0.5ex} \setlength{\parindent}{0mm} -\setcounter{secnumdepth}{\subsubsectionlevel} - -\DeclareFontShape{OT1}{cmtt}{bx}{n} -{ - <5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88>cmttb10 -}{} +\setcounter{secnumdepth}{\subsubsectionnumdepth} \lstset{basicstyle=\ttfamily\small,numberstyle=\tiny,aboveskip=4mm, belowskip=2mm,escapechar=`,breaklines=true} @@ -3577,6 +3570,8 @@ Xenomai et interface RTDM) & \\ \lstinline+--with-devices+ & Nombre de p\'eriph\'eriques Ethernet pour l'op\'eration redondante ($>1$ commute la redondance) & 1\\ +\lstinline+--with-systemdsystemunitdir+ & Chemin Systemd & auto \\ + \lstinline+--enable-debug-if+ & Cr\'eer une interface de d\'everminage pour chaque ma\^itre & non\\ diff --git a/examples/Makefile.am b/examples/Makefile.am index 9dcbef2c..6d79af16 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -66,10 +66,4 @@ DIST_SUBDIRS = \ xenomai \ xenomai_posix -EXTRA_DIST = \ - Kbuild.in - -BUILT_SOURCES = \ - Kbuild - #------------------------------------------------------------------------------ diff --git a/examples/dc_rtai/Makefile.am b/examples/dc_rtai/Makefile.am index 143ee0b0..164936cf 100644 --- a/examples/dc_rtai/Makefile.am +++ b/examples/dc_rtai/Makefile.am @@ -30,12 +30,8 @@ #------------------------------------------------------------------------------ EXTRA_DIST = \ - Kbuild.in \ dc_rtai_sample.c -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules diff --git a/examples/mini/Makefile.am b/examples/mini/Makefile.am index 1b97e51d..cbc0ae32 100644 --- a/examples/mini/Makefile.am +++ b/examples/mini/Makefile.am @@ -32,12 +32,8 @@ #------------------------------------------------------------------------------ EXTRA_DIST = \ - Kbuild.in \ mini.c -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules diff --git a/examples/rtai/Makefile.am b/examples/rtai/Makefile.am index faeee557..a73ea81a 100644 --- a/examples/rtai/Makefile.am +++ b/examples/rtai/Makefile.am @@ -30,12 +30,8 @@ #------------------------------------------------------------------------------ EXTRA_DIST = \ - Kbuild.in \ rtai_sample.c -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules diff --git a/examples/tty/Makefile.am b/examples/tty/Makefile.am index e4bcce48..2f3d0b2c 100644 --- a/examples/tty/Makefile.am +++ b/examples/tty/Makefile.am @@ -36,12 +36,6 @@ noinst_HEADERS = \ serial.h \ tty.c -EXTRA_DIST = \ - Kbuild.in - -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules diff --git a/examples/tty/serial.c b/examples/tty/serial.c index 31d696d4..bb3ed864 100644 --- a/examples/tty/serial.c +++ b/examples/tty/serial.c @@ -481,7 +481,7 @@ int el60xx_port_init(el60xx_port_t *port, ec_slave_config_t *sc, if (port->max_tx_data_size > 0) { port->tx_data = kmalloc(port->max_tx_data_size, GFP_KERNEL); if (port->tx_data == NULL) { - printk(KERN_ERR PFX "Failed to allocate %u bytes of TX" + printk(KERN_ERR PFX "Failed to allocate %zu bytes of TX" " memory for %s.\n", port->max_tx_data_size, port->name); ret = -ENOMEM; goto out_free_tty; diff --git a/master/Makefile.am b/master/Makefile.am index ab855f61..c7ea3ed7 100644 --- a/master/Makefile.am +++ b/master/Makefile.am @@ -74,12 +74,6 @@ noinst_HEADERS = \ sync_config.c sync_config.h \ voe_handler.c voe_handler.h -EXTRA_DIST = \ - Kbuild.in - -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules diff --git a/script/Makefile.am b/script/Makefile.am index 419a024f..4351f9c1 100644 --- a/script/Makefile.am +++ b/script/Makefile.am @@ -35,9 +35,6 @@ SUBDIRS = init.d sysconfig sbin_SCRIPTS = ethercatctl -systemddir = $(libdir)/systemd/system -systemd_DATA = ethercat.service - dist_sysconf_DATA = ethercat.conf EXTRA_DIST = \ @@ -45,8 +42,8 @@ EXTRA_DIST = \ ethercat.service.in \ ifup-eoe.sh -BUILT_SOURCES = \ - ethercatctl \ - ethercat.service +if HAVE_SYSTEMD +systemdsystemunit_DATA = ethercat.service +endif #------------------------------------------------------------------------------ diff --git a/script/init.d/Makefile.am b/script/init.d/Makefile.am index adef8dba..2392e417 100644 --- a/script/init.d/Makefile.am +++ b/script/init.d/Makefile.am @@ -31,8 +31,4 @@ initdir = $(sysconfdir)/init.d init_SCRIPTS = ethercat -EXTRA_DIST = ethercat.in - -BUILT_SOURCES = ethercat - #------------------------------------------------------------------------------ diff --git a/tty/Makefile.am b/tty/Makefile.am index de035efc..0060714f 100644 --- a/tty/Makefile.am +++ b/tty/Makefile.am @@ -32,12 +32,8 @@ noinst_HEADERS = \ module.c EXTRA_DIST = \ - Kbuild.in \ README -BUILT_SOURCES = \ - Kbuild - modules: $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules