Skip to content

Commit

Permalink
Fixed ioqueue backend selection configure script (#3878)
Browse files Browse the repository at this point in the history
  • Loading branch information
sauwming authored Mar 6, 2024
1 parent 7d2248f commit c368025
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 18 deletions.
28 changes: 19 additions & 9 deletions aconfigure
Original file line number Diff line number Diff line change
Expand Up @@ -6518,19 +6518,26 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ioqueue backend" >&5
printf %s "checking ioqueue backend... " >&6; }

ac_os_objs=ioqueue_select.o
ac_linux_poll=select

case $target in
*darwin* | *bsd*)
# Check whether --enable-kqueue was given.
if test ${enable_kqueue+y}
then :
enableval=$enable_kqueue;
ac_os_objs=ioqueue_kqueue.o
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: kqueue()" >&5
if test "$enable_kqueue" = "yes"; then
ac_os_objs=ioqueue_kqueue.o
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: kqueue()" >&5
printf "%s\n" "kqueue()" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: select()" >&5
printf "%s\n" "select()" >&6; }
fi

else $as_nop

ac_os_objs=ioqueue_select.o
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: select()" >&5
printf "%s\n" "select()" >&6; }

Expand All @@ -6542,19 +6549,22 @@ fi
if test ${enable_epoll+y}
then :
enableval=$enable_epoll;
ac_os_objs=ioqueue_epoll.o
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: /dev/epoll" >&5
if test "$enable_epoll" = "yes"; then
ac_os_objs=ioqueue_epoll.o
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: /dev/epoll" >&5
printf "%s\n" "/dev/epoll" >&6; }
printf "%s\n" "#define PJ_HAS_LINUX_EPOLL 1" >>confdefs.h
printf "%s\n" "#define PJ_HAS_LINUX_EPOLL 1" >>confdefs.h

ac_linux_poll=epoll
ac_linux_poll=epoll
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: select()" >&5
printf "%s\n" "select()" >&6; }
fi

else $as_nop

ac_os_objs=ioqueue_select.o
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: select()" >&5
printf "%s\n" "select()" >&6; }
ac_linux_poll=select

fi

Expand Down
26 changes: 17 additions & 9 deletions aconfigure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -467,17 +467,23 @@ AC_SUBST(ac_os_objs)
AC_SUBST(ac_linux_poll)
AC_MSG_CHECKING([ioqueue backend])

ac_os_objs=ioqueue_select.o
ac_linux_poll=select

case $target in
*darwin* | *bsd*)
AC_ARG_ENABLE(kqueue,
AS_HELP_STRING([--enable-kqueue],
[Use kqueue ioqueue on macos/BSD (experimental)]),
[
ac_os_objs=ioqueue_kqueue.o
AC_MSG_RESULT([kqueue()])
if test "$enable_kqueue" = "yes"; then
ac_os_objs=ioqueue_kqueue.o
AC_MSG_RESULT([kqueue()])
else
AC_MSG_RESULT([select()])
fi
],
[
ac_os_objs=ioqueue_select.o
AC_MSG_RESULT([select()])
])
;;
Expand All @@ -486,15 +492,17 @@ case $target in
AS_HELP_STRING([--enable-epoll],
[Use /dev/epoll ioqueue on Linux (experimental)]),
[
ac_os_objs=ioqueue_epoll.o
AC_MSG_RESULT([/dev/epoll])
AC_DEFINE(PJ_HAS_LINUX_EPOLL,1)
ac_linux_poll=epoll
if test "$enable_epoll" = "yes"; then
ac_os_objs=ioqueue_epoll.o
AC_MSG_RESULT([/dev/epoll])
AC_DEFINE(PJ_HAS_LINUX_EPOLL,1)
ac_linux_poll=epoll
else
AC_MSG_RESULT([select()])
fi
],
[
ac_os_objs=ioqueue_select.o
AC_MSG_RESULT([select()])
ac_linux_poll=select
])
;;
esac
Expand Down

0 comments on commit c368025

Please sign in to comment.