Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/Mona.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
workflow_dispatch:

jobs:
build-macOS-x64:
runs-on: macos-12
build-macOS-arm:
runs-on: macos-15

steps:
- uses: actions/checkout@master
Expand All @@ -20,7 +20,7 @@ jobs:

- name: Build
run: |
make -j${nproc}
make -j$(sysctl -n hw.physicalcpu)
mkdir -p MonaBin/MonaServer
mkdir -p MonaBin/MonaBase/lib
mkdir -p MonaBin/MonaCore/lib
Expand All @@ -31,11 +31,11 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: MonaServer-macOS-x64
name: MonaServer-macOS-arm
path: MonaBin

# TODO: Unit Tests don't work on mac for some reason
# - name: Unit Tests
#- name: Unit Tests
# run: |
# ./UnitTests -m=all
# cat UnitTests.log/0.log
Expand Down Expand Up @@ -88,11 +88,11 @@ jobs:
run: |
git clone https://github.com/LuaJIT/LuaJIT.git
cd LuaJIT
make -j${nproc} && sudo make install
make -j$(nproc) && sudo make install

- name: Build
run: |
make -j${nproc}
make -j$(nproc)
mkdir -p MonaBin/MonaServer
mkdir -p MonaBin/MonaBase/lib
mkdir -p MonaBin/MonaCore/lib
Expand Down
15 changes: 11 additions & 4 deletions MonaBase/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ endif
CXX?=g++

