mirror of
https://github.com/3proxy/3proxy.git
synced 2026-04-06 21:30:12 +08:00
Fix external libraries
Some checks are pending
C/C++ CI / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (windows-2022) (push) Waiting to run
Some checks are pending
C/C++ CI / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (windows-2022) (push) Waiting to run
This commit is contained in:
parent
ea8837e4b9
commit
d2c343fbbc
12
.github/workflows/c-cpp.yml
vendored
12
.github/workflows/c-cpp.yml
vendored
@ -50,12 +50,15 @@ jobs:
|
||||
- name: make clean MacOS
|
||||
if: ${{ startsWith(matrix.target, 'macos') }}
|
||||
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
|
||||
if: ${{ startsWith(matrix.target, 'windows') }}
|
||||
run: make -f Makefile.win
|
||||
env:
|
||||
LIBS: '-L "c:/program files/openssl/lib/VC/x64/MT"'
|
||||
CFLAGS: '-I "c:/program files/openssl/include"'
|
||||
LDFLAGS: '-L "c:/msys64/mingw64/lib"'
|
||||
CFLAGS: '-I "c:/msys64/mingw64/include"'
|
||||
- name: make clean Windows
|
||||
if: ${{ startsWith(matrix.target, 'windows') }}
|
||||
run: make -f Makefile.win clean
|
||||
@ -69,11 +72,8 @@ jobs:
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||
D:
|
||||
cd "D:/a/3proxy/3proxy"
|
||||
vcpkg install pcre2:x64-windows
|
||||
mkdir bin64
|
||||
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 clean
|
||||
env:
|
||||
CFLAGS: '-I "c:/program files/openssl/include" -I "c:/vcpkg/installed/x64-windows/include"'
|
||||
|
||||
|
||||
@ -15,8 +15,8 @@ LDFLAGS += -pthread -fno-strict-aliasing
|
||||
# -ldl or -lld may be required for some platforms
|
||||
DCFLAGS ?= -fPIC
|
||||
DLFLAGS ?= -shared
|
||||
LIBS ?=
|
||||
DLSUFFICS = .so
|
||||
LIBS ?=
|
||||
LIBSPREFIX = -l
|
||||
LIBSSUFFIX =
|
||||
LNOUT = -o
|
||||
@ -32,6 +32,7 @@ MAKEFILE = Makefile.FreeBSD
|
||||
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)
|
||||
ifeq ($(OPENSSL_CHECK), true)
|
||||
LIBS += -l crypto -l ssl
|
||||
PLUGINS += SSLPlugin
|
||||
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)
|
||||
|
||||
@ -14,7 +14,7 @@ CFLAGS := -g -fPIC -O2 -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOU
|
||||
COUT = -o
|
||||
LN ?= ${CC}
|
||||
DCFLAGS ?=
|
||||
LDFLAGS ?= -fPIC -O2 -fno-strict-aliasing -pthread
|
||||
LDFLAGS := -fPIC -O2 -fno-strict-aliasing -pthread $(LDFLAGS)
|
||||
DLFLAGS ?= -shared
|
||||
DLSUFFICS = .ld.so
|
||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
||||
@ -38,6 +38,7 @@ LIBS ?= -ldl
|
||||
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)
|
||||
ifeq ($(OPENSSL_CHECK), true)
|
||||
LIBS += -l crypto -l ssl
|
||||
PLUGINS += SSLPlugin
|
||||
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)
|
||||
|
||||
@ -14,7 +14,8 @@ LN = link
|
||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386
|
||||
DLFLAGS = /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 =
|
||||
LIBSSUFFIX = .lib
|
||||
LIBEXT = .lib
|
||||
|
||||
@ -16,7 +16,8 @@ LN = link
|
||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:x64
|
||||
DLFLAGS = /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 =
|
||||
LIBSSUFFIX = .lib
|
||||
LIBEXT = .lib
|
||||
|
||||
@ -14,7 +14,7 @@ LN = link
|
||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:arm64
|
||||
DLFLAGS = /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 =
|
||||
LIBSPREFIX =
|
||||
LIBSSUFFIX = .lib
|
||||
|
||||
@ -31,11 +31,14 @@ TYPECOMMAND = cat
|
||||
COMPATLIBS =
|
||||
MAKEFILE = Makefile.openwrt-mips
|
||||
# PamAuth requires libpam, you may require pam-devel package to be installed
|
||||
# SSLPlugin requires -lcrypto -lssl
|
||||
#LIBS = -lcrypto -lssl -ldl
|
||||
LIBS ?= -ldl
|
||||
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
||||
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)
|
||||
ifeq ($(OPENSSL_CHECK), true)
|
||||
LIBS += -l crypto -l ssl
|
||||
PLUGINS += SSLPlugin
|
||||
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)
|
||||
|
||||
@ -36,6 +36,7 @@ MAKEFILE = Makefile.unix
|
||||
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)
|
||||
ifeq ($(OPENSSL_CHECK), true)
|
||||
LIBS += -l crypto -l ssl
|
||||
PLUGINS += SSLPlugin
|
||||
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)
|
||||
|
||||
@ -13,7 +13,7 @@ CC ?= gcc
|
||||
CFLAGS := -O2 -s -c -mthreads -DWITH_STD_MALLOC -DWITH_WSAPOLL $(CFLAGS)
|
||||
COUT = -o
|
||||
LN ?= $(CC)
|
||||
LDFLAGS ?= -O2 -s -mthreads
|
||||
LDFLAGS := -O2 -s -mthreads $(LDFLAGS)
|
||||
DLFLAGS ?= -shared
|
||||
DLSUFFICS = .dll
|
||||
LIBS := -lws2_32 -lodbc32 -ladvapi32 -luser32 $(LIBS)
|
||||
@ -38,13 +38,14 @@ AFTERCLEAN = (find . -type f -name "*.o" -delete && find . -type f -name "*.res"
|
||||
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)
|
||||
ifeq ($(OPENSSL_CHECK), true)
|
||||
LIBS += -l crypto -l ssl
|
||||
PLUGINS += SSLPlugin
|
||||
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)
|
||||
ifeq ($(PAM_CHECK), true)
|
||||
PLUGINS += PamAuth
|
||||
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)
|
||||
PLUGINS += PCREPlugin
|
||||
endif
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "../../structures.h"
|
||||
#include <string.h>
|
||||
#define PCRE2_CODE_UNIT_WIDTH 8
|
||||
#define PCRE2_STATIC
|
||||
#include <pcre2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -10,5 +10,5 @@ my_ssl$(OBJSUFFICS): my_ssl.c
|
||||
|
||||
|
||||
$(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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user