Skip to contentSkip to conversation

2.6.x make support

Ocfs2-devel John L. Villalovos 1 participant 1 message Mar 3, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Updated to get the make system to be able to build for 2.6.x kernels.

More work still needs to be done but it will compile.

I had to create a Config-minimal.make.in file because when I included Config.make during the portion of the build when the kernel is calling back into our Makefile it broke :( We seem to be setting some variables which are being used by the kernel build system.

So instead I created this minimal one.

This is just a first start at this. There is more work to be done in this area but it does make it so that people should be able to build a kernel for 2.6.x.

John

configure.in +18 -0
Index: configure.in
===================================================================
@@ -83,6 +83,13 @@
    AC_MSG_ERROR(GCC is required)
  fi
 
+AC_ARG_ENABLE(kernel-2_6, AC_HELP_STRING([--enable-kernel-2_6], [(BROKEN!) Enable building on Linux kernel version 2.6.x (default=no)]),enable_kernel26=yes,enable_kernel26=no)
+OCFS_KERNEL_2_6=
+if test "x$enable_kernel26" = "xyes"; then
+  OCFS_KERNEL_2_6=yes
+fi
+AC_SUBST(OCFS_KERNEL_2_6)
+
  AC_ARG_ENABLE(debug, [  --enable-debug=[yes/no]         Turn on debugging [default=yes]],,enable_debug=yes)
  OCFS_DEBUG=
  if test "x$enable_debug" = "xyes"; then
@@ -178,6 +185,13 @@
  case "$kversion" in
    2.4.*)
      ;;
+  2.6.*)
+    if test "x$enable_kernel26" = "xyes"; then
+      AC_MSG_NOTICE([Support for kernel version 2.6 is BROKEN at this time!  Your system WILL hang.])
+    else
+      AC_MSG_ERROR([Support for kernel version 2.6 is BROKEN (Your system WILL hang!) at this time.  You must use --enable-kernel-2_6 to get past this point.])
+    fi
+    ;;
    *)
      AC_MSG_ERROR([This module only supports kernel version 2.4.x])
      ;;
@@ -304,6 +318,9 @@
  GCCINC=$gccdir
  AC_SUBST(GCCINC)
 
+OCFS_BUILD_DIR=`pwd`
+AC_SUBST(OCFS_BUILD_DIR)
+
  AC_OUTPUT([Config.make
  vendor/redhat/ocfs2-2.4.9-e.spec
  vendor/redhat/ocfs2-2.4.18-e.spec
@@ -314,4 +331,5 @@
  vendor/unitedlinux/ocfs2-2.4.21-107.spec
  vendor/unitedlinux/ocfs2-2.4.21-111.spec
  vendor/unitedlinux/ocfs2-2.4.21-138.spec
+src/Makefile-2.6
  ])
Config.make.in +1 -0
Index: Config.make.in
===================================================================
@@ -58,5 +58,6 @@
  OCFS_MEMDEBUG = @OCFS_MEMDEBUG@
  OCFS_TRACE = @OCFS_TRACE@
  OCFS_PROCESSOR = @OCFS_PROCESSOR@
+OCFS_KERNEL_2_6 = @OCFS_KERNEL_2_6@
 
  USE_JOURNAL_CREATE_REPLACEMENT = @USE_JOURNAL_CREATE_REPLACEMENT@
Makefile +20 -0
Index: src/Makefile
===================================================================
@@ -1,3 +1,11 @@
+# See if we are being included by the 2.6 kernel build system.
+ifneq ($(KERNELRELEASE),)
+# We are being included by the 2.6 kernel build system.  So we will include the
+# 2.6.x Makefile and skip everything else.
+include $(obj)/Makefile-2.6
+else
+# Normal build that is being called locally
+
  TOPDIR = ..
 
  include $(TOPDIR)/Preamble.make
@@ -2,2 +10,7 @@
 
+# Preliminary 2.6.x kernel support.  See if we are building for the 2.6.x
+# kernel
+ifndef OCFS_KERNEL_2_6
+# Building for a 2.4.x kernel
+
  WARNINGS = -Wall -Wstrict-prototypes -Wno-format
@@ -196,4 +209,11 @@
  dist-subdircreate:
  	$(TOPDIR)/mkinstalldirs $(DIST_DIR)/inc
 
