Better tdweb build scripts.
GitOrigin-RevId: 2d44117df420202b8d5d1dc4edbba875d6149c82
This commit is contained in:
parent
d164512c4e
commit
209b9454d9
@ -1,18 +1,23 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
emconfigure || { echo 'emconfigure not found. Install Emscripten and add emconfigure and emmake to PATH environment variable'; exit 1; }
|
||||||
|
|
||||||
OPENSSL=OpenSSL_1_1_0j
|
OPENSSL=OpenSSL_1_1_0j
|
||||||
if [ ! -f $OPENSSL.tar.gz ]; then
|
if [ ! -f $OPENSSL.tar.gz ]; then
|
||||||
echo "Download openssl"
|
echo "Downloading OpenSSL sources..."
|
||||||
wget https://github.com/openssl/openssl/archive/$OPENSSL.tar.gz
|
wget https://github.com/openssl/openssl/archive/$OPENSSL.tar.gz
|
||||||
fi
|
fi
|
||||||
rm -rf ./$OPENSSL
|
rm -rf ./$OPENSSL
|
||||||
|
echo "Unpacking OpenSSL sources..."
|
||||||
tar xzf $OPENSSL.tar.gz || exit 1
|
tar xzf $OPENSSL.tar.gz || exit 1
|
||||||
cd openssl-$OPENSSL
|
cd openssl-$OPENSSL
|
||||||
|
|
||||||
emconfigure ./Configure linux-generic32 no-shared
|
emconfigure ./Configure linux-generic32 no-shared no-dso no-engine no-unit-test no-ui || exit 1
|
||||||
sed -i bak 's/CROSS_COMPILE=.*/CROSS_COMPILE=/g' Makefile
|
sed -i.bak 's/CROSS_COMPILE=.*/CROSS_COMPILE=/g' Makefile || exit 1
|
||||||
emmake make depend -s || exit 1
|
sed -i 's/-ldl //g' Makefile || exit 1
|
||||||
emmake make -s || exit 1
|
echo "Building OpenSSL..."
|
||||||
|
emmake make depend || exit 1
|
||||||
|
emmake make -j 4 || exit 1
|
||||||
|
|
||||||
rm -rf ../build/crypto || exit 1
|
rm -rf ../build/crypto || exit 1
|
||||||
mkdir -p ../build/crypto/lib || exit 1
|
mkdir -p ../build/crypto/lib || exit 1
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
emconfigure || { echo 'emconfigure not found. Install Emscripten and add emconfigure to PATH environment variable'; exit 1; }
|
||||||
|
|
||||||
mkdir -p build/generate
|
mkdir -p build/generate
|
||||||
mkdir -p build/asmjs
|
mkdir -p build/asmjs
|
||||||
mkdir -p build/wasm
|
mkdir -p build/wasm
|
||||||
@ -18,20 +20,19 @@ OPENSSL_OPTIONS="-DOPENSSL_FOUND=1 \
|
|||||||
|
|
||||||
pushd .
|
pushd .
|
||||||
cd build/wasm
|
cd build/wasm
|
||||||
eval emconfigure cmake $TD_ROOT -GNinja $OPENSSL_OPTIONS
|
eval emconfigure cmake $TD_ROOT -GNinja $OPENSSL_OPTIONS || exit 1
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd .
|
pushd .
|
||||||
cd build/asmjs
|
cd build/asmjs
|
||||||
eval emconfigure cmake $TD_ROOT -GNinja -DASMJS=1 $OPENSSL_OPTIONS
|
eval emconfigure cmake $TD_ROOT -GNinja -DASMJS=1 $OPENSSL_OPTIONS || exit 1
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd .
|
pushd .
|
||||||
cd build/generate
|
cd build/generate
|
||||||
cmake $TD_ROOT -GNinja
|
cmake $TD_ROOT -GNinja || exit 1
|
||||||
popd
|
popd
|
||||||
|
|
||||||
cmake --build build/generate -j --target prepare_cross_compiling
|
cmake --build build/generate -j --target prepare_cross_compiling || exit 1
|
||||||
cmake --build build/wasm -j --target td_wasm
|
cmake --build build/wasm -j --target td_wasm || exit 1
|
||||||
cmake --build build/asmjs -j --target td_asmjs
|
cmake --build build/asmjs -j --target td_asmjs || exit 1
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
pushd .
|
pushd .
|
||||||
cd tdweb
|
cd tdweb
|
||||||
npm install
|
npm install || exit 1
|
||||||
npm run build
|
npm run build || exit 1
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
dest=tdweb/src/prebuilt/release/
|
DEST=tdweb/src/prebuilt/release/
|
||||||
mkdir -p $dest
|
mkdir -p $DEST
|
||||||
cp build/wasm/td_wasm.{js,wasm} $dest
|
cp build/wasm/td_wasm.{js,wasm} $DEST
|
||||||
cp build/asmjs/td_asmjs.js{,.mem} $dest
|
cp build/asmjs/td_asmjs.js{,.mem} $DEST
|
||||||
|
Loading…
Reference in New Issue
Block a user