[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster ./configure csnap-kernel/src/Makefile ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	fabbione sourceware org	2007-09-19 11:07:22

Modified files:
	.              : configure 
	csnap-kernel/src: Makefile 
	gfs-kernel/src/gfs: Makefile 
	gnbd-kernel/src: Makefile 
	make           : defines.mk.input 

Log message:
	Fix configure and Makefiles to cope with kernel built with O=/path...
	
	Original patch by Joel Becker (joel.becker at oracle.com)
	
	NOTE for developers: you will need to re-run ./configure to update make/defines.mk
	NOTE for packages: you might need to change the way ./configure is invoked to cope
	with kernel_build vs kernel_src

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/configure.diff?cvsroot=cluster&r1=1.31&r2=1.32
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/csnap-kernel/src/Makefile.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/Makefile.diff?cvsroot=cluster&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gnbd-kernel/src/Makefile.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/make/defines.mk.input.diff?cvsroot=cluster&r1=1.3&r2=1.4

--- cluster/configure	2007/09/14 14:32:04	1.31
+++ cluster/configure	2007/09/19 11:07:21	1.32
@@ -29,6 +29,7 @@
 	extracflags => \$extracflags,
 	ldflags => \$ldflags,
 	extraldflags => \$extraldflags,
+	kernel_build => \$kernel_build,
 	kernel_src => \$kernel_src,
 	module_dir => \$module_dir,
 	gfskincdir => \$gfskincdir,
@@ -75,6 +76,7 @@
 		    'debug',
 		    'cflags=s',
 		    'ldflags=s',
+		    'kernel_build=s',
 		    'kernel_src=s',
 		    'module_dir=s',
 		    'gfskincdir=s',
@@ -140,7 +142,8 @@
   print "--extracflags=\tadd extra compiler options to default CFLAGS setting.  (Default: none)\n";
   print "--ldflags=\toverride default LDFLAGS settings.  (Default: none)\n";
   print "--extraldflags=\tadd extra linking options to default LDFLAGS settings.  (Default: none)\n";
-  print "--kernel_src=\tthe directory containing the kernel source you wish to\n\t\tcompile against. (Default: /lib/modules/`uname -r`/build)\n";
+  print "--kernel_build=\tthe directory containing the kernel object tree you wish to\n\t\tcompile against. (Default: /lib/modules/`uname -r`/build\n\t\tif available or /usr/src/linux as fallback)\n";
+  print "--kernel_src=\tthe directory containing the kernel source you wish to\n\t\tcompile against.  (Default: /lib/modules/`uname -r`/source\n\t\tif available or \$kernel_build as fallback)\n";
   print "--incdir=\tthe base directory for include files.  (Default: {prefix}/include)\n";
   print "--ccsincdir=\tthe base directory for ccs include files.  (Default: ./ccs/lib)\n";
   print "--ccslibdir=\tthe base directory for ccs libraries.  (Default: ./ccs/lib)\n";
@@ -195,8 +198,19 @@
 if (!$prefix) {
   $prefix="/usr";
 }
+if (!$kernel_build) {
+  if (-d "/lib/modules/`uname -r`/build") {
+    $kernel_build="/lib/modules/`uname -r`/build";
+  } else {
+    $kernel_build="/usr/src/linux";
+  }
+}
 if (!$kernel_src) {
-  $kernel_src="/lib/modules/`uname -r`/build";
+  if (-d "/lib/modules/`uname -r`/source") {
+    $kernel_src="/lib/modules/`uname -r`/source";
+  } else {
+    $kernel_src=$kernel_build;
+  }
 }
 if (!$module_dir) {
   $module_dir="/lib/modules/`uname -r`/kernel";
@@ -326,6 +340,7 @@
   $_ =~ s/\ CC\@/$cc/;
   $_ =~ s/\ CFLAGS\@/$cflags/;
   $_ =~ s/\ LDFLAGS\@/$ldflags/;
+  $_ =~ s/\ KERNEL_BUILD\@/$kernel_build/;
   $_ =~ s/\ KERNEL_SRC\@/$kernel_src/;
   $_ =~ s/\ MODULE_DIR\@/$module_dir/;
   $_ =~ s/\ GFSKINCDIR\@/$gfskincdir/;
--- cluster/csnap-kernel/src/Makefile	2006/08/11 15:18:06	1.2
+++ cluster/csnap-kernel/src/Makefile	2007/09/19 11:07:21	1.3
@@ -31,7 +31,7 @@
 EXTRA_CFLAGS += -I$(obj) -Idrivers/md
 
 all:
-	${MAKE} -C ${KERNEL_SRC} M=${PWD} modules USING_KBUILD=yes
+	${MAKE} -C ${KERNEL_BUILD} M=${PWD} modules USING_KBUILD=yes
 
 install: all
 	install -d ${incdir}/linux
--- cluster/gfs-kernel/src/gfs/Makefile	2007/06/01 09:45:33	1.16
+++ cluster/gfs-kernel/src/gfs/Makefile	2007/09/19 11:07:21	1.17
@@ -17,7 +17,7 @@
 
 PWD := $(shell pwd)
 
-SYMVERFILE := ${KERNEL_SRC}/Module.symvers
+SYMVERFILE := ${KERNEL_BUILD}/Module.symvers
 
 obj-m := gfs.o
 gfs-objs := acl.o \
@@ -60,7 +60,7 @@
 	util.o
 
 all:
-	${MAKE} -C ${KERNEL_SRC} M=${PWD} symverfile=${SYMVERFILE} modules USING_KBUILD=yes
+	${MAKE} -C ${KERNEL_BUILD} M=${PWD} symverfile=${SYMVERFILE} modules USING_KBUILD=yes
 
 install: all
 	install -d ${module_dir}/fs/gfs
--- cluster/gnbd-kernel/src/Makefile	2007/04/30 11:22:20	1.6
+++ cluster/gnbd-kernel/src/Makefile	2007/09/19 11:07:21	1.7
@@ -17,12 +17,12 @@
 
 PWD = $(shell pwd)
 
-SYMVERFILE := ${KERNEL_SRC}/Module.symvers
+SYMVERFILE := ${KERNEL_BUILD}/Module.symvers
 
 obj-m := gnbd.o
 
 all:
-	${MAKE} -C ${KERNEL_SRC} M=${PWD} symverfile=${SYMVERFILE} modules USING_KBUILD=yes
+	${MAKE} -C ${KERNEL_BUILD} M=${PWD} symverfile=${SYMVERFILE} modules USING_KBUILD=yes
 
 install: all
 	install -d ${incdir}/linux
--- cluster/make/defines.mk.input	2007/09/07 14:21:30	1.3
+++ cluster/make/defines.mk.input	2007/09/19 11:07:21	1.4
@@ -34,6 +34,7 @@
 
 BUILDDIR = @BUILDDIR@
 
+KERNEL_BUILD = @KERNEL_BUILD@
 KERNEL_SRC = @KERNEL_SRC@
 gfskincdir ?= @GFSKINCDIR@
 gnbdkincdir ?= @GNBDKINCDIR@


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]