Compiling support for libkqueue on docker image
Good day everyone! I'm trying to create a docker image of FreeRADIUS 3.2.x (on Ubuntu24) with libkqueue support enabled. I had hoped it would be as easy as installing the libkqueue-dev package before building, but it's turning out to be more difficult. First, I ensured that the docker image had libkqueue-dev installed during the build process. (For now I've listed it in debian/control.in as a build dependency.) I can verify that the libkqueue-dev package is installed, but when the build runs ./configure, the configure script detects kqueue support as "no". I found that if I run the configure script manually with the LIBS environment variable set to "-lkqueue", then configure is able to detect kqueue support as "yes". I looked at how configure.ac is set up to look for kqueue, and see that it's on line 1802 as a parameter to the AC_CHECK_FUNCS check. After looking up what that means (I'm new to autoconf), it looks like autoconf has been set up to check for kqueue within existing libraries, but not try to load the libkqueue library before running that check. So, I added a block starting at line 1046: dnl # dnl # Check for -lkqueue dnl # This library may be needed for kqueue. dnl # AC_SEARCH_LIBS([kqueue], [kqueue]) However, my attempts at running autoconf to regenerate the configure file have all failed with lots of warnings or errors. What's the correct way to run autoconf for the FreeRADIUS source tree? Cheers, --Mark
On 17/10/2024 16:42, Mark Donnelly wrote:
However, my attempts at running autoconf to regenerate the configure file have all failed with lots of warnings or errors. What's the correct way to run autoconf for the FreeRADIUS source tree?
There's a make target for this make configure will re-build any "configure" files as needed from any changed configure.ac files Nick -- Nick Porter
On Oct 17, 2024, at 11:42 AM, Mark Donnelly <mark@PAINLESS-SECURITY.COM> wrote:
First, I ensured that the docker image had libkqueue-dev installed during the build process. (For now I've listed it in debian/control.in as a build dependency.) I can verify that the libkqueue-dev package is installed, but when the build runs ./configure, the configure script detects kqueue support as "no".
The default build for Linux is to use select(). For *BSD, kqueue is the default. I'd prefer to not change that default.
I found that if I run the configure script manually with the LIBS environment variable set to "-lkqueue", then configure is able to detect kqueue support as "yes".
That is the best way to selectively enable libkqueue on Linux.
I looked at how configure.ac is set up to look for kqueue, and see that it's on line 1802 as a parameter to the AC_CHECK_FUNCS check. After looking up what that means (I'm new to autoconf), it looks like autoconf has been set up to check for kqueue within existing libraries, but not try to load the libkqueue library before running that check. So, I added a block starting at line 1046:
dnl # dnl # Check for -lkqueue dnl # This library may be needed for kqueue. dnl # AC_SEARCH_LIBS([kqueue], [kqueue])
Unfortunately, that changes the defaults for everyone. So that change won't go in. Maybe we can add a configure flag --with-libkqueue ?
However, my attempts at running autoconf to regenerate the configure file have all failed with lots of warnings or errors. What's the correct way to run autoconf for the FreeRADIUS source tree?
$ make reconfig Alan DeKok.
participants (3)
-
Alan DeKok -
Mark Donnelly -
Nick Porter