mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-18 03:26:48 +00:00
Fix some building issues
This commit is contained in:
@@ -11,6 +11,7 @@ m4/ltsugar.m4
|
||||
m4/ltversion.m4
|
||||
m4/lt~obsolete.m4
|
||||
src/Makefile.in
|
||||
src/config.h
|
||||
|
||||
# Ignore files generated by configure
|
||||
build/
|
||||
|
||||
+16
-6
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set(PROJECT_NAME shadowsocks-libev)
|
||||
set(RELEASE_DATE 2017-2-17)
|
||||
@@ -8,9 +8,7 @@ set(PROJECT_URL "https://shadowsocks.org")
|
||||
set(PROJECT_ISSUES_URL "https://github.com/shadowsocks/shadowsocks-libev")
|
||||
project(${PROJECT_NAME})
|
||||
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -c")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
|
||||
#set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/out)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
@@ -51,6 +49,8 @@ install(FILES
|
||||
# We need libcork,libipset headers
|
||||
include_directories(libcork/include)
|
||||
include_directories(libipset/include)
|
||||
include_directories(libbloom/murmur2)
|
||||
include_directories(libbloom)
|
||||
|
||||
set(LIBCORK_SOURCE
|
||||
libcork/src/libcork/cli/commands.c
|
||||
@@ -111,11 +111,21 @@ set(LIBIPSET_SOURCE
|
||||
)
|
||||
|
||||
add_library(ipset STATIC ${LIBIPSET_SOURCE})
|
||||
target_link_libraries(ipset cork)
|
||||
|
||||
add_library(ipset-shared SHARED ${LIBIPSET_SOURCE})
|
||||
target_link_libraries(ipset-shared cork-shared)
|
||||
set_target_properties(ipset-shared PROPERTIES OUTPUT_NAME ipset)
|
||||
|
||||
set(LIBBLOOM_SOURCE
|
||||
libbloom/bloom.c
|
||||
libbloom/murmur2/MurmurHash2.c
|
||||
)
|
||||
|
||||
add_library(bloom STATIC ${LIBBLOOM_SOURCE})
|
||||
target_link_libraries(ipset cork bloom)
|
||||
|
||||
add_library(bloom-shared SHARED ${LIBBLOOM_SOURCE})
|
||||
target_link_libraries(ipset-shared cork-shared bloom-shared)
|
||||
set_target_properties(bloom-shared PROPERTIES OUTPUT_NAME bloom)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
|
||||
+1
-15
@@ -275,20 +275,6 @@
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#cmakedefine pid_t @pid_t@
|
||||
|
||||
/* Define to the equivalent of the C99 'restrict' keyword, or to
|
||||
nothing if this is not supported. Do not define if restrict is
|
||||
supported directly. */
|
||||
#cmakedefine restrict @restrict@
|
||||
/* Work around a bug in Sun C++: it does not support _Restrict or
|
||||
__restrict__, even though the corresponding Sun C compiler ends up with
|
||||
"#define restrict _Restrict" or "#define restrict __restrict__" in the
|
||||
previous line. Perhaps some future version of Sun C++ will work with
|
||||
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
|
||||
#if defined __SUNPRO_CC && !defined __RESTRICT
|
||||
# define _Restrict
|
||||
# define __restrict__
|
||||
#endif
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#cmakedefine size_t unsigned int
|
||||
|
||||
@@ -306,4 +292,4 @@
|
||||
/* Define as `fork' if `vfork' does not work. */
|
||||
#cmakedefine vfork
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-10
@@ -149,15 +149,6 @@ set(VERSION ${PACKAGE_VERSION})
|
||||
# TODO Assume we got inline support
|
||||
# https://cmake.org/Wiki/CMakeTestInline
|
||||
|
||||
# Define to the equivalent of the C99 'restrict' keyword, or to
|
||||
# nothing if this is not supported. Do not define if restrict is
|
||||
# supported directly.
|
||||
#define restrict __restrict
|
||||
if (NOT "c_restrict" IN_LIST CMAKE_C_COMPILE_FEATURES)
|
||||
message("No restrict")
|
||||
set(restrict __restrict)
|
||||
endif ()
|
||||
|
||||
# Define to `int' if <sys/types.h> does not define.
|
||||
# undef pid_t
|
||||
# Define to the type of an unsigned integer type of width exactly 16 bits if
|
||||
@@ -197,4 +188,4 @@ endif ()
|
||||
# Define as `fork' if `vfork' does not work.
|
||||
if (NOT HAVE_WORKING_VFORK)
|
||||
set(vfork fork)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
+9
-12
@@ -24,6 +24,7 @@ set(SS_PLUGIN_SOURCE
|
||||
)
|
||||
|
||||
set(SS_SHARED_SOURCES
|
||||
ppbloom.c
|
||||
utils.c
|
||||
jconf.c
|
||||
json.c
|
||||
@@ -96,8 +97,11 @@ find_library(LIBEV_SHARED ev)
|
||||
find_library(LIBUDNS_SHARED udns)
|
||||
find_library(LIBPCRE_SHARED pcre)
|
||||
|
||||
list(APPEND DEPS ${LIBEV} ${LIBUDNS} ${LIBPCRE} ${LIBSODIUM} ${LIBMBEDTLS} ${LIBMBEDCRYPTO})
|
||||
list(APPEND DEPS_SHARED ${LIBEV_SHARED} ${LIBUDNS_SHARED} ${LIBPCRE_SHARED} ${LIBSODIUM_SHARED} ${LIBMBEDTLS_SHARED} ${LIBMBEDCRYPTO_SHARED})
|
||||
list(APPEND DEPS bloom m ${LIBEV} ${LIBUDNS} ${LIBPCRE} ${LIBSODIUM} ${LIBMBEDTLS} ${LIBMBEDCRYPTO})
|
||||
list(APPEND DEPS_SHARED bloom-shared m ${LIBEV_SHARED} ${LIBUDNS_SHARED} ${LIBPCRE_SHARED} ${LIBSODIUM_SHARED}
|
||||
${LIBMBEDTLS_SHARED} ${LIBMBEDCRYPTO_SHARED})
|
||||
|
||||
find_package (Threads)
|
||||
|
||||
# Add our targets
|
||||
add_executable(ss-server ${SS_SERVER_SOURCE})
|
||||
@@ -121,7 +125,7 @@ target_compile_definitions(shadowsocks-libev PUBLIC -DMODULE_LOCAL)
|
||||
|
||||
target_link_libraries(ss-server cork ipset ${DEPS})
|
||||
target_link_libraries(ss-tunnel cork ${DEPS})
|
||||
target_link_libraries(ss-manager cork ${LIBEV} ${LIBUDNS})
|
||||
target_link_libraries(ss-manager m bloom cork ${LIBEV} ${LIBUDNS})
|
||||
target_link_libraries(ss-local cork ipset ${DEPS})
|
||||
target_link_libraries(ss-redir cork ipset ${DEPS})
|
||||
target_link_libraries(shadowsocks-libev cork ipset ${DEPS})
|
||||
@@ -148,12 +152,11 @@ target_compile_definitions(shadowsocks-libev-shared PUBLIC -DMODULE_LOCAL)
|
||||
|
||||
target_link_libraries(ss-server-shared cork-shared ipset-shared ${DEPS_SHARED})
|
||||
target_link_libraries(ss-tunnel-shared cork-shared ${DEPS_SHARED})
|
||||
target_link_libraries(ss-manager-shared cork-shared ${LIBEV_SHARED} ${LIBUDNS_SHARED})
|
||||
target_link_libraries(ss-manager-shared m bloom-shared cork-shared ${CMAKE_THREAD_LIBS_INIT} ${LIBEV_SHARED} ${LIBUDNS_SHARED})
|
||||
target_link_libraries(ss-local-shared cork-shared ipset-shared ${DEPS_SHARED})
|
||||
target_link_libraries(ss-redir-shared cork-shared ipset-shared ${DEPS_SHARED})
|
||||
target_link_libraries(shadowsocks-libev-shared cork-shared ipset-shared ${DEPS_SHARED})
|
||||
|
||||
|
||||
set_target_properties(ss-server-shared PROPERTIES OUTPUT_NAME ss-server)
|
||||
set_target_properties(ss-tunnel-shared PROPERTIES OUTPUT_NAME ss-tunnel)
|
||||
set_target_properties(ss-manager-shared PROPERTIES OUTPUT_NAME ss-manager)
|
||||
@@ -170,12 +173,6 @@ target_compile_definitions(shadowsocks-libev-shared PUBLIC -DMODULE_LOCAL)
|
||||
target_link_libraries(shadowsocks-libev-shared cork-shared ipset-shared ${DEPS_SHARED})
|
||||
|
||||
|
||||
#install(DIRECTORY DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
#install(TARGETS ss-server RUNTIME DESTINATION bin)
|
||||
#install(TARGETS ss-tunnel RUNTIME DESTINATION bin)
|
||||
#install(TARGETS ss-manager RUNTIME DESTINATION bin)
|
||||
#install(TARGETS ss-local RUNTIME DESTINATION bin)
|
||||
|
||||
install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
DESTINATION bin
|
||||
FILES_MATCHING PATTERN "ss-*")
|
||||
@@ -185,4 +182,4 @@ add_custom_target(distclean
|
||||
COMMAND ${CMAKE_COMMAND} -E echo WARNING: distclean target is not functional
|
||||
COMMAND ${CMAKE_COMMAND} -E echo Use 'git clean -fdx' instead
|
||||
VERBATIM
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user