+
+else # OCFS_KERNEL_2_6
+# Building for a 2.6.x kernel
+include Makefile-2.6
+endif # OCFS_KERNEL_2_6
+
  include $(TOPDIR)/Postamble.make
+endif # ifneq ($(KERNELRELEASE),)
Makefile-2.6.in new file +74 -0

74 lines not on this page · raw message

-------------- next part --------------

configure.in +18 -0
Index: configure.in
===================================================================
@@ -83,6 +83,13 @@
   AC_MSG_ERROR(GCC is required)
 fi
 
+AC_ARG_ENABLE(kernel-2_6, AC_HELP_STRING([--enable-kernel-2_6], [(BROKEN!) Enable building on Linux kernel version 2.6.x (default=no)]),enable_kernel26=yes,enable_kernel26=no)
+OCFS_KERNEL_2_6=
+if test "x$enable_kernel26" = "xyes"; then
+  OCFS_KERNEL_2_6=yes
+fi
+AC_SUBST(OCFS_KERNEL_2_6)
+
 AC_ARG_ENABLE(debug, [  --enable-debug=[yes/no]         Turn on debugging [default=yes]],,enable_debug=yes)
 OCFS_DEBUG=
 if test "x$enable_debug" = "xyes"; then
@@ -178,6 +185,13 @@
 case "$kversion" in
   2.4.*)
     ;;
+  2.6.*)
+    if test "x$enable_kernel26" = "xyes"; then
+      AC_MSG_NOTICE([Support for kernel version 2.6 is BROKEN at this time!  Your system WILL hang.])
+    else
+      AC_MSG_ERROR([Support for kernel version 2.6 is BROKEN (Your system WILL hang!) at this time.  You must use --enable-kernel-2_6 to get past this point.])
+    fi
+    ;;
   *)
     AC_MSG_ERROR([This module only supports kernel version 2.4.x])
     ;;
@@ -304,6 +318,9 @@
 GCCINC=$gccdir
 AC_SUBST(GCCINC)
 
+OCFS_BUILD_DIR=`pwd`
+AC_SUBST(OCFS_BUILD_DIR)
+
 AC_OUTPUT([Config.make
 vendor/redhat/ocfs2-2.4.9-e.spec
 vendor/redhat/ocfs2-2.4.18-e.spec
@@ -314,4 +331,5 @@
 vendor/unitedlinux/ocfs2-2.4.21-107.spec
 vendor/unitedlinux/ocfs2-2.4.21-111.spec
 vendor/unitedlinux/ocfs2-2.4.21-138.spec
+src/Makefile-2.6
 ])
Config.make.in +1 -0
Index: Config.make.in
===================================================================
@@ -58,5 +58,6 @@
 OCFS_MEMDEBUG = @OCFS_MEMDEBUG@
 OCFS_TRACE = @OCFS_TRACE@
 OCFS_PROCESSOR = @OCFS_PROCESSOR@
+OCFS_KERNEL_2_6 = @OCFS_KERNEL_2_6@
 
 USE_JOURNAL_CREATE_REPLACEMENT = @USE_JOURNAL_CREATE_REPLACEMENT@
Makefile +20 -0
Index: src/Makefile
===================================================================
@@ -1,3 +1,11 @@
+# See if we are being included by the 2.6 kernel build system.
+ifneq ($(KERNELRELEASE),)
+# We are being included by the 2.6 kernel build system.  So we will include the
+# 2.6.x Makefile and skip everything else.
+include $(obj)/Makefile-2.6
+else
+# Normal build that is being called locally
+
 TOPDIR = ..
 
 include $(TOPDIR)/Preamble.make
@@ -2,2 +10,7 @@
 
+# Preliminary 2.6.x kernel support.  See if we are building for the 2.6.x
+# kernel
+ifndef OCFS_KERNEL_2_6
+# Building for a 2.4.x kernel
+
 WARNINGS = -Wall -Wstrict-prototypes -Wno-format
@@ -196,4 +209,11 @@
 dist-subdircreate:
 	$(TOPDIR)/mkinstalldirs $(DIST_DIR)/inc
 
+
+else # OCFS_KERNEL_2_6
+# Building for a 2.6.x kernel
+include Makefile-2.6
+endif # OCFS_KERNEL_2_6
+
 include $(TOPDIR)/Postamble.make
+endif # ifneq ($(KERNELRELEASE),)
Makefile-2.6.in new file +74 -0

74 lines not on this page · raw message