1PHP_ARG_ENABLE([fpm],, 2 [AS_HELP_STRING([--enable-fpm], 3 [Enable building of the fpm SAPI executable])], 4 [no], 5 [no]) 6 7dnl Configure checks. 8AC_DEFUN([AC_FPM_STDLIBS], 9[ 10 AC_CHECK_FUNCS(clearenv setproctitle setproctitle_fast) 11 12 AC_SEARCH_LIBS(socket, socket) 13 AC_SEARCH_LIBS(inet_addr, nsl) 14]) 15 16AC_DEFUN([AC_FPM_PRCTL], 17[ 18 AC_MSG_CHECKING([for prctl]) 19 20 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/prctl.h>]], [[prctl(0, 0, 0, 0, 0);]])], [ 21 AC_DEFINE([HAVE_PRCTL], 1, [do we have prctl?]) 22 AC_MSG_RESULT([yes]) 23 ], [ 24 AC_MSG_RESULT([no]) 25 ]) 26]) 27 28AC_DEFUN([AC_FPM_PROCCTL], 29[ 30 AC_MSG_CHECKING([for procctl]) 31 32 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/procctl.h>]], [[procctl(0, 0, 0, 0);]])], [ 33 AC_DEFINE([HAVE_PROCCTL], 1, [do we have procctl?]) 34 AC_MSG_RESULT([yes]) 35 ], [ 36 AC_MSG_RESULT([no]) 37 ]) 38]) 39 40AC_DEFUN([AC_FPM_SETPFLAGS], 41[ 42 AC_MSG_CHECKING([for setpflags]) 43 44 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <priv.h>]], [[setpflags(0, 0);]])], [ 45 AC_DEFINE([HAVE_SETPFLAGS], 1, [do we have setpflags?]) 46 AC_MSG_RESULT([yes]) 47 ], [ 48 AC_MSG_RESULT([no]) 49 ]) 50]) 51 52AC_DEFUN([AC_FPM_CLOCK], 53[ 54 have_clock_gettime=no 55 56 AC_MSG_CHECKING([for clock_gettime]) 57 58 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);]])], [ 59 have_clock_gettime=yes 60 AC_MSG_RESULT([yes]) 61 ], [ 62 AC_MSG_RESULT([no]) 63 ]) 64 65 if test "$have_clock_gettime" = "no"; then 66 AC_MSG_CHECKING([for clock_gettime in -lrt]) 67 68 SAVED_LIBS="$LIBS" 69 LIBS="$LIBS -lrt" 70 71 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);]])], [ 72 have_clock_gettime=yes 73 AC_MSG_RESULT([yes]) 74 ], [ 75 LIBS="$SAVED_LIBS" 76 AC_MSG_RESULT([no]) 77 ]) 78 fi 79 80 if test "$have_clock_gettime" = "yes"; then 81 AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [do we have clock_gettime?]) 82 fi 83 84 have_clock_get_time=no 85 86 if test "$have_clock_gettime" = "no"; then 87 AC_MSG_CHECKING([for clock_get_time]) 88 89 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <mach/mach.h> 90 #include <mach/clock.h> 91 #include <mach/mach_error.h> 92 93 int main(void) 94 { 95 kern_return_t ret; clock_serv_t aClock; mach_timespec_t aTime; 96 ret = host_get_clock_service(mach_host_self(), REALTIME_CLOCK, &aClock); 97 98 if (ret != KERN_SUCCESS) { 99 return 1; 100 } 101 102 ret = clock_get_time(aClock, &aTime); 103 if (ret != KERN_SUCCESS) { 104 return 2; 105 } 106 107 return 0; 108 } 109 ]])], [ 110 have_clock_get_time=yes 111 AC_MSG_RESULT([yes]) 112 ], [ 113 AC_MSG_RESULT([no]) 114 ], [AC_MSG_RESULT([no (cross-compiling)])]) 115 fi 116 117 if test "$have_clock_get_time" = "yes"; then 118 AC_DEFINE([HAVE_CLOCK_GET_TIME], 1, [do we have clock_get_time?]) 119 fi 120]) 121 122AC_DEFUN([AC_FPM_TRACE], 123[ 124 have_ptrace=no 125 have_broken_ptrace=no 126 127 AC_MSG_CHECKING([for ptrace]) 128 129 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 130 #include <sys/types.h> 131 #include <sys/ptrace.h> ]], [[ptrace(0, 0, (void *) 0, 0);]])], [ 132 have_ptrace=yes 133 AC_MSG_RESULT([yes]) 134 ], [ 135 AC_MSG_RESULT([no]) 136 ]) 137 138 if test "$have_ptrace" = "yes"; then 139 AC_MSG_CHECKING([whether ptrace works]) 140 141 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 142 #include <unistd.h> 143 #include <signal.h> 144 #include <sys/wait.h> 145 #include <sys/types.h> 146 #include <sys/ptrace.h> 147 #include <errno.h> 148 149 #if !defined(PTRACE_ATTACH) && defined(PT_ATTACH) 150 #define PTRACE_ATTACH PT_ATTACH 151 #endif 152 153 #if !defined(PTRACE_DETACH) && defined(PT_DETACH) 154 #define PTRACE_DETACH PT_DETACH 155 #endif 156 157 #if !defined(PTRACE_PEEKDATA) && defined(PT_READ_D) 158 #define PTRACE_PEEKDATA PT_READ_D 159 #endif 160 161 int main(void) 162 { 163 long v1 = (unsigned int) -1; /* copy will fail if sizeof(long) == 8 and we've got "int ptrace()" */ 164 long v2; 165 pid_t child; 166 int status; 167 168 if ( (child = fork()) ) { /* parent */ 169 int ret = 0; 170 171 if (0 > ptrace(PTRACE_ATTACH, child, 0, 0)) { 172 return 2; 173 } 174 175 waitpid(child, &status, 0); 176 177 #ifdef PT_IO 178 struct ptrace_io_desc ptio = { 179 .piod_op = PIOD_READ_D, 180 .piod_offs = &v1, 181 .piod_addr = &v2, 182 .piod_len = sizeof(v1) 183 }; 184 185 if (0 > ptrace(PT_IO, child, (void *) &ptio, 0)) { 186 ret = 3; 187 } 188 #else 189 errno = 0; 190 191 v2 = ptrace(PTRACE_PEEKDATA, child, (void *) &v1, 0); 192 193 if (errno) { 194 ret = 4; 195 } 196 #endif 197 ptrace(PTRACE_DETACH, child, (void *) 1, 0); 198 199 kill(child, SIGKILL); 200 201 return ret ? ret : (v1 != v2); 202 } 203 else { /* child */ 204 sleep(10); 205 return 0; 206 } 207 } 208 ]])], [ 209 AC_MSG_RESULT([yes]) 210 ], [ 211 have_ptrace=no 212 have_broken_ptrace=yes 213 AC_MSG_RESULT([no]) 214 ], [ 215 AC_MSG_RESULT([skipped (cross-compiling)]) 216 ]) 217 fi 218 219 if test "$have_ptrace" = "yes"; then 220 AC_DEFINE([HAVE_PTRACE], 1, [do we have ptrace?]) 221 fi 222 223 have_mach_vm_read=no 224 225 if test "$have_broken_ptrace" = "yes"; then 226 AC_MSG_CHECKING([for mach_vm_read]) 227 228 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/mach.h> 229 #include <mach/mach_vm.h> 230 ]], [[ 231 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); 232 ]])], [ 233 have_mach_vm_read=yes 234 AC_MSG_RESULT([yes]) 235 ], [ 236 AC_MSG_RESULT([no]) 237 ]) 238 fi 239 240 if test "$have_mach_vm_read" = "yes"; then 241 AC_DEFINE([HAVE_MACH_VM_READ], 1, [do we have mach_vm_read?]) 242 fi 243 244 proc_mem_file="" 245 246 if test -r /proc/$$/mem ; then 247 proc_mem_file="mem" 248 else 249 if test -r /proc/$$/as ; then 250 proc_mem_file="as" 251 fi 252 fi 253 254 if test -n "$proc_mem_file" ; then 255 AC_MSG_CHECKING([for proc mem file]) 256 257 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 258 #define _GNU_SOURCE 259 #define _FILE_OFFSET_BITS 64 260 #include <stdint.h> 261 #include <unistd.h> 262 #include <sys/types.h> 263 #include <sys/stat.h> 264 #include <fcntl.h> 265 #include <stdio.h> 266 int main(void) 267 { 268 long v1 = (unsigned int) -1, v2 = 0; 269 char buf[128]; 270 int fd; 271 sprintf(buf, "/proc/%d/$proc_mem_file", getpid()); 272 fd = open(buf, O_RDONLY); 273 if (0 > fd) { 274 return 1; 275 } 276 if (sizeof(long) != pread(fd, &v2, sizeof(long), (uintptr_t) &v1)) { 277 close(fd); 278 return 1; 279 } 280 close(fd); 281 return v1 != v2; 282 } 283 ]])], [ 284 AC_MSG_RESULT([$proc_mem_file]) 285 ], [ 286 proc_mem_file="" 287 AC_MSG_RESULT([no]) 288 ], [ 289 AC_MSG_RESULT([skipped (cross-compiling)]) 290 ]) 291 fi 292 293 if test -n "$proc_mem_file"; then 294 AC_DEFINE_UNQUOTED([PROC_MEM_FILE], "$proc_mem_file", [/proc/pid/mem interface]) 295 fi 296 297 fpm_trace_type="" 298 299 if test "$have_ptrace" = "yes"; then 300 fpm_trace_type=ptrace 301 302 elif test -n "$proc_mem_file"; then 303 fpm_trace_type=pread 304 305 elif test "$have_mach_vm_read" = "yes" ; then 306 fpm_trace_type=mach 307 308 else 309 AC_MSG_WARN([FPM Trace - ptrace, pread, or mach: could not be found]) 310 fi 311 312]) 313 314AC_DEFUN([AC_FPM_BUILTIN_ATOMIC], 315[ 316 AC_MSG_CHECKING([if gcc supports __sync_bool_compare_and_swap]) 317 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[ 318 int variable = 1; 319 return (__sync_bool_compare_and_swap(&variable, 1, 2) 320 && __sync_add_and_fetch(&variable, 1)) ? 1 : 0; 321 ]])], [ 322 AC_MSG_RESULT([yes]) 323 AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o.]) 324 ], [ 325 AC_MSG_RESULT([no]) 326 ]) 327]) 328 329AC_DEFUN([AC_FPM_LQ], 330[ 331 have_lq=no 332 333 AC_MSG_CHECKING([for TCP_INFO]) 334 335 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[struct tcp_info ti; int x = TCP_INFO;]])], [ 336 have_lq=tcp_info 337 AC_MSG_RESULT([yes]) 338 ], [ 339 AC_MSG_RESULT([no]) 340 ]) 341 342 if test "$have_lq" = "tcp_info"; then 343 AC_DEFINE([HAVE_LQ_TCP_INFO], 1, [do we have TCP_INFO?]) 344 fi 345 346 AC_MSG_CHECKING([for TCP_CONNECTION_INFO]) 347 348 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[struct tcp_connection_info ti; int x = TCP_CONNECTION_INFO;]])], [ 349 have_lq=tcp_connection_info 350 AC_MSG_RESULT([yes]) 351 ], [ 352 AC_MSG_RESULT([no]) 353 ]) 354 355 if test "$have_lq" = "tcp_connection_info"; then 356 AC_DEFINE([HAVE_LQ_TCP_CONNECTION_INFO], 1, [do we have TCP_CONNECTION_INFO?]) 357 fi 358 359 if test "$have_lq" = "no" ; then 360 AC_MSG_CHECKING([for SO_LISTENQLEN]) 361 362 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[int x = SO_LISTENQLIMIT; int y = SO_LISTENQLEN;]])], [ 363 have_lq=so_listenq 364 AC_MSG_RESULT([yes]) 365 ], [ 366 AC_MSG_RESULT([no]) 367 ]) 368 369 if test "$have_lq" = "tcp_info"; then 370 AC_DEFINE([HAVE_LQ_SO_LISTENQ], 1, [do we have SO_LISTENQxxx?]) 371 fi 372 fi 373]) 374 375AC_DEFUN([AC_FPM_SYSCONF], 376[ 377 AC_MSG_CHECKING([for sysconf]) 378 379 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[sysconf(_SC_CLK_TCK);]])],[ 380 AC_DEFINE([HAVE_SYSCONF], 1, [do we have sysconf?]) 381 AC_MSG_RESULT([yes]) 382 ], [ 383 AC_MSG_RESULT([no]) 384 ]) 385]) 386 387AC_DEFUN([AC_FPM_TIMES], 388[ 389 AC_MSG_CHECKING([for times]) 390 391 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/times.h>]], [[struct tms t; times(&t);]])],[ 392 AC_DEFINE([HAVE_TIMES], 1, [do we have times?]) 393 AC_MSG_RESULT([yes]) 394 ], [ 395 AC_MSG_RESULT([no]) 396 ]) 397]) 398 399AC_DEFUN([AC_FPM_KQUEUE], 400[ 401 AC_MSG_CHECKING([for kqueue]) 402 403 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 404 #include <sys/types.h> 405 #include <sys/event.h> 406 #include <sys/time.h> 407 ]], [[ 408 int kfd; 409 struct kevent k; 410 kfd = kqueue(); 411 /* 0 -> STDIN_FILENO */ 412 EV_SET(&k, 0, EVFILT_READ , EV_ADD | EV_CLEAR, 0, 0, NULL); 413 ]])], [ 414 AC_DEFINE([HAVE_KQUEUE], 1, [do we have kqueue?]) 415 AC_MSG_RESULT([yes]) 416 ], [ 417 AC_MSG_RESULT([no]) 418 ]) 419]) 420 421AC_DEFUN([AC_FPM_PORT], 422[ 423 AC_MSG_CHECKING([for port framework]) 424 425 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 426 #include <port.h> 427 ]], [[ 428 int port; 429 430 port = port_create(); 431 if (port < 0) { 432 return 1; 433 } 434 ]])], [ 435 AC_DEFINE([HAVE_PORT], 1, [do we have port framework?]) 436 AC_MSG_RESULT([yes]) 437 ], [ 438 AC_MSG_RESULT([no]) 439 ]) 440]) 441 442AC_DEFUN([AC_FPM_DEVPOLL], 443[ 444 AC_MSG_CHECKING([for /dev/poll]) 445 446 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 447 #include <stdio.h> 448 #include <sys/devpoll.h> 449 ]], [[ 450 int n, dp; 451 struct dvpoll dvp; 452 dp = 0; 453 dvp.dp_fds = NULL; 454 dvp.dp_nfds = 0; 455 dvp.dp_timeout = 0; 456 n = ioctl(dp, DP_POLL, &dvp) 457 ]])], [ 458 AC_DEFINE([HAVE_DEVPOLL], 1, [do we have /dev/poll?]) 459 AC_MSG_RESULT([yes]) 460 ], [ 461 AC_MSG_RESULT([no]) 462 ]) 463]) 464 465AC_DEFUN([AC_FPM_EPOLL], 466[ 467 AC_MSG_CHECKING([for epoll]) 468 469 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 470 #include <sys/epoll.h> 471 ]], [[ 472 int epollfd; 473 struct epoll_event e; 474 475 epollfd = epoll_create(1); 476 if (epollfd < 0) { 477 return 1; 478 } 479 480 e.events = EPOLLIN | EPOLLET; 481 e.data.fd = 0; 482 483 if (epoll_ctl(epollfd, EPOLL_CTL_ADD, 0, &e) == -1) { 484 return 1; 485 } 486 487 e.events = 0; 488 if (epoll_wait(epollfd, &e, 1, 1) < 0) { 489 return 1; 490 } 491 ]])], [ 492 AC_DEFINE([HAVE_EPOLL], 1, [do we have epoll?]) 493 AC_MSG_RESULT([yes]) 494 ], [ 495 AC_MSG_RESULT([no]) 496 ]) 497]) 498 499AC_DEFUN([AC_FPM_SELECT], 500[ 501 AC_MSG_CHECKING([for select]) 502 503 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 504 /* According to POSIX.1-2001 */ 505 #include <sys/select.h> 506 507 /* According to earlier standards */ 508 #include <sys/time.h> 509 #include <sys/types.h> 510 #include <unistd.h> 511 ]], [[ 512 fd_set fds; 513 struct timeval t; 514 t.tv_sec = 0; 515 t.tv_usec = 42; 516 FD_ZERO(&fds); 517 /* 0 -> STDIN_FILENO */ 518 FD_SET(0, &fds); 519 select(FD_SETSIZE, &fds, NULL, NULL, &t); 520 ]])], [ 521 AC_DEFINE([HAVE_SELECT], 1, [do we have select?]) 522 AC_MSG_RESULT([yes]) 523 ], [ 524 AC_MSG_RESULT([no]) 525 ]) 526]) 527 528AC_MSG_CHECKING(for FPM build) 529if test "$PHP_FPM" != "no"; then 530 AC_MSG_RESULT($PHP_FPM) 531 532 AC_FPM_STDLIBS 533 AC_FPM_PRCTL 534 AC_FPM_PROCCTL 535 AC_FPM_SETPFLAGS 536 AC_FPM_CLOCK 537 AC_FPM_TRACE 538 AC_FPM_BUILTIN_ATOMIC 539 AC_FPM_LQ 540 AC_FPM_SYSCONF 541 AC_FPM_TIMES 542 AC_FPM_KQUEUE 543 AC_FPM_PORT 544 AC_FPM_DEVPOLL 545 AC_FPM_EPOLL 546 AC_FPM_SELECT 547 548 PHP_ARG_WITH([fpm-user],, 549 [AS_HELP_STRING([[--with-fpm-user[=USER]]], 550 [Set the user for php-fpm to run as. (default: nobody)])], 551 [nobody], 552 [no]) 553 554 PHP_ARG_WITH([fpm-group],, 555 [AS_HELP_STRING([[--with-fpm-group[=GRP]]], 556 [Set the group for php-fpm to run as. For a system user, this should 557 usually be set to match the fpm username (default: nobody)])], 558 [nobody], 559 [no]) 560 561 PHP_ARG_WITH([fpm-systemd],, 562 [AS_HELP_STRING([--with-fpm-systemd], 563 [Activate systemd integration])], 564 [no], 565 [no]) 566 567 PHP_ARG_WITH([fpm-acl],, 568 [AS_HELP_STRING([--with-fpm-acl], 569 [Use POSIX Access Control Lists])], 570 [no], 571 [no]) 572 573 PHP_ARG_WITH([fpm-apparmor],, 574 [AS_HELP_STRING([--with-fpm-apparmor], 575 [Support AppArmor confinement through libapparmor])], 576 [no], 577 [no]) 578 579 PHP_ARG_WITH([fpm-selinux],, 580 [AS_HELP_STRING([--with-fpm-selinux], 581 [Support SELinux policy library])], 582 [no], 583 [no]) 584 585 if test "$PHP_FPM_SYSTEMD" != "no" ; then 586 PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 209]) 587 588 AC_CHECK_HEADERS(systemd/sd-daemon.h, [HAVE_SD_DAEMON_H="yes"], [HAVE_SD_DAEMON_H="no"]) 589 if test $HAVE_SD_DAEMON_H = "no"; then 590 AC_MSG_ERROR([Your system does not support systemd.]) 591 else 592 AC_DEFINE(HAVE_SYSTEMD, 1, [FPM use systemd integration]) 593 PHP_FPM_SD_FILES="fpm/fpm_systemd.c" 594 PHP_EVAL_LIBLINE($SYSTEMD_LIBS) 595 PHP_EVAL_INCLINE($SYSTEMD_CFLAGS) 596 php_fpm_systemd=notify 597 fi 598 else 599 php_fpm_systemd=simple 600 fi 601 602 if test "$PHP_FPM_ACL" != "no" ; then 603 AC_MSG_CHECKING([for acl user/group permissions support]) 604 AC_CHECK_HEADERS([sys/acl.h]) 605 606 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/acl.h> 607 int main(void) 608 { 609 acl_t acl; 610 acl_entry_t user, group; 611 acl = acl_init(1); 612 acl_create_entry(&acl, &user); 613 acl_set_tag_type(user, ACL_USER); 614 acl_create_entry(&acl, &group); 615 acl_set_tag_type(user, ACL_GROUP); 616 acl_free(acl); 617 return 0; 618 } 619 ]])], [ 620 AC_CHECK_LIB(acl, acl_free, 621 [PHP_ADD_LIBRARY(acl) 622 have_fpm_acl=yes 623 AC_MSG_RESULT([yes]) 624 ],[ 625 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/acl.h> 626 int main(void) 627 { 628 acl_t acl; 629 acl_entry_t user, group; 630 acl = acl_init(1); 631 acl_create_entry(&acl, &user); 632 acl_set_tag_type(user, ACL_USER); 633 acl_create_entry(&acl, &group); 634 acl_set_tag_type(user, ACL_GROUP); 635 acl_free(acl); 636 return 0; 637 } 638 ]])], [ 639 have_fpm_acl=yes 640 AC_MSG_RESULT([yes]) 641 ], [ 642 have_fpm_acl=no 643 AC_MSG_RESULT([no]) 644 ], [AC_MSG_RESULT([skipped])]) 645 ]) 646 ], [ 647 have_fpm_acl=no 648 AC_MSG_RESULT([no]) 649 ], [AC_MSG_RESULT([skipped (cross-compiling)])]) 650 651 if test "$have_fpm_acl" = "yes"; then 652 AC_DEFINE([HAVE_FPM_ACL], 1, [do we have acl support?]) 653 fi 654 fi 655 656 if test "x$PHP_FPM_APPARMOR" != "xno" ; then 657 AC_CHECK_HEADERS([sys/apparmor.h]) 658 AC_CHECK_LIB(apparmor, aa_change_profile, [ 659 PHP_ADD_LIBRARY(apparmor) 660 AC_DEFINE(HAVE_APPARMOR, 1, [ AppArmor confinement available ]) 661 ],[ 662 AC_MSG_ERROR(libapparmor required but not found) 663 ]) 664 fi 665 666 if test "x$PHP_FPM_SELINUX" != "xno" ; then 667 AC_CHECK_HEADERS([selinux/selinux.h]) 668 AC_CHECK_LIB(selinux, security_setenforce, [ 669 PHP_ADD_LIBRARY(selinux) 670 AC_DEFINE(HAVE_SELINUX, 1, [ SElinux available ]) 671 ],[]) 672 fi 673 674 PHP_SUBST_OLD(php_fpm_systemd) 675 AC_DEFINE_UNQUOTED(PHP_FPM_SYSTEMD, "$php_fpm_systemd", [fpm systemd service type]) 676 677 if test -z "$PHP_FPM_USER" -o "$PHP_FPM_USER" = "yes" -o "$PHP_FPM_USER" = "no"; then 678 php_fpm_user="nobody" 679 else 680 php_fpm_user="$PHP_FPM_USER" 681 fi 682 683 if test -z "$PHP_FPM_GROUP" -o "$PHP_FPM_GROUP" = "yes" -o "$PHP_FPM_GROUP" = "no"; then 684 php_fpm_group="nobody" 685 else 686 php_fpm_group="$PHP_FPM_GROUP" 687 fi 688 689 PHP_SUBST_OLD(php_fpm_user) 690 PHP_SUBST_OLD(php_fpm_group) 691 php_fpm_sysconfdir=`eval echo $sysconfdir` 692 PHP_SUBST_OLD(php_fpm_sysconfdir) 693 php_fpm_localstatedir=`eval echo $localstatedir` 694 PHP_SUBST_OLD(php_fpm_localstatedir) 695 php_fpm_prefix=`eval echo $prefix` 696 PHP_SUBST_OLD(php_fpm_prefix) 697 698 AC_DEFINE_UNQUOTED(PHP_FPM_USER, "$php_fpm_user", [fpm user name]) 699 AC_DEFINE_UNQUOTED(PHP_FPM_GROUP, "$php_fpm_group", [fpm group name]) 700 701 PHP_ADD_BUILD_DIR(sapi/fpm/fpm) 702 PHP_ADD_BUILD_DIR(sapi/fpm/fpm/events) 703 PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/www.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html) 704 PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/fpm/Makefile.frag]) 705 706 SAPI_FPM_PATH=sapi/fpm/php-fpm 707 708 if test "$fpm_trace_type" && test -f "$abs_srcdir/sapi/fpm/fpm/fpm_trace_$fpm_trace_type.c"; then 709 PHP_FPM_TRACE_FILES="fpm/fpm_trace.c fpm/fpm_trace_$fpm_trace_type.c" 710 fi 711 712 PHP_FPM_CFLAGS="-I$abs_srcdir/sapi/fpm -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1" 713 714 PHP_FPM_FILES="fpm/fpm.c \ 715 fpm/fpm_children.c \ 716 fpm/fpm_cleanup.c \ 717 fpm/fpm_clock.c \ 718 fpm/fpm_conf.c \ 719 fpm/fpm_env.c \ 720 fpm/fpm_events.c \ 721 fpm/fpm_log.c \ 722 fpm/fpm_main.c \ 723 fpm/fpm_php.c \ 724 fpm/fpm_php_trace.c \ 725 fpm/fpm_process_ctl.c \ 726 fpm/fpm_request.c \ 727 fpm/fpm_shm.c \ 728 fpm/fpm_scoreboard.c \ 729 fpm/fpm_signals.c \ 730 fpm/fpm_sockets.c \ 731 fpm/fpm_status.c \ 732 fpm/fpm_stdio.c \ 733 fpm/fpm_unix.c \ 734 fpm/fpm_worker_pool.c \ 735 fpm/zlog.c \ 736 fpm/events/select.c \ 737 fpm/events/poll.c \ 738 fpm/events/epoll.c \ 739 fpm/events/kqueue.c \ 740 fpm/events/devpoll.c \ 741 fpm/events/port.c \ 742 " 743 744 PHP_SELECT_SAPI(fpm, program, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES $PHP_FPM_SD_FILES, $PHP_FPM_CFLAGS, '$(SAPI_FPM_PATH)') 745 746 case $host_alias in 747 *aix*) 748 BUILD_FPM="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_FPM_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) --tag=CC --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_BINARY_OBJS) \$(PHP_FASTCGI_OBJS) \$(PHP_FPM_OBJS) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)" 749 ;; 750 *darwin*) 751 BUILD_FPM="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_BINARY_OBJS:.lo=.o) \$(PHP_FASTCGI_OBJS:.lo=.o) \$(PHP_FPM_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)" 752 ;; 753 *) 754 BUILD_FPM="\$(LIBTOOL) --tag=CC --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_BINARY_OBJS:.lo=.o) \$(PHP_FASTCGI_OBJS:.lo=.o) \$(PHP_FPM_OBJS:.lo=.o) \$(EXTRA_LIBS) \$(FPM_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)" 755 ;; 756 esac 757 758 PHP_SUBST(SAPI_FPM_PATH) 759 PHP_SUBST(BUILD_FPM) 760 761else 762 AC_MSG_RESULT(no) 763fi 764