Skip to content

Commit

Permalink
Plugin: Openssl3 switch (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
hbeni committed Aug 3, 2023
1 parent 380bbdb commit 1e44a9a
Show file tree
Hide file tree
Showing 4 changed files with 3,252 additions and 1,811 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:

- name: Build and run CATCH2 tests
run: |
make -C client/mumble-plugin/ CC=g++-11 CFLAGS+="-I/usr/local/opt/openssl@1.1/include/ -L/usr/local/opt/openssl@1.1/lib/" test
make -C client/mumble-plugin/ CC=g++-11 test
- name: Build Plugin
run: |
make -C client/mumble-plugin/ CFLAGS+="-I/usr/local/opt/openssl@1.1/include/ -L/usr/local/opt/openssl@1.1/lib/" plugin-macOS
make -C client/mumble-plugin/ plugin-macOS
- name: Upload plugin
uses: actions/upload-artifact@main
Expand All @@ -49,7 +49,7 @@ jobs:

build_release_package:
name: Build release package
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: build_macPlugin

steps:
Expand Down Expand Up @@ -126,11 +126,11 @@ jobs:

- name: Build and run CATCH2 tests
run: |
make -C client/mumble-plugin/ DEBUG+="-g3 -Og -DDEBUG" CC=g++-11 CFLAGS+="-I/usr/local/opt/openssl@1.1/include/ -L/usr/local/opt/openssl@1.1/lib/" test
make -C client/mumble-plugin/ DEBUG+="-g3 -Og -DDEBUG" CC=g++-11 test
- name: Build Plugin
run: |
make -C client/mumble-plugin/ DEBUG+="-g3 -Og -DDEBUG" CFLAGS+="-I/usr/local/opt/openssl@1.1/include/ -L/usr/local/opt/openssl@1.1/lib/" plugin-macOS
make -C client/mumble-plugin/ DEBUG+="-g3 -Og -DDEBUG" plugin-macOS
- name: Upload plugin
uses: actions/upload-artifact@main
Expand All @@ -142,7 +142,7 @@ jobs:

build_release_package-debug:
name: Build release package (debug version)
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: build_macPlugin-debug

steps:
Expand Down
34 changes: 16 additions & 18 deletions client/mumble-plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ THREADS_UNIX=-pthread
THREADS_WIN=-Wl,-Bstatic -lstdc++ -lpthread -lws2_32
override CFLAGS+=-Wall -O3 -I. -I./lib $(DEBUG)
override CFLAGS_WIN+=-Wl,--subsystem,windows -static-libgcc -static-libstdc++ $(CFLAGS)
SSLFLAGS+=-lssl -lcrypto -DSSLFLAGS
SSLFLAGS+=-I./lib/openssl/include/ -L./lib/openssl/ -lssl -lcrypto -DSSLFLAGS
SSLFLAGS_WIN+=-I./lib/openssl/include/ -L./lib/openssl/ -static -lssl -lcrypto -lws2_32 -lcrypt32 -DSSLFLAGS -D_WIN32
# Note on flags: -D_WIN32 is needed by httplib on Windows

Expand Down Expand Up @@ -153,32 +153,30 @@ plugin-win-dllresource:
# shortcut for building natively on macOS
plugin-macOS: CC=g++-11
plugin-macOS: outname=fgcom-mumble-macOS.bundle
plugin-macOS:
make CC=$(CC) outname=$(outname) CFLAGS+="-I/usr/local/opt/openssl/include/ -L/usr/local/opt/openssl/lib/" plugin
plugin-macOS: openssl-macOS
make CC=$(CC) outname=$(outname) plugin

# OpenSSL (static build)
# OpenSSL
# The sources are located under lib/openssl as git submodule, and supposed to point to the latest stable head
# Info on configure options: https://wiki.openssl.org/index.php/Compilation_and_Installation
openssl-win:
ifdef SSLFLAGS
@echo "BUILD OpenSSL"
git submodule init
git submodule update
cd lib/openssl/ && git reset --hard
cd lib/openssl/ && ./Configure mingw64 -static no-pinshared no-weak-ssl-ciphers no-ssl2 no-ssl3 no-idea no-dtls1 --cross-compile-prefix=x86_64-w64-mingw32- && make clean && make -j4
else
@echo "Skipping building OpenSSL"
endif
openssl-win: openSSLBuildOpts=mingw64 -static
openssl-win: openSSLCrossCompileOpts=--cross-compile-prefix=x86_64-w64-mingw32-
openssl-win: openssl

openssl-win32: openSSLBuildOpts=mingw -static
openssl-win32: openSSLCrossCompileOpts=--cross-compile-prefix=i686-w64-mingw32-
openssl-win32: openssl

openssl-win32:
openssl-macOS: openSSLBuildOpts=
openssl-macOS: openssl

openssl:
ifdef SSLFLAGS
@echo "BUILD OpenSSL"
git submodule init
git submodule update
cd lib/openssl/ && git reset --hard
cd lib/openssl/ && ./Configure mingw -static no-pinshared no-weak-ssl-ciphers no-ssl2 no-ssl3 no-idea no-dtls1 --cross-compile-prefix=i686-w64-mingw32- && make clean && make -j4
cd lib/openssl/ && ./Configure $(openSSLBuildOpts) no-pinshared no-weak-ssl-ciphers no-ssl3 no-idea no-dtls1 $(openSSLCrossCompileOpts) && make clean && make -j4
else
@echo "Skipping building OpenSSL"
endif


Loading

0 comments on commit 1e44a9a

Please sign in to comment.