Browse Source

Fix cmake builds

pull/1813/merge
Max Lv 6 years ago
parent
commit
42b29fbb63
5 changed files with 12 additions and 6 deletions
  1. 3
      CMakeLists.txt
  2. 6
      cmake/config.h.cmake
  3. 5
      cmake/configure.cmake
  4. 2
      src/local.c
  5. 2
      src/netutils.h

3
CMakeLists.txt

@ -36,7 +36,8 @@ option(WITH_STATIC "build with static libraries." ON)
# Run platform tests
include(${CMAKE_SOURCE_DIR}/cmake/configure.cmake)
configure_file(${CMAKE_SOURCE_DIR}/cmake/config.h.cmake ${CMAKE_SOURCE_DIR}/src/config.h)
configure_file(${CMAKE_SOURCE_DIR}/cmake/config.h.cmake ${CMAKE_BINARY_DIR}/src/config.h)
add_definitions(-I$(CMAKE_BINARY_DIR)/src)
add_definitions(-DHAVE_CONFIG_H)
# pkg-config

6
cmake/config.h.cmake

@ -53,6 +53,12 @@
/* Define to 1 if you have the <linux/if.h> header file. */
#cmakedefine HAVE_LINUX_IF_H 1
/* Define to 1 if you have the <linux/tcp.h> header file. */
#cmakedefine HAVE_LINUX_TCP_H
/* Define to 1 if you have the <netinet/tcp.h> header file. */
#cmakedefine HAVE_NETINET_TCP_H
/* Define to 1 if you have the <linux/netfilter_ipv4.h> header file. */
#cmakedefine HAVE_LINUX_NETFILTER_IPV4_H 1

5
cmake/configure.cmake

@ -43,6 +43,8 @@ check_function_exists(memset HAVE_MEMSET)
check_include_files(netdb.h HAVE_NETDB_H)
check_include_files(netinet/in.h HAVE_NETINET_IN_H)
check_include_files(netinet/tcp.h HAVE_NETINET_TCP_H)
check_include_files(linux/tcp.h HAVE_LINUX_TCP_H)
check_include_files(net/if.h HAVE_NET_IF_H)
check_include_files(pcre.h HAVE_PCRE_H)
check_include_files(pcre/pcre.h HAVE_PCRE_PCRE_H)
@ -87,8 +89,7 @@ set(NDEBUG 1)
set(PACKAGE ${PROJECT_NAME})
set(PACKAGE_BUGREPORT max.c.lv@gmail.com)
set(PACKAGE_NAME ${PROJECT_NAME})
#set(PACKAGE_VERSION ${PROJECT_VERSION})
set(PACKAGE_VERSION 3.0.2)
set(PACKAGE_VERSION ${PROJECT_VERSION})
set(PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME ${PROJECT_NAME})
set(PACKAGE_URL "")

2
src/local.c

@ -38,10 +38,8 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <pthread.h>
#ifdef LIB_ONLY
#include <pthread.h>
#include "shadowsocks.h"
#endif

2
src/netutils.h

@ -25,7 +25,7 @@
#include <sys/socket.h>
#if HAVE_LINUX_TCP_H
#ifdef HAVE_LINUX_TCP_H
#include <linux/tcp.h>
#elif defined(HAVE_NETINET_TCP_H)
#include <netinet/tcp.h>

Loading…
Cancel
Save