summaryrefslogtreecommitdiffstats
path: root/ircclient-upstream.patch
blob: 92a8128f705cdcf21f03dcd5ea62938cb84220a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
From aa17942a54b43746f854bd3704f6ef6d7b799894 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Fri, 10 Jan 2014 14:19:23 +0100
Subject: [PATCH 1/8] Fix find header when directly in /usr/include + honour
 --with-libdir option

---
 config.m4       | 27 ++++++++++++++++-----------
 php_ircclient.c |  2 +-
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/config.m4 b/config.m4
index c8940da..d238bbe 100644
--- a/config.m4
+++ b/config.m4
@@ -5,20 +5,25 @@ if test "$PHP_IRCCLIENT" != "no"; then
 	AC_PROG_EGREP
 	AC_PROG_SED
 	
-	AC_MSG_CHECKING([for libircclient/libircclient.h])
+	AC_MSG_CHECKING([for libircclient.h])
 	for d in $PHP_IRCCLIENT /usr /usr/local /opt; do
-		if test -f $d/include/libircclient/libircclient.h; then
+		if test -f $d/include/libircclient.h; then
+			IRCCLIENT_INCDIR=$d/include
+			IRCCLIENT_LIBDIR=$d/$PHP_LIBDIR
 			AC_MSG_RESULT([found in $d])
-			IRCCLIENT_DIR=$d
+		elif test -f $d/include/libircclient/libircclient.h; then
+			AC_MSG_RESULT([found in $d])
+			IRCCLIENT_INCDIR=$d/include/libircclient
+			IRCCLIENT_LIBDIR=$d/$PHP_LIBDIR
 			break
 		fi
 	done
-	if test "x$IRCCLIENT_DIR" = "x"; then
+	if test "x$IRCCLIENT_INCDIR" = "x"; then
 		AC_MSG_ERROR([not found])
 	fi
-	if test -f "$IRCCLIENT_DIR/include/libircclient/libirc_params.h"; then
-		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH=`$EGREP "define LIBIRC_VERSION_HIGH" $IRCCLIENT_DIR/include/libircclient/libirc_params.h | $SED -e 's/[[^0-9\x]]//g'`
-		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW=`$EGREP "define LIBIRC_VERSION_LOW" $IRCCLIENT_DIR/include/libircclient/libirc_params.h | $SED -e 's/[[^0-9\x]]//g'`
+	if test -f "$IRCCLIENT_INCDIR/libirc_params.h"; then
+		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH=`$EGREP "define LIBIRC_VERSION_HIGH" $IRCCLIENT_INCDIR/libirc_params.h | $SED -e 's/[[^0-9\x]]//g'`
+		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW=`$EGREP "define LIBIRC_VERSION_LOW" $IRCCLIENT_INCDIR/libirc_params.h | $SED -e 's/[[^0-9\x]]//g'`
 	else
 		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH=0
 		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW=0
@@ -26,20 +31,20 @@ if test "$PHP_IRCCLIENT" != "no"; then
 	AC_DEFINE_UNQUOTED([PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH], [$PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH], [ ])
 	AC_DEFINE_UNQUOTED([PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW], [$PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW], [ ])
 	
