Skip to content

configure.ac: include prerequisite headers before checking for res_ninit()#297

Open
thegushi wants to merge 1 commit into
trusteddomainproject:developfrom
thegushi:fix-resolv-configure
Open

configure.ac: include prerequisite headers before checking for res_ninit()#297
thegushi wants to merge 1 commit into
trusteddomainproject:developfrom
thegushi:fix-resolv-configure

Conversation

@thegushi
Copy link
Copy Markdown
Collaborator

Fixes #203. Based on PR #204 by @futatuki.

On FreeBSD 14 (and other non-glibc platforms), resolv.h requires sys/types.h, netinet/in.h, arpa/nameser.h, and netdb.h to be included first. The configure check for res_ninit() was including only resolv.h, so the compile test failed and res_ninit() went undetected on these platforms.

Changes:

  • Move AC_HEADER_RESOLV to before the res_ninit check (it was previously called after)
  • Add the prerequisite headers to the test program, guarded by their HAVE_* defines
  • Add bind as a fallback library in AC_SEARCH_LIBS (needed on some BSDs where resolver functions live in -lbind)
  • Add configure to .gitignore — it is a generated file and should not be tracked

Note: configure was not regenerated here as autoreconf is failing on the macOS build environment due to a pre-existing issue unrelated to this change. The configure script will need to be regenerated on a Linux host before merging (or as part of the release process via HowToRelease).

…nit()

On FreeBSD (and other non-glibc platforms), resolv.h requires sys/types.h,
netinet/in.h, arpa/nameser.h, and netdb.h to be included first. The
configure check for res_ninit() was including only resolv.h, causing the
compile test to fail and res_ninit() to go undetected.

Fix by calling AC_HEADER_RESOLV before the res_ninit check (moving it
from its previous location after the check), and including the prerequisite
headers in the test program.

Also add 'bind' as a fallback library in AC_SEARCH_LIBS, needed on some BSDs.

Also add 'configure' to .gitignore -- it is a generated file and should
not be tracked.

Based on PR trusteddomainproject#204 by futatuki. Fixes trusteddomainproject#203.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-testing Flags things that have been fixed in develop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant