diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a41cf4f7..239b80ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ .ubuntu: &ubuntu_def variables: - CMAKE_VERSION: 3.12.1 + CMAKE_VERSION: 3.9.6 before_script: - REPOSITORY="$PWD" && cd .. - apt-get update && apt-get install -y dpkg-dev wget g++ gcc libncurses5-dev libreadline-dev libssl-dev make zlib1g-dev git file @@ -23,11 +23,7 @@ trusty: <<: *ubuntu_def image: ubuntu:trusty -# -# there's no cmake3 for 12.04 -# maybe, there's ppa ? -# -#precise: -# <<: *ubuntu_def -# image: ubuntu:precise +precise: + <<: *ubuntu_def + image: ubuntu:precise diff --git a/CMakeLists.txt b/CMakeLists.txt index eaa53315..e04ed733 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,9 @@ if (NOT ${PROJECT_VERSION} VERSION_EQUAL "${CurrentBuild_MAJOR}.${CurrentBuild_M message (FATAL_ERROR "PROJECT_VERSION does not match to src/CurrentBuild.txt") endif() +include(CheckIncludeFile) +Check_Include_File(sys/auxv.h HAVE_SYS_AUXV) + configure_file("${SoftEtherVPN_SOURCE_DIR}/AUTHORS.TXT" "${SoftEtherVPN_SOURCE_DIR}/src/bin/hamcore/authors.txt" COPYONLY) set(BUILD_DIRECTORY ${SoftEtherVPN_SOURCE_DIR}/build) diff --git a/src/Mayaqua/CMakeLists.txt b/src/Mayaqua/CMakeLists.txt index 1117f637..81ece532 100644 --- a/src/Mayaqua/CMakeLists.txt +++ b/src/Mayaqua/CMakeLists.txt @@ -19,11 +19,24 @@ find_package(ZLIB REQUIRED) # In some cases libiconv is not included in libc find_library(LIB_ICONV iconv) -add_subdirectory(cpu_features) +if(HAVE_SYS_AUXV) + add_subdirectory(cpu_features) +endif() target_include_directories(mayaqua PRIVATE cpu_features/include) -target_link_libraries(mayaqua cpu_features OpenSSL::SSL OpenSSL::Crypto Threads::Threads ZLIB::ZLIB) +target_link_libraries(mayaqua OpenSSL::SSL OpenSSL::Crypto Threads::Threads ZLIB::ZLIB) + +if(HAVE_SYS_AUXV) + target_link_libraries(mayaqua cpu_features) +else() + add_definitions(-DSKIP_CPU_FEATURES) +endif() + +find_library(LIB_RT rt) +if(LIB_RT) + target_link_libraries(mayaqua rt) +endif() if(LIB_ICONV) target_link_libraries(mayaqua ${LIB_ICONV}) diff --git a/src/Mayaqua/Encrypt.c b/src/Mayaqua/Encrypt.c index ca157a22..1c24cbbd 100644 --- a/src/Mayaqua/Encrypt.c +++ b/src/Mayaqua/Encrypt.c @@ -148,7 +148,11 @@ #ifdef _MSC_VER #include // For __cpuid() #else // _MSC_VER + +#ifndef SKIP_CPU_FEATURES #include "cpu_features_macros.h" +#endif + #if defined(CPU_FEATURES_ARCH_X86) #include "cpuinfo_x86.h" #elif defined(CPU_FEATURES_ARCH_ARM)