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