diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-10-20 23:10:09 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-10-20 23:10:09 +0200 |
commit | 11bca5a7af4b448ee0a37cd243e34ecd0e652b3d (patch) | |
tree | 04a51ccec3f2db4d16591698c76c4c56b893ec1b | |
parent | 64d0bef9efd4a82b7a132b490328c80e67431041 (diff) | |
download | fastd-11bca5a7af4b448ee0a37cd243e34ecd0e652b3d.tar fastd-11bca5a7af4b448ee0a37cd243e34ecd0e652b3d.zip |
Improve include_directories to prevent conflicts between system and fastd headers
In in-tree builds, fastd's poll.h was conflicting with the system one on
non-Linux systems.
-rw-r--r-- | cmake/config.cmake | 2 | ||||
-rw-r--r-- | cmake/generate_version.cmake | 3 | ||||
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/build.h.in (renamed from src/fastd_config.h.in) | 0 | ||||
-rw-r--r-- | src/compat.h | 2 | ||||
-rw-r--r-- | src/config.c | 2 | ||||
-rw-r--r-- | src/fastd.c | 2 | ||||
-rw-r--r-- | src/handshake.c | 2 | ||||
-rw-r--r-- | src/lex.h | 2 | ||||
-rw-r--r-- | src/options.c | 2 |
10 files changed, 12 insertions, 11 deletions
diff --git a/cmake/config.cmake b/cmake/config.cmake index 049304f..9ddf5bf 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -12,7 +12,7 @@ endif() set(USE_BINDTODEVICE ${LINUX}) -set(USE_EPOLL ${LINUX}) +set(USE_EPOLL FALSE) set(USE_FREEBIND ${LINUX}) set(USE_PMTU ${LINUX}) set(USE_PKTINFO ${LINUX}) diff --git a/cmake/generate_version.cmake b/cmake/generate_version.cmake index 3830800..104e49c 100644 --- a/cmake/generate_version.cmake +++ b/cmake/generate_version.cmake @@ -1,7 +1,8 @@ -set(VERSION_FILE "${FASTD_BINARY_DIR}/src/fastd_version.h") +set(VERSION_FILE "${FASTD_BINARY_DIR}/gen/generated/version.h") add_custom_target( version + COMMAND mkdir -p "${FASTD_BINARY_DIR}/gen/generated" COMMAND echo "#pragma once" > "${VERSION_FILE}.new" COMMAND sh -c "echo \"#define FASTD_VERSION \\\"$(git --git-dir=./.git describe --dirty 2>/dev/null || echo ${FASTD_VERSION})\\\"\"" >> "${VERSION_FILE}.new" COMMAND cmp -s "${VERSION_FILE}" "${VERSION_FILE}.new" && rm "${VERSION_FILE}.new" || mv "${VERSION_FILE}.new" "${VERSION_FILE}" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 20813ce..086e23d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,7 @@ set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE __APPLE_USE_RFC_3542) set(FASTD_CFLAGS "${PTHREAD_CFLAGS} -std=c99 ${LIBUECC_CFLAGS_OTHER} ${LIBNACL_CFLAGS_OTHER} ${JSON_C_CFLAGS_OTHER} ${CFLAGS_LTO} -Wall") -include_directories(${FASTD_SOURCE_DIR} ${FASTD_BINARY_DIR}/src) +include_directories(${FASTD_SOURCE_DIR} ${FASTD_BINARY_DIR}/gen) include(generate_version) @@ -12,9 +12,9 @@ add_subdirectory(methods) add_subdirectory(crypto) include(check_reqs) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fastd_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/fastd_config.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/build.h.in ${CMAKE_BINARY_DIR}/gen/generated/build.h) -BISON_TARGET(fastd_config_parse config.y ${CMAKE_CURRENT_BINARY_DIR}/config.yy.c) +BISON_TARGET(fastd_config_parse config.y ${CMAKE_BINARY_DIR}/gen/generated/config.yy.c) add_executable(fastd android.c diff --git a/src/fastd_config.h.in b/src/build.h.in index 5f9c868..5f9c868 100644 --- a/src/fastd_config.h.in +++ b/src/build.h.in diff --git a/src/compat.h b/src/compat.h index 29c9253..620bf33 100644 --- a/src/compat.h +++ b/src/compat.h @@ -32,7 +32,7 @@ #pragma once -#include <fastd_config.h> +#include <generated/build.h> #include <stdint.h> #include <time.h> diff --git a/src/config.c b/src/config.c index 64ee12a..a2a5e8a 100644 --- a/src/config.c +++ b/src/config.c @@ -41,7 +41,7 @@ #include "method.h" #include "peer.h" #include "peer_group.h" -#include <config.yy.h> +#include <generated/config.yy.h> #include <dirent.h> #include <grp.h> diff --git a/src/fastd.c b/src/fastd.c index fbeffe5..3d5b3d4 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -42,7 +42,7 @@ #include "peer_group.h" #include "peer_hashtable.h" #include "poll.h" -#include <fastd_version.h> +#include <generated/version.h> #include <grp.h> #include <signal.h> diff --git a/src/handshake.c b/src/handshake.c index 2c50c0e..3d94c12 100644 --- a/src/handshake.c +++ b/src/handshake.c @@ -34,7 +34,7 @@ #include "method.h" #include "peer.h" #include "peer_group.h" -#include <fastd_version.h> +#include <generated/version.h> /** Human-readable names for the TLV record types */ @@ -33,7 +33,7 @@ #pragma once #include "types.h" -#include <config.yy.h> +#include <generated/config.yy.h> #include <stdio.h> diff --git a/src/options.c b/src/options.c index 17a6abb..ff73923 100644 --- a/src/options.c +++ b/src/options.c @@ -51,7 +51,7 @@ #include "config.h" #include "peer.h" #include "peer_group.h" -#include <fastd_version.h> +#include <generated/version.h> #include <arpa/inet.h> |