File: CheckNameserCompat.cmake

package info (click to toggle)
broccoli-python 0.62-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 460 kB
  • ctags: 105
  • sloc: python: 407; sh: 202; makefile: 21
file content (25 lines) | stat: -rw-r--r-- 752 bytes parent folder | download | duplicates (22)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
include(CheckCSourceCompiles)

# Check whether the namser compatibility header is required
# This can be the case on the Darwin platform

set(CMAKE_REQUIRED_INCLUDES ${BIND_INCLUDE_DIR})

check_c_source_compiles("
    #include <arpa/nameser.h>
    int main() { HEADER *hdr; int d = NS_IN6ADDRSZ; return 0; }"
    have_nameser_header)

if (NOT have_nameser_header)
    check_c_source_compiles("
        #include <arpa/nameser.h>
        #include <arpa/nameser_compat.h>
        int main() { HEADER *hdr; int d = NS_IN6ADDRSZ; return 0; }"
        NEED_NAMESER_COMPAT_H)
    if (NOT NEED_NAMESER_COMPAT_H)
        message(FATAL_ERROR
            "Asynchronous DNS support compatibility check failed.")
    endif ()
endif ()

set(CMAKE_REQUIRED_INCLUDES)