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