configure.ac: include prerequisite headers before checking for res_ninit()#297
Open
thegushi wants to merge 1 commit into
Open
configure.ac: include prerequisite headers before checking for res_ninit()#297thegushi wants to merge 1 commit into
thegushi wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #203. Based on PR #204 by @futatuki.
On FreeBSD 14 (and other non-glibc platforms),
resolv.hrequiressys/types.h,netinet/in.h,arpa/nameser.h, andnetdb.hto be included first. The configure check forres_ninit()was including onlyresolv.h, so the compile test failed andres_ninit()went undetected on these platforms.Changes:
AC_HEADER_RESOLVto before theres_ninitcheck (it was previously called after)HAVE_*definesbindas a fallback library inAC_SEARCH_LIBS(needed on some BSDs where resolver functions live in-lbind)configureto.gitignore— it is a generated file and should not be trackedNote:
configurewas not regenerated here asautoreconfis failing on the macOS build environment due to a pre-existing issue unrelated to this change. Theconfigurescript will need to be regenerated on a Linux host before merging (or as part of the release process viaHowToRelease).