Improved handling and installation of the modules' symbol versions.
authorFlorian Pose <fp@igh-essen.com>
Tue, 16 Feb 2010 15:08:54 +0100
changeset 1809 586be70ff70a
parent 1808 96adb3e6db74
child 1810 a352f3e4f95d
Improved handling and installation of the modules' symbol versions.
Makefile.am
NEWS
configure.ac
devices/Kbuild.in
devices/e1000/Kbuild.in
examples/dc_rtai/Kbuild.in
examples/mini/Kbuild.in
examples/rtai/Kbuild.in
examples/tty/Kbuild.in
master/Makefile.am
tty/Makefile.am
--- a/Makefile.am	Tue Feb 16 11:16:05 2010 +0100
+++ b/Makefile.am	Tue Feb 16 15:08:54 2010 +0100
@@ -84,9 +84,11 @@
 	$(MAKE) -C tty modules_install
 endif
 
+dist_pkgdata_DATA = $(LINUX_SYMVERS)
+
 clean-local:
 	$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean
-	@rm -f Modules.symvers
+	@rm -f $(LINUX_SYMVERS)
 
 mydist:
 	hg log --style=changelog $(srcdir) > ChangeLog
@@ -100,25 +102,25 @@
 
 mrproper: clean cleandoc
 	rm -rf \
+		$(LINUX_SYMVERS) \
 		*~ \
+		ChangeLog \
+		Doxyfile \
+		Kbuild \
+		Makefile \
+		Makefile.in \
+		TAGS \
 		aclocal.m4 \
 		autoconf \
 		autom4te.cache \
-		ChangeLog \
 		config.h \
 		config.h.in \
 		config.log \
 		config.status \
 		configure \
 		configure.in \
-		Doxyfile \
-		Kbuild \
 		libtool \
-		Makefile \
-		Makefile.in \
-		Module.symvers \
-		stamp-h1 \
-		TAGS
+		stamp-h1
 
 doc:
 	doxygen Doxyfile
--- a/NEWS	Tue Feb 16 11:16:05 2010 +0100
+++ b/NEWS	Tue Feb 16 15:08:54 2010 +0100
@@ -59,8 +59,7 @@
 * Changed EC_MAX_SII_SIZE to 4096.
 * 'ethercat xml' creates valid XML <EtherCATInfoList> for more than one slave
   (thanks to E. Burgstaller).
-* Module symbol versions file for ec_master.ko is installed to
-  prefix/modules/ec_master.symvers.
+* Module symbol versions file is installed to $prefix/share/ethercat.
 * Added 'ethercat eoe' command to display Ethernet over EtherCAT statistics.
 * Added 'ethercat cstruct' command to output PDO information in C language.
 * Significantly improved EoE bandwidth by running EoE processing in a kthread.
--- a/configure.ac	Tue Feb 16 11:16:05 2010 +0100
+++ b/configure.ac	Tue Feb 16 15:08:54 2010 +0100
@@ -102,6 +102,27 @@
 AC_MSG_RESULT([$LINUX_SOURCE_DIR (Kernel $LINUX_KERNEL_RELEASE)])
 
 #------------------------------------------------------------------------------
+# Determine the name of the symbol version file
+#------------------------------------------------------------------------------
+
+AC_MSG_CHECKING([for Linux symbol version file])
+
+symvers=
+for file in Module.symvers Modules.symvers; do
+	if test -f "$LINUX_SOURCE_DIR/$file"; then
+		symvers=$file
+		break
+	fi
+done
+
+AC_SUBST(LINUX_SYMVERS,[$symvers])
+if test -n "$symvers"; then
+	AC_MSG_RESULT([$LINUX_SYMVERS])
+else
+	AC_MSG_RESULT(["(none)"])
+fi
+
+#------------------------------------------------------------------------------
 # Generic Ethernet driver
 #------------------------------------------------------------------------------
 
--- a/devices/Kbuild.in	Tue Feb 16 11:16:05 2010 +0100
+++ b/devices/Kbuild.in	Tue Feb 16 15:08:54 2010 +0100
@@ -70,7 +70,7 @@
 endif
 
 KBUILD_EXTRA_SYMBOLS := \
-	@abs_top_builddir@/Module.symvers \
-	@abs_top_builddir@/master/Module.symvers
+	@abs_top_builddir@/$(LINUX_SYMVERS) \
+	@abs_top_builddir@/master/$(LINUX_SYMVERS)
 
 #------------------------------------------------------------------------------
--- a/devices/e1000/Kbuild.in	Tue Feb 16 11:16:05 2010 +0100
+++ b/devices/e1000/Kbuild.in	Tue Feb 16 15:08:54 2010 +0100
@@ -51,7 +51,7 @@
 endif
 
 KBUILD_EXTRA_SYMBOLS := \
