summaryrefslogtreecommitdiff
path: root/linux/Makefile.linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux/Makefile.linux')
-rw-r--r--linux/Makefile.linux39
1 files changed, 27 insertions, 12 deletions
diff --git a/linux/Makefile.linux b/linux/Makefile.linux
index 368c3c850..ecc196bdd 100644
--- a/linux/Makefile.linux
+++ b/linux/Makefile.linux
@@ -1,7 +1,8 @@
# Makefile -- For the Direct Rendering Manager module (drm)
# Created: Mon Jan 4 09:26:53 1999 by faith@precisioninsight.com
#
-# Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+# Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+# Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -23,8 +24,22 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
-# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux,v 1.6 2000/02/23 04:47:25 martin Exp $
-#
+#
+# ***** NOTE NOTE NOTE NOTE NOTE *****
+# To override the automatic Linux source tree determination, pass the
+# pathname for the kernel that you want to compile on the command line,
+# like this:
+# make TREE=/usr/my-kernel-tree/include
+#
+#
+# ***** NOTE NOTE NOTE NOTE NOTE *****
+# Because some distributions patch 2.2.x kernels to make kill_fasync have
+# three parameters, this script tries to determine, via the examination of
+# header files, if your kernel has been patched. If this detection is
+# incorrect, you can override the value on the command line, like this:
+# make PARAMS=2
+# or
+# make PARAMS=3
.SUFFIXES:
@@ -96,11 +111,6 @@ endif
endif
endif
-# To override this determination, pass the path on the make command line:
-# make TREE=/usr/my-kernel-tree/include
-# or hardcode a value for TREE here:
-# TREE:=/usr/include
-
ifeq ($(TREE),0)
all:; @echo Error: Could not locate kernel tree in $A $B $C
else
@@ -110,6 +120,8 @@ MODVERSIONS := $(shell gcc -E -I $(TREE) picker.c 2>/dev/null \
| grep -s 'MODVERSIONS = ' | cut -d' ' -f3)
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'AGP = ' | cut -d' ' -f3)
+PARAMS := $(shell if fgrep kill_fasync $(TREE)/linux/fs.h \
+ | fgrep -q band; then echo 3; else echo 2; fi)
ifeq ($(AGP),0)
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'AGP_MODULE = ' | cut -d' ' -f3)
@@ -127,8 +139,9 @@ I810OBJS= i810_drv.o i810_dma.o i810_bufs.o i810_context.o
I810HEADERS= i810_drv.h $(DRMHEADERS)
endif
-all::;@echo KERNEL HEADERS IN $(TREE): SMP=${SMP} MODVERSIONS=${MODVERSIONS} \
- AGP=${AGP}
+all::;@echo === KERNEL HEADERS IN $(TREE)
+all::;@echo === SMP=${SMP} MODVERSIONS=${MODVERSIONS} AGP=${AGP}
+all::;@echo === kill_fasync has $(PARAMS) parameters
all:: $(LIBS) $(MODS) $(PROGS)
endif
@@ -141,7 +154,9 @@ endif
ifeq ($(MODVERSIONS),1)
MODCFLAGS += -DMODVERSIONS -include $(TREE)/linux/modversions.h
endif
-
+ifeq ($(PARAMS),3)
+MODCFLAGS += -DKILLFASYNCHASTHREEPARAMETERS
+endif
# **** End of configuration
@@ -178,7 +193,7 @@ ChangeLog:
# .o files are used for modules
%.o: %.c
- $(CC) $(MODCFLAGS) -c $< -o $@
+ $(CC) $(MODCFLAGS) -I$(TREE) -c $< -o $@
%.po: %.c
$(CC) $(PRGCFLAGS) -DDRM_USE_MALLOC -c $< -o $@