mirror of
https://github.com/3proxy/3proxy.git
synced 2026-04-13 00:10:11 +08:00
Compare commits
6 Commits
ddd10746bc
...
9c44c2b7b4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c44c2b7b4 | ||
|
|
4e8ea2d7f0 | ||
|
|
82533b1a50 | ||
|
|
8c8ad7be6d | ||
|
|
d2c343fbbc | ||
|
|
b7f2254ee6 |
25
.github/workflows/c-cpp.yml
vendored
25
.github/workflows/c-cpp.yml
vendored
@ -50,12 +50,15 @@ jobs:
|
|||||||
- name: make clean MacOS
|
- name: make clean MacOS
|
||||||
if: ${{ startsWith(matrix.target, 'macos') }}
|
if: ${{ startsWith(matrix.target, 'macos') }}
|
||||||
run: make -f Makefile.FreeBSD clean
|
run: make -f Makefile.FreeBSD clean
|
||||||
|
- name: install Windows libraries
|
||||||
|
if: ${{ startsWith(matrix.target, 'windows') }}
|
||||||
|
run: vcpkg install pcre2:x64-windows && c:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-pcre2 mingw-w64-x86_64-openssl
|
||||||
- name: make Windows
|
- name: make Windows
|
||||||
if: ${{ startsWith(matrix.target, 'windows') }}
|
if: ${{ startsWith(matrix.target, 'windows') }}
|
||||||
run: make -f Makefile.win
|
run: make -f Makefile.win
|
||||||
env:
|
env:
|
||||||
LIBS: '-L "c:/program files/openssl/lib/VC/x64/MT"'
|
LDFLAGS: '-L "c:/msys64/mingw64/lib"'
|
||||||
CFLAGS: '-I "c:/program files/openssl/include"'
|
CFLAGS: '-I "c:/msys64/mingw64/include"'
|
||||||
- name: make clean Windows
|
- name: make clean Windows
|
||||||
if: ${{ startsWith(matrix.target, 'windows') }}
|
if: ${{ startsWith(matrix.target, 'windows') }}
|
||||||
run: make -f Makefile.win clean
|
run: make -f Makefile.win clean
|
||||||
@ -69,11 +72,21 @@ jobs:
|
|||||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
D:
|
D:
|
||||||
cd "D:/a/3proxy/3proxy"
|
cd "D:/a/3proxy/3proxy"
|
||||||
vcpkg install pcre2:x64-windows
|
|
||||||
mkdir bin64
|
mkdir bin64
|
||||||
set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib"
|
set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib"
|
||||||
|
set "INCLUDE=%INCLUDE%;c:/program files/openssl/include;c:/vcpkg/installed/x64-windows/include"
|
||||||
nmake /F Makefile.msvc64
|
nmake /F Makefile.msvc64
|
||||||
nmake /F Makefile.msvc64 clean
|
nmake /F Makefile.msvc64 clean
|
||||||
env:
|
- name: make with CMake POSIX
|
||||||
CFLAGS: '-I "c:/program files/openssl/include" -I "c:/vcpkg/installed/x64-windows/include"'
|
if: ${{ !startsWith(matrix.target, 'windows') }}
|
||||||
|
run: mkdir build && cd build && cmake .. && make
|
||||||
|
- name: make with CMake Win
|
||||||
|
if: ${{ startsWith(matrix.target, 'windows') }}
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
# set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib"
|
||||||
|
# set "INCLUDE=%INCLUDE%;c:/program files/openssl/include;c:/vcpkg/installed/x64-windows/include"
|
||||||
|
cmake -DCMAKE_C_COMPILER=clang ..
|
||||||
|
dir
|
||||||
|
make
|
||||||
|
|||||||
550
CMakeLists.txt
Normal file
550
CMakeLists.txt
Normal file
@ -0,0 +1,550 @@
|
|||||||
|
#
|
||||||
|
# 3proxy CMake build system
|
||||||
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
# Read version from RELEASE file
|
||||||
|
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/RELEASE" PROJECT_VERSION LIMIT_COUNT 1)
|
||||||
|
|
||||||
|
project(3proxy
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
|
LANGUAGES C
|
||||||
|
DESCRIPTION "3proxy - tiny free proxy server"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Include GNUInstallDirs for standard installation directories
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
# Add cmake module path
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
|
# Detect compiler
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
|
||||||
|
set(COMPILER_IS_CLANG TRUE)
|
||||||
|
if(WIN32 AND CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||||
|
set(COMPILER_IS_CLANG_CL TRUE)
|
||||||
|
else()
|
||||||
|
set(COMPILER_IS_CLANG_CL FALSE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(COMPILER_IS_CLANG FALSE)
|
||||||
|
set(COMPILER_IS_CLANG_CL FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
|
set(COMPILER_IS_GCC TRUE)
|
||||||
|
else()
|
||||||
|
set(COMPILER_IS_GCC FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC AND NOT COMPILER_IS_CLANG_CL)
|
||||||
|
set(COMPILER_IS_MSVC TRUE)
|
||||||
|
else()
|
||||||
|
set(COMPILER_IS_MSVC FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Options
|
||||||
|
option(3PROXY_BUILD_SHARED "Build shared libraries for plugins" ON)
|
||||||
|
option(3PROXY_USE_OPENSSL "Enable OpenSSL/SSLPlugin" ON)
|
||||||
|
option(3PROXY_USE_PCRE2 "Enable PCRE2/PCREPlugin" ON)
|
||||||
|
option(3PROXY_USE_PAM "Enable PAM/PamAuth" ON)
|
||||||
|
option(3PROXY_USE_ODBC "Enable ODBC support (Unix only, always ON on Windows)" OFF)
|
||||||
|
option(3PROXY_USE_SPLICE "Use Linux splice() for zero-copy (Linux only)" ON)
|
||||||
|
option(3PROXY_USE_POLL "Use poll() instead of select() (Unix only)" ON)
|
||||||
|
option(3PROXY_USE_WSAPOLL "Use WSAPoll instead of select() (Windows only)" ON)
|
||||||
|
option(3PROXY_USE_NETFILTER "Enable Linux netfilter support (Linux only)" ON)
|
||||||
|
|
||||||
|
# Output directory
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
|
|
||||||
|
# Find threads library (cross-platform pthread equivalent)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
|
# Set default build type if not specified
|
||||||
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Platform-independent position independent code for shared libraries
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
# Platform detection and configuration
|
||||||
|
if(WIN32)
|
||||||
|
# Windows-specific configuration
|
||||||
|
add_compile_definitions(
|
||||||
|
WIN32
|
||||||
|
_WIN32
|
||||||
|
_MBCS
|
||||||
|
_CONSOLE
|
||||||
|
PRINTF_INT64_MODIFIER="I64"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(COMPILER_IS_MSVC)
|
||||||
|
# MSVC-specific settings
|
||||||
|
add_compile_definitions(
|
||||||
|
MSVC
|
||||||
|
WITH_SSL
|
||||||
|
)
|
||||||
|
# Use static runtime library
|
||||||
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
|
# MSVC compiler options
|
||||||
|
add_compile_options(
|
||||||
|
/W3 # Warning level 3
|
||||||
|
/GS # Buffer security check
|
||||||
|
/GA # Optimize for Windows applications
|
||||||
|
/GF # Enable string pooling
|
||||||
|
)
|
||||||
|
# Optimization flags per build type
|
||||||
|
set(CMAKE_C_FLAGS_RELEASE "/O2")
|
||||||
|
|
||||||
|
elseif(COMPILER_IS_CLANG_CL)
|
||||||
|
# clang-cl (Clang with MSVC frontend)
|
||||||
|
add_compile_definitions(
|
||||||
|
MSVC
|
||||||
|
WITH_SSL
|
||||||
|
)
|
||||||
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
|
add_compile_options(
|
||||||
|
-W3
|
||||||
|
-fno-strict-aliasing
|
||||||
|
)
|
||||||
|
|
||||||
|
elseif(COMPILER_IS_CLANG OR COMPILER_IS_GCC)
|
||||||
|
# Clang or GCC on Windows (MinGW-like)
|
||||||
|
add_compile_definitions(WITH_STD_MALLOC)
|
||||||
|
add_compile_options(-fno-strict-aliasing)
|
||||||
|
|
||||||
|
elseif(WATCOM)
|
||||||
|
# OpenWatcom-specific flags
|
||||||
|
add_compile_definitions(
|
||||||
|
WATCOM
|
||||||
|
MSVC
|
||||||
|
NOIPV6
|
||||||
|
NODEBUG
|
||||||
|
NORADIUS
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Windows libraries
|
||||||
|
set(WINDOWS_LIBS ws2_32 advapi32 user32 kernel32 gdi32 crypt32)
|
||||||
|
|
||||||
|
# Windows plugins (always built)
|
||||||
|
set(DEFAULT_PLUGINS
|
||||||
|
utf8tocp1251
|
||||||
|
WindowsAuthentication
|
||||||
|
TrafficPlugin
|
||||||
|
StringsPlugin
|
||||||
|
FilePlugin
|
||||||
|
)
|
||||||
|
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
# Linux-specific configuration
|
||||||
|
add_compile_definitions(
|
||||||
|
_GNU_SOURCE
|
||||||
|
GETHOSTBYNAME_R
|
||||||
|
_THREAD_SAFE
|
||||||
|
_REENTRANT
|
||||||
|
)
|
||||||
|
|
||||||
|
if(COMPILER_IS_CLANG OR COMPILER_IS_GCC)
|
||||||
|
# Clang/GCC on Linux
|
||||||
|
add_compile_options(-fno-strict-aliasing)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(3PROXY_USE_SPLICE)
|
||||||
|
add_compile_definitions(WITHSPLICE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(3PROXY_USE_NETFILTER)
|
||||||
|
add_compile_definitions(WITH_NETFILTER)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(DEFAULT_PLUGINS
|
||||||
|
StringsPlugin
|
||||||
|
TrafficPlugin
|
||||||
|
TransparentPlugin
|
||||||
|
)
|
||||||
|
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|Darwin|OpenBSD|NetBSD")
|
||||||
|
# BSD/macOS-specific configuration
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
# macOS-specific
|
||||||
|
add_compile_definitions(_DARWIN_UNLIMITED_SELECT)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(COMPILER_IS_CLANG OR COMPILER_IS_GCC)
|
||||||
|
add_compile_options(-fno-strict-aliasing)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(DEFAULT_PLUGINS
|
||||||
|
StringsPlugin
|
||||||
|
TrafficPlugin
|
||||||
|
TransparentPlugin
|
||||||
|
)
|
||||||
|
|
||||||
|
else()
|
||||||
|
# Generic Unix configuration
|
||||||
|
if(COMPILER_IS_CLANG OR COMPILER_IS_GCC)
|
||||||
|
add_compile_options(-fno-strict-aliasing)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(DEFAULT_PLUGINS
|
||||||
|
StringsPlugin
|
||||||
|
TrafficPlugin
|
||||||
|
TransparentPlugin
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Common definitions
|
||||||
|
if(WIN32)
|
||||||
|
# Windows: use WSAPOLL
|
||||||
|
if(3PROXY_USE_WSAPOLL)
|
||||||
|
add_compile_definitions(WITH_WSAPOLL)
|
||||||
|
else()
|
||||||
|
add_compile_definitions(FD_SETSIZE=4096)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# Unix: use poll
|
||||||
|
if(3PROXY_USE_POLL)
|
||||||
|
add_compile_definitions(WITH_POLL)
|
||||||
|
else()
|
||||||
|
add_compile_definitions(FD_SETSIZE=4096)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Find dependencies
|
||||||
|
|
||||||
|
# OpenSSL
|
||||||
|
set(OPENSSL_FOUND FALSE)
|
||||||
|
if(3PROXY_USE_OPENSSL)
|
||||||
|
find_package(OpenSSL QUIET)
|
||||||
|
if(OpenSSL_FOUND)
|
||||||
|
set(OPENSSL_FOUND TRUE)
|
||||||
|
add_compile_definitions(WITH_SSL)
|
||||||
|
message(STATUS "OpenSSL found: ${OPENSSL_VERSION}")
|
||||||
|
else()
|
||||||
|
message(STATUS "OpenSSL not found, SSLPlugin will not be built")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# PCRE2
|
||||||
|
set(PCRE2_FOUND FALSE)
|
||||||
|
if(3PROXY_USE_PCRE2)
|
||||||
|
find_package(PCRE2 QUIET)
|
||||||
|
if(PCRE2_FOUND)
|
||||||
|
message(STATUS "PCRE2 found: ${PCRE2_VERSION}")
|
||||||
|
else()
|
||||||
|
message(STATUS "PCRE2 not found, PCREPlugin will not be built")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# PAM (Unix only)
|
||||||
|
set(PAM_FOUND FALSE)
|
||||||
|
if(3PROXY_USE_PAM AND NOT WIN32)
|
||||||
|
find_package(PAM QUIET)
|
||||||
|
if(PAM_FOUND)
|
||||||
|
message(STATUS "PAM found")
|
||||||
|
else()
|
||||||
|
message(STATUS "PAM not found, PamAuth will not be built")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ODBC (always enabled on Windows)
|
||||||
|
set(ODBC_FOUND FALSE)
|
||||||
|
if(WIN32 OR 3PROXY_USE_ODBC)
|
||||||
|
find_package(ODBC QUIET)
|
||||||
|
if(ODBC_FOUND)
|
||||||
|
message(STATUS "ODBC found")
|
||||||
|
else()
|
||||||
|
message(STATUS "ODBC not found, building without ODBC support")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Set NOODBC if ODBC is not found
|
||||||
|
if(NOT ODBC_FOUND)
|
||||||
|
add_compile_definitions(NOODBC)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Source files for 3proxy core
|
||||||
|
set(3PROXY_CORE_SOURCES
|
||||||
|
src/3proxy.c
|
||||||
|
src/auth.c
|
||||||
|
src/authradius.c
|
||||||
|
src/conf.c
|
||||||
|
src/datatypes.c
|
||||||
|
src/plugins.c
|
||||||
|
src/stringtable.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# MD4/MD5 sources for mycrypt
|
||||||
|
set(MD_SOURCES
|
||||||
|
src/libs/md4.c
|
||||||
|
src/libs/md5.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# Object libraries for common sources (shared between executables)
|
||||||
|
# ============================================================================
|
||||||
|
|
||||||
|
# Common object library (sockmap, sockgetchar, common, log)
|
||||||
|
add_library(common_obj OBJECT
|
||||||
|
src/sockmap.c
|
||||||
|
src/sockgetchar.c
|
||||||
|
src/common.c
|
||||||
|
src/log.c
|
||||||
|
)
|
||||||
|
target_include_directories(common_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
|
# base64 object library
|
||||||
|
add_library(base64_obj OBJECT src/base64.c)
|
||||||
|
target_include_directories(base64_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# Object libraries for 3proxy (compiled WITHOUT WITHMAIN)
|
||||||
|
# These are used by the main 3proxy executable
|
||||||
|
# ============================================================================
|
||||||
|
|
||||||
|
# Server modules object library (without WITHMAIN)
|
||||||
|
add_library(srv_modules OBJECT
|
||||||
|
src/proxy.c
|
||||||
|
src/pop3p.c
|
||||||
|
src/smtpp.c
|
||||||
|
src/ftppr.c
|
||||||
|
src/tcppm.c
|
||||||
|
src/tlspr.c
|
||||||
|
src/auto.c
|
||||||
|
src/socks.c
|
||||||
|
src/webadmin.c
|
||||||
|
src/udppm.c
|
||||||
|
src/dnspr.c
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(srv_modules PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# mainfunc object (proxymain.c compiled with MODULEMAINFUNC=mainfunc for 3proxy)
|
||||||
|
add_library(mainfunc OBJECT src/proxymain.c)
|
||||||
|
target_include_directories(mainfunc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
target_compile_definitions(mainfunc PRIVATE MODULEMAINFUNC=mainfunc)
|
||||||
|
|
||||||
|
# ftp object (used only by 3proxy and ftppr)
|
||||||
|
add_library(ftp_obj OBJECT src/ftp.c)
|
||||||
|
target_include_directories(ftp_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
|
# mycrypt object for 3proxy (without WITHMAIN)
|
||||||
|
add_library(mycrypt_obj OBJECT src/mycrypt.c)
|
||||||
|
target_include_directories(mycrypt_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# Main 3proxy executable
|
||||||
|
# Uses srv_* object files (without WITHMAIN)
|
||||||
|
# ============================================================================
|
||||||
|
|
||||||
|
add_executable(3proxy
|
||||||
|
${3PROXY_CORE_SOURCES}
|
||||||
|
${MD_SOURCES}
|
||||||
|
$<TARGET_OBJECTS:srv_modules>
|
||||||
|
$<TARGET_OBJECTS:mainfunc>
|
||||||
|
$<TARGET_OBJECTS:common_obj>
|
||||||
|
$<TARGET_OBJECTS:base64_obj>
|
||||||
|
$<TARGET_OBJECTS:ftp_obj>
|
||||||
|
$<TARGET_OBJECTS:mycrypt_obj>
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(3proxy PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/libs
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(3proxy PRIVATE Threads::Threads)
|
||||||
|
|
||||||
|
if(ODBC_FOUND)
|
||||||
|
if(TARGET ODBC::ODBC)
|
||||||
|
target_link_libraries(3proxy PRIVATE ODBC::ODBC)
|
||||||
|
else()
|
||||||
|
target_link_libraries(3proxy PRIVATE ${ODBC_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(3proxy PRIVATE ${WINDOWS_LIBS})
|
||||||
|
if(OpenSSL_FOUND)
|
||||||
|
target_link_libraries(3proxy PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||||
|
endif()
|
||||||
|
if(COMPILER_IS_MSVC AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3proxy.rc)
|
||||||
|
target_sources(3proxy PRIVATE 3proxy.rc)
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
target_link_libraries(3proxy PRIVATE dl)
|
||||||
|
if(OpenSSL_FOUND)
|
||||||
|
target_link_libraries(3proxy PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Build mycrypt utility
|
||||||
|
add_executable(mycrypt
|
||||||
|
src/mycrypt.c
|
||||||
|
${MD_SOURCES}
|
||||||
|
$<TARGET_OBJECTS:base64_obj>
|
||||||
|
)
|
||||||
|
target_compile_definitions(mycrypt PRIVATE WITHMAIN)
|
||||||
|
target_include_directories(mycrypt PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/libs
|
||||||
|
)
|
||||||
|
target_link_libraries(mycrypt PRIVATE Threads::Threads)
|
||||||
|
|
||||||
|
# Build standalone proxy executables
|
||||||
|
foreach(PROXY_NAME proxy socks pop3p smtpp ftppr tcppm udppm tlspr)
|
||||||
|
if(PROXY_NAME STREQUAL "ftppr" OR PROXY_NAME STREQUAL "proxy")
|
||||||
|
# ftppr and proxy use ftp_obj
|
||||||
|
add_executable(${PROXY_NAME}
|
||||||
|
src/${PROXY_NAME}.c
|
||||||
|
$<TARGET_OBJECTS:common_obj>
|
||||||
|
$<TARGET_OBJECTS:ftp_obj>
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_executable(${PROXY_NAME}
|
||||||
|
src/${PROXY_NAME}.c
|
||||||
|
$<TARGET_OBJECTS:common_obj>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(${PROXY_NAME} PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(${PROXY_NAME} PRIVATE
|
||||||
|
WITHMAIN
|
||||||
|
NOPORTMAP
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(${PROXY_NAME} PRIVATE Threads::Threads)
|
||||||
|
|
||||||
|
if(PROXY_NAME STREQUAL "proxy")
|
||||||
|
target_compile_definitions(${PROXY_NAME} PRIVATE ANONYMOUS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PROXY_NAME STREQUAL "tcppm" OR PROXY_NAME STREQUAL "udppm" OR PROXY_NAME STREQUAL "tlspr")
|
||||||
|
target_compile_definitions(${PROXY_NAME} PRIVATE PORTMAP)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(${PROXY_NAME} PRIVATE ${WINDOWS_LIBS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PROXY_NAME STREQUAL "proxy" OR PROXY_NAME STREQUAL "smtpp")
|
||||||
|
target_sources(${PROXY_NAME} PRIVATE $<TARGET_OBJECTS:base64_obj>)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# Plugin output directory
|
||||||
|
set(PLUGIN_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||||
|
if(WIN32)
|
||||||
|
set(PLUGIN_SUFFIX ".dll")
|
||||||
|
else()
|
||||||
|
set(PLUGIN_SUFFIX ".ld.so")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Include plugin definitions
|
||||||
|
include(cmake/plugins.cmake)
|
||||||
|
|
||||||
|
# Build plugins
|
||||||
|
foreach(PLUGIN ${DEFAULT_PLUGINS})
|
||||||
|
add_subdirectory(src/plugins/${PLUGIN})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if(OPENSSL_FOUND)
|
||||||
|
add_subdirectory(src/plugins/SSLPlugin)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PCRE2_FOUND)
|
||||||
|
add_subdirectory(src/plugins/PCREPlugin)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PAM_FOUND)
|
||||||
|
add_subdirectory(src/plugins/PamAuth)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Build full list of plugins to be built
|
||||||
|
set(ALL_PLUGINS ${DEFAULT_PLUGINS})
|
||||||
|
if(OPENSSL_FOUND)
|
||||||
|
list(APPEND ALL_PLUGINS SSLPlugin)
|
||||||
|
endif()
|
||||||
|
if(PCRE2_FOUND)
|
||||||
|
list(APPEND ALL_PLUGINS PCREPlugin)
|
||||||
|
endif()
|
||||||
|
if(PAM_FOUND)
|
||||||
|
list(APPEND ALL_PLUGINS PamAuth)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Installation rules
|
||||||
|
install(TARGETS 3proxy mycrypt proxy socks pop3p smtpp ftppr tcppm udppm tlspr
|
||||||
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Install plugins
|
||||||
|
if(WIN32)
|
||||||
|
install(FILES
|
||||||
|
${PLUGIN_OUTPUT_DIR}/utf8tocp1251${PLUGIN_SUFFIX}
|
||||||
|
${PLUGIN_OUTPUT_DIR}/WindowsAuthentication${PLUGIN_SUFFIX}
|
||||||
|
${PLUGIN_OUTPUT_DIR}/TrafficPlugin${PLUGIN_SUFFIX}
|
||||||
|
${PLUGIN_OUTPUT_DIR}/StringsPlugin${PLUGIN_SUFFIX}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
install(FILES
|
||||||
|
${PLUGIN_OUTPUT_DIR}/StringsPlugin${PLUGIN_SUFFIX}
|
||||||
|
${PLUGIN_OUTPUT_DIR}/TrafficPlugin${PLUGIN_SUFFIX}
|
||||||
|
${PLUGIN_OUTPUT_DIR}/TransparentPlugin${PLUGIN_SUFFIX}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/3proxy
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Install configuration files
|
||||||
|
if(NOT WIN32)
|
||||||
|
install(FILES scripts/3proxy.cfg DESTINATION /etc/3proxy)
|
||||||
|
install(FILES scripts/add3proxyuser.sh DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Install man pages
|
||||||
|
if(NOT WIN32)
|
||||||
|
file(GLOB MAN3_FILES "${CMAKE_CURRENT_SOURCE_DIR}/man/*.3")
|
||||||
|
file(GLOB MAN8_FILES "${CMAKE_CURRENT_SOURCE_DIR}/man/*.8")
|
||||||
|
install(FILES ${MAN3_FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
|
||||||
|
install(FILES ${MAN8_FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
message(STATUS "")
|
||||||
|
message(STATUS "3proxy configuration summary:")
|
||||||
|
message(STATUS " Version: ${PROJECT_VERSION}")
|
||||||
|
message(STATUS " Platform: ${CMAKE_SYSTEM_NAME}")
|
||||||
|
message(STATUS " Compiler: ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
|
||||||
|
message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
|
||||||
|
message(STATUS "")
|
||||||
|
message(STATUS " Options:")
|
||||||
|
message(STATUS " BUILD_SHARED: ${3PROXY_BUILD_SHARED}")
|
||||||
|
message(STATUS " USE_OPENSSL: ${3PROXY_USE_OPENSSL}")
|
||||||
|
message(STATUS " USE_PCRE2: ${3PROXY_USE_PCRE2}")
|
||||||
|
message(STATUS " USE_PAM: ${3PROXY_USE_PAM}")
|
||||||
|
message(STATUS " USE_ODBC: ${3PROXY_USE_ODBC}")
|
||||||
|
message(STATUS " USE_POLL: ${3PROXY_USE_POLL}")
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
message(STATUS " USE_SPLICE: ${3PROXY_USE_SPLICE}")
|
||||||
|
message(STATUS " USE_NETFILTER: ${3PROXY_USE_NETFILTER}")
|
||||||
|
endif()
|
||||||
|
if(WIN32)
|
||||||
|
message(STATUS " USE_WSAPOLL: ${3PROXY_USE_WSAPOLL}")
|
||||||
|
endif()
|
||||||
|
message(STATUS "")
|
||||||
|
message(STATUS " Libraries found:")
|
||||||
|
message(STATUS " OpenSSL: ${OPENSSL_FOUND}")
|
||||||
|
message(STATUS " PCRE2: ${PCRE2_FOUND}")
|
||||||
|
message(STATUS " PAM: ${PAM_FOUND}")
|
||||||
|
message(STATUS " ODBC: ${ODBC_FOUND}")
|
||||||
|
message(STATUS "")
|
||||||
|
message(STATUS " Plugins to build: ${ALL_PLUGINS}")
|
||||||
|
message(STATUS "")
|
||||||
@ -7,7 +7,7 @@
|
|||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC ?= cc
|
CC ?= cc
|
||||||
|
|
||||||
CFLAGS := -c -fno-strict-aliasing -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL $(CFLAGS)
|
CFLAGS := -c -fno-strict-aliasing -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL $(CFLAGS)
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN ?= ${CC}
|
LN ?= ${CC}
|
||||||
LDFLAGS += -pthread -fno-strict-aliasing
|
LDFLAGS += -pthread -fno-strict-aliasing
|
||||||
@ -15,8 +15,8 @@ LDFLAGS += -pthread -fno-strict-aliasing
|
|||||||
# -ldl or -lld may be required for some platforms
|
# -ldl or -lld may be required for some platforms
|
||||||
DCFLAGS ?= -fPIC
|
DCFLAGS ?= -fPIC
|
||||||
DLFLAGS ?= -shared
|
DLFLAGS ?= -shared
|
||||||
LIBS ?=
|
|
||||||
DLSUFFICS = .so
|
DLSUFFICS = .so
|
||||||
|
LIBS ?=
|
||||||
LIBSPREFIX = -l
|
LIBSPREFIX = -l
|
||||||
LIBSSUFFIX =
|
LIBSSUFFIX =
|
||||||
LNOUT = -o
|
LNOUT = -o
|
||||||
@ -32,6 +32,7 @@ MAKEFILE = Makefile.FreeBSD
|
|||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += -l crypto -l ssl
|
||||||
PLUGINS += SSLPlugin
|
PLUGINS += SSLPlugin
|
||||||
endif
|
endif
|
||||||
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false)
|
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false)
|
||||||
|
|||||||
@ -1,20 +1,17 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for GCC/Linux/Cygwin
|
# 3 proxy Makefile for GCC/Linux/Cygwin
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LIBS to compile with ODBC
|
# remove -DNOODBC from CFLAGS and add -lodbc to LIBS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
|
|
||||||
CFLAGS := -g -fPIC -O2 -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER $(CFLAGS)
|
CFLAGS := -g -fPIC -O2 -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER $(CFLAGS)
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN ?= ${CC}
|
LN ?= ${CC}
|
||||||
DCFLAGS ?=
|
DCFLAGS ?=
|
||||||
LDFLAGS ?= -fPIC -O2 -fno-strict-aliasing -pthread
|
LDFLAGS := -fPIC -O2 -fno-strict-aliasing -pthread $(LDFLAGS)
|
||||||
DLFLAGS ?= -shared
|
DLFLAGS ?= -shared
|
||||||
DLSUFFICS = .ld.so
|
DLSUFFICS = .ld.so
|
||||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
||||||
@ -38,6 +35,7 @@ LIBS ?= -ldl
|
|||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += -l crypto -l ssl
|
||||||
PLUGINS += SSLPlugin
|
PLUGINS += SSLPlugin
|
||||||
endif
|
endif
|
||||||
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false)
|
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false)
|
||||||
|
|||||||
@ -1,15 +1,13 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Solaris/SunCC
|
# 3 proxy Makefile for Solaris/SunCC
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC = cc
|
CC = cc
|
||||||
CFLAGS = -xO3 -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL
|
CFLAGS = -xO3 -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL
|
||||||
COUT = -o ./
|
COUT = -o ./
|
||||||
LN = $(CC)
|
LN = $(CC)
|
||||||
LDFLAGS = -xO3
|
LDFLAGS = -xO3
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Solaris/gcc
|
# 3 proxy Makefile for Solaris/gcc
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
@ -10,7 +8,7 @@
|
|||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O2 -fno-strict-aliasing -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL
|
CFLAGS = -O2 -fno-strict-aliasing -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL
|
||||||
COUT = -o ./
|
COUT = -o ./
|
||||||
LN = $(CC)
|
LN = $(CC)
|
||||||
LDFLAGS = -O3
|
LDFLAGS = -O3
|
||||||
|
|||||||
@ -1,12 +1,10 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
||||||
#
|
#
|
||||||
# You can try to add /D "WITH_STD_MALLOC" to CFLAGS to use standard malloc
|
|
||||||
# libraries
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC = cl
|
CC = cl
|
||||||
CFLAGS = /FD /MDd /nologo /W3 /ZI /Wp64 /GS /Gs /RTCsu /EHs- /GA /GF /DEBUG /D "WITH_STD_MALLOC" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /c
|
CFLAGS = /FD /MDd /nologo /W3 /ZI /Wp64 /GS /Gs /RTCsu /EHs- /GA /GF /DEBUG /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /c
|
||||||
COUT = /Fo
|
COUT = /Fo
|
||||||
LN = link
|
LN = link
|
||||||
LDFLAGS = /nologo /subsystem:console /machine:I386 /DEBUG
|
LDFLAGS = /nologo /subsystem:console /machine:I386 /DEBUG
|
||||||
|
|||||||
@ -1,20 +1,19 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC = cl
|
CC = cl
|
||||||
CFLAGS = /nologo /MT /W3 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "WITH_STD_MALLOC" /D "WITH_WSAPOLL" /D "NDEBUG" /D "WIN32" /D "WITH_SSL" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRINTF_INT64_MODIFIER=\"I64\"" /Fp"proxy.pch" /FD /c $(VERSION) $(BUILDDATE)
|
CFLAGS = /nologo /MT /W3 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "WITH_WSAPOLL" /D "NDEBUG" /D "WIN32" /D "WITH_SSL" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRINTF_INT64_MODIFIER=\"I64\"" /Fp"proxy.pch" /FD /c $(VERSION) $(BUILDDATE)
|
||||||
COUT = /Fo
|
COUT = /Fo
|
||||||
LN = link
|
LN = link
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386
|
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386
|
||||||
DLFLAGS = /DLL
|
DLFLAGS = /DLL
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib
|
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib libcrypto.lib libssl.lib
|
||||||
|
LIBSOLD = libeay32MT.lib ssleay32MT.lib
|
||||||
LIBSPREFIX =
|
LIBSPREFIX =
|
||||||
LIBSSUFFIX = .lib
|
LIBSSUFFIX = .lib
|
||||||
LIBEXT = .lib
|
LIBEXT = .lib
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
||||||
|
|
||||||
@ -10,13 +8,14 @@ MAKEFILE = Makefile.msvc64
|
|||||||
|
|
||||||
BUILDDIR = ../bin64/
|
BUILDDIR = ../bin64/
|
||||||
CC = cl
|
CC = cl
|
||||||
CFLAGS = /nologo /MT /W3 /Ox /EHs- /GS /GA /GF /D "MSVC" /D "WITH_STD_MALLOC" /D "WITH_SSL" /D "WITH_WSAPOLL" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRINTF_INT64_MODIFIER=\"I64\"" /Fp"proxy.pch" /FD /c $(VERSION) $(BUILDDATE) $(CFLAGS)
|
CFLAGS = /nologo /MT /W3 /Ox /EHs- /GS /GA /GF /D "MSVC" /D "WITH_SSL" /D "WITH_WSAPOLL" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRINTF_INT64_MODIFIER=\"I64\"" /Fp"proxy.pch" /FD /c $(VERSION) $(BUILDDATE) $(CFLAGS)
|
||||||
COUT = /Fo
|
COUT = /Fo
|
||||||
LN = link
|
LN = link
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:x64
|
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:x64
|
||||||
DLFLAGS = /DLL
|
DLFLAGS = /DLL
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib $(LIBS)
|
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib libcrypto.lib libssl.lib $(LIBS)
|
||||||
|
LIBSOLD = libeay32.lib ssleay32.lib
|
||||||
LIBSPREFIX =
|
LIBSPREFIX =
|
||||||
LIBSSUFFIX = .lib
|
LIBSSUFFIX = .lib
|
||||||
LIBEXT = .lib
|
LIBEXT = .lib
|
||||||
|
|||||||
@ -1,20 +1,18 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
||||||
|
|
||||||
BUILDDIR = ../bin64/
|
BUILDDIR = ../bin64/
|
||||||
CC = cl
|
CC = cl
|
||||||
CFLAGS = /nologo /MT /W3 /Ox /EHs- /GS /GA /GF /D "MSVC" /D "WITH_STD_MALLOC" /D "WITH_WSAPOLL" /D "WITH_SSL" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRINTF_INT64_MODIFIER=\"I64\"" /Fp"proxy.pch" /FD /c $(VERSION) $(BUILDDATE)
|
CFLAGS = /nologo /MT /W3 /Ox /EHs- /GS /GA /GF /D "MSVC" /D "WITH_WSAPOLL" /D "WITH_SSL" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRINTF_INT64_MODIFIER=\"I64\"" /Fp"proxy.pch" /FD /c $(VERSION) $(BUILDDATE)
|
||||||
COUT = /Fo
|
COUT = /Fo
|
||||||
LN = link
|
LN = link
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:arm64
|
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:arm64
|
||||||
DLFLAGS = /DLL
|
DLFLAGS = /DLL
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib
|
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib libcrypto.lib libssl.lib
|
||||||
LIBSOLD =
|
LIBSOLD =
|
||||||
LIBSPREFIX =
|
LIBSPREFIX =
|
||||||
LIBSSUFFIX = .lib
|
LIBSSUFFIX = .lib
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC = cl
|
CC = cl
|
||||||
CFLAGS = /DARM /D "NOODBC" /nologo /MT /W3 /Wp64 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "_WINCE" /D "WITH_STD_MALLOC" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRINTF_INT64_MODIFIER=\"I64\"" /Fp"proxy.pch" /FD /c
|
CFLAGS = /DARM /D "NOODBC" /nologo /MT /W3 /Wp64 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "_WINCE" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRINTF_INT64_MODIFIER=\"I64\"" /Fp"proxy.pch" /FD /c
|
||||||
COUT = /Fo
|
COUT = /Fo
|
||||||
LN = link
|
LN = link
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no
|
LDFLAGS = /nologo /subsystem:console /incremental:no
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for GCC/Linux/Cygwin
|
# 3 proxy Makefile for GCC/Linux/Cygwin
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LIBS to compile with ODBC
|
# remove -DNOODBC from CFLAGS and add -lodbc to LIBS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
@ -10,7 +8,7 @@
|
|||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC = mips-openwrt-linux-gcc
|
CC = mips-openwrt-linux-gcc
|
||||||
|
|
||||||
CFLAGS ?= -g -O2 -fno-strict-aliasing -c -pthread -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER
|
CFLAGS ?= -g -O2 -fno-strict-aliasing -c -pthread -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN = $(CC)
|
LN = $(CC)
|
||||||
DCFLAGS = -fPIC
|
DCFLAGS = -fPIC
|
||||||
@ -31,11 +29,14 @@ TYPECOMMAND = cat
|
|||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.openwrt-mips
|
MAKEFILE = Makefile.openwrt-mips
|
||||||
# PamAuth requires libpam, you may require pam-devel package to be installed
|
# PamAuth requires libpam, you may require pam-devel package to be installed
|
||||||
|
# SSLPlugin requires -lcrypto -lssl
|
||||||
|
#LIBS = -lcrypto -lssl -ldl
|
||||||
LIBS ?= -ldl
|
LIBS ?= -ldl
|
||||||
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += -l crypto -l ssl
|
||||||
PLUGINS += SSLPlugin
|
PLUGINS += SSLPlugin
|
||||||
endif
|
endif
|
||||||
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false)
|
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false)
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for GCC/Unix
|
# 3 proxy Makefile for GCC/Unix
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
@ -11,7 +9,7 @@ BUILDDIR = ../bin/
|
|||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
|
|
||||||
# you may need -L/usr/pkg/lib for older NetBSD versions
|
# you may need -L/usr/pkg/lib for older NetBSD versions
|
||||||
CFLAGS := -g -O2 -fno-strict-aliasing -c -pthread -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL $(CFLAGS)
|
CFLAGS := -g -O2 -fno-strict-aliasing -c -pthread -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL $(CFLAGS)
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN ?= $(CC)
|
LN ?= $(CC)
|
||||||
LDFLAGS ?= -O2 -fno-strict-aliasing -pthread
|
LDFLAGS ?= -O2 -fno-strict-aliasing -pthread
|
||||||
@ -36,6 +34,7 @@ MAKEFILE = Makefile.unix
|
|||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += -l crypto -l ssl
|
||||||
PLUGINS += SSLPlugin
|
PLUGINS += SSLPlugin
|
||||||
endif
|
endif
|
||||||
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false)
|
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false)
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Open Watcom 2
|
# 3 proxy Makefile for Open Watcom 2
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC = cl
|
CC = cl
|
||||||
CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NODEBUG" /D "NOODBC" /D "NORADIUS" /D"WATCOM" /D "MSVC" /D "WITH_STD_MALLOC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRINTF_INT64_MODIFIER=\"I64\"" /c $(VERSION) $(BUILDDATE)
|
CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NODEBUG" /D "NOODBC" /D "NORADIUS" /D"WATCOM" /D "MSVC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRINTF_INT64_MODIFIER=\"I64\"" /c $(VERSION) $(BUILDDATE)
|
||||||
COUT = /Fo
|
COUT = /Fo
|
||||||
LN = link
|
LN = link
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no
|
LDFLAGS = /nologo /subsystem:console /incremental:no
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for GCC/windows
|
# 3 proxy Makefile for GCC/windows
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
||||||
# library support
|
# library support
|
||||||
@ -10,10 +8,10 @@
|
|||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
CFLAGS := -O2 -s -c -mthreads -DWITH_STD_MALLOC -DWITH_WSAPOLL $(CFLAGS)
|
CFLAGS := -O2 -s -c -mthreads -DWITH_WSAPOLL $(CFLAGS)
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN ?= $(CC)
|
LN ?= $(CC)
|
||||||
LDFLAGS ?= -O2 -s -mthreads
|
LDFLAGS := -O2 -s -mthreads $(LDFLAGS)
|
||||||
DLFLAGS ?= -shared
|
DLFLAGS ?= -shared
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS := -lws2_32 -lodbc32 -ladvapi32 -luser32 $(LIBS)
|
LIBS := -lws2_32 -lodbc32 -ladvapi32 -luser32 $(LIBS)
|
||||||
@ -38,13 +36,14 @@ AFTERCLEAN = (find . -type f -name "*.o" -delete && find . -type f -name "*.res"
|
|||||||
ifndef OPENSSL_CHECK
|
ifndef OPENSSL_CHECK
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += -l crypto -l ssl
|
||||||
PLUGINS += SSLPlugin
|
PLUGINS += SSLPlugin
|
||||||
endif
|
endif
|
||||||
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false)
|
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false)
|
||||||
ifeq ($(PAM_CHECK), true)
|
ifeq ($(PAM_CHECK), true)
|
||||||
PLUGINS += PamAuth
|
PLUGINS += PamAuth
|
||||||
endif
|
endif
|
||||||
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include <pcre2.h>\\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -l pcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false)
|
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include <pcre2.h>\\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -lpcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false)
|
||||||
ifeq ($(PCRE_CHECK), true)
|
ifeq ($(PCRE_CHECK), true)
|
||||||
PLUGINS += PCREPlugin
|
PLUGINS += PCREPlugin
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for GCC/windows
|
# 3 proxy Makefile for GCC/windows
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
||||||
# library support
|
# library support
|
||||||
@ -10,7 +8,7 @@
|
|||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC = /opt/cegcc/arm-wince-cegcc/bin/gcc
|
CC = /opt/cegcc/arm-wince-cegcc/bin/gcc
|
||||||
CFLAGS = -O2 -s -c -mthreads -DWITH_STD_MALLOC -DNOODBC -D_WINCE -D_WIN32 -DNORADIUS -D__USE_W32_SOCKETS
|
CFLAGS = -O2 -s -c -mthreads -DNOODBC -D_WINCE -D_WIN32 -DNORADIUS -D__USE_W32_SOCKETS
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN = /opt/cegcc/arm-wince-cegcc/bin/gcc
|
LN = /opt/cegcc/arm-wince-cegcc/bin/gcc
|
||||||
LDFLAGS = -O2 -s -mthreads
|
LDFLAGS = -O2 -s -mthreads
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
# Yes, 3proxy.cfg can be executable, in this case you should place
|
# Yes, 3proxy.cfg can be executable, in this case you should place
|
||||||
# something like
|
# something like
|
||||||
#config /usr/local/3proxy/3proxy.cfg
|
#config /usr/local/3proxy/3proxy.cfg
|
||||||
# to show which configuration 3proxy should re-read on realod.
|
# to show which configuration 3proxy should re-read on reload.
|
||||||
|
|
||||||
#system "echo Hello world!"
|
#system "echo Hello world!"
|
||||||
# you may use system to execute some external command if proxy starts
|
# you may use system to execute some external command if proxy starts
|
||||||
@ -14,17 +14,16 @@ nserver 10.2.2.2
|
|||||||
nscache 65536
|
nscache 65536
|
||||||
|
|
||||||
#nsrecord porno.security.nnov.ru 0.0.0.0
|
#nsrecord porno.security.nnov.ru 0.0.0.0
|
||||||
# nobody will be able to access porno.security.nnov.ru by the name.
|
# nobody will be able to access porno.security.nnov.ru by name.
|
||||||
#nsrecord wpad.security.nnov.ru www.security.nnov.ru
|
#nsrecord wpad.security.nnov.ru www.security.nnov.ru
|
||||||
# wpad.security.nnov.ru will resolve to www.security.nnov.ru for
|
# wpad.security.nnov.ru will resolve to www.security.nnov.ru for
|
||||||
# clients
|
# clients
|
||||||
|
|
||||||
|
|
||||||
timeouts 1 5 30 60 180 1800 15 60
|
timeouts 1 5 30 60 180 1800 15 60
|
||||||
# Here we can change timeout values
|
# Here we can change timeout values
|
||||||
|
|
||||||
users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1"
|
users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1"
|
||||||
# note that "" required, overvise $... is treated as include file name.
|
# note that "" required, otherwise $... is treated as include file name.
|
||||||
# $1$qwer$CHFTUFGqkjue9HyhcMHEe1 is 'test' in MD5 crypt format.
|
# $1$qwer$CHFTUFGqkjue9HyhcMHEe1 is 'test' in MD5 crypt format.
|
||||||
#users $/usr/local/etc/3proxy/passwd
|
#users $/usr/local/etc/3proxy/passwd
|
||||||
# this example shows you how to include passwd file. For included files
|
# this example shows you how to include passwd file. For included files
|
||||||
@ -60,7 +59,7 @@ log c:\3proxy\logs\3proxy.log D
|
|||||||
#
|
#
|
||||||
#Compatible with ISA 2000/2004 firewall FWSEXTD.log (fields are TAB-delimited):
|
#Compatible with ISA 2000/2004 firewall FWSEXTD.log (fields are TAB-delimited):
|
||||||
#
|
#
|
||||||
#"- + L%C %U unnknown:0:0.0 N %Y-%m-%d %H:%M:%S fwsrv 3PROXY - %n %R %r %D %O %I %r TCP Connect - - - %E - - - - -"
|
#"- + L%C %U Unknown:0:0.0 N %Y-%m-%d %H:%M:%S fwsrv 3PROXY - %n %R %r %D %O %I %r TCP Connect - - - %E - - - - -"
|
||||||
#
|
#
|
||||||
#Compatible with HTTPD standard log (Apache and others)
|
#Compatible with HTTPD standard log (Apache and others)
|
||||||
#
|
#
|
||||||
@ -71,13 +70,12 @@ log c:\3proxy\logs\3proxy.log D
|
|||||||
# in log file we want to have underscores instead of spaces
|
# in log file we want to have underscores instead of spaces
|
||||||
logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"
|
logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"
|
||||||
|
|
||||||
|
|
||||||
#archiver gz /bin/gzip %F
|
#archiver gz /bin/gzip %F
|
||||||
#archiver zip zip -m -qq %A %F
|
#archiver zip zip -m -qq %A %F
|
||||||
#archiver zip pkzipc -add -silent -move %A %F
|
#archiver zip pkzipc -add -silent -move %A %F
|
||||||
archiver rar rar a -df -inul %A %F
|
archiver rar rar a -df -inul %A %F
|
||||||
# if archiver specified log file will be compressed after closing.
|
# if archiver is specified, log file will be compressed after closing.
|
||||||
# you should specify extension, path to archiver and command line, %A will be
|
# you should specify the extension, path to archiver, and command line, %A will be
|
||||||
# substituted with archive file name, %f - with original file name.
|
# substituted with archive file name, %f - with original file name.
|
||||||
# Original file will not be removed, so archiver should care about it.
|
# Original file will not be removed, so archiver should care about it.
|
||||||
|
|
||||||
@ -90,19 +88,18 @@ auth iponly
|
|||||||
# auth specifies type of user authentication. If you specify none proxy
|
# auth specifies type of user authentication. If you specify none proxy
|
||||||
# will not do anything to check name of the user. If you specify
|
# will not do anything to check name of the user. If you specify
|
||||||
# nbname proxy will send NetBIOS name request packet to UDP/137 of
|
# nbname proxy will send NetBIOS name request packet to UDP/137 of
|
||||||
# client and parse request for NetBIOS name of messanger service.
|
# client and parse request for NetBIOS name of messenger service.
|
||||||
# Strong means that proxy will check password. For strong authentication
|
# Strong means that proxy will check password. For strong authentication
|
||||||
# unknown user will not be allowed to use proxy regardless of ACL.
|
# unknown user will not be allowed to use proxy regardless of ACL.
|
||||||
# If you do not want username to be checked but wanna ACL to work you should
|
# If you do not want username to be checked but wanna ACL to work you should
|
||||||
# specify auth iponly.
|
# specify auth iponly.
|
||||||
|
|
||||||
|
|
||||||
#allow ADMINISTRATOR,root
|
#allow ADMINISTRATOR,root
|
||||||
#allow * 127.0.0.1,192.168.1.1 * *
|
#allow * 127.0.0.1,192.168.1.1 * *
|
||||||
#parent 1000 http 192.168.1.2 80 * * * 80
|
#parent 1000 http 192.168.1.2 80 * * * 80
|
||||||
#allow * 192.168.1.0/24 * 25,53,110,20-21,1024-65535
|
#allow * 192.168.1.0/24 * 25,53,110,20-21,1024-65535
|
||||||
# we will allow everything if username matches ADMINISTRATOR or root or
|
# we will allow everything if username matches ADMINISTRATOR or root or
|
||||||
# client ip is 127.0.0.1 or 192.168.1.1. Overwise we will redirect any request
|
# client ip is 127.0.0.1 or 192.168.1.1. Otherwise we will redirect any request
|
||||||
# to port 80 to our Web-server 192.168.0.2.
|
# to port 80 to our Web-server 192.168.0.2.
|
||||||
# We will allow any outgoing connections from network 192.168.1.0/24 to
|
# We will allow any outgoing connections from network 192.168.1.0/24 to
|
||||||
# SMTP, POP3, FTP, DNS and unprivileged ports.
|
# SMTP, POP3, FTP, DNS and unprivileged ports.
|
||||||
@ -119,34 +116,33 @@ external 10.1.1.1
|
|||||||
internal 192.168.1.1
|
internal 192.168.1.1
|
||||||
# internal is address of interface proxy will listen for incoming requests
|
# internal is address of interface proxy will listen for incoming requests
|
||||||
# 127.0.0.1 means only localhost will be able to use this proxy. This is
|
# 127.0.0.1 means only localhost will be able to use this proxy. This is
|
||||||
# address you should specify for clients as proxy IP.
|
# the address you should specify for clients as proxy IP.
|
||||||
# You MAY use 0.0.0.0 but you shouldn't, because it's a chance for you to
|
# You MAY use 0.0.0.0 but you shouldn't, because it's a chance for you to
|
||||||
# have open proxy in your network in this case.
|
# have open proxy in your network in this case.
|
||||||
|
|
||||||
auth none
|
auth none
|
||||||
# no authentication is requires
|
# no authentication is required
|
||||||
|
|
||||||
dnspr
|
dnspr
|
||||||
|
|
||||||
# dnsproxy listens on UDP/53 to answer client's DNS requests. It requires
|
# dnsproxy listens on UDP/53 to answer client's DNS requests. It requires
|
||||||
# nserver/nscache configuration.
|
# nserver/nscache configuration.
|
||||||
|
|
||||||
|
|
||||||
#external $./external.ip
|
#external $./external.ip
|
||||||
#internal $./internal.ip
|
#internal $./internal.ip
|
||||||
# this is just an alternative form fo giving external and internal address
|
# this is just an alternative form of giving the external and internal address
|
||||||
# allows you to read this addresses from files
|
# allows you to read these addresses from files
|
||||||
|
|
||||||
auth strong
|
auth strong
|
||||||
# We want to protect internal interface
|
# We want to protect internal interface
|
||||||
deny * * 127.0.0.1,192.168.1.1
|
deny * * 127.0.0.1,192.168.1.1
|
||||||
# and llow HTTP and HTTPS traffic.
|
# and allow HTTP and HTTPS traffic.
|
||||||
allow * * * 80-88,8080-8088 HTTP
|
allow * * * 80-88,8080-8088 HTTP
|
||||||
allow * * * 443,8443 HTTPS
|
allow * * * 443,8443 HTTPS
|
||||||
proxy -n
|
proxy -n
|
||||||
|
|
||||||
auth none
|
auth none
|
||||||
# pop3p will be used without any authentication. It's bad choice
|
# pop3p will be used without any authentication. It's a bad choice
|
||||||
# because it's possible to use pop3p to access any port
|
# because it's possible to use pop3p to access any port
|
||||||
pop3p
|
pop3p
|
||||||
|
|
||||||
@ -157,7 +153,7 @@ tcppm 25 mail.my.provider 25
|
|||||||
# Now we can use our proxy as SMTP and DNS server.
|
# Now we can use our proxy as SMTP and DNS server.
|
||||||
# -s switch for UDP means "single packet" service - instead of setting
|
# -s switch for UDP means "single packet" service - instead of setting
|
||||||
# association for period of time association will only be set for 1 packet.
|
# association for period of time association will only be set for 1 packet.
|
||||||
# It's very userfull for services like DNS but not for some massive services
|
# It's very useful for services like DNS but not for some massive services
|
||||||
# like multimedia streams or online games.
|
# like multimedia streams or online games.
|
||||||
|
|
||||||
auth strong
|
auth strong
|
||||||
@ -169,14 +165,13 @@ socks
|
|||||||
# we flush previously configured ACL list and create new one to allow users
|
# we flush previously configured ACL list and create new one to allow users
|
||||||
# test and 3APA3A to connect from any location
|
# test and 3APA3A to connect from any location
|
||||||
|
|
||||||
|
|
||||||
auth strong
|
auth strong
|
||||||
flush
|
flush
|
||||||
internal 127.0.0.1
|
internal 127.0.0.1
|
||||||
allow 3APA3A 127.0.0.1
|
allow 3APA3A 127.0.0.1
|
||||||
maxconn 3
|
maxconn 3
|
||||||
admin
|
admin
|
||||||
#only allow acces to admin interface for user 3APA3A from 127.0.0.1 address
|
#only allow access to admin interface for user 3APA3A from 127.0.0.1 address
|
||||||
#via 127.0.0.1 address.
|
#via 127.0.0.1 address.
|
||||||
|
|
||||||
# map external 80 and 443 ports to internal Web server
|
# map external 80 and 443 ports to internal Web server
|
||||||
@ -192,10 +187,7 @@ admin
|
|||||||
#tcppm 80 websrv 80
|
#tcppm 80 websrv 80
|
||||||
#tcppm 443 websrv 443
|
#tcppm 443 websrv 443
|
||||||
|
|
||||||
|
|
||||||
#chroot /usr/local/jail
|
#chroot /usr/local/jail
|
||||||
#setgid 65535
|
#setgid 65535
|
||||||
#setuid 65535
|
#setuid 65535
|
||||||
# now we needn't any root rights. We can chroot and setgid/setuid.
|
# now we needn't any root rights. We can chroot and setgid/setuid.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
63
cmake/FindODBC.cmake
Normal file
63
cmake/FindODBC.cmake
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# FindODBC.cmake
|
||||||
|
#
|
||||||
|
# Find the ODBC library
|
||||||
|
#
|
||||||
|
# This module defines:
|
||||||
|
# ODBC_FOUND - whether the ODBC library was found
|
||||||
|
# ODBC_INCLUDE_DIRS - the ODBC include directories
|
||||||
|
# ODBC_LIBRARIES - the ODBC libraries
|
||||||
|
|
||||||
|
# Try pkg-config first
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
if(PkgConfig_FOUND)
|
||||||
|
pkg_check_modules(PC_ODBC QUIET odbc)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Find include directory
|
||||||
|
find_path(ODBC_INCLUDE_DIR
|
||||||
|
NAMES sql.h
|
||||||
|
HINTS
|
||||||
|
${PC_ODBC_INCLUDE_DIRS}
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
)
|
||||||
|
|
||||||
|
# Find library
|
||||||
|
if(WIN32)
|
||||||
|
# On Windows, ODBC is typically available as odbc32
|
||||||
|
find_library(ODBC_LIBRARY
|
||||||
|
NAMES odbc32
|
||||||
|
HINTS
|
||||||
|
${PC_ODBC_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
# On Unix, look for odbc
|
||||||
|
find_library(ODBC_LIBRARY
|
||||||
|
NAMES odbc iodbc
|
||||||
|
HINTS
|
||||||
|
${PC_ODBC_LIBRARY_DIRS}
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(ODBC
|
||||||
|
REQUIRED_VARS ODBC_LIBRARY ODBC_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
if(ODBC_FOUND)
|
||||||
|
set(ODBC_LIBRARIES ${ODBC_LIBRARY})
|
||||||
|
set(ODBC_INCLUDE_DIRS ${ODBC_INCLUDE_DIR})
|
||||||
|
|
||||||
|
if(NOT TARGET ODBC::ODBC)
|
||||||
|
add_library(ODBC::ODBC UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(ODBC::ODBC PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${ODBC_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${ODBC_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(ODBC_INCLUDE_DIR ODBC_LIBRARY)
|
||||||
45
cmake/FindPAM.cmake
Normal file
45
cmake/FindPAM.cmake
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# FindPAM.cmake
|
||||||
|
#
|
||||||
|
# Find the PAM library
|
||||||
|
#
|
||||||
|
# This module defines:
|
||||||
|
# PAM_FOUND - whether the PAM library was found
|
||||||
|
# PAM_INCLUDE_DIRS - the PAM include directories
|
||||||
|
# PAM_LIBRARIES - the PAM libraries
|
||||||
|
|
||||||
|
# Find include directory
|
||||||
|
find_path(PAM_INCLUDE_DIR
|
||||||
|
NAMES security/pam_appl.h pam/pam_appl.h
|
||||||
|
HINTS
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
)
|
||||||
|
|
||||||
|
# Find library
|
||||||
|
find_library(PAM_LIBRARY
|
||||||
|
NAMES pam
|
||||||
|
HINTS
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(PAM
|
||||||
|
REQUIRED_VARS PAM_LIBRARY PAM_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
if(PAM_FOUND)
|
||||||
|
set(PAM_LIBRARIES ${PAM_LIBRARY})
|
||||||
|
set(PAM_INCLUDE_DIRS ${PAM_INCLUDE_DIR})
|
||||||
|
|
||||||
|
if(NOT TARGET PAM::PAM)
|
||||||
|
add_library(PAM::PAM UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(PAM::PAM PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${PAM_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${PAM_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY)
|
||||||
69
cmake/FindPCRE2.cmake
Normal file
69
cmake/FindPCRE2.cmake
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
# FindPCRE2.cmake
|
||||||
|
#
|
||||||
|
# Find the PCRE2 library
|
||||||
|
#
|
||||||
|
# This module defines:
|
||||||
|
# PCRE2_FOUND - whether the PCRE2 library was found
|
||||||
|
# PCRE2_INCLUDE_DIRS - the PCRE2 include directories
|
||||||
|
# PCRE2_LIBRARIES - the PCRE2 libraries
|
||||||
|
# PCRE2_VERSION - the PCRE2 version
|
||||||
|
|
||||||
|
# Try pkg-config first
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
if(PkgConfig_FOUND)
|
||||||
|
pkg_check_modules(PC_PCRE2 QUIET libpcre2-8)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Find include directory
|
||||||
|
find_path(PCRE2_INCLUDE_DIR
|
||||||
|
NAMES pcre2.h
|
||||||
|
HINTS
|
||||||
|
${PC_PCRE2_INCLUDE_DIRS}
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
PATH_SUFFIXES
|
||||||
|
pcre2
|
||||||
|
)
|
||||||
|
|
||||||
|
# Find library
|
||||||
|
find_library(PCRE2_LIBRARY
|
||||||
|
NAMES pcre2-8 pcre2-8d pcre2
|
||||||
|
HINTS
|
||||||
|
${PC_PCRE2_LIBRARY_DIRS}
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
# Extract version from header
|
||||||
|
if(PCRE2_INCLUDE_DIR AND EXISTS "${PCRE2_INCLUDE_DIR}/pcre2.h")
|
||||||
|
file(STRINGS "${PCRE2_INCLUDE_DIR}/pcre2.h" PCRE2_VERSION_MAJOR_LINE
|
||||||
|
REGEX "^#define[ \t]+PCRE2_MAJOR[ \t]+[0-9]+")
|
||||||
|
file(STRINGS "${PCRE2_INCLUDE_DIR}/pcre2.h" PCRE2_VERSION_MINOR_LINE
|
||||||
|
REGEX "^#define[ \t]+PCRE2_MINOR[ \t]+[0-9]+")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+PCRE2_MAJOR[ \t]+([0-9]+)" "\\1"
|
||||||
|
PCRE2_VERSION_MAJOR "${PCRE2_VERSION_MAJOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+PCRE2_MINOR[ \t]+([0-9]+)" "\\1"
|
||||||
|
PCRE2_VERSION_MINOR "${PCRE2_VERSION_MINOR_LINE}")
|
||||||
|
set(PCRE2_VERSION "${PCRE2_VERSION_MAJOR}.${PCRE2_VERSION_MINOR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(PCRE2
|
||||||
|
REQUIRED_VARS PCRE2_LIBRARY PCRE2_INCLUDE_DIR
|
||||||
|
VERSION_VAR PCRE2_VERSION
|
||||||
|
)
|
||||||
|
|
||||||
|
if(PCRE2_FOUND)
|
||||||
|
set(PCRE2_LIBRARIES ${PCRE2_LIBRARY})
|
||||||
|
set(PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR})
|
||||||
|
|
||||||
|
if(NOT TARGET PCRE2::PCRE2)
|
||||||
|
add_library(PCRE2::PCRE2 UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(PCRE2::PCRE2 PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${PCRE2_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${PCRE2_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(PCRE2_INCLUDE_DIR PCRE2_LIBRARY)
|
||||||
76
cmake/plugins.cmake
Normal file
76
cmake/plugins.cmake
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
#
|
||||||
|
# 3proxy plugin definitions
|
||||||
|
#
|
||||||
|
# This file defines functions for building plugins
|
||||||
|
#
|
||||||
|
|
||||||
|
# Function to add a simple plugin (single source file, no dependencies)
|
||||||
|
function(add_3proxy_plugin_simple PLUGIN_NAME SOURCE_FILE)
|
||||||
|
if(WIN32)
|
||||||
|
set(PLUGIN_SUFFIX ".dll")
|
||||||
|
else()
|
||||||
|
set(PLUGIN_SUFFIX ".ld.so")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(${PLUGIN_NAME} SHARED ${SOURCE_FILE})
|
||||||
|
|
||||||
|
set_target_properties(${PLUGIN_NAME} PROPERTIES
|
||||||
|
PREFIX ""
|
||||||
|
SUFFIX ${PLUGIN_SUFFIX}
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(${PLUGIN_NAME} PRIVATE Threads::Threads)
|
||||||
|
|
||||||
|
target_include_directories(${PLUGIN_NAME} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Function to add a plugin with dependencies
|
||||||
|
function(add_3proxy_plugin PLUGIN_NAME)
|
||||||
|
set(options "")
|
||||||
|
set(oneValueArgs "")
|
||||||
|
set(multiValueArgs SOURCES LIBRARIES INCLUDE_DIRS COMPILE_DEFINITIONS LINK_OPTIONS)
|
||||||
|
|
||||||
|
cmake_parse_arguments(PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(PLUGIN_SUFFIX ".dll")
|
||||||
|
else()
|
||||||
|
set(PLUGIN_SUFFIX ".ld.so")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES})
|
||||||
|
|
||||||
|
set_target_properties(${PLUGIN_NAME} PROPERTIES
|
||||||
|
PREFIX ""
|
||||||
|
SUFFIX ${PLUGIN_SUFFIX}
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
|
)
|
||||||
|
|
||||||
|
# Always link with Threads
|
||||||
|
target_link_libraries(${PLUGIN_NAME} PRIVATE Threads::Threads)
|
||||||
|
|
||||||
|
if(PLUGIN_LIBRARIES)
|
||||||
|
target_link_libraries(${PLUGIN_NAME} PRIVATE ${PLUGIN_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PLUGIN_INCLUDE_DIRS)
|
||||||
|
target_include_directories(${PLUGIN_NAME} PRIVATE ${PLUGIN_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PLUGIN_COMPILE_DEFINITIONS)
|
||||||
|
target_compile_definitions(${PLUGIN_NAME} PRIVATE ${PLUGIN_COMPILE_DEFINITIONS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PLUGIN_LINK_OPTIONS)
|
||||||
|
set_target_properties(${PLUGIN_NAME} PROPERTIES LINK_OPTIONS "${PLUGIN_LINK_OPTIONS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(${PLUGIN_NAME} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
4
src/plugins/FilePlugin/CMakeLists.txt
Normal file
4
src/plugins/FilePlugin/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# FilePlugin
|
||||||
|
add_3proxy_plugin(FilePlugin
|
||||||
|
SOURCES FilePlugin.c
|
||||||
|
)
|
||||||
20
src/plugins/PCREPlugin/CMakeLists.txt
Normal file
20
src/plugins/PCREPlugin/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# PCREPlugin - requires PCRE2
|
||||||
|
|
||||||
|
if(NOT PCRE2_FOUND)
|
||||||
|
message(STATUS "PCREPlugin requires PCRE2, skipping")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_3proxy_plugin(PCREPlugin
|
||||||
|
SOURCES pcre_plugin.c
|
||||||
|
COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=8
|
||||||
|
)
|
||||||
|
|
||||||
|
if(TARGET PCRE2::PCRE2)
|
||||||
|
target_link_libraries(PCREPlugin PRIVATE PCRE2::PCRE2)
|
||||||
|
else()
|
||||||
|
target_link_libraries(PCREPlugin PRIVATE ${PCRE2_LIBRARIES})
|
||||||
|
if(PCRE2_INCLUDE_DIRS)
|
||||||
|
target_include_directories(PCREPlugin PRIVATE ${PCRE2_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
@ -8,6 +8,7 @@
|
|||||||
#include "../../structures.h"
|
#include "../../structures.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#define PCRE2_CODE_UNIT_WIDTH 8
|
#define PCRE2_CODE_UNIT_WIDTH 8
|
||||||
|
#define PCRE2_STATIC
|
||||||
#include <pcre2.h>
|
#include <pcre2.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
19
src/plugins/PamAuth/CMakeLists.txt
Normal file
19
src/plugins/PamAuth/CMakeLists.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# PamAuth - requires PAM
|
||||||
|
|
||||||
|
if(NOT PAM_FOUND)
|
||||||
|
message(STATUS "PamAuth requires PAM, skipping")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_3proxy_plugin(PamAuth
|
||||||
|
SOURCES pamauth.c
|
||||||
|
)
|
||||||
|
|
||||||
|
if(TARGET PAM::PAM)
|
||||||
|
target_link_libraries(PamAuth PRIVATE PAM::PAM)
|
||||||
|
else()
|
||||||
|
target_link_libraries(PamAuth PRIVATE ${PAM_LIBRARIES})
|
||||||
|
if(PAM_INCLUDE_DIRS)
|
||||||
|
target_include_directories(PamAuth PRIVATE ${PAM_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
17
src/plugins/SSLPlugin/CMakeLists.txt
Normal file
17
src/plugins/SSLPlugin/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# SSLPlugin - requires OpenSSL
|
||||||
|
|
||||||
|
if(NOT TARGET OpenSSL::SSL)
|
||||||
|
message(STATUS "SSLPlugin requires OpenSSL, skipping")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_3proxy_plugin(SSLPlugin
|
||||||
|
SOURCES
|
||||||
|
ssl_plugin.c
|
||||||
|
my_ssl.c
|
||||||
|
LIBRARIES
|
||||||
|
OpenSSL::SSL
|
||||||
|
OpenSSL::Crypto
|
||||||
|
COMPILE_DEFINITIONS
|
||||||
|
WITH_SSL
|
||||||
|
)
|
||||||
@ -10,5 +10,5 @@ my_ssl$(OBJSUFFICS): my_ssl.c
|
|||||||
|
|
||||||
|
|
||||||
$(BUILDDIR)SSLPlugin$(DLSUFFICS): ssl_plugin$(OBJSUFFICS) my_ssl$(OBJSUFFICS)
|
$(BUILDDIR)SSLPlugin$(DLSUFFICS): ssl_plugin$(OBJSUFFICS) my_ssl$(OBJSUFFICS)
|
||||||
$(LN) $(LNOUT)../../$(BUILDDIR)SSLPlugin$(DLSUFFICS) $(LDFLAGS) $(DLFLAGS) ssl_plugin$(OBJSUFFICS) my_ssl$(OBJSUFFICS) $(LIBSPREFIX)crypto$(LIBSSUFFIX) $(LIBSPREFIX)ssl$(LIBSSUFFIX)
|
$(LN) $(LNOUT)../../$(BUILDDIR)SSLPlugin$(DLSUFFICS) $(LDFLAGS) $(DLFLAGS) ssl_plugin$(OBJSUFFICS) my_ssl$(OBJSUFFICS) $(LIBS)
|
||||||
|
|
||||||
4
src/plugins/StringsPlugin/CMakeLists.txt
Normal file
4
src/plugins/StringsPlugin/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# StringsPlugin
|
||||||
|
add_3proxy_plugin(StringsPlugin
|
||||||
|
SOURCES StringsPlugin.c
|
||||||
|
)
|
||||||
4
src/plugins/TrafficPlugin/CMakeLists.txt
Normal file
4
src/plugins/TrafficPlugin/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# TrafficPlugin
|
||||||
|
add_3proxy_plugin(TrafficPlugin
|
||||||
|
SOURCES TrafficPlugin.c
|
||||||
|
)
|
||||||
6
src/plugins/TransparentPlugin/CMakeLists.txt
Normal file
6
src/plugins/TransparentPlugin/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# TransparentPlugin
|
||||||
|
# Works on Linux (with netfilter), BSD and macOS (without netfilter support)
|
||||||
|
|
||||||
|
add_3proxy_plugin(TransparentPlugin
|
||||||
|
SOURCES transparent_plugin.c
|
||||||
|
)
|
||||||
10
src/plugins/WindowsAuthentication/CMakeLists.txt
Normal file
10
src/plugins/WindowsAuthentication/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# WindowsAuthentication
|
||||||
|
if(NOT WIN32)
|
||||||
|
message(STATUS "WindowsAuthentication requires Windows, skipping")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_3proxy_plugin(WindowsAuthentication
|
||||||
|
SOURCES WindowsAuthentication.c
|
||||||
|
LIBRARIES advapi32
|
||||||
|
)
|
||||||
4
src/plugins/utf8tocp1251/CMakeLists.txt
Normal file
4
src/plugins/utf8tocp1251/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# utf8tocp1251
|
||||||
|
add_3proxy_plugin(utf8tocp1251
|
||||||
|
SOURCES utf8tocp1251.c
|
||||||
|
)
|
||||||
Loading…
Reference in New Issue
Block a user