Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
fa9d9eb
update version number for next dev version;
gatekeep Sep 3, 2025
f3f1e97
implement passing complex types as refs in lambda functions;
gatekeep Sep 8, 2025
7772127
move KMM NoService response into its own helper function;
gatekeep Sep 8, 2025
234c7a4
remove data call collisions (this code was really iffy); refactor log…
gatekeep Sep 8, 2025
acc192f
set RSI data properly for outgoing KMM frame;
gatekeep Sep 9, 2025
cfc428d
implement TEK encryption with an AES-256 KEK;
gatekeep Sep 9, 2025
361abfb
add support for unwrapping (decrypting) a KEK encrypted TEK;
gatekeep Sep 9, 2025
aa2b6ea
reorganize code and organization for handling P25 OTAR KMMs for bette…
gatekeep Sep 19, 2025
a3726c4
force hard disable KMF services if OpenSSL isn't compiled in; add ins…
gatekeep Sep 19, 2025
bedba9c
add support to expose KMF services via DLI UDP; add plumbing to suppo…
gatekeep Sep 19, 2025
548f79d
add some debug dumping;
gatekeep Sep 19, 2025
ae9703a
BUGFIX: null reference when trying to perform old style lookup of tim…
gatekeep Sep 19, 2025
dd3bc4a
Merge branch 'master' into r04k34_dev
gatekeep Sep 19, 2025
a23b387
standardize KMM logging;
gatekeep Sep 19, 2025
a36983f
begin adding support for V.24 PDU data;
gatekeep Sep 19, 2025
14181e6
fix C++ namespace shenanigans;
gatekeep Sep 19, 2025
f061cc8
fix documentation error;
gatekeep Sep 19, 2025
db85755
add support for outgoing V.24 PDU data;
gatekeep Sep 20, 2025
ee1d535
minor alterations to bridge UDP audio logic; set better default for b…
gatekeep Sep 23, 2025
784051c
re-engineer entirely how source untimed raw PCM frames over UDP are h…
gatekeep Sep 23, 2025
88208aa
add support to resize the recv and send buffers on the raw UDP socket…
gatekeep Sep 23, 2025
7f55b5a
set socket buffer sizes to larger values then the default;
gatekeep Sep 23, 2025
bf36dd0
annotate Linux limiting the maximum send and recv socket buffer sizes
gatekeep Sep 23, 2025
963af4b
update dvmhost submodule;
gatekeep Sep 23, 2025
8f634eb
use a 2M buffer for bridge UDP audio;
gatekeep Sep 23, 2025
4f32796
display the socket buffer resize as warnings and not errors;
gatekeep Sep 23, 2025
889192d
reduce UDP recv/send buffer size to a lower reasonable value of 512K;
gatekeep Sep 25, 2025
2399e50
update README.md;
gatekeep Sep 25, 2025
0ac2bbd
add more class copy safety;
gatekeep Sep 25, 2025
55e63e1
correct missing parens;
gatekeep Sep 25, 2025
1975d4f
correct loop indexing; remove unused variable;
gatekeep Sep 25, 2025
0a8c990
deprecate unused DIU flag (this isn't what this byte meant in the fir…
gatekeep Sep 25, 2025
dffe262
add call start marker to main application log;
gatekeep Sep 30, 2025
32e0b97
remove SIP classes (this will be done by a different team, and done d…
gatekeep Oct 1, 2025
270e431
whoops accidentally blew away activity log transmission to the FNE, f…
gatekeep Oct 1, 2025
9d8d4fd
add better concurrency protection to AffiliationLookup; fix issues wh…
gatekeep Oct 1, 2025
5d75bab
remove __spinlock() from touchGrant() and isGranted();
gatekeep Oct 1, 2025
b8f228f
correct bad ordering of log message for call source switching;
gatekeep Oct 2, 2025
0646ba5
remove blockTrafficTo; implement promiscuous hub mode for FNE (this m…
gatekeep Oct 2, 2025
6995c25
fix typo;
gatekeep Oct 2, 2025
5df7bd3
for the purposes of my OCD fix incorrect one-liner Doxygen documentat…
gatekeep Oct 2, 2025
2f91135
better document peer ID and rid ACL list files;
gatekeep Oct 3, 2025
2e1d60c
add backward for stacktrace support on crash;
gatekeep Oct 4, 2025
a6f5e49
fix FNE compilation when SSL is not available; make Win32 builds work…
gatekeep Oct 4, 2025
a3087c6
remove double error message;
gatekeep Oct 4, 2025
fb4e2bc
generate stacktrace file if main logger file is not initialized or un…
gatekeep Oct 4, 2025
dc8a35b
reduce the use of unordered_map::at();
gatekeep Oct 4, 2025
4db617a
begin relabeling peer-link to peer replication/peer replica;
gatekeep Oct 5, 2025
bf23495
implement identity with qualifier, this makes logs (and only logs) ea…
gatekeep Oct 6, 2025
fb884be
lock m_status and m_statusPVCall before trying to update data elements;
gatekeep Oct 6, 2025
d972ab5
don't drop out-of-order packets (this was a bad idea, instead log an …
gatekeep Oct 6, 2025
f3aaf07
update order of operations for peer ident;
gatekeep Oct 6, 2025
e81f842
normalize log messages;
gatekeep Oct 6, 2025
7891977
differentiate a call end collision from a call collision;
gatekeep Oct 6, 2025
d948652
differentiate a call grant collision from a call collision;
gatekeep Oct 6, 2025
9882a8b
fix missing code commenting;
gatekeep Oct 7, 2025
954cbc5
initial implementation of naive round-robin HA mechanism. this mechan…
gatekeep Oct 7, 2025
2e4b28a
hide debug messages unless debugging is enabled;
gatekeep Oct 7, 2025
b93b7f2
remove old call in progress global; refactor call collisions, allow t…
gatekeep Oct 7, 2025
ee24b40
simplify sendmmsg implementation;
gatekeep Oct 7, 2025
7eb1d3e
BUGFIX: correct scenario where traffic from an upstream master to a d…
gatekeep Oct 8, 2025
eade334
refactor how RTP multiplexing by stream is handled;
gatekeep Oct 8, 2025
2bd6377
fix some odd behavior with very fast calls locking up grants on on DV…
gatekeep Oct 8, 2025
96ff1e8
refactor RTP sequence count handling;
gatekeep Oct 8, 2025
23fe11b
Merge remote-tracking branch 'origin/master' into r04k34_dev
gatekeep Oct 8, 2025
d2168e5
whoops this stream ID check was intended for non-promiscuous operatio…
gatekeep Oct 8, 2025
83d7755
fix memory leak with PacketBuffer::decode(), dont use a direct heap a…
gatekeep Oct 20, 2025
7d4618d
simplify implementation;
gatekeep Oct 20, 2025
07c8eb2
rename backtrace namespace to log_stacktrace, when using simple mode …
gatekeep Oct 21, 2025
5754e19
whoops forgot to update BridgeMain.cpp for log_stacktrace;
gatekeep Oct 21, 2025
3ba4506
lock the peer list when writing traffic data to prevent peer removal …
gatekeep Oct 21, 2025
a89cac4
utilize a shared_timed_mutex for peer list locking on the FNE, this b…
gatekeep Oct 21, 2025
dcdfe23
better handling locking peer connections during critical state changes;
gatekeep Oct 21, 2025
64c651d
whoops this lock should only take place for a connected peer;
gatekeep Oct 21, 2025
f053b56
reflect higher requirements for FNE; fix issue on host where sometime…
gatekeep Oct 21, 2025
f43885c
change around some naming;
gatekeep Oct 22, 2025
401acb6
typo;
gatekeep Oct 22, 2025
562f6b1
[EXPERIMENTAL] implement rudimentary spanning tree mechanism to preve…
gatekeep Oct 22, 2025
f0ea9ee
[EXPERIMENTAL] enhance detection for case where FNE A and FNE B are c…
gatekeep Oct 22, 2025
cc8a683
add REST API endpoint to fetch the master tree;
gatekeep Oct 22, 2025
d878d55
make sure master peer ID 0 doesnt ever happen;
gatekeep Oct 22, 2025
11d0d46
log condition where masterPeerId is 0
gatekeep Oct 22, 2025
30c2112
SysView peers announce themselves as an external FNE, but we do not c…
gatekeep Oct 22, 2025
24ec2d9
SysView masquarades its masterPeerId as itself;
gatekeep Oct 22, 2025
c6ada38
instead of killing a peer connection instantly on a duplicate conn dr…
gatekeep Oct 22, 2025
f0db1fc
better handle duplicate connection disconnect NAKs; add REST API on F…
gatekeep Oct 23, 2025
3f04070
fix issue with purely ACL virtual FNEs not being able to replicate co…
gatekeep Oct 23, 2025
1b9f70f
deprecate the "external FNE" terming for upstream FNE connections and…
gatekeep Oct 23, 2025
a082b81
more code cleanup, simplify naming;
gatekeep Oct 23, 2025
68ef404
cleanup code; refactor log messages from the FNE to better categorize…
gatekeep Oct 23, 2025
da15b05
enhance STP peer reconnect logic to allow peers announcing the same p…
gatekeep Oct 23, 2025
5ed30e6
update log colorizer to match new logging categories in the FNE;
gatekeep Oct 23, 2025
6c263e0
update log colorizer to match new logging categories in the FNE (roun…
gatekeep Oct 23, 2025
6e692ea
update log colorizer to match new logging categories in the FNE (roun…
gatekeep Oct 23, 2025
468a13a
update log colorizer to match new logging categories in the FNE (roun…
gatekeep Oct 23, 2025
cec396d
bump major version numbering in a preliminary fashion, at least until…
gatekeep Oct 24, 2025
1966073
fix messaging for fast peer reconnect (it was misleading as a RPTC NA…
gatekeep Oct 24, 2025
0015625
allow reparenting of a STP node if it moves from one tree node to ano…
gatekeep Oct 24, 2025
f12925e
implement tree cleanups if the downstream announcement removes child …
gatekeep Oct 24, 2025
7f2878f
relabel MasterTree to SpanningTree proper;
gatekeep Oct 24, 2025
aefba6b
whoops errant i++;
gatekeep Oct 24, 2025
9a8957b
fix up some concurrency problems when dealing with parrot transmissio…
gatekeep Oct 27, 2025
022e974
make sure to share lock peers while processing in maintainence loop;
gatekeep Oct 27, 2025
b7fa861
add mutex locking around spanning tree updates;
gatekeep Oct 27, 2025
aab7368
simplify log levels, deprecate LogMessage log level in favor of just …
gatekeep Oct 27, 2025
f5fea08
better classify log messages;
gatekeep Oct 27, 2025
5d1a057
simplify FNE configuration for peers, make identity a global applying…
gatekeep Oct 28, 2025
5e164a8
better report global identity;
gatekeep Oct 28, 2025
3d9f6f7
allow overriding the global identity for upstream connections; implem…
gatekeep Oct 28, 2025
63f8e71
update config examples to reflect new log levels;
gatekeep Oct 28, 2025
dbe827c
add back peer "name" field, this is strictly informational to make th…
gatekeep Oct 28, 2025
231f78f
Win32: bump version number for file resource metadata;
gatekeep Oct 28, 2025
63504d7
add documentation for packet payloads for: writeLogin, writeAuthorisa…
gatekeep Oct 28, 2025
9ce2e4e
add some more packet payload documentation;
gatekeep Oct 28, 2025
a162ec3
continue packet payload documenting;
gatekeep Oct 28, 2025
17895d2
minor comment alteration;
gatekeep Oct 28, 2025
e8a264a
correct DMR data handling; refactor FNE DMR data calls to be structur…
gatekeep Oct 28, 2025
600d574
use WASAPI by default on Windows;
gatekeep Oct 29, 2025
86d97bb
better handle out of order blocks for PDUs; reduce packet retry to 2;…
gatekeep Oct 29, 2025
70a8947
refactor how buffered UDP datagram queuing is performed;
gatekeep Oct 31, 2025
dcd22d0
relabel static class variables to use s_ and globals to use g_
gatekeep Oct 31, 2025
fd923b4
enhance colorize-host.sh to terminate color properly;
gatekeep Oct 31, 2025
69e8fbc
enhance colorize-host.sh to terminate color properly;
gatekeep Oct 31, 2025
9e4a0ca
RTS PTT will only assert when audio is present. Add holdoff timer be…
lorenzolrom Nov 1, 2025
e746e7f
add option to enable/disable upstream call start/end event logging;
gatekeep Nov 2, 2025
185aaf2
more work towards a working DLD-type OTAR service for P25;
gatekeep Nov 3, 2025
901ae6c
fix typos;
gatekeep Nov 3, 2025
c57f39c
Add carrier operated relay support to dvmbridge. (#104)
lorenzolrom Nov 4, 2025
dc03a84
refactor KMMFrame to properly support message number and add framewor…
gatekeep Nov 5, 2025
5c8fa29
begin work on generating KMM CMAC for message authentication;
gatekeep Nov 5, 2025
a794246
document sections of doc where a test originates test data;
gatekeep Nov 5, 2025
945a034
begin work on generating CBC-MAC for message authentication;
gatekeep Nov 6, 2025
36bac19
minor cleanups;
gatekeep Nov 6, 2025
489a1c4
test should be using generated key;
gatekeep Nov 6, 2025
96caec6
CBC-MAC now works properly; CMAC MAC generation works (just gotta fix…
gatekeep Nov 6, 2025
54b5f8f
complete CBC-MAC implemenation, at least for the provided samples fro…
gatekeep Nov 6, 2025
c5a298f
typo
gatekeep Nov 6, 2025
661ebe6
implement OFB data encryption per TIA-102.AAAD-B; test proper final e…
gatekeep Nov 6, 2025
c3f14f9
add experimental DES crypto;
gatekeep Nov 6, 2025
0b03962
move Git hash global defines out of Defines.h and into GitHash.h;
gatekeep Nov 6, 2025
ecb9341
fix copyrights;
gatekeep Nov 6, 2025
19f47a3
cleanup file headers containing lingering old comments; update fw/mod…
gatekeep Nov 6, 2025
cd37a9d
remove debug trace not needed anymore;
gatekeep Nov 6, 2025
96e68b4
add support for PDU auxiliary ES headers;
gatekeep Nov 7, 2025
5d411b2
complete refactor of how P25 PDUs are assembled from user data and di…
gatekeep Nov 8, 2025
fd91ed6
remove left over debug code; fix AMBT CRC-32 calculation error, AMBTs…
gatekeep Nov 8, 2025
ebaf24b
add some better error handling for NetRPC;
gatekeep Nov 10, 2025
8e509e0
validate LC_CALL_TERM peer ID before allowing them to repeat, this fi…
gatekeep Nov 10, 2025
fb0ff63
fix issue with dvmpatch not properly evaluating the destination TEK;
gatekeep Nov 11, 2025
bce1202
add support to patch to *disable* enc processing and allow frames to …
gatekeep Nov 11, 2025
13b5dd4
reorganize application files, I've wanted to do this for a while JSON…
gatekeep Nov 11, 2025
f55f8a3
add multi-block PDU for V.24;
gatekeep Nov 11, 2025
4a8be29
add some guard rails on PDU reception so we dont overflow ourselves;
gatekeep Nov 11, 2025
7e00a0a
it seems as if PDU_(UN)CONF_END is variable length, it will always be…
gatekeep Nov 11, 2025
f257389
cleanup dataBlocks pointer array;
gatekeep Nov 11, 2025
4aa2ead
preliminary code for sending PDU frames >3 blocks over V.24;
gatekeep Nov 11, 2025
fcfec19
use unsigned numbers for these loops the values should never be negat…
gatekeep Nov 11, 2025
5a73e26
properly encode sequence opcode;
gatekeep Nov 11, 2025
38e939e
whoops missing parens;
gatekeep Nov 11, 2025
2acb0d4
initialize these unordered_maps to allow the max connection cap count…
gatekeep Nov 11, 2025
268379b
well that was a little naive of me, I didnt multiply the count by the…
gatekeep Nov 11, 2025
9042511
reverse course lets do this more intelligently and implement the pass…
gatekeep Nov 11, 2025
1b08fb1
add STP check to see if a downstream leaf is blown itself away on the…
gatekeep Nov 12, 2025
2098fa0
implement DMR data PDU assembler based on the P25 PDU assembler;
gatekeep Nov 12, 2025
401e612
expand on the files related to an FNE instance for clarity;
gatekeep Nov 12, 2025
2524cee
add preliminary support for enabling peers with call priority, this w…
gatekeep Nov 12, 2025
fbd264a
implement a more solidified peer call priority mechanism using ICC;
gatekeep Nov 13, 2025
41f2539
bump WebSocketPP version to conform to new CMake minimum version; (#108)
nyaaaaaaatalie Nov 13, 2025
00fcc65
fix typo;
gatekeep Nov 17, 2025
ab5f169
add some documentation around newer protocol additions;
gatekeep Nov 17, 2025
67ef2dc
whoops typo;
gatekeep Nov 17, 2025
36e70f0
start adding foundational work for future P25 Phase 2;
gatekeep Nov 18, 2025
6e8cb20
decomplicate foundational changes to RS coders for Phase 2;
gatekeep Nov 18, 2025
caabdbe
added new peer config options to FNE REST api
W3AXL Nov 19, 2025
7e7ff91
add some locks around pkt maps in DiagNetwork;
gatekeep Nov 20, 2025
988c81b
better document the master peerId importance;
gatekeep Nov 21, 2025
41f0ce5
ensure buffers are set to nullptr after deleting to prevent double fr…
gatekeep Nov 21, 2025
9aa605a
skip trying to transmit any buffer that is null;
gatekeep Nov 21, 2025
bf1b07b
add thread safties to SpanningTree;
gatekeep Nov 21, 2025
e3a5faf
correct bad memory allocation;
gatekeep Nov 21, 2025
edcb4e3
revert previous change to add locking to SpanningTree (this is handle…
gatekeep Nov 21, 2025
e7a1b4f
make sure during resetPeer() we lock the connection;
gatekeep Nov 21, 2025
7e59e14
readd SpanningTree internal locking mechanisms;
gatekeep Nov 21, 2025
896953c
make sure pointers are set to null after delete;
gatekeep Nov 21, 2025
f89a60f
ensure when a FNE loses all its downstream leaves, that it will prope…
gatekeep Nov 21, 2025
2cb428f
fix defaultNetIdleTalkgroup being treated as a hex value instead of d…
gatekeep Nov 21, 2025
753d246
how about we dont blatently leave debug messages enabled...;
gatekeep Nov 21, 2025
7618380
BUGFIX: hopefully correct crash condition when trying to erase child …
gatekeep Nov 25, 2025
9c21855
followup for last commit, simplify implementation;
gatekeep Nov 25, 2025
a0b1e81
this will be unpopular, but I am deprecating support for cross-compil…
gatekeep Nov 29, 2025
3bac512
remove deprecated patch;
gatekeep Nov 29, 2025
35b8176
update README.md;
gatekeep Nov 29, 2025
506ea91
correct some cross-compile shennigans for OpenSSL;
gatekeep Nov 29, 2025
04c4f02
correct some cross-compile shennigans for aarch64;
gatekeep Nov 29, 2025
323c46e
BUGFIX: fix issue where the host would incorrectly reset the voice st…
gatekeep Nov 29, 2025
66eb3cc
match code change from previous bugfix to DMR and NXDN;
gatekeep Nov 29, 2025
59ac0da
dont use the deprecated OpenSSL1.1 functions, use portable AESCrypto …
gatekeep Nov 29, 2025
f7a6877
disable STP reparenting when deserializing children of a tree;
gatekeep Nov 30, 2025
2379924
BUGFIX: fix tged and peered in the case where an empty file or file w…
gatekeep Nov 30, 2025
f9b0aa1
BUGFIX: add some validation checks around deserialization reparenting;
gatekeep Dec 2, 2025
9855ab8
implement P25P2 reed-solomon codes for future use;
gatekeep Dec 2, 2025
eb73896
BUGFIX: correct bad check for parrot frames end of call;
gatekeep Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 4 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
needs: [setup]
strategy:
matrix:
arch: ["amd64", "arm", "aarch64", "armhf"]
arch: ["amd64", "arm", "aarch64"]
runs-on: ubuntu-22.04
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.DATE }}-${{ matrix.arch }}
Expand Down Expand Up @@ -105,12 +105,8 @@ jobs:
build_args="$build_args -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-s' -DCMAKE_CXX_FLAGS='-s'"
fi

if [[ "${{ matrix.arch }}" == 'armhf' ]]; then
cmake $(echo $build_args) -DCROSS_COMPILE_RPI_ARM=1 .
else
cmake $(echo $build_args) \
-D "CROSS_COMPILE_$(echo '${{ matrix.arch }}' | tr '[:lower:]' '[:upper:]')=1" .
fi
cmake $(echo $build_args) \
-D "CROSS_COMPILE_$(echo '${{ matrix.arch }}' | tr '[:lower:]' '[:upper:]')=1" .

make -j $(nproc)
make tarball
Expand Down Expand Up @@ -146,7 +142,7 @@ jobs:
needs: [setup, build, create-release]
strategy:
matrix:
arch: ["amd64", "arm", "aarch64", "armhf"]
arch: ["amd64", "arm", "aarch64"]
runs-on: ubuntu-22.04
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.DATE }}-${{ matrix.arch }}
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
needs: [setup]
strategy:
matrix:
arch: ["amd64", "arm", "aarch64", "armhf"]
arch: ["amd64", "arm", "aarch64"]
runs-on: ubuntu-22.04
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-${{ matrix.arch }}
Expand Down Expand Up @@ -77,12 +77,8 @@ jobs:

build_args="$build_args -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-s' -DCMAKE_CXX_FLAGS='-s'"

if [[ "${{ matrix.arch }}" == 'armhf' ]]; then
cmake $(echo $build_args) -DCROSS_COMPILE_RPI_ARM=1 .
else
cmake $(echo $build_args) \
-D "CROSS_COMPILE_$(echo '${{ matrix.arch }}' | tr '[:lower:]' '[:upper:]')=1" .
fi
cmake $(echo $build_args) \
-D "CROSS_COMPILE_$(echo '${{ matrix.arch }}' | tr '[:lower:]' '[:upper:]')=1" .

make -j $(nproc)
make strip
Expand Down Expand Up @@ -118,7 +114,7 @@ jobs:
needs: [setup, build, create-release]
strategy:
matrix:
arch: ["amd64", "arm", "aarch64", "armhf"]
arch: ["amd64", "arm", "aarch64"]
runs-on: ubuntu-22.04
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-${{ matrix.arch }}
Expand Down
126 changes: 52 additions & 74 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ endif (DISABLE_WEBSOCKETS)
# Cross-compile options
option(CROSS_COMPILE_ARM "Cross-compile for 32-bit ARM" off)
option(CROSS_COMPILE_AARCH64 "Cross-compile for 64-bit ARM" off)
option(CROSS_COMPILE_RPI_ARM "Cross-compile for (old RPi) 32-bit ARM" off)

option(COMPILE_WIN32 "Compile for Win32" off)

set(ENABLE_LIBDW_SUPPORT ON)

if (COMPILE_WIN32)
set(ARCH amd64)
set(CMAKE_SYSTEM_PROCESSOR amd64)
Expand Down Expand Up @@ -73,69 +75,37 @@ else()
endif (COMPILE_WIN32)

if (CROSS_COMPILE_ARM)
set(CMAKE_CROSSCOMPILING TRUE)
set(ARCH armhf CACHE STRING "Architecture" FORCE)
set(CMAKE_SYSTEM_PROCESSOR armhf CACHE STRING "System Processor" FORCE)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf CACHE STRING "Package Architecture" FORCE)
message(CHECK_START "Target Architecture - ${ARCH}")

set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc CACHE STRING "C compiler" FORCE)
set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++ CACHE STRING "C++ compiler" FORCE)
set(ARCH armhf)
set(CMAKE_SYSTEM_PROCESSOR armhf)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf)

set(OPENSSL_ROOT_DIR /usr/lib/arm-linux-gnueabihf)
message(CHECK_START "Target Architecture - ${ARCH}")
set(CMAKE_INCLUDE_PATH /usr/arm-linux-gnueabihf/include)
set(CMAKE_LIBRARY_PATH /usr/arm-linux-gnueabihf/lib)

message(CHECK_START "Cross compiling for 32-bit ARM - ${CMAKE_C_COMPILER}")
endif (CROSS_COMPILE_ARM)
if (CROSS_COMPILE_AARCH64)
set(CMAKE_CROSSCOMPILING TRUE)
set(ARCH aarch64 CACHE STRING "Architecture" FORCE)
set(CMAKE_SYSTEM_PROCESSOR aarch64 CACHE STRING "System Processor" FORCE)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE aarch64 CACHE STRING "Package Architecture" FORCE)
message(CHECK_START "Target Architecture - ${ARCH}")

set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc CACHE STRING "C compiler" FORCE)
set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++ CACHE STRING "C++ compiler" FORCE)
set(ARCH arm64)
set(CMAKE_SYSTEM_PROCESSOR arm64)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64)

