aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/c-ares
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-08-25 13:23:13 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-08-25 13:23:13 -0700
commit8076d2b6edbda02b7ff4a8aa946d01c40b0ee29b (patch)
tree268a1ea1fbead2f7f0e409471134bfb69735a78a /src/c-ares
parent925b688bb5a3e0d180ebace9b99ccfb440e30ee0 (diff)
Build c-ares with cmake
Diffstat (limited to 'src/c-ares')
-rw-r--r--src/c-ares/CMakeLists.txt15
-rw-r--r--src/c-ares/config_linux/ares_config.h8
2 files changed, 19 insertions, 4 deletions
diff --git a/src/c-ares/CMakeLists.txt b/src/c-ares/CMakeLists.txt
new file mode 100644
index 0000000000..87c86fa045
--- /dev/null
+++ b/src/c-ares/CMakeLists.txt
@@ -0,0 +1,15 @@
+string(TOLOWER ${CMAKE_SYSTEM_NAME} cares_system_name)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../third_party/c-ares)
+
+if(${cares_system_name} MATCHES windows)
+ add_definitions(-DCARES_STATICLIB=1)
+ add_definitions(-DWIN32_LEAN_AND_MEAN=1)
+else()
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/config_${cares_system_name})
+ add_definitions(-DHAVE_CONFIG_H=1)
+endif()
+
+file(GLOB lib_sources ../../third_party/c-ares/*.c)
+add_library(cares ${lib_sources})
diff --git a/src/c-ares/config_linux/ares_config.h b/src/c-ares/config_linux/ares_config.h
index 8296bb7b17..265974cfae 100644
--- a/src/c-ares/config_linux/ares_config.h
+++ b/src/c-ares/config_linux/ares_config.h
@@ -352,7 +352,7 @@
/* #undef NEED_THREAD_SAFE */
/* cpu-machine-OS */
-#define OS "x86_64-unknown-linux-gnu"
+#define OS "i386-unknown-linux-gnu"
/* Name of package */
#define PACKAGE "c-ares"
@@ -451,13 +451,13 @@
#define SIZEOF_INT 4
/* The size of `long', as computed by sizeof. */
-#define SIZEOF_LONG 8
+#define SIZEOF_LONG 4
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* The size of `size_t', as computed by sizeof. */
-#define SIZEOF_SIZE_T 8
+#define SIZEOF_SIZE_T 4
/* The size of `struct in6_addr', as computed by sizeof. */
#define SIZEOF_STRUCT_IN6_ADDR 16
@@ -466,7 +466,7 @@
#define SIZEOF_STRUCT_IN_ADDR 4
/* The size of `time_t', as computed by sizeof. */
-#define SIZEOF_TIME_T 8
+#define SIZEOF_TIME_T 4
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1