-	PHP_ADD_INCLUDE($IRCCLIENT_DIR/include)
+	PHP_ADD_INCLUDE($IRCCLIENT_INCDIR)
 	AC_CHECK_MEMBER([irc_callbacks_t.event_channel_notice], [
 		AC_DEFINE(HAVE_LIBIRCCLIENT_EVENT_CHANNEL_NOTICE, 1, [ ])
 	], [], [
-		[#include <libircclient/libircclient.h>]
+		[#include <libircclient.h>]
 	])
 	PHP_CHECK_LIBRARY(ircclient, irc_create_session,
 	[
-		PHP_ADD_LIBRARY_WITH_PATH(ircclient, $IRCCLIENT_DIR/lib, IRCCLIENT_SHARED_LIBADD)
+		PHP_ADD_LIBRARY_WITH_PATH(ircclient, $IRCCLIENT_LIBDIR, IRCCLIENT_SHARED_LIBADD)
 		AC_DEFINE(HAVE_LIBIRCCLIENT,1,[ ])
 	],[
 		AC_MSG_ERROR([libircclient not found])
 	],[
-		-L$IRCCLIENT_DIR/lib -lm
+		-L$IRCCLIENT_LIBDIR -lm
 	])
 	PHP_SUBST([IRCCLIENT_SHARED_LIBADD])
 	PHP_NEW_EXTENSION([ircclient], [php_ircclient.c], [$ext_shared])
diff --git a/php_ircclient.c b/php_ircclient.c
index e7134a1..97e28d6 100644
--- a/php_ircclient.c
+++ b/php_ircclient.c
@@ -32,7 +32,7 @@
 
 #include <errno.h>
 #include <ctype.h>
-#include <libircclient/libircclient.h>
+#include <libircclient.h>
 
 PHP_FUNCTION(parse_origin)
 {
-- 
1.8.3.1

From 591006e7e6742d3c566707a74ff473351d2c3706 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Fri, 10 Jan 2014 14:24:28 +0100
Subject: [PATCH 2/8] dont display "0.0" for unkown header version

---
 php_ircclient.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/php_ircclient.c b/php_ircclient.c
index 97e28d6..3ac38ca 100644
--- a/php_ircclient.c
+++ b/php_ircclient.c
@@ -1420,8 +1420,12 @@ PHP_MINFO_FUNCTION(ircclient)
 
 	irc_get_version(&high, &low);
 	spprintf(&version[1], 0, "%u.%u", high, low);
+#if PHP_IPHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH
 	spprintf(&version[0], 0, "%u.%u", PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH, PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW);
-
+#else
+	/* version <= 1.6 doesn't exposed its version */
+	spprintf(&version[0], 0, "-");
+#endif
 	php_info_print_table_start();
 	php_info_print_table_header(2, "IRC client support", "enabled");
 	php_info_print_table_row(2, "Version", PHP_IRCCLIENT_VERSION);
-- 
1.8.3.1

From 4972a9a46a1ffa16bc29787ca5ec94e4f69b015f Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Fri, 10 Jan 2014 14:25:34 +0100
Subject: [PATCH 3/8] Fix [-Wunused-variable]

---
 php_ircclient.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/php_ircclient.c b/php_ircclient.c
index 3ac38ca..06d3cc1 100644
--- a/php_ircclient.c
+++ b/php_ircclient.c
@@ -418,7 +418,7 @@ PHP_METHOD(Session, doConnect)
 	if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "bs|ls!", &ip6, &server_str, &server_len, &port, &passwd_str, &passwd_len)) {
 		php_ircclient_session_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
 		char *nick = NULL, *user = NULL, *real = NULL;
-		zval *znick, *zuser, *zreal, *tmp;
+		zval *znick, *zuser, *zreal;
 
 		znick = zend_read_property(php_ircclient_session_class_entry, getThis(), ZEND_STRL("nick"), 0 TSRMLS_CC);
 		SEPARATE_ARG_IF_REF(znick);
-- 
1.8.3.1

From 3ef394c42caf15727f13ce95e3e7fdfd4b8ffd11 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Fri, 10 Jan 2014 14:27:08 +0100
Subject: [PATCH 4/8] Fix: warning: implicit declaration of function
 'php_get_inf'

---
 php_ircclient.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/php_ircclient.c b/php_ircclient.c
index 06d3cc1..022d298 100644
--- a/php_ircclient.c
+++ b/php_ircclient.c
@@ -19,6 +19,7 @@
 #include <main/php_network.h>
 #include <ext/standard/php_string.h>
 #include <ext/standard/info.h>
+#include <ext/standard/basic_functions.h>
 
 #include <Zend/zend.h>
 #include <Zend/zend_constants.h>
-- 
1.8.3.1

From c3525184f44ef40be9093022dd21c23b29300524 Mon Sep 17 00:00:00 2001
From: Michael Wallner <mike@php.net>
Date: Fri, 10 Jan 2014 14:41:32 +0100
Subject: [PATCH 5/8] prepare-0.3.1

---
 package.xml     | 5 +++--
 php_ircclient.c | 9 ++++++---
 php_ircclient.h | 4 ++--
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/php_ircclient.c b/php_ircclient.c
index 022d298..c8a603a 100644
--- a/php_ircclient.c
+++ b/php_ircclient.c
@@ -1418,14 +1418,15 @@ PHP_MINFO_FUNCTION(ircclient)
 {
 	unsigned int high, low;
 	char *version[2];
+	char lt16 = "<=1.6";
 
 	irc_get_version(&high, &low);
 	spprintf(&version[1], 0, "%u.%u", high, low);
 #if PHP_IPHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH
 	spprintf(&version[0], 0, "%u.%u", PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH, PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW);
 #else
-	/* version <= 1.6 doesn't exposed its version */
-	spprintf(&version[0], 0, "-");
+	/* version <= 1.6 doesn't expose its version */
+	version[0] = lt16;
 #endif
 	php_info_print_table_start();
 	php_info_print_table_header(2, "IRC client support", "enabled");
@@ -1441,7 +1442,9 @@ PHP_MINFO_FUNCTION(ircclient)
 	);
 	php_info_print_table_end();
 
-	efree(version[0]);
+	if (version[0] != lt16) {
+		efree(version[0]);
+	}
 	efree(version[1]);
 }
 
--
1.8.3.1

From 3e895879ea461ef0442f260a2880eaed7573904c Mon Sep 17 00:00:00 2001
From: Michael Wallner <mike@php.net>
Date: Fri, 10 Jan 2014 14:42:16 +0100
Subject: [PATCH 6/8] fix typo

---
 php_ircclient.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/php_ircclient.c b/php_ircclient.c
index c8a603a..8dfee13 100644
--- a/php_ircclient.c
+++ b/php_ircclient.c
@@ -1418,7 +1418,7 @@ PHP_MINFO_FUNCTION(ircclient)
 {
 	unsigned int high, low;
 	char *version[2];
-	char lt16 = "<=1.6";
+	char *lt16 = "<=1.6";
 
 	irc_get_version(&high, &low);
 	spprintf(&version[1], 0, "%u.%u", high, low);
-- 
1.8.3.1

From c55fab5599836f9a921cd437d34aa6485e23bb5e Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Fri, 10 Jan 2014 15:15:54 +0100
Subject: [PATCH 7/8] missing in previous

---
 config.m4       | 5 +++++
 php_ircclient.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/config.m4 b/config.m4
index d238bbe..8b5953b 100644
--- a/config.m4
+++ b/config.m4
@@ -11,22 +11,27 @@ if test "$PHP_IRCCLIENT" != "no"; then
 			IRCCLIENT_INCDIR=$d/include
 			IRCCLIENT_LIBDIR=$d/$PHP_LIBDIR
 			AC_MSG_RESULT([found in $d])
+			break
 		elif test -f $d/include/libircclient/libircclient.h; then
 			AC_MSG_RESULT([found in $d])
 			IRCCLIENT_INCDIR=$d/include/libircclient
 			IRCCLIENT_LIBDIR=$d/$PHP_LIBDIR
+			AC_MSG_RESULT([found in $d])
 			break
 		fi
 	done
 	if test "x$IRCCLIENT_INCDIR" = "x"; then
 		AC_MSG_ERROR([not found])
 	fi
+	AC_MSG_CHECKING([libircclient version])
 	if test -f "$IRCCLIENT_INCDIR/libirc_params.h"; then
 		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH=`$EGREP "define LIBIRC_VERSION_HIGH" $IRCCLIENT_INCDIR/libirc_params.h | $SED -e 's/[[^0-9\x]]//g'`
 		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW=`$EGREP "define LIBIRC_VERSION_LOW" $IRCCLIENT_INCDIR/libirc_params.h | $SED -e 's/[[^0-9\x]]//g'`
+		AC_MSG_RESULT([$PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH $PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW])
 	else
 		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH=0
 		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW=0
+		AC_MSG_RESULT([unkown])
 	fi
 	AC_DEFINE_UNQUOTED([PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH], [$PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH], [ ])
 	AC_DEFINE_UNQUOTED([PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW], [$PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW], [ ])
diff --git a/php_ircclient.c b/php_ircclient.c
index 022d298..0145dfd 100644
--- a/php_ircclient.c
+++ b/php_ircclient.c
@@ -1421,7 +1421,7 @@ PHP_MINFO_FUNCTION(ircclient)
 
 	irc_get_version(&high, &low);
 	spprintf(&version[1], 0, "%u.%u", high, low);
-#if PHP_IPHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH
+#if PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH
 	spprintf(&version[0], 0, "%u.%u", PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH, PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW);
 #else
 	/* version <= 1.6 doesn't expose its version */
-- 
1.8.3.1

From 337cac32fcbd026c502fe2b27537693135a5d93a Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Fri, 10 Jan 2014 15:16:54 +0100
Subject: [PATCH 8/8] fix ZTS build

---
 php_ircclient.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/php_ircclient.c b/php_ircclient.c
index 0145dfd..bf17d5e 100644
--- a/php_ircclient.c
+++ b/php_ircclient.c
@@ -1138,7 +1138,7 @@ static void call_closure(INTERNAL_FUNCTION_PARAMETERS, /* stupid non-const API *
 		INIT_PZVAL(&za);
 		array_init(&za);
 
-		if (SUCCESS == zend_copy_parameters_array(ZEND_NUM_ARGS(), &za)) {
+		if (SUCCESS == zend_copy_parameters_array(ZEND_NUM_ARGS(), &za TSRMLS_CC)) {
 			php_printf("ircclient: %s - ", prop_str);
 			zend_print_flat_zval_r(&za TSRMLS_CC);
 			php_printf("\n");
-- 
1.8.3.1

From c8042b1f4a6678d02111985f1e429b5e163b3694 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Fri, 10 Jan 2014 16:13:08 +0100
Subject: [PATCH] Fix with old autotools (RHEL-5)

---
 config.m4 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/config.m4 b/config.m4
index 8b5953b..9b8d3f6 100644
--- a/config.m4
+++ b/config.m4
@@ -2,8 +2,8 @@ PHP_ARG_WITH(ircclient, for ircclient support,
 	[  --with-ircclient[=LIBIRCCLIENTDIR]   Include ircclient support])
 
 if test "$PHP_IRCCLIENT" != "no"; then
-	AC_PROG_EGREP
-	AC_PROG_SED
+	AC_PATH_PROG(GREP, grep, no)
+	AC_PATH_PROG(SED, sed, no)
 	
 	AC_MSG_CHECKING([for libircclient.h])
 	for d in $PHP_IRCCLIENT /usr /usr/local /opt; do
@@ -24,9 +24,9 @@ if test "$PHP_IRCCLIENT" != "no"; then
 		AC_MSG_ERROR([not found])
 	fi
 	AC_MSG_CHECKING([libircclient version])
-	if test -f "$IRCCLIENT_INCDIR/libirc_params.h"; then
-		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH=`$EGREP "define LIBIRC_VERSION_HIGH" $IRCCLIENT_INCDIR/libirc_params.h | $SED -e 's/[[^0-9\x]]//g'`
-		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW=`$EGREP "define LIBIRC_VERSION_LOW" $IRCCLIENT_INCDIR/libirc_params.h | $SED -e 's/[[^0-9\x]]//g'`
+	if test -x $GREP && test -x $SED && test -f "$IRCCLIENT_INCDIR/libirc_params.h"; then
+		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH=`$GREP "define LIBIRC_VERSION_HIGH" $IRCCLIENT_INCDIR/libirc_params.h | $SED -e 's/[[^0-9\x]]//g'`
+		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW=`$GREP "define LIBIRC_VERSION_LOW" $IRCCLIENT_INCDIR/libirc_params.h | $SED -e 's/[[^0-9\x]]//g'`
 		AC_MSG_RESULT([$PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH $PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_LOW])
 	else
 		PHP_IRCCLIENT_LIBIRCCLIENT_VERSION_HIGH=0
-- 
1.8.3.1