set(OPENSSL_ROOT_DIR /usr/lib/aarch64-linux-gnu)
message(CHECK_START "Target Architecture - ${ARCH}")
set(CMAKE_INCLUDE_PATH /usr/aarch64-linux-gnu/include)
set(CMAKE_LIBRARY_PATH /usr/aarch64-linux-gnu/lib)
message(CHECK_START "Cross compiling for 64-bit ARM - ${CMAKE_C_COMPILER}")
endif (CROSS_COMPILE_AARCH64)

option(WITH_RPI_ARM_TOOLS "Specifies the location for the RPI ARM tools" off)
if (WITH_RPI_ARM_TOOLS)
set(RPI_ARM_TOOLS ${WITH_RPI_ARM_TOOLS})
message(CHECK_START "With RPi 1 Tools: ${RPI_ARM_TOOLS}")
endif (WITH_RPI_ARM_TOOLS)

if (CROSS_COMPILE_RPI_ARM)
if (NOT WITH_RPI_ARM_TOOLS)
message("-- Cloning legacy Raspberry Pi compilation toolchain")
include(FetchContent)
FetchContent_Declare(
RPiTools
GIT_REPOSITORY https://github.com/raspberrypi/tools.git
)
FetchContent_MakeAvailable(RPiTools)
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CACHE STRING "C compiler" FORCE)
set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ CACHE STRING "C++ compiler" FORCE)

