Skip to content

Commit

Permalink
Simplify (wrap) build into 1 single script
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrChaika committed Dec 22, 2023
1 parent 80e0f9c commit 3dc7783
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
18 changes: 4 additions & 14 deletions docs/building/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,14 @@ sudo apt-get install python3 python3-pip python3-setuptools python3-wheel ninja-
pip3 install meson
```

## Build for amd64
## Build for amd64 or for arm64

```
./scripts/build_openssl_amd64.sh
./scripts/build_glib_amd64.sh
cd build_amd64
cmake -DCMAKE_INSTALL_PREFIX=../dist_amd64 -DCMAKE_TOOLCHAIN_FILE=../cmake/linux/amd64/toolchain.cmake -DOPENSSL_ROOT_DIR=../build_amd64 -DOPENSSL_CRYPTO_LIBRARY=../build_amd64/lib/libcrypto.so ..
make install
./scripts/build.sh amd64
```

## Build for aarch64 (Raspberry Pi)

or
```
./scripts/build_openssl_arm64.sh
./scripts/build_glib_arm64.sh
cd build_arm64
cmake -DCMAKE_INSTALL_PREFIX=../dist_arm64 -DCMAKE_TOOLCHAIN_FILE=../cmake/linux/arm64/toolchain.cmake -DOPENSSL_ROOT_DIR=../build_arm64 -DOPENSSL_CRYPTO_LIBRARY=../build_arm64/lib/libcrypto.so ..
make install
./scripts/build.sh arm64
```

## Run
Expand Down
22 changes: 22 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

if [ "$1" = "amd64" ]; then
./scripts/build_openssl_amd64.sh
./scripts/build_glib_amd64.sh
cd build_amd64
cmake -DCMAKE_INSTALL_PREFIX=../dist_amd64 -DCMAKE_TOOLCHAIN_FILE=../cmake/linux/amd64/toolchain.cmake -DOPENSSL_ROOT_DIR=../build_amd64 -DOPENSSL_CRYPTO_LIBRARY=../build_amd64/lib/libcrypto.so ..
make install
exit 0
fi

if [ "$1" = "arm64" ]; then
./scripts/build_openssl_arm64.sh
./scripts/build_glib_arm64.sh
cd build_arm64
cmake -DCMAKE_INSTALL_PREFIX=../dist_arm64 -DCMAKE_TOOLCHAIN_FILE=../cmake/linux/arm64/toolchain.cmake -DOPENSSL_ROOT_DIR=../build_arm64 -DOPENSSL_CRYPTO_LIBRARY=../build_arm64/lib/libcrypto.so ..
make install
exit 0
fi

echo "Unknown architecture '$1'"

0 comments on commit 3dc7783

Please sign in to comment.