Skip to contentSkip to conversation

Updated Patch for 2.6 Make system

Ocfs2-devel John L. Villalovos 2 participants 2 messages Mar 2, 2004

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

Fixes an error from the previous patch where I forgot to do NPTL :(

This now compiles with SVN revision 748.

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

#1 lore raw
Quoted 3 lines · John L. Villalovos

Fixes an error from the previous patch where I forgot to do NPTL :(

This now compiles with SVN revision 748.

I just committed a modified version of the configure.in and Config.make.in changes.

Quoted 11 lines

Index: configure.in
===================================================================

configure.in +1 -0
@@ -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)

configure.in line 91

Quoted 5 lines
configure.in +5 -0
+OCFS_KERNEL_2_6=
+if test "x$enable_kernel26" = "xyes"; then
+  OCFS_KERNEL_2_6=yes
+fi
+AC_SUBST(OCFS_KERNEL_2_6)

I got rid of the _'s. configure's never use _ in switches. Also, we can't use AC_HELP_STRING since we still need to support AS 2.1, which ships with ancient autoconf 2.13.

Quoted 2 lines

+ AC_MSG_NOTICE([Support for kernel version 2.6 is BROKEN at this
time! Your system WILL hang.])

Used AC_MSG_WARN instead of AC_MSG_NOTICE for the same reason.

configure.in line 334

Quoted 5 lines
configure.in +1 -0
@@ -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

In makebo philosophy, Makefiles should never be generated from .in's. You should be able to include Config.make for what you need.

What I'd like to see is having one Makefile that does everything, with the defines, cflags, and object files defined only once. Keeping this in sync across multiple files is a maintainence headache.

-Manish