summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRik Faith <faith@alephnull.com>2000-08-25 12:44:44 +0000
committerRik Faith <faith@alephnull.com>2000-08-25 12:44:44 +0000
commit68f6795ef45739816fe9d5f1f5b3ef4900bf3187 (patch)
tree7ffa4189a70435685ff423608d9112d85de59e79
parentfb3939c1a5cee3fedc02e0ca710870548481f99e (diff)
Improve detection of kill_fasync parameter count Make compilation of sis.o
depend on CONFIG_FB_SIS
-rw-r--r--linux/Makefile.linux24
-rw-r--r--linux/picker.c5
2 files changed, 23 insertions, 6 deletions
diff --git a/linux/Makefile.linux b/linux/Makefile.linux
index fd136e97..7dfb20b1 100644
--- a/linux/Makefile.linux
+++ b/linux/Makefile.linux
@@ -48,7 +48,7 @@
# **** End of SMP/MODVERSIONS detection
-MODS= gamma.o tdfx.o r128.o sis.o
+MODS= gamma.o tdfx.o r128.o
LIBS= libdrm.a
PROGS= drmstat
@@ -65,9 +65,6 @@ TDFXHEADERS= tdfx_drv.h $(DRMHEADERS)
R128OBJS= r128_drv.o r128_dma.o r128_bufs.o r128_context.o
R128HEADERS= r128_drv.h r128_drm.h $(DRMHEADERS)
-SISOBJS= sis_drv.o sis_context.o sis_ds.o sis_mm.o
-SISHEADERS= sis_drv.h sis_ds.h sis_drm_public.h $(DRMHEADERS)
-
PROGOBJS= drmstat.po xf86drm.po xf86drmHash.po xf86drmRandom.po sigio.po
PROGHEADERS= xf86drm.h $(DRMHEADERS)
@@ -125,8 +122,10 @@ 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)
+SIS := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
+ | grep -s 'SIS = ' | cut -d' ' -f3)
PARAMS := $(shell if fgrep kill_fasync $(TREE)/linux/fs.h \
- | fgrep -q band; then echo 3; else echo 2; fi)
+ | egrep -q '(band|int, int)'; 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)
@@ -144,8 +143,21 @@ I810OBJS= i810_drv.o i810_dma.o i810_bufs.o i810_context.o
I810HEADERS= i810_drv.h $(DRMHEADERS)
endif
+ifeq ($(SIS),1)
+# It appears that the SiS driver makes calls to sis_malloc and sis_free, and
+# that these calls are only defined if CONFIG_FB_SIS is selected. So, key
+# off that to determine if we should attempt to build the SiS driver.
+#
+# A better way would be to detect the appropriate definitions in the header
+# file to see if we can, at least, compile the driver.
+MODS += sis.o
+
+SISOBJS= sis_drv.o sis_context.o sis_ds.o sis_mm.o
+SISHEADERS= sis_drv.h sis_ds.h sis_drm.h $(DRMHEADERS)
+endif
+
all::;@echo === KERNEL HEADERS IN $(TREE)
-all::;@echo === SMP=${SMP} MODVERSIONS=${MODVERSIONS} AGP=${AGP}
+all::;@echo === SMP=${SMP} MODVERSIONS=${MODVERSIONS} AGP=${AGP} SIS=${SIS}
all::;@echo === kill_fasync has $(PARAMS) parameters
all:: $(LIBS) $(MODS) $(PROGS)
endif
diff --git a/linux/picker.c b/linux/picker.c
index 0bd8bfd5..f8cfe459 100644
--- a/linux/picker.c
+++ b/linux/picker.c
@@ -17,8 +17,13 @@
#define CONFIG_AGP 0
#endif
+#ifndef CONFIG_FB_SIS
+#define CONFIG_FB_SIS 0
+#endif
+
SMP = CONFIG_SMP
MODVERSIONS = CONFIG_MODVERSIONS
AGP = CONFIG_AGP
AGP_MODULE = CONFIG_AGP_MODULE
RELEASE = UTS_RELEASE
+SIS = CONFIG_FB_SIS