NLnetLabs / unbound

Unbound is a validating, recursive, and caching DNS resolver.
https://nlnetlabs.nl/unbound
BSD 3-Clause "New" or "Revised" License
3.04k stars 348 forks source link

Issue with flag --enable-systemd #1084

Closed Krophil closed 3 months ago

Krophil commented 3 months ago

Hi, I am trying to build from source in Debian but did not manage to get it because of some weird error.

Describe the bug When I try to use ./configure --enable-systemd in freshly new repo, it returns me an error about systemd not found :

checking for SYSTEMD... no
checking for SYSTEMD_DAEMON... no
configure: error: systemd enabled but libsystemd not

To reproduce Steps to reproduce the behavior:

  1. Install libsystemd-dev build-essential libssl-dev libexpat1-dev bison flex
  2. Run ./configure --enable-systemd
  3. Output:
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking how to run the C preprocessor... gcc -E
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking minix/config.h usability... no
    checking minix/config.h presence... no
    checking for minix/config.h... no
    checking whether it is safe to define __EXTENSIONS__... yes
    checking for an ANSI C-conforming const... yes
    checking whether gcc supports -g... yes
    checking whether gcc supports -O2... yes
    checking for gcc option to accept ISO C99... none needed
    checking for gcc option to accept ISO Standard C... (cached) none needed
    checking gcc dependency flag... -MM
    checking whether gcc supports -Werror... yes
    checking whether gcc supports -Wall... yes
    checking whether gcc supports -std=c99... yes
    checking whether gcc supports -xc99... no
    checking for getopt.h... yes
    checking for time.h... yes
    checking whether we need -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE as a flag for gcc... failed
    checking whether we need -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE as a flag for gcc... failed
    checking whether we need -std=c99 as a flag for gcc... no
    checking whether we need -D_BSD_SOURCE -D_DEFAULT_SOURCE as a flag for gcc... no
    checking whether we need -D_GNU_SOURCE as a flag for gcc... yes
    checking whether we need -D_GNU_SOURCE -D_FRSRESGID as a flag for gcc... no
    checking whether we need -D_POSIX_C_SOURCE=200112 as a flag for gcc... no
    checking whether we need -D__EXTENSIONS__ as a flag for gcc... failed
    checking if gcc supports -flto... yes
    checking for inline... inline
    checking whether the C compiler (gcc) accepts the "format" attribute... yes
    checking whether the C compiler (gcc) accepts the "unused" attribute... yes
    checking whether the C compiler (gcc) accepts the "weak" attribute... yes
    checking whether the C compiler (gcc) accepts the "noreturn" attribute... yes
    checking for flex... flex
    checking lex output file root... lex.yy
    checking lex library... -lfl
    checking whether yytext is a pointer... yes
    checking for yylex_destroy... yes
    checking for lex %option... yes
    checking for bison... bison -y
    checking for doxygen... no
    checking for strip... strip
    checking build system type... aarch64-unknown-linux-gnu
    checking host system type... aarch64-unknown-linux-gnu
    checking for ar... /usr/bin/ar
    checking how to print strings... printf
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for fgrep... /usr/bin/grep -F
    checking for ld used by gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 1572864
    checking how to convert aarch64-unknown-linux-gnu file names to aarch64-unknown-linux-gnu format... func_convert_file_noop
    checking how to convert aarch64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
    checking for /usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for archiver @FILE support... @
    checking for strip... (cached) strip
    checking for ranlib... ranlib
    checking for gawk... gawk
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for a working dd... /usr/bin/dd
    checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
    checking for mt... mt
    checking if mt is a manifest tool... no
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -fPIC -DPIC
    checking if gcc PIC flag -fPIC -DPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking for pkg-config... no
    checking for stdarg.h... yes
    checking for stdbool.h... yes
    checking for netinet/in.h... yes
    checking for netinet/tcp.h... yes
    checking for sys/param.h... yes
    checking for sys/select.h... yes
    checking for sys/socket.h... yes
    checking for sys/un.h... yes
    checking for sys/uio.h... yes
    checking for sys/resource.h... yes
    checking for arpa/inet.h... yes
    checking for syslog.h... yes
    checking for netdb.h... yes
    checking for sys/wait.h... yes
    checking for pwd.h... yes
    checking for glob.h... yes
    checking for grp.h... yes
    checking for login_cap.h... no
    checking for winsock2.h... no
    checking for ws2tcpip.h... no
    checking for endian.h... yes
    checking for sys/endian.h... no
    checking for libkern/OSByteOrder.h... no
    checking for sys/ipc.h... yes
    checking for sys/shm.h... yes
    checking for ifaddrs.h... yes
    checking for poll.h... yes
    checking for net/if.h... yes
    checking for TargetConditionals.h... no
    checking for netioapi.h... no
    checking for linux/net_tstamp.h... yes
    checking for int8_t... yes
    checking for int16_t... yes
    checking for int32_t... yes
    checking for int64_t... yes
    checking for uint8_t... yes
    checking for uint16_t... yes
    checking for uint32_t... yes
    checking for uint64_t... yes
    checking for size_t... yes
    checking for ssize_t... yes
    checking for uid_t in sys/types.h... yes
    checking for pid_t... yes
    checking for off_t... yes
    checking for u_char... yes
    checking for rlim_t... yes
    checking for socklen_t... yes
    checking for in_addr_t... yes
    checking for in_port_t... yes
    checking if memcmp compares unsigned... yes
    checking size of time_t... 8
    checking size of size_t... 8
    checking for library containing inet_pton... none required
    checking for library containing socket... none required
    checking for unistd.h... (cached) yes
    checking for working chown... yes
    checking vfork.h usability... no
    checking vfork.h presence... no
    checking for vfork.h... no
    checking for fork... yes
    checking for vfork... yes
    checking for working fork... yes
    checking for working vfork... (cached) yes
    checking for _LARGEFILE_SOURCE value needed for large files... no
    checking for special C compiler options needed for large files... no
    checking for _FILE_OFFSET_BITS value needed for large files... no
    checking whether we need -D_LARGEFILE_SOURCE=1 as a flag for gcc... no
    checking if nonblocking sockets work... yes
    checking whether mkdir has one arg... no
    checking for strptime... yes
    checking whether strptime works... yes
    checking for SYSTEMD... no
    checking for SYSTEMD_DAEMON... no
    configure: error: systemd enabled but libsystemd not found

Expected behavior It should build without returning this error as libsystemd-dev is installed

System:

Additional information I use a virtual machine so it may differ from usual. The arch is aarch64-linux-gnu.

Thank you for your help

wcawijngaards commented 3 months ago

In the log output I see that checking for pkg-config... no. The solution is to install pkg-config. Then the configure script can use that to find systemd.

Krophil commented 3 months ago

Thanks! This worked! PS: I had another issue with python missing, solved by adding "--with-python PYTHON_VERSION=3.11"