# Variables extendable
override CFLAGS+=-D_GLIBCXX_USE_C99 -std=c++14 -D__BIG_ENDIAN__=$(BIG_ENDIAN) -D_FILE_OFFSET_BITS=64 -Wall -Wno-reorder -Wno-terminate -Wunknown-pragmas -Wno-unknown-warning-option -Wno-exceptions
override INCLUDES+=-I./include/ -I/usr/local/opt/openssl/include/
override CFLAGS+=-D_GLIBCXX_USE_C99 -std=c++14 -D__BIG_ENDIAN__=$(BIG_ENDIAN) -D_FILE_OFFSET_BITS=64 -Wall -Wno-deprecated-declarations -Wno-reorder -Wno-terminate -Wunknown-pragmas -Wno-unknown-warning-option -Wno-exceptions
override INCLUDES+=-I./include/
override LIBS+=-lcrypto -lssl
ifneq ("$(wildcard /usr/local/opt/openssl/lib/)","")
override LIBDIRS+=-L/usr/local/opt/openssl/lib/
ifeq ($(OS),Darwin)
ifneq ("$(wildcard $(shell brew --prefix openssl)/lib/)","")
override LIBDIRS+=-L$(shell brew --prefix openssl)/lib/
override CFLAGS+=-I$(shell brew --prefix openssl)/include/
endif
ifneq ("$(wildcard $(shell brew --prefix luajit)/lib/)","")
override LIBDIRS+=-L$(shell brew --prefix luajit)/lib/
override CFLAGS+=-I$(shell brew --prefix luajit)/include/
endif
endif
ifdef ENABLE_SRT
override CFLAGS += -DENABLE_SRT
Expand Down
1 change: 1 addition & 0 deletions MonaBase/include/Mona/Exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ details (or else see http://mozilla.org/MPL/2.0/).
#include "Mona/Mona.h"
#include "Mona/String.h"
#include "assert.h"
#include <stdexcept>

namespace Mona {

Expand Down
1 change: 1 addition & 0 deletions MonaBase/include/Mona/UnitTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ details (or else see http://mozilla.org/MPL/2.0/).

#include "Mona/Application.h"
#include "Mona/Stopwatch.h"
#include <stdexcept>

namespace Mona {

Expand Down
15 changes: 11 additions & 4 deletions MonaCore/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ endif
CXX?=g++

# Variables extendable
override CFLAGS+=-D_GLIBCXX_USE_C99 -std=c++14 -D__BIG_ENDIAN__=$(BIG_ENDIAN) -D_FILE_OFFSET_BITS=64 -Wall -Wno-reorder -Wno-terminate -Wunknown-pragmas -Wno-unknown-warning-option -Wno-overloaded-virtual -Wno-potentially-evaluated-expression -Wno-switch-bool -Wno-exceptions
override INCLUDES+=-I./../MonaBase/include/ -I./include/ -I/usr/local/opt/openssl/include/
override CFLAGS+=-D_GLIBCXX_USE_C99 -std=c++14 -D__BIG_ENDIAN__=$(BIG_ENDIAN) -D_FILE_OFFSET_BITS=64 -Wall -Wno-deprecated-declarations -Wno-reorder -Wno-terminate -Wunknown-pragmas -Wno-unknown-warning-option -Wno-overloaded-virtual -Wno-potentially-evaluated-expression -Wno-switch-bool -Wno-exceptions
override INCLUDES+=-I./../MonaBase/include/ -I./include/
override LIBDIRS+=-L./../MonaBase/lib/
override LIBS+=-lMonaBase -lcrypto -lssl
ifneq ("$(wildcard /usr/local/opt/openssl/lib/)","")
override LIBDIRS+=-L/usr/local/opt/openssl/lib/
ifeq ($(OS),Darwin)
ifneq ("$(wildcard $(shell brew --prefix openssl)/lib/)","")
override LIBDIRS+=-L$(shell brew --prefix openssl)/lib/
override CFLAGS+=-I$(shell brew --prefix openssl)/include/
endif
ifneq ("$(wildcard $(shell brew --prefix luajit)/lib/)","")
override LIBDIRS+=-L$(shell brew --prefix luajit)/lib/
override CFLAGS+=-I$(shell brew --prefix luajit)/include/
endif
endif
ifdef ENABLE_SRT
override CFLAGS += -DENABLE_SRT
Expand Down
6 changes: 4 additions & 2 deletions MonaCore/sources/RTMFP/RTMFP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ bool RTMFP::Send(Socket& socket, const Packet& packet, const SocketAddress& addr
}

bool RTMFP::Engine::decode(Exception& ex, Buffer& buffer, const SocketAddress& address) {
static UInt8 IV[KEY_SIZE];
static UInt8 IV[KEY_SIZE] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
EVP_CIPHER_CTX_reset(_context);
EVP_CipherInit_ex(_context, EVP_aes_128_cbc(), NULL, _key, IV, 0);
int temp;
EVP_CIPHER_CTX_set_padding(_context, 0);
int temp = buffer.size();
EVP_CipherUpdate(_context, buffer.data(), &temp, buffer.data(), buffer.size());
// Check CRC
BinaryReader reader(buffer.data(), buffer.size());
Expand Down
15 changes: 11 additions & 4 deletions MonaServer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ else
endif

# Variables extendable
override CFLAGS+=-D_GLIBCXX_USE_C99 -std=c++14 -D__BIG_ENDIAN__=$(BIG_ENDIAN) -D_FILE_OFFSET_BITS=64 -Wall -Wno-reorder -Wno-terminate -Wunknown-pragmas -Wno-unknown-warning-option -Wno-unused-value -Wno-exceptions
override INCLUDES+=-I../MonaBase/include/ -I../MonaCore/include/ -I../ -I/usr/local/opt/openssl/include/
override CFLAGS+=-D_GLIBCXX_USE_C99 -std=c++14 -D__BIG_ENDIAN__=$(BIG_ENDIAN) -D_FILE_OFFSET_BITS=64 -Wall -Wno-deprecated-declarations -Wno-reorder -Wno-terminate -Wunknown-pragmas -Wno-unknown-warning-option -Wno-unused-value -Wno-exceptions
override INCLUDES+=-I../MonaBase/include/ -I../MonaCore/include/ -I../
override LIBDIRS+=-L../MonaBase/lib/ -L../MonaCore/lib/
override LDFLAGS+="$(EXE_LINKER_FLAGS),-rpath,../MonaBase/lib/,-rpath,../MonaCore/lib/,-rpath,/usr/local/lib/,-rpath,/usr/local/lib64/"
override LIBS+=-pthread -lMonaBase -lMonaCore -lcrypto -lssl -lluajit-5.1
Expand All @@ -29,8 +29,15 @@ endif
ifneq ($(shell ldconfig -p | grep libatomic),)
override LIBS += -latomic
endif
ifneq ("$(wildcard /usr/local/opt/openssl/lib/)","")
override LIBDIRS+=-L/usr/local/opt/openssl/lib/
ifeq ($(OS),Darwin)
ifneq ("$(wildcard $(shell brew --prefix openssl)/lib/)","")
override LIBDIRS+=-L$(shell brew --prefix openssl)/lib/
override CFLAGS+=-I$(shell brew --prefix openssl)/include/
endif
ifneq ("$(wildcard $(shell brew --prefix luajit)/lib/)","")
override LIBDIRS+=-L$(shell brew --prefix luajit)/lib/
override CFLAGS+=-I$(shell brew --prefix luajit)/include/
endif
endif
ifneq ($(OS),FreeBSD)
override LIBS+= -ldl
Expand Down
15 changes: 11 additions & 4 deletions MonaTiny/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ else
endif

# Variables extendable
override CFLAGS+=-D_GLIBCXX_USE_C99 -std=c++14 -D__BIG_ENDIAN__=$(BIG_ENDIAN) -D_FILE_OFFSET_BITS=64 -Wall -Wno-reorder -Wno-terminate -Wunknown-pragmas -Wno-unknown-warning-option -Wno-exceptions
override INCLUDES+=-I../MonaBase/include/ -I../MonaCore/include/ -I../ -I/usr/local/opt/openssl/include/
override CFLAGS+=-D_GLIBCXX_USE_C99 -std=c++14 -D__BIG_ENDIAN__=$(BIG_ENDIAN) -D_FILE_OFFSET_BITS=64 -Wall -Wno-deprecated-declarations -Wno-reorder -Wno-terminate -Wunknown-pragmas -Wno-unknown-warning-option -Wno-exceptions
override INCLUDES+=-I../MonaBase/include/ -I../MonaCore/include/ -I../
override LIBDIRS+=-L../MonaBase/lib/ -L../MonaCore/lib/
override LDFLAGS+="$(EXE_LINKER_FLAGS),-rpath,../MonaBase/lib/,-rpath,../MonaCore/lib/,-rpath,/usr/local/lib/,-rpath,/usr/local/lib64/"
override LIBS+=-pthread -lMonaBase -lMonaCore -lcrypto -lssl
Expand All @@ -29,8 +29,15 @@ endif
ifneq ($(shell ldconfig -p | grep libatomic),)
override LIBS += -latomic
endif
ifneq ("$(wildcard /usr/local/opt/openssl/lib/)","")
override LIBDIRS+=-L/usr/local/opt/openssl/lib/
ifeq ($(OS),Darwin)
ifneq ("$(wildcard $(shell brew --prefix openssl)/lib/)","")
override LIBDIRS+=-L$(shell brew --prefix openssl)/lib/
override CFLAGS+=-I$(shell brew --prefix openssl)/include/
endif
ifneq ("$(wildcard $(shell brew --prefix luajit)/lib/)","")
override LIBDIRS+=-L$(shell brew --prefix luajit)/lib/
override CFLAGS+=-I$(shell brew --prefix luajit)/include/
endif
endif
ifneq ($(OS),FreeBSD)
override LIBS+= -ldl
Expand Down
15 changes: 11 additions & 4 deletions UnitTests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ CXX?=g++
EXEC?=UnitTests

# Variables extendable
override CFLAGS+=-D_GLIBCXX_USE_C99 -std=c++14 -D__BIG_ENDIAN__=$(BIG_ENDIAN) -D_FILE_OFFSET_BITS=64 -Wall -Wno-reorder -Wno-terminate -Wunknown-pragmas -Wno-unknown-warning-option -Wno-exceptions
override INCLUDES+=-I../MonaBase/include/ -I../ -I/usr/local/opt/openssl/include/
override CFLAGS+=-D_GLIBCXX_USE_C99 -std=c++14 -D__BIG_ENDIAN__=$(BIG_ENDIAN) -D_FILE_OFFSET_BITS=64 -Wall -Wno-deprecated-declarations -Wno-reorder -Wno-terminate -Wunknown-pragmas -Wno-unknown-warning-option -Wno-exceptions
override INCLUDES+=-I../MonaBase/include/ -I../
override LIBDIRS+=-L../MonaBase/lib/
override LDFLAGS+="-Wl,-rpath,$(CURDIR)/../MonaBase/lib/,-rpath,/usr/local/lib/,-rpath,/usr/local/lib64/"
override LIBS+=-pthread -lMonaBase -lcrypto -lssl
Expand All @@ -23,8 +23,15 @@ endif
ifneq ($(shell ldconfig -p | grep libatomic),)
override LIBS += -latomic
endif
ifneq ("$(wildcard /usr/local/opt/openssl/lib/)","")
override LIBDIRS+=-L/usr/local/opt/openssl/lib/
ifeq ($(OS),Darwin)
ifneq ("$(wildcard $(shell brew --prefix openssl)/lib/)","")
override LIBDIRS+=-L$(shell brew --prefix openssl)/lib/
override CFLAGS+=-I$(shell brew --prefix openssl)/include/
endif
ifneq ("$(wildcard $(shell brew --prefix luajit)/lib/)","")
override LIBDIRS+=-L$(shell brew --prefix luajit)/lib/
override CFLAGS+=-I$(shell brew --prefix luajit)/include/
endif
endif
ifneq ($(OS),FreeBSD)
override LIBS+= -ldl
Expand Down