[etherlab-users] 2 extensions for the configure

Sergej.Stepanov at ids.de Sergej.Stepanov at ids.de
Thu Apr 14 17:40:45 CEST 2011


Hallo list,

By using the Igh EtherCAT-stack in cross environment it would be nice to have the following extensions in the configure.ac:
1. install prefix for cross-compiled kernel modules (it could be for native platforms also useful)
2. compiled kernel modules be stripped after they are installed

For this purposes could be used the following patch based on current repo state:

--- ethercat-default/Makefile.am	2011-01-25 09:32:18.000000000 +0100
+++ ethercat-1.5.0/Makefile.am	2011-04-14 16:54:57.000000000 +0200
@@ -82,6 +82,7 @@ modules:
 
 modules_install:
 	$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \
+		@ENABLE_KMODDEBUG@ @INSTALL_KMODPATH@ \
 		INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install
 
 clean-local:
--- ethercat-default/configure.ac	2011-01-25 09:32:18.000000000 +0100
+++ ethercat-1.5.0/configure.ac	2011-04-14 16:45:20.000000000 +0200
@@ -603,6 +658,57 @@ AC_ARG_ENABLE([tty],
 AM_CONDITIONAL(ENABLE_TTY, test "x$tty" = "x1")
 AC_SUBST(ENABLE_TTY,[$tty])
 
+#------- kmod install dir -------------------------------------------------
+AC_ARG_WITH([kmodpath],
+    AS_HELP_STRING(
+	[--with-kmodpath=<DIR>],
+	[Install prefix for cross-compiled kernel modules]
+    ),
+    [
+	if test -n "$CROSS_COMPILE" ;then
+	    if test -z $withval ;then
+		AC_MSG_WARN([Empty value for INSTALL_MOD_PATH])
+	    fi
+	fi
+	AC_MSG_CHECKING([install prefix for compiled kernel modules])
+	AC_SUBST(INSTALL_KMODPATH,INSTALL_MOD_PATH="$withval")
+	kmodpath=[$withval]
+	AC_MSG_RESULT([$kmodpath])
+    ],
+    [
+	if test -n "$CROSS_COMPILE" ;then
+		AC_MSG_WARN([INSTALL_MOD_PATH varable is nice to have for cross-compile])
+	fi
+	kmodpath=default
+    ]
+)
+
+#------------------------------------------------------------------------------
+AC_MSG_CHECKING([whether compiled kernel modules be striped])
+AC_ARG_ENABLE([kmoddebug],
+    AS_HELP_STRING(
+	[--enable-kmoddebug],
+	[Strip compiled kernel modules at install (default: no)]
+    ),
+    [
+	case "${enableval}" in
+	    yes) kmoddebug=1
+		 AC_SUBST(ENABLE_KMODDEBUG,[])
+		 AC_MSG_RESULT(no)
+		 ;;
+	    no) kmoddebug=0
+		 AC_SUBST(ENABLE_KMODDEBUG,[INSTALL_MOD_STRIP=1])
+		 AC_MSG_RESULT(yes)
+		;;
+	    *) AC_MSG_ERROR([Invalid value for --enable-kmoddebug])
+		;;
+	esac
+    ],
+    [
+	kmoddebug=1;
+	AC_MSG_RESULT(no)
+    ]
+)
 #------------------------------------------------------------------------------
 
 AC_CONFIG_FILES([


Best regards
Sergej Stepanov.
--
Dipl.-Ing. Sergej Stepanov 
Software-Developer

IDS GmbH 
E-PA (Development - Process Automation)
Nobelstr. 18, 
D-76275 Ettlingen 
T. (0) 72 43/2 18-615 
F. (0) 72 43/2 18-100 
E. Sergej.Stepanov at ids.de


Managing Directors: Norbert Wagner, Friedrich AbriƟ 
Registered office: Ettlingen 
Register of companies: Mannheim HRB 362503 


More information about the Etherlab-users mailing list