~ubuntu-branches/ubuntu/quantal/zaptel/quantal

« back to all changes in this revision

Viewing changes to debian/patches/Makefile_uname.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Tzafrir Cohen
  • Date: 2008-08-28 22:58:23 UTC
  • mfrom: (11.1.11 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080828225823-r8bdunirm8hmc76m
Tags: 1:1.4.11~dfsg-2
* Patch xpp_fxs_power: Fixed an issue with hook detection of the Astribank
  FXS module.
* Don't fail init.d script if fxotune fails. This may happen if running it
  when Asterisk is already running.
* Bump standards version to 3.8.0.0 .
* Ignore false lintian warning ("m-a a-i" has "a a").
* Patch xpp_fxo_cid_always: do always pass PCM if that's what the user
  asked.
* Patch vzaphfc_proc_root_dir: fix vzaphfc on 2.6.26.
* Patch wcte12xp_flags: Proper time for irq save flags.
* Patch headers_2627: Fix location of semaphore.h for 2.6.27 .
* Patch xpp_fxs_dtmf_leak: Don't play DTMFs to the wrong channel.
* Patch wctdm_fix_alarm: Fix sending channel alarms.
* Patch device_class_2626: Fix building 2.6.26 (Closes: #493397).
* Using dh_lintian for lintian overrides, hence requiring debhelper 6.0.7.
* Lintian: we know we have direct changes. Too bad we're half-upstream :-(
* Fix doc-base section names. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## Makefile_unamem.dpatch by Tzafrir Cohen <tzafrir.cohen@xorcom.com>
3
 
##
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 .
9
 
 
10
 
@DPATCH@
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
14
 
@@ -11,6 +11,11 @@
15
 
 
16
 
 INSTALL_PREFIX:=$(DESTDIR)
17
 
 
18
 
+ifeq ($(DEB_HOST_GNU_TYPE),)
19
 
+UNAME_M:=$(shell uname -m)
20
 
+else
21
 
+UNAME_M:=$(DEB_HOST_GNU_TYPE)
22
 
+endif
23
 
 # If you want to build for a kernel other than the current kernel, set KVERS
24
 
 ifndef KVERS
25
 
 KVERS:=$(shell uname -r)
26
 
@@ -23,11 +28,16 @@
27
 
     KSRC:=$(shell for dir in $(KSRC_SEARCH_PATH); do if [ -d $$dir ]; then echo $$dir; break; fi; done)
28
 
   endif
29
 
 endif
30
 
+KVERS_MAJ:=$(shell echo $(KVERS) | cut -d. -f1-2)
31
 
 KINCLUDES:=$(KSRC)/include
32
 
 
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
39
 
+endif
40
 
+ifneq (,$(findstring x86_64,$(UNAME_M)))
41
 
+CFLAGS_X86-64:=-m64
42
 
+endif
43
 
 CFLAGS+=$(CFLAGS_PPC) $(CFLAGS_X86-64)
44
 
 LCFLAGS:=-fPIC $(CFLAGS) -DBUILDING_TONEZONE
45
 
 KFLAGS:=-I$(KINCLUDES) -O6
46
 
@@ -36,9 +46,15 @@
47
 
 ifneq (,$(wildcard $(KINCLUDES)/linux/modversions.h))
48
 
   KFLAGS+=-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h
49
 
 endif
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
53
 
+endif
54
 
 KFLAGS+=$(KFLAGS_PPC)
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
59
 
+  endif
60
 
+endif
61
 
 
62
 
 #
63
 
 # Features are now configured in zconfig.h
64
 
@@ -52,10 +68,10 @@
65
 
 CONFIG_FILE:=$(INSTALL_PREFIX)/etc/zaptel.conf
66
 
 CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
67
 
 
68
 
-ifeq (2.6,$(shell echo $(KVERS) | cut -d. -f1-2))
69
 
-  BUILDVER:=linux26
70
 
-else
71
 
+ifeq ($(KVERS_MAJ),2.4)
72
 
   BUILDVER:=linux24
73
 
+else
74
 
+  BUILDVER:=linux26
75
 
 endif
76
 
 
77
 
 ifeq ($(BUILDVER),linux24)