-
Notifications
You must be signed in to change notification settings - Fork 1
/
php-5.2.17-fpm-0.5.14.patch
33857 lines (33796 loc) · 919 KB
/
php-5.2.17-fpm-0.5.14.patch
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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/configure b/configure
index 2d88ed7..c490abf 100755
--- a/configure
+++ b/configure
@@ -773,6 +773,17 @@ ac_help="$ac_help
--disable-path-info-check CGI: If this is disabled, paths such as
/info.php/test?a=b will fail to work"
ac_help="$ac_help
+ --enable-fpm FastCGI: If this is enabled, the fastcgi support
+ will include experimental process manager code"
+ac_help="$ac_help
+ --with-fpm-conf=PATH Set the path for php-fpm configuration file [PREFIX/etc/php-fpm.conf]"
+ac_help="$ac_help
+ --with-fpm-log=PATH Set the path for php-fpm log file [PREFIX/logs/php-fpm.log]"
+ac_help="$ac_help
+ --with-fpm-pid=PATH Set the path for php-fpm pid file [PREFIX/logs/php-fpm.pid]"
+ac_help="$ac_help
+ --with-xml-config=PATH FPM: use xml-config in PATH to find libxml"
+ac_help="$ac_help
General settings:
"
@@ -12153,11 +12164,30 @@ ext_output=$PHP_PATH_INFO_CHECK
+php_enable_fpm=no
+
+
+# Check whether --enable-fpm or --disable-fpm was given.
+if test "${enable_fpm+set}" = set; then
+ enableval="$enable_fpm"
+ PHP_FPM=$enableval
+else
+
+ PHP_FPM=no
+
+ if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
+ PHP_FPM=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+ext_output=$PHP_FPM
if test "$PHP_SAPI" = "default"; then
echo $ac_n "checking whether to build CGI binary""... $ac_c" 1>&6
-echo "configure:12175: checking whether to build CGI binary" >&5
+echo "configure:12463: checking whether to build CGI binary" >&5
if test "$PHP_CGI" != "no"; then
echo "$ac_t""yes" 1>&6
@@ -12194,8 +12224,25 @@ EOF
echo "$ac_t""$PHP_FASTCGI" 1>&6
+ if test "$PHP_FASTCGI" = "yes"; then
+ echo $ac_n "checking whether to enable FastCGI Process Manager""... $ac_c" 1>&6
+echo "configure:12474: checking whether to enable FastCGI Process Manager" >&5
+ if test "$PHP_FPM" = "yes"; then
+ PHP_FASTCGI_PM=1
+ else
+ PHP_FASTCGI_PM=0
+ fi
+ echo "$ac_t""$PHP_FPM" 1>&6
+ else
+ PHP_FASTCGI_PM=0
+ fi
+ cat >> confdefs.h <<EOF
+#define PHP_FASTCGI_PM $PHP_FASTCGI_PM
+EOF
+
+
echo $ac_n "checking whether to force Apache CGI redirect""... $ac_c" 1>&6
-echo "configure:12213: checking whether to force Apache CGI redirect" >&5
+echo "configure:12490: checking whether to force Apache CGI redirect" >&5
if test "$PHP_FORCE_CGI_REDIRECT" = "yes"; then
CGI_REDIRECT=1
else
@@ -12410,10 +12457,10 @@ EOF
BUILD_CGI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
;;
*darwin*)
- BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
+ BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(SAPI_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
;;
*)
- BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
+ BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(SAPI_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
;;
esac
@@ -12476,6 +12523,875 @@ fi
fi
+if test "$PHP_FASTCGI" = "yes" -a "$PHP_FPM" = "yes"; then
+
+ echo "$ac_t""" 1>&6
+ echo "$ac_t""${T_MD}Running FastCGI Process Manager checks${T_ME}" 1>&6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FPM_VERSION="0.5.14"
+
+
+php_with_fpm_conf=\$prefix/etc/php-fpm.conf
+
+echo $ac_n "checking for php-fpm config file path""... $ac_c" 1>&6
+echo "configure:12798: checking for php-fpm config file path" >&5
+# Check whether --with-fpm-conf or --without-fpm-conf was given.
+if test "${with_fpm_conf+set}" = set; then
+ withval="$with_fpm_conf"
+ PHP_FPM_CONF=$withval
+else
+
+ PHP_FPM_CONF=\$prefix/etc/php-fpm.conf
+
+ if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
+ PHP_FPM_CONF=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+ext_output=$PHP_FPM_CONF
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+
+
+php_with_fpm_log=\$prefix/logs/php-fpm.log
+
+echo $ac_n "checking for php-fpm log file path""... $ac_c" 1>&6
+echo "configure:12824: checking for php-fpm log file path" >&5
+# Check whether --with-fpm-log or --without-fpm-log was given.
+if test "${with_fpm_log+set}" = set; then
+ withval="$with_fpm_log"
+ PHP_FPM_LOG=$withval
+else
+
+ PHP_FPM_LOG=\$prefix/logs/php-fpm.log
+
+ if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
+ PHP_FPM_LOG=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+ext_output=$PHP_FPM_LOG
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+
+
+php_with_fpm_pid=\$prefix/logs/php-fpm.pid
+
+echo $ac_n "checking for php-fpm pid file path""... $ac_c" 1>&6
+echo "configure:12850: checking for php-fpm pid file path" >&5
+# Check whether --with-fpm-pid or --without-fpm-pid was given.
+if test "${with_fpm_pid+set}" = set; then
+ withval="$with_fpm_pid"
+ PHP_FPM_PID=$withval
+else
+
+ PHP_FPM_PID=\$prefix/logs/php-fpm.pid
+
+ if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
+ PHP_FPM_PID=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+ext_output=$PHP_FPM_PID
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+
+FPM_SOURCES="fpm.c \
+ fpm_conf.c \
+ fpm_signals.c \
+ fpm_children.c \
+ fpm_worker_pool.c \
+ fpm_unix.c \
+ fpm_cleanup.c \
+ fpm_sockets.c \
+ fpm_stdio.c \
+ fpm_env.c \
+ fpm_events.c \
+ fpm_php.c \
+ fpm_php_trace.c \
+ fpm_process_ctl.c \
+ fpm_request.c \
+ fpm_clock.c \
+ fpm_shm.c \
+ fpm_shm_slots.c \
+ xml_config.c \
+ zlog.c"
+
+
+ echo "$ac_t""checking for XML configuration" 1>&6
+
+ # Check whether --with-xml-config or --without-xml-config was given.
+if test "${with_xml_config+set}" = set; then
+ withval="$with_xml_config"
+ XMLCONFIG="$withval"
+else
+ for ac_prog in xml2-config xml-config
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:12906: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_XMLCONFIG'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$XMLCONFIG" in
+ /*)
+ ac_cv_path_XMLCONFIG="$XMLCONFIG" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_XMLCONFIG="$XMLCONFIG" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_XMLCONFIG="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+fi
+XMLCONFIG="$ac_cv_path_XMLCONFIG"
+if test -n "$XMLCONFIG"; then
+ echo "$ac_t""$XMLCONFIG" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$XMLCONFIG" && break
+done
+test -n "$XMLCONFIG" || XMLCONFIG=""""
+
+
+fi
+
+
+ if test "x$XMLCONFIG" = "x"; then
+ { echo "configure: error: XML configuration could not be found" 1>&2; exit 1; }
+ else
+ echo $ac_n "checking for libxml library""... $ac_c" 1>&6
+echo "configure:12950: checking for libxml library" >&5
+
+ if test ! -x "$XMLCONFIG"; then
+ { echo "configure: error: $XMLCONFIG cannot be executed" 1>&2; exit 1; }
+ fi
+
+ LIBXML_LIBS="`$XMLCONFIG --libs`"
+ LIBXML_CFLAGS="`$XMLCONFIG --cflags`"
+ LIBXML_VERSION="`$XMLCONFIG --version`"
+
+ echo "$ac_t""yes, $LIBXML_VERSION" 1>&6
+
+
+ SAVED_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $LIBXML_CFLAGS"
+ SAVED_LIBS="$LIBS"
+ LIBS="$LIBS $LIBXML_LIBS"
+
+ echo $ac_n "checking for xmlParseFile""... $ac_c" 1>&6
+echo "configure:12969: checking for xmlParseFile" >&5
+if eval "test \"`echo '$''{'ac_cv_func_xmlParseFile'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 12974 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char xmlParseFile(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char xmlParseFile();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_xmlParseFile) || defined (__stub___xmlParseFile)
+choke me
+#else
+xmlParseFile();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:12997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_xmlParseFile=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_xmlParseFile=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'xmlParseFile`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+{ echo "configure: error: Failed to link with libxml" 1>&2; exit 1; }
+fi
+
+
+ CFLAGS="$SAVED_CFLAGS"
+ LIBS="$SAVED_LIBS"
+
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_LIBXML 1
+EOF
+
+ fi
+
+
+ echo $ac_n "checking for prctl""... $ac_c" 1>&6
+echo "configure:13030: checking for prctl" >&5
+
+ cat > conftest.$ac_ext <<EOF
+#line 13033 "configure"
+#include "confdefs.h"
+ #include <sys/prctl.h>
+int main() {
+prctl(0, 0, 0, 0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:13040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRCTL 1
+EOF
+
+ echo "$ac_t""yes" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -f conftest*
+
+
+ have_clock_gettime=no
+
+ echo $ac_n "checking for clock_gettime""... $ac_c" 1>&6
+echo "configure:13063: checking for clock_gettime" >&5
+
+ cat > conftest.$ac_ext <<EOF
+#line 13066 "configure"
+#include "confdefs.h"
+ #include <time.h>
+int main() {
+struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);
+; return 0; }
+EOF
+if { (eval echo configure:13073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+
+ have_clock_gettime=yes
+ echo "$ac_t""yes" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -f conftest*
+
+ if test "$have_clock_gettime" = "no"; then
+ echo $ac_n "checking for clock_gettime in -lrt""... $ac_c" 1>&6
+echo "configure:13091: checking for clock_gettime in -lrt" >&5
+
+ SAVED_LIBS="$LIBS"
+ LIBS="$LIBS -lrt"
+
+ cat > conftest.$ac_ext <<EOF
+#line 13097 "configure"
+#include "confdefs.h"
+ #include <time.h>
+int main() {
+struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);
+; return 0; }
+EOF
+if { (eval echo configure:13104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+
+ have_clock_gettime=yes
+ echo "$ac_t""yes" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+
+ LIBS="$SAVED_LIBS"
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -f conftest*
+ fi
+
+ if test "$have_clock_gettime" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_CLOCK_GETTIME 1
+EOF
+
+ fi
+
+ have_clock_get_time=no
+
+ if test "$have_clock_gettime" = "no"; then
+ echo $ac_n "checking for clock_get_time""... $ac_c" 1>&6
+echo "configure:13133: checking for clock_get_time" >&5
+
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 13139 "configure"
+#include "confdefs.h"
+ #include <mach/mach.h>
+ #include <mach/clock.h>
+ #include <mach/mach_error.h>
+
+ int main()
+ {
+ kern_return_t ret; clock_serv_t aClock; mach_timespec_t aTime;
+ ret = host_get_clock_service(mach_host_self(), REALTIME_CLOCK, &aClock);
+
+ if (ret != KERN_SUCCESS) {
+ return 1;
+ }
+
+ ret = clock_get_time(aClock, &aTime);
+ if (ret != KERN_SUCCESS) {
+ return 2;
+ }
+
+ return 0;
+ }
+
+EOF
+if { (eval echo configure:13163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+
+ have_clock_get_time=yes
+ echo "$ac_t""yes" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -fr conftest*
+fi
+
+ fi
+
+ if test "$have_clock_get_time" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_CLOCK_GET_TIME 1
+EOF
+
+ fi
+
+
+ have_ptrace=no
+ have_broken_ptrace=no
+
+ echo $ac_n "checking for ptrace""... $ac_c" 1>&6
+echo "configure:13194: checking for ptrace" >&5
+
+ cat > conftest.$ac_ext <<EOF
+#line 13197 "configure"
+#include "confdefs.h"
+
+ #include <sys/types.h>
+ #include <sys/ptrace.h>
+int main() {
+ptrace(0, 0, (void *) 0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:13206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+
+ have_ptrace=yes
+ echo "$ac_t""yes" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -f conftest*
+
+ if test "$have_ptrace" = "yes"; then
+ echo $ac_n "checking whether ptrace works""... $ac_c" 1>&6
+echo "configure:13224: checking whether ptrace works" >&5
+
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 13230 "configure"
+#include "confdefs.h"
+
+ #include <unistd.h>
+ #include <signal.h>
+ #include <sys/wait.h>
+ #include <sys/types.h>
+ #include <sys/ptrace.h>
+ #include <errno.h>
+
+ #if !defined(PTRACE_ATTACH) && defined(PT_ATTACH)
+ #define PTRACE_ATTACH PT_ATTACH
+ #endif
+
+ #if !defined(PTRACE_DETACH) && defined(PT_DETACH)
+ #define PTRACE_DETACH PT_DETACH
+ #endif
+
+ #if !defined(PTRACE_PEEKDATA) && defined(PT_READ_D)
+ #define PTRACE_PEEKDATA PT_READ_D
+ #endif
+
+ int main()
+ {
+ long v1 = (unsigned int) -1; /* copy will fail if sizeof(long) == 8 and we've got "int ptrace()" */
+ long v2;
+ pid_t child;
+ int status;
+
+ if ( (child = fork()) ) { /* parent */
+ int ret = 0;
+
+ if (0 > ptrace(PTRACE_ATTACH, child, 0, 0)) {
+ return 1;
+ }
+
+ waitpid(child, &status, 0);
+
+ #ifdef PT_IO
+ struct ptrace_io_desc ptio = {
+ .piod_op = PIOD_READ_D,
+ .piod_offs = &v1,
+ .piod_addr = &v2,
+ .piod_len = sizeof(v1)
+ };
+
+ if (0 > ptrace(PT_IO, child, (void *) &ptio, 0)) {
+ ret = 1;
+ }
+ #else
+ errno = 0;
+
+ v2 = ptrace(PTRACE_PEEKDATA, child, (void *) &v1, 0);
+
+ if (errno) {
+ ret = 1;
+ }
+ #endif
+ ptrace(PTRACE_DETACH, child, (void *) 1, 0);
+
+ kill(child, SIGKILL);
+
+ return ret ? ret : (v1 != v2);
+ }
+ else { /* child */
+ sleep(10);
+ return 0;
+ }
+ }
+
+EOF
+if { (eval echo configure:13301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+
+ echo "$ac_t""yes" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+
+ have_ptrace=no
+ have_broken_ptrace=yes
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -fr conftest*
+fi
+
+ fi
+
+ if test "$have_ptrace" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PTRACE 1
+EOF
+
+ fi
+
+ have_mach_vm_read=no
+
+ if test "$have_broken_ptrace" = "yes"; then
+ echo $ac_n "checking for mach_vm_read""... $ac_c" 1>&6
+echo "configure:13332: checking for mach_vm_read" >&5
+
+ cat > conftest.$ac_ext <<EOF
+#line 13335 "configure"
+#include "confdefs.h"
+ #include <mach/mach.h>
+ #include <mach/mach_vm.h>
+
+int main() {
+
+ mach_vm_read((vm_map_t)0, (mach_vm_address_t)0, (mach_vm_size_t)0, (vm_offset_t *)0, (mach_msg_type_number_t*)0);
+
+; return 0; }
+EOF
+if { (eval echo configure:13346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+
+ have_mach_vm_read=yes
+ echo "$ac_t""yes" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -f conftest*
+ fi
+
+ if test "$have_mach_vm_read" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_MACH_VM_READ 1
+EOF
+
+ fi
+
+ proc_mem_file=""
+
+ if test -r /proc/$$/mem ; then
+ proc_mem_file="mem"
+ else
+ if test -r /proc/$$/as ; then
+ proc_mem_file="as"
+ fi
+ fi
+
+ if test -n "$proc_mem_file" ; then
+ echo $ac_n "checking for proc mem file""... $ac_c" 1>&6
+echo "configure:13382: checking for proc mem file" >&5
+
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 13388 "configure"
+#include "confdefs.h"
+
+ #define _GNU_SOURCE
+ #define _FILE_OFFSET_BITS 64
+ #include <stdint.h>
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <stdio.h>
+ int main()
+ {
+ long v1 = (unsigned int) -1, v2 = 0;
+ char buf[128];
+ int fd;
+ sprintf(buf, "/proc/%d/$proc_mem_file", getpid());
+ fd = open(buf, O_RDONLY);
+ if (0 > fd) {
+ return 1;
+ }
+ if (sizeof(long) != pread(fd, &v2, sizeof(long), (uintptr_t) &v1)) {
+ close(fd);
+ return 1;
+ }
+ close(fd);
+ return v1 != v2;
+ }
+
+EOF
+if { (eval echo configure:13418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+
+ echo "$ac_t""$proc_mem_file" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+
+ proc_mem_file=""
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -fr conftest*
+fi
+
+ fi
+
+ if test -n "$proc_mem_file"; then
+ cat >> confdefs.h <<EOF
+#define PROC_MEM_FILE "$proc_mem_file"
+EOF
+
+ fi
+
+ if test "$have_ptrace" = "yes"; then
+ FPM_SOURCES="$FPM_SOURCES fpm_trace.c fpm_trace_ptrace.c"
+ elif test -n "$proc_mem_file"; then
+ FPM_SOURCES="$FPM_SOURCES fpm_trace.c fpm_trace_pread.c"
+ elif test "$have_mach_vm_read" = "yes" ; then
+ FPM_SOURCES="$FPM_SOURCES fpm_trace.c fpm_trace_mach.c"
+ fi
+
+
+
+LIBEVENT_CFLAGS="-I$abs_srcdir/libevent"
+LIBEVENT_LIBS="$abs_builddir/libevent/libevent.a"
+
+SAPI_EXTRA_DEPS="$LIBEVENT_LIBS"
+
+FPM_CFLAGS="$LIBEVENT_CFLAGS $LIBXML_CFLAGS $JUDY_CFLAGS"
+
+FPM_CFLAGS="$FPM_CFLAGS -I$abs_srcdir/sapi/cgi" # for fastcgi.h
+
+if test "$ICC" = "yes" ; then
+ FPM_ADD_CFLAGS="-Wall -wd279,310,869,810,981"
+elif test "$GCC" = "yes" ; then
+ FPM_ADD_CFLAGS="-Wall -Wpointer-arith -Wno-unused-parameter -Wunused-variable -Wunused-value -fno-strict-aliasing"
+fi
+
+if test -n "$FPM_WERROR" ; then
+ FPM_ADD_CFLAGS="$FPM_ADD_CFLAGS -Werror"
+fi
+
+FPM_CFLAGS="$FPM_ADD_CFLAGS $FPM_CFLAGS"
+
+
+ src=$abs_srcdir/sapi/cgi/fpm/Makefile.frag
+ ac_srcdir=$ext_srcdir
+ ac_builddir=$ext_builddir
+ test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments
+
+
+
+
+ case sapi/cgi/fpm in
+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
+ /*) ac_srcdir=`echo "sapi/cgi/fpm"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/sapi/cgi/fpm/"; ac_bdir="sapi/cgi/fpm/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ esac
+
+
+
+ b_c_pre=$php_c_pre
+ b_cxx_pre=$php_cxx_pre
+ b_c_meta=$php_c_meta
+ b_cxx_meta=$php_cxx_meta
+ b_c_post=$php_c_post
+ b_cxx_post=$php_cxx_post
+ b_lo=$php_lo
+
+
+ old_IFS=$IFS
+ for ac_src in $FPM_SOURCES; do
+
+ IFS=.
+ set $ac_src
+ ac_obj=$1
+ IFS=$old_IFS
+
+ PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"
+
+ case $ac_src in
+ *.c) ac_comp="$b_c_pre $FPM_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.s) ac_comp="$b_c_pre $FPM_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.S) ac_comp="$b_c_pre $FPM_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $FPM_CFLAGS $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
+ esac
+
+ cat >>Makefile.objects<<EOF
+$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
+ $ac_comp
+EOF
+ done
+
+
+
+
+
+ BUILD_DIR="$BUILD_DIR sapi/cgi/fpm"
+
+
+
+install_fpm="install-fpm"
+
+
+ echo "$ac_t""" 1>&6
+ echo "$ac_t""${T_MD}Configuring libevent${T_ME}" 1>&6
+
+
+test -d "$abs_builddir/libevent" || mkdir -p $abs_builddir/libevent
+
+
+chmod +x "$abs_srcdir/libevent/configure" \
+ "$abs_srcdir/libevent/depcomp" \
+ "$abs_srcdir/libevent/install-sh" \
+ "$abs_srcdir/libevent/missing"
+
+libevent_configure="cd $abs_builddir/libevent ; CFLAGS=\"$CFLAGS $GCC_CFLAGS\" $abs_srcdir/libevent/configure --disable-shared"
+
+(eval $libevent_configure)
+
+if test ! -f "$abs_builddir/libevent/Makefile" ; then
+ echo "Failed to configure libevent" >&2
+ exit 1
+fi
+
+
+LIBEVENT_LIBS="$LIBEVENT_LIBS `echo "@LIBS@" | $abs_builddir/libevent/config.status --file=-:-`"
+
+SAPI_EXTRA_LIBS="$LIBEVENT_LIBS $LIBXML_LIBS $JUDY_LIBS"
+
+
+if test "$prefix" = "NONE" ; then
+ fpm_prefix=/usr/local
+else
+ fpm_prefix="$prefix"
+fi
+
+if test "$PHP_FPM_CONF" = "\$prefix/etc/php-fpm.conf" ; then
+ php_fpm_conf_path="$fpm_prefix/etc/php-fpm.conf"
+else
+ php_fpm_conf_path="$PHP_FPM_CONF"
+fi
+
+if test "$PHP_FPM_LOG" = "\$prefix/logs/php-fpm.log" ; then
+ php_fpm_log_path="$fpm_prefix/logs/php-fpm.log"
+else
+ php_fpm_log_path="$PHP_FPM_LOG"
+fi
+
+if test "$PHP_FPM_PID" = "\$prefix/logs/php-fpm.pid" ; then
+ php_fpm_pid_path="$fpm_prefix/logs/php-fpm.pid"
+else
+ php_fpm_pid_path="$PHP_FPM_PID"
+fi
+
+
+if grep nobody /etc/group >/dev/null 2>&1; then
+ php_fpm_group=nobody
+else
+ if grep nogroup /etc/group >/dev/null 2>&1; then
+ php_fpm_group=nogroup
+ else
+ php_fpm_group=nobody
+ fi
+fi
+
+
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST php_fpm_conf_path"
+
+
+
+
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST php_fpm_log_path"
+
+
+
+
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST php_fpm_pid_path"
+
+
+
+
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST php_fpm_group"
+
+
+
+
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST FPM_VERSION"
+
+
+
+
+
+ PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES sapi/cgi/fpm/fpm_autoconf.h"
+
+
+ PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES sapi/cgi/fpm/php-fpm.conf:sapi/cgi/fpm/conf/php-fpm.conf.in"
+
+
+ PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES sapi/cgi/fpm/php-fpm:sapi/cgi/fpm/init.d/php-fpm.in"
+
+
+fi
+
@@ -17779,6 +18695,7 @@ fi
for ac_func in alphasort \
asctime_r \
chroot \
+clearenv \
ctime_r \
cuserid \
crypt \
@@ -108404,6 +109321,18 @@ fi
+ PHP_VAR_SUBST="$PHP_VAR_SUBST SAPI_EXTRA_LIBS"
+
+
+
+
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST SAPI_EXTRA_DEPS"
+
+
+
+
+
PHP_VAR_SUBST="$PHP_VAR_SUBST ZEND_EXTRA_LIBS"
@@ -116677,7 +117606,7 @@ case $PHP_SAPI in
install_targets="$PHP_INSTALL_CLI_TARGET $install_targets"
;;