message(CHECK_START "Apply OpenSSL library binaries for cross compling (old RPi) 32-bit ARM - ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src")
execute_process(COMMAND tar xzf contrib/openssl_cross_patch.RPI_ARM.tar.gz -C ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})

set(OPENSSL_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/lib)
else()
set(CMAKE_C_COMPILER ${RPI_ARM_TOOLS}/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CACHE STRING "C compiler" FORCE)
set(CMAKE_CXX_COMPILER ${RPI_ARM_TOOLS}/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ CACHE STRING "C++ compiler" FORCE)

message(CHECK_START "Apply OpenSSL library binaries for cross compling (old RPi) 32-bit ARM - ${RPI_ARM_TOOLS}")
execute_process(COMMAND tar xzf contrib/openssl_cross_patch.RPI_ARM.tar.gz -C ${RPI_ARM_TOOLS} WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})

set(OPENSSL_ROOT_DIR ${RPI_ARM_TOOLS}/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/lib)
endif ()

set(ARCH armhf)
set(CMAKE_SYSTEM_PROCESSOR armhf)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf)
message(CHECK_START "Target Architecture - ${ARCH}")
message(CHECK_START "Cross compiling for (old RPi) 32-bit ARM - ${CMAKE_C_COMPILER}")

# No TUI for this
set(ENABLE_TUI_SUPPORT OFF)
message(CHECK_START "Enable TUI support - no; for simplicity RPI_ARM cross-compiling does not support TUI.")
endif (CROSS_COMPILE_RPI_ARM)

# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

Expand Down Expand Up @@ -174,11 +144,6 @@ if (CROSS_COMPILE_ARM)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wno-psabi")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-psabi")
endif (CROSS_COMPILE_ARM)
if (CROSS_COMPILE_RPI_ARM)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=c99")
endif (CROSS_COMPILE_RPI_ARM)
if (COMPILE_WIN32)
set(CMAKE_C_FLAGS "/EHsc /D_WIN32 /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
set(CMAKE_CXX_FLAGS "/EHsc /D_WIN32 /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
Expand All @@ -191,6 +156,7 @@ set(CMAKE_INSTALL_PREFIX "/usr/local")
#
# Library Inclusions
#
# ASIO
if (NOT ASIO_INCLUDED)
option(WITH_ASIO "Manually specify the location for the ASIO library" off)
if (WITH_ASIO)
Expand All @@ -210,21 +176,49 @@ if (NOT ASIO_INCLUDED)
endif (WITH_ASIO)
endif (NOT ASIO_INCLUDED)

# WebSocket++
if (NOT DISABLE_WEBSOCKETS)
if (NOT WEBSOCKETPP_INCLUDED)
message("-- Cloning WebSocket++")
include(FetchContent)
FetchContent_Declare(
WEBSOCKETPP
GIT_REPOSITORY https://github.com/zaphoyd/websocketpp.git
GIT_TAG 56123c87598f8b1dd471be83ca841ceae07f95ba # 0.8.2
GIT_TAG 4dfe1be74e684acca19ac1cf96cce0df9eac2a2d # 0.8.2 with modified CMake version
)
FetchContent_MakeAvailable(WEBSOCKETPP)
add_subdirectory(${websocketpp_SOURCE_DIR} EXCLUDE_FROM_ALL)
set(WEBSOCKETPP_INCLUDED 1)
endif (NOT WEBSOCKETPP_INCLUDED)
endif (NOT DISABLE_WEBSOCKETS)

# elfutils (libdw-dev)
if (ENABLE_LIBDW_SUPPORT)
find_path(LIBDW_INCLUDE_DIR NAMES elfutils/libdw.h elfutils/libdwfl.h HINTS /usr /usr/local PATH_SUFFIXES include)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libdw DEFAULT_MSG LIBDW_INCLUDE_DIR)

if (LIBDW_FOUND)
message("-- libdw (libdw-dev) found, detailed backtrace support enabled")
add_definitions(-DBACKWARD_HAS_DW=1)
set(LIBDW_LIBRARY "dw")
else()
message("-- libdw (libdw-dev) not found, simple backtrace only")
add_definitions(-DBACKWARD_HAS_DW=0 -DBACKWARD_HAS_BACKTRACE_SYMBOL=1)
set(LIBDW_INCLUDE_DIR "")
set(LIBDW_LIBRARY "")
endif (LIBDW_FOUND)

mark_as_advanced(LIBDW_INCLUDE_DIR LIBDW_LIBRARY)
else()
message("-- libdw (libdw-dev) disabled, simple backtrace only")
add_definitions(-DBACKWARD_HAS_DW=0 -DBACKWARD_HAS_BACKTRACE_SYMBOL=1)
set(LIBDW_INCLUDE_DIR "")
set(LIBDW_LIBRARY "")
endif (ENABLE_LIBDW_SUPPORT)

# FinalCut
if (ENABLE_TUI_SUPPORT AND NOT FC_INCLUDED)
message("-- Cloning finalcut")
include(FetchContent)
Expand Down Expand Up @@ -342,22 +336,6 @@ if (NOT TARGET strip)
COMMAND aarch64-linux-gnu-strip -s dvmbridge
COMMAND aarch64-linux-gnu-strip -s dvmpatch)
endif (ENABLE_TUI_SUPPORT AND (NOT DISABLE_TUI_APPS))
elseif (CROSS_COMPILE_RPI_ARM)
if (NOT WITH_RPI_ARM_TOOLS)
add_custom_target(strip
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmhost
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmfne
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmcmd
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmbridge
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmpatch)
else()
add_custom_target(strip
COMMAND ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmhost
COMMAND ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmfne
COMMAND ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmcmd
COMMAND ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmbridge
COMMAND ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip -s dvmpatch)
endif ()
else()
if (ENABLE_TUI_SUPPORT AND (NOT DISABLE_TUI_APPS))
add_custom_target(strip
Expand Down
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ aarch64:
&& make -j $(nproc)
@echo 'Successfully compiled for AARCH64'

armhf:
@echo 'Cross-Compiling for ARMHF'
mkdir -p "build/$@" && cd "build/$@" \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-s" -DCMAKE_CXX_FLAGS="-s" \
-DCROSS_COMPILE_RPI_ARM=1 ../.. \
&& make -j $(nproc)
@echo 'Successfully compiled for ARMHF'

clean:
@echo 'Removing all temporary files'
git clean -ffxd
Expand Down
Loading