Skip to content

Commit d71f4a8

Browse files
committed
fix linux build
1 parent 7b86d78 commit d71f4a8

File tree

11 files changed

+43
-24
lines changed

11 files changed

+43
-24
lines changed

Makefile.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
# Licensed under the "BSD-2-Clause Plus Patent License"
88
#
99

10+
UNAME := $(shell uname)
11+
ifeq ($(UNAME), Linux)
12+
SHELL := /bin/bash
13+
endif
14+
1015
# Package-specific substitution variables
1116
package = @PACKAGE_NAME@
1217
version = @PACKAGE_VERSION@

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,35 @@ See [`MANUAL.md`](MANUAL.md) for details, many more examples, and version histor
135135

136136
These dependencies are automatically installed as submodules when you run the build script. This is the recommended way to install.
137137

138+
### MacOS
139+
138140
```bash
139141
$ ./build.sh
140142
$ sudo make install
141143
```
142144

145+
### Linux
146+
147+
Make sure you have llvm/clang, libc++ and libc++abi installed. All of them with
148+
a minimum recommended version 10.
149+
150+
#### Ubuntu and Debian
151+
152+
```bash
153+
$ sudo apt-get install make
154+
155+
$ wget https://apt.llvm.org/llvm.sh
156+
$ chmod +x llvm.sh
157+
$ sudo ./llvm.sh 10 # version 10
158+
159+
$ sudo apt-get install libc++-10-dev libc++abi-10-dev
160+
```
161+
162+
```bash
163+
$ export CC="clang-10" && export CXX="clang++-10" && ./build.sh
164+
$ sudo make install
165+
```
166+
143167
## Alternative Installation
144168

145169
This sequence does *not* install the dependencies from submodules; instead they must be installed in the usual places on the build system, otherwise the `./configure` step below will fail.
@@ -149,6 +173,7 @@ $ ./configure
149173
$ make
150174
$ sudo make install
151175
```
176+
*Note:* On Linux the first step is `./configure CC=clang-10 CXX=clang++-10`
152177

153178
## Incremental Builds
154179

configure

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3753,19 +3753,6 @@ LIBS=$ac_check_lib_save_LIBS
37533753
fi
37543754
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bc_bytewords_bytewords_encode" >&5
37553755
$as_echo "$ac_cv_lib_bc_bytewords_bytewords_encode" >&6; }
3756-
if test "x$ac_cv_lib_bc_bytewords_bytewords_encode" = xyes; then :
3757-
cat >>confdefs.h <<_ACEOF
3758-
#define HAVE_LIBBC_BYTEWORDS 1
3759-
_ACEOF
3760-
3761-
LIBS="-lbc-bytewords $LIBS"
3762-
3763-
else
3764-
3765-
echo "### Error! libbc-bytewords must be installed first."
3766-
exit -1
3767-
3768-
fi
37693756

37703757
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for argp_parse in -largp" >&5
37713758
$as_echo_n "checking for argp_parse in -largp... " >&6; }
@@ -5820,4 +5807,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
58205807
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
58215808
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
58225809
fi
5823-

configure.ac

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ AC_CHECK_LIB([bc-bip39], [bip39_mnemonic_from_word], [], [
2929
echo "### Error! libbc-bip39 must be installed first."
3030
exit -1
3131
])
32-
AC_CHECK_LIB([bc-bytewords], [bytewords_encode], [], [
33-
echo "### Error! libbc-bytewords must be installed first."
34-
exit -1
35-
])
3632
AC_CHECK_LIB([argp], [argp_parse], [], [
3733
echo "### Error! argp must be installed first. Try 'brew install argp-standalone'."
3834
exit -1

deps/bc-crypto-base

src/Makefile.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ OBJS = \
5959
randombytes.o \
6060
hkdf.o
6161

62-
LDFLAGS += -lstdc++ -lbc-crypto-base -lbc-shamir -lbc-slip39 -lbc-bip39 -lbc-ur -largp
62+
LDFLAGS += -lstdc++
63+
LDLIBS += -lbc-slip39 -lbc-shamir -lbc-crypto-base -lbc-bip39 -lbc-ur -largp
64+
65+
UNAME := $(shell uname)
66+
ifeq ($(UNAME), Linux)
67+
LDLIBS += -lm -lc++ -lc++abi -lgcc_s -lgcc
68+
endif
6369

6470
$(toolname): $(OBJS)
6571

0 commit comments

Comments
 (0)