[Ocfs2-commits] rev 754 - in trunk: . src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Mar 3 20:10:04 CST 2004
Author: manish
Date: 2004-03-03 20:10:02 -0600 (Wed, 03 Mar 2004)
New Revision: 754
Modified:
trunk/Config.make.in
trunk/configure.in
trunk/src/Makefile
Log:
2.6 build framework from John L. Villalovos
Modified: trunk/Config.make.in
===================================================================
--- trunk/Config.make.in 2004-03-04 01:12:45 UTC (rev 753)
+++ trunk/Config.make.in 2004-03-04 02:10:02 UTC (rev 754)
@@ -1,3 +1,4 @@
+ifeq ($(KERNELRELEASE),)
PACKAGE = @PACKAGE@
VERSION = @VERSION@
@@ -47,13 +48,14 @@
KVER = @KVER@
-HAVE_NPTL = @HAVE_NPTL@
-
MODULEDIR = @MODULEDIR@
MODVERSIONS = @MODVERSIONS@
GCCINC = @GCCINC@
+endif
+HAVE_NPTL = @HAVE_NPTL@
+
OCFS_DEBUG = @OCFS_DEBUG@
OCFS_LARGEIO = @OCFS_LARGEIO@
OCFS_AIO = @OCFS_AIO@
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2004-03-04 01:12:45 UTC (rev 753)
+++ trunk/configure.in 2004-03-04 02:10:02 UTC (rev 754)
@@ -276,9 +276,12 @@
USE_JOURNAL_CREATE_REPLACEMENT=yes
case "$kversion" in
-$journal_min_version)
- USE_JOURNAL_CREATE_REPLACEMENT=no
- ;;
+ $journal_min_version)
+ USE_JOURNAL_CREATE_REPLACEMENT=no
+ ;;
+ 2.6.*)
+ USE_JOURNAL_CREATE_REPLACEMENT=no
+ ;;
esac
AC_MSG_RESULT($USE_JOURNAL_CREATE_REPLACEMENT)
Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile 2004-03-04 01:12:45 UTC (rev 753)
+++ trunk/src/Makefile 2004-03-04 02:10:02 UTC (rev 754)
@@ -1,57 +1,67 @@
+# See if we are being included by the 2.6 kernel build system.
+ifeq ($(KERNELRELEASE),)
+# Normal build that is being called locally
TOPDIR = ..
include $(TOPDIR)/Preamble.make
+else # ifeq ($(KERNELRELEASE),)
+# We are being included by the 2.6.x kernel build system
-WARNINGS = -Wall -Wstrict-prototypes -Wno-format
+# Global parameter so we know where our stuff is
+OCFS_SRC_DIR := $(SUBDIRS)
-ifneq ($(OCFS_PROCESSOR),x86_64)
-WARNINGS += -Wmissing-prototypes -Wmissing-declarations
+include $(OCFS_SRC_DIR)/../Config.make
endif
+#-*******************************************************
+# Now do stuff which is global for 2.4.x and 2.6.x builds
+
+WARNINGS = -Wall -Wstrict-prototypes -Wno-format
+
ifdef OCFS_DEBUG
OPTS += -g
endif
BASE_DEFINES = -DMODULE -DLINUX -D__KERNEL__
-DEFINES = $(BASE_DEFINES)
+GLOBAL_DEFINES =
ifdef OCFS_DEBUG
-DEFINES += -DDEBUG
+GLOBAL_DEFINES += -DDEBUG
endif
ifdef OCFS_MEMDEBUG
-DEFINES += -DOCFS_LINUX_MEM_DEBUG -DDEBUG_SLAB_ALLOCS
+GLOBAL_DEFINES += -DOCFS_LINUX_MEM_DEBUG -DDEBUG_SLAB_ALLOCS
endif
ifdef OCFS_AIO
-DEFINES += -DAIO_ENABLED
+GLOBAL_DEFINES += -DAIO_ENABLED
endif
ifdef OCFS_TRACE
-DEFINES += -DTRACE
+GLOBAL_DEFINES += -DTRACE
endif
ifdef HAVE_NPTL
-DEFINES += -DHAVE_NPTL
+GLOBAL_DEFINES += -DHAVE_NPTL
endif
ifeq ($(USE_JOURNAL_CREATE_REPLACEMENT),yes)
-DEFINES += -DUSE_JOURNAL_CREATE_REPLACEMENT
+GLOBAL_DEFINES += -DUSE_JOURNAL_CREATE_REPLACEMENT
endif
ifneq ($(QUIET),1)
-DEFINES += -DDEBUG_LOCK_BUFFER
-DEFINES += -DVERBOSE_BH_JBD_TRACE
-DEFINES += -DVERBOSE_LOCKING_TRACE
-DEFINES += -DVERBOSE_BH_SEQNUM_TRACE
-DEFINES += -DVERBOSE_PROCESS_VOTE
+GLOBAL_DEFINES += -DDEBUG_LOCK_BUFFER
+GLOBAL_DEFINES += -DVERBOSE_BH_JBD_TRACE
+GLOBAL_DEFINES += -DVERBOSE_LOCKING_TRACE
+GLOBAL_DEFINES += -DVERBOSE_BH_SEQNUM_TRACE
+GLOBAL_DEFINES += -DVERBOSE_PROCESS_VOTE
#off by default -- these generate ALOT of output
-#DEFINES += -DVERBOSE_BH_SEM
-#DEFINES += -DBH_SEM_DEBUG
+#GLOBAL_DEFINES += -DVERBOSE_BH_SEM
+#GLOBAL_DEFINES += -DBH_SEM_DEBUG
ifneq ($(OCFS_PROCESSOR),ia64)
-#DEFINES += -DOCFS_DBG_TIMING
+#GLOBAL_DEFINES += -DOCFS_DBG_TIMING
endif
endif
@@ -61,43 +71,35 @@
endif
ifeq ($(KVER),suse)
-DEFINES += -DSUSE
+GLOBAL_DEFINES += -DSUSE
endif
ifeq ($(KVER),hugemem)
- DEFINES += -D__BOOT_KERNEL_HUGEMEM=1
- DEFINES += -D__BOOT_KERNEL_ENTERPRISE=0
- DEFINES += -D__BOOT_KERNEL_SMP=0
- DEFINES += -D__BOOT_KERNEL_UP=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_HUGEMEM=1
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_ENTERPRISE=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_SMP=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_UP=0
endif
ifeq ($(KVER),smp)
- DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
- DEFINES += -D__BOOT_KERNEL_ENTERPRISE=0
- DEFINES += -D__BOOT_KERNEL_SMP=1
- DEFINES += -D__BOOT_KERNEL_UP=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_ENTERPRISE=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_SMP=1
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_UP=0
endif
ifeq ($(KVER),ent)
- DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
- DEFINES += -D__BOOT_KERNEL_ENTERPRISE=1
- DEFINES += -D__BOOT_KERNEL_SMP=0
- DEFINES += -D__BOOT_KERNEL_UP=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_ENTERPRISE=1
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_SMP=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_UP=0
endif
ifeq ($(KVER),up)
- DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
- DEFINES += -D__BOOT_KERNEL_ENTERPRISE=0
- DEFINES += -D__BOOT_KERNEL_SMP=0
- DEFINES += -D__BOOT_KERNEL_UP=1
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_ENTERPRISE=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_SMP=0
+ GLOBAL_DEFINES += -D__BOOT_KERNEL_UP=1
endif
-INCLUDES = -Iinc -I$(KERNELINC) -I$(GCCINC)
-
-CFLAGS=$(OPTS) -pipe -nostdinc -fno-strict-aliasing -fno-common \
- -fomit-frame-pointer $(MODVERSIONS) $(WARNINGS)
-LDADD=-nostdlib
-
-OPTIMIZE = -O2
-
ifeq ($(OCFS_PROCESSOR),ppc64)
- DEFINES += -D__LP64__
+ GLOBAL_DEFINES += -D__LP64__
CFLAGS += -m64 -fsigned-char -fno-builtin -msoft-float -mminimal-toc
LDADD += -m elf64ppc
endif
@@ -107,17 +109,27 @@
ifeq ($(OCFS_PROCESSOR),ia64)
endif
ifeq ($(OCFS_PROCESSOR),i686)
- DEFINES += -D__ILP32__
+ GLOBAL_DEFINES += -D__ILP32__
endif
ifeq ($(OCFS_PROCESSOR),i586)
- DEFINES += -D__ILP32__
+ GLOBAL_DEFINES += -D__ILP32__
endif
-CFLAGS += $(OPTIMIZE)
+DEFINES += $(BASE_DEFINES) $(GLOBAL_DEFINES)
-MODULES = ocfs2.o
+ifeq ($(OCFS_PROCESSOR),x86_64)
+SUPPORT =
+endif
+ifeq ($(OCFS_PROCESSOR),ia64)
+SUPPORT =
+endif
+ifeq ($(OCFS_PROCESSOR),i686)
+SUPPORT = divdi3.c
+endif
+ifeq ($(OCFS_PROCESSOR),i586)
+SUPPORT = divdi3.c
+endif
-
OSOURCES = \
alloc.c \
bitmap.c \
@@ -146,20 +158,6 @@
volcfg.c \
vote.c
-
-ifeq ($(OCFS_PROCESSOR),x86_64)
-SUPPORT =
-endif
-ifeq ($(OCFS_PROCESSOR),ia64)
-SUPPORT =
-endif
-ifeq ($(OCFS_PROCESSOR),i686)
-SUPPORT = divdi3.c
-endif
-ifeq ($(OCFS_PROCESSOR),i586)
-SUPPORT = divdi3.c
-endif
-
CFILES = $(OSOURCES) $(SUPPORT)
HFILES = \
@@ -168,14 +166,41 @@
inc/io.h \
inc/proto.h
+OBJS = $(subst .c,.o,$(CFILES))
+
+# End of stuff which is global for 2.4.x and 2.6.x kernels
+#-********************************************************
+
+# See if we are being included by the 2.6 kernel build system.
+ifeq ($(KERNELRELEASE),)
+# Normal build that is being called locally
+# Preliminary 2.6.x kernel support. See if we are building for the 2.6.x
+# kernel
+ifndef KERNEL_26
+# Building for a 2.4.x kernel
+
+ifneq ($(OCFS_PROCESSOR),x86_64)
+WARNINGS += -Wmissing-prototypes -Wmissing-declarations
+endif
+
+INCLUDES = -Iinc -I$(KERNELINC) -I$(GCCINC)
+
+CFLAGS=$(OPTS) -pipe -nostdinc -fno-strict-aliasing -fno-common \
+ -fomit-frame-pointer $(MODVERSIONS) $(WARNINGS)
+LDADD=-nostdlib
+
+OPTIMIZE = -O2
+
+CFLAGS += $(OPTIMIZE)
+
+MODULES = ocfs2.o
+
$(CFILES): $(HFILES)
VERSION_FILES = $(CFILES) $(HFILES)
VERSION_SRC = ver.c
VERSION_PREFIX = OCFS
-OBJS = $(subst .c,.o,$(CFILES))
-
ocfs2.o: $(OBJS)
$(CC) $(OPTS) -Wl,-r -o $@ $^ $(LDADD)
@@ -196,4 +221,58 @@
dist-subdircreate:
$(TOPDIR)/mkinstalldirs $(DIST_DIR)/inc
+
+else # ifndef KERNEL_26
+# The 2.6.x kernel makefile
+
+# This Makefile has two ways through it. They are:
+# 1. We are being included by the local Makefile to do a 2.6 kernel build.
+# In this method we will call the kernel make system to build our module.
+# This will cause the kernel make system to call back into our makefile
+# (2nd way).
+
+KDIR := $(KERNELDIR)
+
+all:
+ $(MAKE) -C $(KDIR) V=1 SUBDIRS=$(CURDIR) modules
+
+endif # OCFS_KERNEL_2_6
+
include $(TOPDIR)/Postamble.make
+
+else # ifeq ($(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.
+# The 2.6.x kernel makefile
+
+# This Makefile has two ways through it. They are:
+# 1. We are being included by the local Makefile to do a 2.6 kernel build.
+# In this method we will call the kernel make system to build our module.
+# This will cause the kernel make system to call back into our makefile
+# (2nd way).
+#
+# 2. We are being included by the kernel make system. So in this method we
+# just setup the variables that the make system wants and then the kernel
+# make system will take care of the build.
+
+# 2nd method. The kernel make system is including us. We need to setup the
+# various parameters for the kernel make system and then it will take care of
+# building us.
+
+# EXTRA_CFLAGS += -D__ILP32__ -I$(OCFS_SRC_DIR)/inc -Wno-format
+EXTRA_CFLAGS += -I$(OCFS_SRC_DIR)/inc
+
+EXTRA_CFLAGS += $(GLOBAL_DEFINES) $(WARNINGS)
+
+# FIXME: Need to figure out how to use the stuff from Postamble.make. In
+# particular the MD5 and Version strings
+EXTRA_CFLAGS += -DOCFS_BUILD_DATE=\"y\" -DOCFS_BUILD_MD5=\"z\" \
+ -DOCFS_BUILD_VERSION=\"x\"
+
+# Kernel Module file to produce
+obj-m += ocfs2.o
+
+# list of object files that are used to create our module
+ocfs2-objs := $(OBJS)
+
+endif # ifneq ($(KERNELRELEASE),)
More information about the Ocfs2-commits
mailing list