-	@abs_top_builddir@/Module.symvers \
-	@abs_top_builddir@/master/Module.symvers
+	@abs_top_builddir@/$(LINUX_SYMVERS) \
+	@abs_top_builddir@/master/$(LINUX_SYMVERS)
 
 #------------------------------------------------------------------------------
--- a/examples/dc_rtai/Kbuild.in	Tue Feb 16 11:16:05 2010 +0100
+++ b/examples/dc_rtai/Kbuild.in	Tue Feb 16 15:08:54 2010 +0100
@@ -38,7 +38,7 @@
 EXTRA_CFLAGS := -I@RTAI_DIR@/include
 
 KBUILD_EXTRA_SYMBOLS := \
-	@abs_top_builddir@/Module.symvers \
-	@abs_top_builddir@/master/Module.symvers
+	@abs_top_builddir@/$(LINUX_SYMVERS) \
+	@abs_top_builddir@/master/$(LINUX_SYMVERS)
 
 #------------------------------------------------------------------------------
--- a/examples/mini/Kbuild.in	Tue Feb 16 11:16:05 2010 +0100
+++ b/examples/mini/Kbuild.in	Tue Feb 16 15:08:54 2010 +0100
@@ -36,7 +36,7 @@
 ec_mini-objs := mini.o
 
 KBUILD_EXTRA_SYMBOLS := \
-	@abs_top_builddir@/Module.symvers \
-	@abs_top_builddir@/master/Module.symvers
+	@abs_top_builddir@/$(LINUX_SYMVERS) \
+	@abs_top_builddir@/master/$(LINUX_SYMVERS)
 
 #------------------------------------------------------------------------------
--- a/examples/rtai/Kbuild.in	Tue Feb 16 11:16:05 2010 +0100
+++ b/examples/rtai/Kbuild.in	Tue Feb 16 15:08:54 2010 +0100
@@ -38,7 +38,7 @@
 EXTRA_CFLAGS := -I@RTAI_DIR@/include
 
 KBUILD_EXTRA_SYMBOLS := \
-	@abs_top_builddir@/Module.symvers \
-	@abs_top_builddir@/master/Module.symvers
+	@abs_top_builddir@/$(LINUX_SYMVERS) \
+	@abs_top_builddir@/master/$(LINUX_SYMVERS)
 
 #------------------------------------------------------------------------------
--- a/examples/tty/Kbuild.in	Tue Feb 16 11:16:05 2010 +0100
+++ b/examples/tty/Kbuild.in	Tue Feb 16 15:08:54 2010 +0100
@@ -40,7 +40,7 @@
 CFLAGS_tty.o := -I$(src)
 
 KBUILD_EXTRA_SYMBOLS := \
-	@abs_top_builddir@/Module.symvers \
-	@abs_top_builddir@/master/Module.symvers
+	@abs_top_builddir@/$(LINUX_SYMVERS) \
+	@abs_top_builddir@/master/$(LINUX_SYMVERS)
 
 #------------------------------------------------------------------------------
--- a/master/Makefile.am	Tue Feb 16 11:16:05 2010 +0100
+++ b/master/Makefile.am	Tue Feb 16 15:08:54 2010 +0100
@@ -82,18 +82,4 @@
 clean-local:
 	$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean
 
-modulesdir=@prefix@/modules
-SYMVERS=$(top_builddir)/Module.symvers
-SYMVERSS=$(top_builddir)/Modules.symvers
-
-install-data-local:
-	for symvers in $(SYMVERS) $(SYMVERSS); do \
-		if test -f $$symvers; then \
-			mkdir -p $(DESTDIR)$(modulesdir) && \
-			cp -vf $$symvers \
-			$(DESTDIR)$(modulesdir)/ec_master.symvers; \
-			break; \
-		fi; \
-	done
-
 #------------------------------------------------------------------------------
--- a/tty/Makefile.am	Tue Feb 16 11:16:05 2010 +0100
+++ b/tty/Makefile.am	Tue Feb 16 15:08:54 2010 +0100
@@ -48,13 +48,4 @@
 clean-local:
 	$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean
 
-modulesdir=@prefix@/modules
-SYMVERS=`echo $(top_builddir)/Module*.symvers`
-
-install-data-local:
-	@test -n "$(SYMVERS)" && \
-		mkdir -p $(DESTDIR)$(modulesdir) && \
-		cp -vf $(SYMVERS) \
-			$(DESTDIR)$(modulesdir)/ec_tty.symvers
-
 #------------------------------------------------------------------------------