1 |
haubi 12/10/02 13:16:42 |
2 |
|
3 |
Added: cntlm-0.92.3-buildsystem.patch |
4 |
Log: |
5 |
Revbump. Respect CC/CFLAGS/LDFLAGS, build verbose, bug#334647. |
6 |
|
7 |
(Portage version: 2.1.10.65/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-proxy/cntlm/files/cntlm-0.92.3-buildsystem.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/cntlm/files/cntlm-0.92.3-buildsystem.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/cntlm/files/cntlm-0.92.3-buildsystem.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: cntlm-0.92.3-buildsystem.patch |
16 |
=================================================================== |
17 |
Gentoo Bug#334647: |
18 |
Respect CC, CFLAGS, LDFLAGS (with gcc). |
19 |
Support verbose building via 'make V=1'. |
20 |
--- configure.orig 2012-10-02 14:01:48.735669564 +0200 |
21 |
+++ configure 2012-10-02 14:23:01.224271511 +0200 |
22 |
@@ -10,7 +10,7 @@ |
23 |
# This can be disabled if neccessary. |
24 |
# |
25 |
|
26 |
-CCS="xlc_r gcc" |
27 |
+CCS=${CC-"xlc_r gcc"} |
28 |
|
29 |
# |
30 |
# Look for supported compilers |
31 |
@@ -31,15 +31,21 @@ |
32 |
else |
33 |
echo "Using $CCPATH to compile Cntlm" |
34 |
[ -h Makefile ] && rm -f Makefile 2>/dev/null |
35 |
- case "$CC" in |
36 |
- gcc) |
37 |
+ if $CC -v >/dev/null 2>&1; then |
38 |
# default Makefile is for GCC; just revert back to |
39 |
# GCC if Makefile is linked to other compiler version |
40 |
if [ ! -f Makefile ]; then |
41 |
mv Makefile.gcc Makefile |
42 |
fi |
43 |
- ;; |
44 |
- *) |
45 |
+ : ${CFLAGS=-O3} |
46 |
+ : ${LDFLAGS=} |
47 |
+ CFLAGS="$CFLAGS -std=c99 -Wall -Wno-unused-but-set-variable -pedantic -pthread" |
48 |
+ LDFLAGS="$LDFLAGS -pthread" |
49 |
+ sed -e "s~^CFLAGS=~CFLAGS=$CFLAGS ~" \ |
50 |
+ -e "s~^LDFLAGS=.*~LDFLAGS=$LDFLAGS~" \ |
51 |
+ -e "s~^CC=.*~CC=$CC~" \ |
52 |
+ -i Makefile |
53 |
+ else |
54 |
# backup default GCC Makefile and create a link to other |
55 |
if [ -f Makefile ]; then |
56 |
mv Makefile Makefile.gcc |
57 |
@@ -47,8 +53,7 @@ |
58 |
|
59 |
EXT=`echo "$CC" | sed 's/_.*//'` |
60 |
ln -s Makefile.$EXT Makefile |
61 |
- ;; |
62 |
- esac |
63 |
+ fi |
64 |
fi |
65 |
|
66 |
STAMP=configure-stamp |
67 |
@@ -62,7 +67,7 @@ |
68 |
for i in $TESTS; do |
69 |
printf "Checking $i... " |
70 |
printf "#define config_$i " >> $CONFIG |
71 |
- OUT=`$CC -D_POSIX_C_SOURCE=199506L -D_ISOC99_SOURCE -D_REENTRANT -o config/$i config/$i.c 2>&1` |
72 |
+ OUT=`$CC $CFLAGS $LDFLAGS -D_POSIX_C_SOURCE=199506L -D_ISOC99_SOURCE -D_REENTRANT -o config/$i config/$i.c 2>&1` |
73 |
rc=$? |
74 |
|
75 |
if [ $rc -ne 0 ]; then # -o -n "$OUT" ]; then |
76 |
--- Makefile.orig 2012-10-02 15:05:58.924914577 +0200 |
77 |
+++ Makefile 2012-10-02 15:10:09.644014197 +0200 |
78 |
@@ -15,10 +15,10 @@ |
79 |
NAME=cntlm |
80 |
CC=gcc |
81 |
VER=`cat VERSION` |
82 |
-CFLAGS+=$(FLAGS) -std=c99 -Wall -Wno-unused-but-set-variable -pedantic -O3 -D__BSD_VISIBLE -D_ALL_SOURCE -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112 -D_ISOC99_SOURCE -D_REENTRANT -D_BSD_SOURCE -DVERSION=\"`cat VERSION`\" |
83 |
+CFLAGS=-D__BSD_VISIBLE -D_ALL_SOURCE -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112 -D_ISOC99_SOURCE -D_REENTRANT -D_BSD_SOURCE -DVERSION=\"`cat VERSION`\" |
84 |
OS=$(shell uname -s) |
85 |
-OSLDFLAGS=$(shell [ $(OS) = "SunOS" ] && echo "-lrt -lsocket -lnsl") |
86 |
-LDFLAGS:=-lpthread $(OSLDFLAGS) |
87 |
+LIBS=$(shell [ $(OS) = "SunOS" ] && echo "-lrt -lsocket -lnsl") |
88 |
+LDFLAGS= |
89 |
|
90 |
ifeq ($(findstring CYGWIN,$(OS)),) |
91 |
OBJS=utils.o ntlm.o xcrypt.o config.o socket.o acl.o auth.o http.o forward.o direct.o scanner.o pages.o main.o |
92 |
@@ -26,21 +26,28 @@ |
93 |
OBJS=utils.o ntlm.o xcrypt.o config.o socket.o acl.o auth.o http.o forward.o direct.o scanner.o pages.o main.o win/resources.o |
94 |
endif |
95 |
|
96 |
+VE_=@echo |
97 |
+VE_1=@: |
98 |
+VE=$(VE_$(V)) |
99 |
+VV_=@ |
100 |
+VV_1= |
101 |
+VV=$(VV_$(V)) |
102 |
+ |
103 |
$(NAME): configure-stamp $(OBJS) |
104 |
- @echo "Linking $@" |
105 |
- @$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) |
106 |
+ $(VE) "Linking $@" |
107 |
+ $(VV) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) |
108 |
|
109 |
main.o: main.c |
110 |
- @echo "Compiling $<" |
111 |
- @if [ -z "$(SYSCONFDIR)" ]; then \ |
112 |
+ $(VE) "Compiling $<" |
113 |
+ $(VV) if [ -z "$(SYSCONFDIR)" ]; then \ |
114 |
$(CC) $(CFLAGS) -c main.c -o $@; \ |
115 |
else \ |
116 |
$(CC) $(CFLAGS) -DSYSCONFDIR=\"$(SYSCONFDIR)\" -c main.c -o $@; \ |
117 |
fi |
118 |
|
119 |
.c.o: |
120 |
- @echo "Compiling $<" |
121 |
- @$(CC) $(CFLAGS) -c -o $@ $< |
122 |
+ $(VE) "Compiling $<" |
123 |
+ $(VV) $(CC) $(CFLAGS) -c -o $@ $< |
124 |
|
125 |
install: $(NAME) |
126 |
# Special handling for install(1) |
127 |
@@ -123,17 +130,17 @@ |
128 |
@echo |
129 |
|
130 |
win/resources.o: win/resources.rc |
131 |
- @echo Adding EXE resources |
132 |
- @windres $^ -o $@ |
133 |
+ $(VE) Adding EXE resources |
134 |
+ $(VV) windres $^ -o $@ |
135 |
|
136 |
uninstall: |
137 |
rm -f $(BINDIR)/$(NAME) $(MANDIR)/man1/$(NAME).1 2>/dev/null || true |
138 |
|
139 |
clean: |
140 |
- @rm -f *.o cntlm cntlm.exe configure-stamp build-stamp config/config.h 2>/dev/null |
141 |
- @rm -f win/*.exe win/*.dll win/*.iss win/*.pdf win/cntlm.ini win/license.txt win/resouces.o 2>/dev/null |
142 |
- @rm -f config/endian config/gethostname config/strdup config/socklen_t config/*.exe |
143 |
- @if [ -h Makefile ]; then rm -f Makefile; mv Makefile.gcc Makefile; fi |
144 |
+ $(VV) rm -f *.o cntlm cntlm.exe configure-stamp build-stamp config/config.h 2>/dev/null |
145 |
+ $(VV) rm -f win/*.exe win/*.dll win/*.iss win/*.pdf win/cntlm.ini win/license.txt win/resouces.o 2>/dev/null |
146 |
+ $(VV) rm -f config/endian config/gethostname config/strdup config/socklen_t config/*.exe |
147 |
+ $(VV) if [ -h Makefile ]; then rm -f Makefile; mv Makefile.gcc Makefile; fi |
148 |
|
149 |
distclean: clean |
150 |
if [ `id -u` = 0 ]; then \ |
151 |
@@ -143,4 +150,4 @@ |
152 |
fakeroot debian/rules clean; \ |
153 |
fakeroot rpm/rules clean; \ |
154 |
fi |
155 |
- @rm -f *.exe *.deb *.rpm *.tgz *.tar.gz *.tar.bz2 tags ctags pid 2>/dev/null |
156 |
+ $(VV) rm -f *.exe *.deb *.rpm *.tgz *.tar.gz *.tar.bz2 tags ctags pid 2>/dev/null |