Skip to content

Commit abf4a60

Browse files
committed
Submodule-based build.
1 parent f4cf398 commit abf4a60

File tree

9 files changed

+76
-15
lines changed

9 files changed

+76
-15
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22

33
A tool for creating and transforming cryptographic seeds.
44

5-
## Prerequisites
5+
## Dependencies
66

7-
If any of the following prerequisites are not installed, the `configure` step below will fail.
7+
These dependencies are automatically installed as submodules when you run the build script.
88

99
* [`bc-crypto-base`](https://github.com/blockchaincommons/bc-crypto-base)
1010
* [`bc-shamir`](https://github.com/blockchaincommons/bc-shamir)
1111
* [`bc-slip39`](https://github.com/blockchaincommons/bc-slip39)
1212
* [`bc-bip39`](https://github.com/blockchaincommons/bc-bip39)
1313
* [`bc-bech32`](https://github.com/blockchaincommons/bc-bech32)
14-
* [`GNU argp`](https://www.gnu.org/software/libc/manual/html_node/Argp.html) This may be installed via `brew install argp-standalone`.
14+
* [`GNU argp`](https://www.gnu.org/software/libc/manual/html_node/Argp.html)
1515

1616
## Installation
1717

1818
```bash
19-
$ ./configure
20-
$ make check
19+
$ ./build.sh
2120
$ sudo make install
2221
```
2322

23+
If you do not run the build script, opting instead for `./configure && make` the dependencies above will need to already be installed on your system.
24+
2425
## Use
2526

2627
```
@@ -65,7 +66,7 @@ This table below also establishes provenance (repository of origin, permalink, a
6566
| randombytes.c | [dsprenkels/randombytes](https://github.com/dsprenkels/randombytes/blob/master/randombytes.c) | [6db39aa](https://github.com/dsprenkels/randombytes/commit/6db39aaae6bb9ab97beca00d81bcfe935c56c88d) | 2017-2019 [Daan Sprenkels](https://github.com/dsprenkels/) | [MIT](https://github.com/dsprenkels/randombytes/commit/73ae9b4fce2e62babdd6a480b53ad449dd745ed9) |
6667
| randombytes.h | [dsprenkels/randombytes](https://github.com/dsprenkels/randombytes/blob/master/randombytes.h) | [19fd002](https://github.com/dsprenkels/randombytes/commit/19fd002d9b7b001b333a671186a91231b60d821b) | 2017-2019 [Daan Sprenkels](https://github.com/dsprenkels/) | [MIT](https://github.com/dsprenkels/randombytes/commit/73ae9b4fce2e62babdd6a480b53ad449dd745ed9) |
6768

68-
### Dependencies
69+
### Tool Dependencies
6970

7071
To build `seedtool` you'll need to use the following tools:
7172

build.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
3+
git submodule init
4+
git submodule update
5+
6+
LIBS=${PWD}/libs
7+
LIB=${LIBS}/lib
8+
INCLUDE=${LIBS}/include
9+
10+
export CFLAGS="${CFLAGS} -I${INCLUDE}"
11+
export CXXFLAGS="${CXXFLAGS} -I${INCLUDE}"
12+
export LDFLAGS="${LDFLAGS} -L${LIB}"
13+
14+
# Terminal colors
15+
RED=`tput setaf 1`
16+
GREEN=`tput setaf 2`
17+
RESET=`tput sgr0`
18+
19+
pushd deps/bc-crypto-base
20+
./configure --prefix ${LIBS}
21+
make check
22+
make install
23+
popd
24+
25+
pushd deps/bc-shamir
26+
./configure --prefix ${LIBS}
27+
make check
28+
make install
29+
popd
30+
31+
pushd deps/bc-slip39
32+
./configure --prefix ${LIBS}
33+
make check
34+
make install
35+
popd
36+
37+
pushd deps/bc-bip39
38+
./configure --prefix ${LIBS}
39+
make check
40+
make install
41+
popd
42+
43+
pushd deps/bc-bech32
44+
./configure --prefix ${LIBS}
45+
make check
46+
make install
47+
popd
48+
49+
pushd deps/argp-standalone/argp-standalone
50+
patch -N <../patch-argp-fmtstream.h
51+
./configure --prefix ${LIBS}
52+
make install
53+
cp libargp.a ${LIBS}/lib/
54+
cp argp.h ${LIBS}/include/
55+
popd
56+
57+
./configure
58+
make check
59+
echo "${GREEN}*** Seedtool built.${RESET}"
60+
echo "${GREEN}Next step: sudo make install${RESET}"

deps/argp-standalone

deps/bc-bech32

deps/bc-bip39

deps/bc-crypto-base

deps/bc-shamir

deps/bc-slip39

src/Makefile.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ GREEN=`tput setaf 2`
2727
RESET=`tput sgr0`
2828

2929
COMPILER = g++
30-
CFLAGS = --debug -O0
31-
CXXFLAGS = -std=c++17 -stdlib=libc++ --debug -O0
30+
CFLAGS += --debug -O0
31+
CXXFLAGS += -std=c++17 -stdlib=libc++ --debug -O0
3232

3333
toolname = seedtool
3434

@@ -55,7 +55,7 @@ OBJS = \
5555
randombytes.o \
5656
hkdf.o
5757

58-
LDFLAGS = -lstdc++ -lbc-crypto-base -lbc-shamir -lbc-slip39 -lbc-bip39 -lbc-bech32 -largp
58+
LDFLAGS += -lstdc++ -lbc-crypto-base -lbc-shamir -lbc-slip39 -lbc-bip39 -lbc-bech32 -largp
5959

6060
$(toolname): $(OBJS)
6161

0 commit comments

Comments
 (0)