Provide ares_nameser.h as a public interface (#417)

NodeJS needs ares_nameser.h as a pubic header.

Fixes: #415
Fix By: Felix Yan (@felixonmars)
pull/419/head
Felix Yan 3 years ago committed by GitHub
parent 9c4c483f06
commit 7712fcd178
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      CMakeLists.txt
  2. 14
      configure.ac
  3. 2
      include/CMakeLists.txt
  4. 2
      include/Makefile.am
  5. 2
      include/ares_build.h.cmake
  6. 3
      include/ares_build.h.in
  7. 10
      include/ares_nameser.h
  8. 1
      src/lib/Makefile.inc

@ -557,6 +557,12 @@ ENDIF()
IF (HAVE_WINDOWS_H) IF (HAVE_WINDOWS_H)
SET (CARES_HAVE_WINDOWS_H 1) SET (CARES_HAVE_WINDOWS_H 1)
ENDIF() ENDIF()
IF (HAVE_ARPA_NAMESER_H)
SET (CARES_HAVE_ARPA_NAMESER_H 1)
ENDIF()
IF (HAVE_ARPA_NAMESER_COMPAT_H)
SET (CARES_HAVE_ARPA_NAMESER_COMPAT_H 1)
ENDIF()
# Record toplevel CMakeLists.txt path # Record toplevel CMakeLists.txt path
set(CARES_TOPLEVEL_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(CARES_TOPLEVEL_DIR "${CMAKE_CURRENT_SOURCE_DIR}")

@ -547,6 +547,20 @@ dnl *Sigh* these are needed in order for net/if.h to get properly detected.
] ]
) )
dnl Test and set CARES_HAVE_ARPA_NAMESER_H / CARES_HAVE_ARPA_NAMESER_COMPAT_H
AC_CHECK_DECL([HAVE_ARPA_NAMESER_H],
[
CARES_DEFINE_UNQUOTED([CARES_HAVE_ARPA_NAMESER_H])
],
[]
)
AC_CHECK_DECL([HAVE_ARPA_NAMESER_COMPAT_H],
[
CARES_DEFINE_UNQUOTED([CARES_HAVE_ARPA_NAMESER_COMPAT_H])
],
[]
)
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
AC_TYPE_SIZE_T AC_TYPE_SIZE_T

@ -3,6 +3,6 @@ CONFIGURE_FILE (ares_build.h.cmake ${PROJECT_BINARY_DIR}/ares_build.h)
# Headers installation target # Headers installation target
IF (CARES_INSTALL) IF (CARES_INSTALL)
SET (CARES_HEADERS ares.h ares_version.h "${PROJECT_BINARY_DIR}/ares_build.h" ares_rules.h ares_dns.h) SET (CARES_HEADERS ares.h ares_version.h "${PROJECT_BINARY_DIR}/ares_build.h" ares_rules.h ares_dns.h ares_nameser.h)
INSTALL (FILES ${CARES_HEADERS} COMPONENT Devel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) INSTALL (FILES ${CARES_HEADERS} COMPONENT Devel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
ENDIF () ENDIF ()

@ -2,6 +2,6 @@ AUTOMAKE_OPTIONS = foreign nostdinc 1.9.6
ACLOCAL_AMFLAGS = -I m4 --install ACLOCAL_AMFLAGS = -I m4 --install
# what headers to install on 'make install': # what headers to install on 'make install':
include_HEADERS = ares.h ares_version.h ares_build.h ares_rules.h ares_dns.h include_HEADERS = ares.h ares_version.h ares_build.h ares_rules.h ares_dns.h ares_nameser.h
EXTRA_DIST = ares_build.h.cmake ares_build.h.in ares_build.h.dist CMakeLists.txt EXTRA_DIST = ares_build.h.cmake ares_build.h.in ares_build.h.dist CMakeLists.txt

@ -13,6 +13,8 @@
#cmakedefine CARES_HAVE_WS2TCPIP_H #cmakedefine CARES_HAVE_WS2TCPIP_H
#cmakedefine CARES_HAVE_WINSOCK2_H #cmakedefine CARES_HAVE_WINSOCK2_H
#cmakedefine CARES_HAVE_WINDOWS_H #cmakedefine CARES_HAVE_WINDOWS_H
#cmakedefine CARES_HAVE_ARPA_NAMESER_H
#cmakedefine CARES_HAVE_ARPA_NAMESER_COMPAT_H
#ifdef CARES_HAVE_SYS_TYPES_H #ifdef CARES_HAVE_SYS_TYPES_H
# include <sys/types.h> # include <sys/types.h>

@ -55,6 +55,9 @@
Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
#endif #endif
#undef CARES_HAVE_ARPA_NAMESER_H
#undef CARES_HAVE_ARPA_NAMESER_COMPAT_H
/* ================================================================ */ /* ================================================================ */
/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */ /* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
/* ================================================================ */ /* ================================================================ */

@ -2,10 +2,12 @@
#ifndef ARES_NAMESER_H #ifndef ARES_NAMESER_H
#define ARES_NAMESER_H #define ARES_NAMESER_H
#ifdef HAVE_ARPA_NAMESER_H #include "ares_build.h"
#ifdef CARES_HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h> # include <arpa/nameser.h>
#endif #endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H #ifdef CARES_HAVE_ARPA_NAMESER_COMPAT_H
# include <arpa/nameser_compat.h> # include <arpa/nameser_compat.h>
#endif #endif
@ -68,7 +70,7 @@
* provide them * provide them
* ============================================================================ * ============================================================================
*/ */
#ifndef HAVE_ARPA_NAMESER_H #ifndef CARES_HAVE_ARPA_NAMESER_H
typedef enum __ns_class { typedef enum __ns_class {
ns_c_invalid = 0, /* Cookie. */ ns_c_invalid = 0, /* Cookie. */
@ -173,7 +175,7 @@ typedef enum __ns_rcode {
ns_r_badtime = 18 ns_r_badtime = 18
} ns_rcode; } ns_rcode;
#endif /* HAVE_ARPA_NAMESER_H */ #endif /* CARES_HAVE_ARPA_NAMESER_H */
/* ============================================================================ /* ============================================================================

@ -73,7 +73,6 @@ HHEADERS = ares_android.h \
ares_strsplit.h \ ares_strsplit.h \
ares_writev.h \ ares_writev.h \
bitncmp.h \ bitncmp.h \
ares_nameser.h \
ares_setup.h \ ares_setup.h \
setup_once.h setup_once.h

Loading…
Cancel
Save