Skip to content

Commit

Permalink
Merge pull request #11 from billywhizz/main
Browse files Browse the repository at this point in the history
fix mbedtls build
  • Loading branch information
billywhizz authored Nov 30, 2023
2 parents 1c20b3d + b695c29 commit 93793fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
- [ ] **bug** : mbedtls fails to compile on raspberry pi
- [ ] **todo**: redirection of stdin/out/err for child processes
- [ ] **todo**: cacheing for binding dependencies builder
- [ ] **todo**: fix the CC env var issue. this should be C compiler, not C++

## modules

Expand Down
3 changes: 2 additions & 1 deletion lib/mbedtls/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ async function build (C = 'gcc', CC = 'g++') {
if (obj.some(o => !isFile(o))) {
assert(chdir('deps/mbedtls') === 0)
const status = new Int32Array(2)
exec('make', ['CFLAGS=-fPIC', 'lib'], status)
// this fixes an issue using g++ to compile C code as CC should really be the C compiler, not the C++ one. need to fix
exec('make', [`CC="${C}"`, 'CFLAGS=-fPIC', 'lib'], status)
assert(status[0] === 0)
assert(chdir('../../') === 0)
}
Expand Down

0 comments on commit 93793fa

Please sign in to comment.