+dnl PSI_SH_CONFIG_POSIX_ENABLED(section)
+dnl Expand to $psi_config_posix_<section>
+AC_DEFUN(PSI_SH_CONFIG_POSIX_ENABLED, [$AS_TR_SH([psi_config_posix_]$1)])
+
+dnl PSI_CONFIG_POSIX_ENABLED(section, action-if-yes, action-if-not)
+dnl Internal. Used to check if --enable-psi-posix=section was given.
+AC_DEFUN(PSI_CONFIG_POSIX_ENABLED, [
+ AS_TR_SH([psi_config_posix_]$1)=false
+ case "$PHP_PSI_POSIX" in
+ yes|all)
+ AS_TR_SH([psi_config_posix_]$1)=true
+ ;;
+ *)
+ if expr "$PHP_PSI_POSIX" : '\b$1\b' >/dev/null; then
+ AS_TR_SH([psi_config_posix_]$1)=true
+ fi
+ ;;
+ esac
+ if $AS_TR_SH([psi_config_posix_]$1); then
+ ifelse([$2],,:,[$2])
+ else
+ ifelse([$3],,:,[$3])
+ fi
+])
+
+dnl PSI_TEST_POSIX_ENABLED(section, action-if-yes, action-if-not)
+dnl Shell-if test if PSI POSIX section was configured.
+AC_DEFUN(PSI_SH_TEST_POSIX_ENABLED, [
+ if test "PSI_SH_CONFIG_POSIX_ENABLED([$1])" && $PSI_SH_CONFIG_POSIX_ENABLED([$1]); then
+ ifelse([$2],,:,[$2])
+ else
+ ifelse([$3],,:,[$3])
+ fi
+])
+
+dnl PSI_CONFIG_POSIX(section, headers)
+AC_DEFUN(PSI_CONFIG_POSIX, [
+ PSI_CONFIG_POSIX_ENABLED($1, [
+ PHP_CONFIGURE_PART(Configuring PSI POSIX: $1)
+ ifelse([$2],,,AC_CHECK_HEADERS($2))
+ ], [
+ return 0
+ ])
+])
+
+AC_DEFUN(PSI_PTHREAD_ONCE, [
+ AX_PTHREAD([
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ ])
+])
+AC_DEFUN(PSI_PTHREAD, [
+ AC_REQUIRE([PSI_PTHREAD_ONCE])
+])
+