--- a/Makefile.am Sun Jul 08 13:40:31 2018 +0200
+++ b/Makefile.am Tue Jul 10 16:49:05 2018 +0200
@@ -85,7 +85,7 @@
modules_install:
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \
- INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install
+ $(INSTALL_MOD_PATH_DEFS) modules_install
clean-local:
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean
--- a/configure.ac Sun Jul 08 13:40:31 2018 +0200
+++ b/configure.ac Tue Jul 10 16:49:05 2018 +0200
@@ -152,21 +152,38 @@
fi
#------------------------------------------------------------------------------
+# Linux module installation directory
+#------------------------------------------------------------------------------
+
+AC_ARG_WITH([module-path],
+ AC_HELP_STRING(
+ [--with-module-path=<DIR>],
+ [Linux module installation path. Default: /lib/modules/kernel_version]
+ ),
+ [modpathdefs="INSTALL_MOD_PATH='$withval'"],
+ [modpathdefs=""]
+)
+
+AC_MSG_CHECKING([for Linux modules installation directory])
+AC_MSG_RESULT([$with_mod_path])
+
+#------------------------------------------------------------------------------
# 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])
+ [Linux module installation subdir. Default: ethercat]
+ ),
+ [modpathdefs="$modpathdefs INSTALL_MOD_DIR='$withval'"],
+ [modpathdefs=""]
+)
+
+AC_MSG_CHECKING([for Linux modules installation subdirectory])
+AC_MSG_RESULT([$with_mod_dir])
+
+AC_SUBST(INSTALL_MOD_PATH_DEFS,[$modpathdefs])
#------------------------------------------------------------------------------
# Generic Ethernet driver
--- a/master/Makefile.am Sun Jul 08 13:40:31 2018 +0200
+++ b/master/Makefile.am Tue Jul 10 16:49:05 2018 +0200
@@ -85,7 +85,7 @@
modules_install:
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \
- INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install
+ $(INSTALL_MOD_PATH_DEFS) modules_install
clean-local:
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean