upgpkg: ocaml-integers 0.5.0-1
[arch-packages.git] / ispell / repos / extra-x86_64 / cflags-from-environment.patch
blob529b31e6dbd2e9070099cf73da8e01e13996a5b6
1 From: Robert Luberda <robert@debian.org>
2 Date: Sat, 5 Mar 2011 13:19:20 +0100
3 Subject: 0015 CFLAGS from environment
5 Use CFLAGS from environment instead of hard-coding them in local.h.
6 Make use of LDFLAGS when needed.
7 ---
8 Makefile | 20 +++++++++++---------
9 deformatters/Makefile | 4 ++--
10 2 files changed, 13 insertions(+), 11 deletions(-)
12 diff --git a/Makefile b/Makefile
13 index c8e4b23..7f6e065 100644
14 --- a/Makefile
15 +++ b/Makefile
16 @@ -294,7 +294,7 @@ showversion: ispell
17 .c.o:
18 @. ./config.sh; \
19 set -x; \
20 - $$CC $$CFLAGS -c $<
21 + $$CC $$CFLAGS -DCFLAGS="\"$$CFLAGS\"" -c $<
24 # The funny business with y_tab.c is necessary for MS-DOS systems,
25 @@ -305,7 +305,7 @@ showversion: ispell
26 set -x; \
27 $$YACC $<; \
28 [ -f y_tab.c ] || mv y.tab.c y_tab.c; \
29 - $$CC $$CFLAGS -c y_tab.c; \
30 + $$CC $$CFLAGS -DCFLAGS="$$CFLAGS" -c y_tab.c; \
31 mv y_tab.o $@; \
32 rm -f y_tab.c
34 @@ -485,22 +485,23 @@ language-subdirs: config.sh
35 buildhash: config.sh buildhash.o hash.o makedent.o parse.o
36 @. ./config.sh; \
37 set -x; \
38 - $$CC $$CFLAGS -o buildhash buildhash.o hash.o makedent.o parse.o \
39 + $$CC $(LDFLAGS) -o buildhash buildhash.o hash.o makedent.o parse.o \
40 $$LIBES
42 icombine: config.sh icombine.o makedent.o parse.o
43 @. ./config.sh; \
44 set -x; \
45 - $$CC $$CFLAGS -o icombine icombine.o makedent.o parse.o \
46 + $$CC $(LDFLAGS) -o icombine icombine.o makedent.o parse.o \
47 $$LIBES
49 ijoin: config.sh ijoin.o fields.o
50 @. ./config.sh; \
51 set -x; \
52 - $$CC $$CFLAGS -o ijoin ijoin.o fields.o $$LIBES
53 + $$CC $(LDFLAGS) -o ijoin ijoin.o fields.o $$LIBES
55 EDITFILE = notthere
56 OUTFILE = /dev/null
57 +CFLAGS ?= -O
60 # Note: we use "sed -n -e $$p" to achieve "tail -1" here because some
61 @@ -537,7 +538,7 @@ defhash.h: config.X local.h Makefile
63 config.sh: config.X defhash.h local.h Makefile
64 set $(SHELLDEBUG); \
65 - for var in BAKEXT BINDIR CC CFLAGS COUNTSUFFIX DEFDICT DEFHASH \
66 + for var in BAKEXT BINDIR CC COUNTSUFFIX DEFDICT DEFHASH \
67 DEFLANG EXEEXT HASHSUFFIX INSTALL \
68 LANGUAGES LIBDIR LIBES LINK LINT LINTFLAGS LOOK_XREF \
69 MAKE_SORTTMP MAN1DIR MAN1EXT MAN45DIR MAN45EXT MAN45SECT MASTERHASH \
70 @@ -549,6 +550,7 @@ config.sh: config.X defhash.h local.h Makefile
71 | sed -e 's/"[^"]*$$/'"'/" -e "s/=/='/" -e 's/\\"/"/g' \
72 | sed -n -e '$$p'; \
73 done > config.sh; \
74 + echo "CFLAGS='$(CFLAGS)'" >> config.sh; \
75 echo 'case "$$MAKE_SORTTMP" in "") \
76 SORTTMP="-e /!!SORTTMP!!/s/=.*$$/=/";; *) SORTTMP=;; esac' \
77 >> config.sh
78 @@ -631,17 +633,17 @@ term.o: term.c
79 ispell: config.sh $(OBJS)
80 @. ./config.sh; \
81 set -x; \
82 - $$CC $$CFLAGS -o ispell $(OBJS) $$TERMLIB $$REGLIB $$LIBES
83 + $$CC $(LDFLAGS) -o ispell $(OBJS) $$TERMLIB $$REGLIB $$LIBES
85 sq: config.sh msgs.h sq.c
86 @@. ./config.sh; \
87 set -x; \
88 - $$CC $$CFLAGS -o sq sq.c
89 + $$CC $$CFLAGS $(LDFLAGS) -o sq sq.c
91 unsq: config.sh msgs.h unsq.c
92 @@. ./config.sh; \
93 set -x; \
94 - $$CC $$CFLAGS -o unsq unsq.c
95 + $$CC $$CFLAGS $(LDFLAGS) -o unsq unsq.c
97 $(OBJS) buildhash.o icombine.o hash.o parse.o: config.h ispell.h local.h
98 $(OBJS) buildhash.o icombine.o hash.o parse.o: proto.h msgs.h config.sh
99 diff --git a/deformatters/Makefile b/deformatters/Makefile
100 index a4d99ee..82337e4 100644
101 --- a/deformatters/Makefile
102 +++ b/deformatters/Makefile
103 @@ -77,12 +77,12 @@ all: $(PROGRAMS)
104 defmt-c: defmt-c.o
105 @. ../config.sh; \
106 set -x; \
107 - $$CC $$CFLAGS -o $@ $<
108 + $$CC $(LDFLAGS) -o $@ $<
110 defmt-sh: defmt-sh.o
111 @. ../config.sh; \
112 set -x; \
113 - $$CC $$CFLAGS -o $@ $<
114 + $$CC $(LDFLAGS) -o $@ $<
116 .c.o:
117 @. ../config.sh; \