1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## Makefile_unamem.dpatch by Tzafrir Cohen <tzafrir.cohen@xorcom.com>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Removes unnecessary calls to uname -r and uname -m . Use UNAME_M
6
## DP: and KVERS/KVERS_MAJ instead.
7
## DP: Impact: Minimal: fixes a possible incorrect behaviour (try version
8
## DP: no. 2.6.2-4) and will also consider 2.5 as linux26 BUILDVER .
11
diff -urNad zaptel-1.2.11.dfsg~/Makefile zaptel-1.2.11.dfsg/Makefile
12
--- zaptel-1.2.11.dfsg~/Makefile 2006-12-02 14:12:47.000000000 +0000
13
+++ zaptel-1.2.11.dfsg/Makefile 2006-12-02 14:12:54.000000000 +0000
16
INSTALL_PREFIX:=$(DESTDIR)
18
+ifeq ($(DEB_HOST_GNU_TYPE),)
19
+UNAME_M:=$(shell uname -m)
21
+UNAME_M:=$(DEB_HOST_GNU_TYPE)
23
# If you want to build for a kernel other than the current kernel, set KVERS
25
KVERS:=$(shell uname -r)
27
KSRC:=$(shell for dir in $(KSRC_SEARCH_PATH); do if [ -d $$dir ]; then echo $$dir; break; fi; done)
30
+KVERS_MAJ:=$(shell echo $(KVERS) | cut -d. -f1-2)
31
KINCLUDES:=$(KSRC)/include
33
-CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
34
-CFLAGS_PPC:=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
35
-CFLAGS_X86-64:=$(shell if uname -m | grep -q x86_64; then echo "-m64"; fi)
36
+CFLAGS+=-I. -O2 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
37
+ifneq (,$(findstring ppc,$(UNAME_M)))
38
+CFLAGS_PPC:=-fsigned-char
40
+ifneq (,$(findstring x86_64,$(UNAME_M)))
43
CFLAGS+=$(CFLAGS_PPC) $(CFLAGS_X86-64)
44
LCFLAGS:=-fPIC $(CFLAGS) -DBUILDING_TONEZONE
45
KFLAGS:=-I$(KINCLUDES) -O6
47
ifneq (,$(wildcard $(KINCLUDES)/linux/modversions.h))
48
KFLAGS+=-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h
50
-KFLAGS_PPC:=$(shell if uname -m | grep -q ppc; then echo "-msoft-float -fsigned-char"; fi)
51
+ifneq (,$(findstring ppc,$(UNAME_M)))
52
+KFLAGS_PPC:=-msoft-float -fsigned-char
55
-KFLAGS+=$(shell if uname -r | grep -q 2.4; then if uname -m | grep -q x86_64; then echo "-mcmodel=kernel"; fi; fi)
56
+ifeq ($(KVERS_MAJ),2.4)
57
+ ifneq (,$(findstring x86_64,$(UNAME_M)))
58
+ KFLAGS+=-mcmodel=kernel
63
# Features are now configured in zconfig.h
65
CONFIG_FILE:=$(INSTALL_PREFIX)/etc/zaptel.conf
66
CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
68
-ifeq (2.6,$(shell echo $(KVERS) | cut -d. -f1-2))
71
+ifeq ($(KVERS_MAJ),2.4)
77
ifeq ($(BUILDVER),linux24)