# HG changeset patch # User Florian Pose # Date 1159193864 0 # Node ID a5a8a64d2b52f558e83fe9e21e4db0e704e644c2 # Parent 07c82e520ddd52ac41611c42b9017d7fa89fa72d MERGE trunk -r 552:553 -> branches/stable-1.1 (--with-linux, mydist) diff -r 07c82e520ddd -r a5a8a64d2b52 Makefile.am --- a/Makefile.am Mon Sep 25 12:20:44 2006 +0000 +++ b/Makefile.am Mon Sep 25 14:17:44 2006 +0000 @@ -68,6 +68,9 @@ EXTRA_DIST = $(noinst_SCRIPTS) $(MINI_FILES) $(RTAI_FILES) $(MSR_FILES) +mydist: + $(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-r`svnversion $(srcdir)` + dist-hook: if which svnversion >/dev/null 2>&1; then \ svnversion $(srcdir) 2>/dev/null >$(distdir)/svnrevision; \ @@ -80,6 +83,7 @@ $(INSTALL_SCRIPT) $(srcdir)/script/lsec.pl $(bindir)/lsec $(INSTALL_SCRIPT) $(srcdir)/script/ethercat.sh $(initdir)/ethercat $(INSTALL_DATA) $(srcdir)/script/sysconfig $(sysdir)/ethercat + $(DEPMOD) $(LINUX_KERNEL_VERSION) uninstall-local: rm -rf $(LINUX_MODULES_DIR)/ethercat diff -r 07c82e520ddd -r a5a8a64d2b52 configure.ac --- a/configure.ac Mon Sep 25 12:20:44 2006 +0000 +++ b/configure.ac Mon Sep 25 14:17:44 2006 +0000 @@ -14,27 +14,42 @@ # Linux sources #------------------------------------------------------------------------------ -AC_ARG_WITH([linux-dir], +AC_ARG_WITH([linux], AC_HELP_STRING( - [--with-linux-dir=], - [Linux source directory @<:@/lib/modules//build@:>@]), + [--with-linux=], + [Linux kernel version @<:@running kernel@:>@] + ), [ ], - [ - modulesdir=/lib/modules/`uname -r` - withval=${modulesdir}/build - ]) + [version=`uname -r`] +) -AC_MSG_CHECKING([for Linux source tree]) - -if test \! -r ${withval}/Makefile; then +AC_MSG_CHECKING([for Linux kernel]) +modulesdir=/lib/modules/${version} +if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then echo - AC_MSG_ERROR([No Linux kernel tree in $withval]) + AC_MSG_ERROR([Invalid modules directory ${modulesdir}]) +fi +sourcedir=`cd ${modulesdir}/build && pwd -P` +if test \! -r ${sourcedir}/Makefile; then + echo + AC_MSG_ERROR([No Linux kernel tree in $sourcedir]) fi -AC_SUBST(LINUX_DIR,[$withval]) +AC_SUBST(LINUX_KERNEL_VERSION,[$version]) +AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir]) AC_SUBST(LINUX_MODULES_DIR,[$modulesdir]) -AC_MSG_RESULT($LINUX_DIR) +AC_MSG_RESULT($LINUX_KERNEL_VERSION) + +#------------------------------------------------------------------------------ +# Depmod +#------------------------------------------------------------------------------ + +AC_PATH_PROG([DEPMOD], [depmod],, [$PATH:/sbin:/usr/sbin:/usr/local/sbin]) + +if test -z "$DEPMOD"; then + AC_MSG_WARN([depmod was not found!]); +fi #------------------------------------------------------------------------------ diff -r 07c82e520ddd -r a5a8a64d2b52 devices/Makefile.am --- a/devices/Makefile.am Mon Sep 25 12:20:44 2006 +0000 +++ b/devices/Makefile.am Mon Sep 25 14:17:44 2006 +0000 @@ -44,13 +44,13 @@ ABSSRCDIR = `cd $(srcdir) && pwd -P` all: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" modules + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" modules clean-local: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" clean + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" clean install-data-local: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" \ + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" \ INSTALL_MOD_DIR="ethercat" modules_install #------------------------------------------------------------------------------ diff -r 07c82e520ddd -r a5a8a64d2b52 examples/mini/Makefile.am --- a/examples/mini/Makefile.am Mon Sep 25 12:20:44 2006 +0000 +++ b/examples/mini/Makefile.am Mon Sep 25 14:17:44 2006 +0000 @@ -38,13 +38,13 @@ ABSSRCDIR = `cd $(srcdir) && pwd -P` all: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" modules + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" modules clean-local: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" clean + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" clean install-data-local: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" \ + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" \ INSTALL_MOD_DIR="ethercat" modules_install #------------------------------------------------------------------------------ diff -r 07c82e520ddd -r a5a8a64d2b52 examples/msr/Makefile.am --- a/examples/msr/Makefile.am Mon Sep 25 12:20:44 2006 +0000 +++ b/examples/msr/Makefile.am Mon Sep 25 14:17:44 2006 +0000 @@ -45,13 +45,13 @@ ABSSRCDIR = `cd $(srcdir) && pwd -P` all: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" modules + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" modules clean-local: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" clean + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" clean install-data-local: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" \ + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" \ INSTALL_MOD_DIR="ethercat" modules_install #------------------------------------------------------------------------------ diff -r 07c82e520ddd -r a5a8a64d2b52 examples/rtai/Makefile.am --- a/examples/rtai/Makefile.am Mon Sep 25 12:20:44 2006 +0000 +++ b/examples/rtai/Makefile.am Mon Sep 25 14:17:44 2006 +0000 @@ -40,13 +40,13 @@ ABSSRCDIR = `cd $(srcdir) && pwd -P` all: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" modules + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" modules clean-local: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" clean + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" clean install-data-local: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" \ + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" \ INSTALL_MOD_DIR="ethercat" modules_install #------------------------------------------------------------------------------ diff -r 07c82e520ddd -r a5a8a64d2b52 master/Makefile.am --- a/master/Makefile.am Mon Sep 25 12:20:44 2006 +0000 +++ b/master/Makefile.am Mon Sep 25 14:17:44 2006 +0000 @@ -54,13 +54,13 @@ ABSSRCDIR = `cd $(srcdir) && pwd -P` all: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" modules + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" modules clean-local: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" clean + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" clean install-data-local: - $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" \ + $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(ABSSRCDIR)" \ INSTALL_MOD_DIR="ethercat" modules_install #------------------------------------------------------------------------------