|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +set -e |
| 4 | + |
| 5 | +deps=rieMinerDeps |
| 6 | +curl="curl-8.14.1" |
| 7 | +gmp="gmp-6.3.0" |
| 8 | +json="nlohmann-json-3.12.0-include" |
| 9 | + |
| 10 | +incs="incs" |
| 11 | +libs="libs" |
| 12 | + |
| 13 | +if test ${1:-native} = "Deb64" ; then |
| 14 | + target="x86_64-pc-linux-gnu" |
| 15 | + incs="incsDeb64" |
| 16 | + libs="libsDeb64" |
| 17 | + export CC=x86_64-linux-gnu-gcc |
| 18 | + export CXX=x86_64-linux-gnu-g++ |
| 19 | +elif test ${1:-native} = "Deb32" ; then |
| 20 | + target="i686-pc-linux-gnu" |
| 21 | + incs="incsDeb32" |
| 22 | + libs="libsDeb32" |
| 23 | + export CC=i686-linux-gnu-gcc |
| 24 | + export CXX=i686-linux-gnu-g++ |
| 25 | +elif test ${1:-native} = "Arm64" ; then |
| 26 | + target="aarch64-pc-linux-gnu" |
| 27 | + incs="incsArm64" |
| 28 | + libs="libsArm64" |
| 29 | + export CC=aarch64-linux-gnu-gcc |
| 30 | + export CXX=aarch64-linux-gnu-g++ |
| 31 | +elif test ${1:-native} = "Arm32" ; then |
| 32 | + target="arm-pc-linux-gnu" |
| 33 | + incs="incsArm32" |
| 34 | + libs="libsArm32" |
| 35 | + export CC=arm-linux-gnueabihf-gcc |
| 36 | + export CXX=arm-linux-gnueabihf-g++ |
| 37 | +elif test ${1:-native} = "Win64" ; then |
| 38 | + target="x86_64-w64-mingw32" |
| 39 | + incs="incsWin64" |
| 40 | + libs="libsWin64" |
| 41 | + export CC=x86_64-w64-mingw32-gcc-posix |
| 42 | + export CXX=x86_64-w64-mingw32-g++-posix |
| 43 | + export WINDRES=x86_64-w64-mingw32-windres |
| 44 | +elif test ${1:-native} = "Win32" ; then |
| 45 | + target="i686-w64-mingw32" |
| 46 | + incs="incsWin32" |
| 47 | + libs="libsWin32" |
| 48 | + export CC=i686-w64-mingw32-gcc-posix |
| 49 | + export CXX=i686-w64-mingw32-g++-posix |
| 50 | + export WINDRES=i686-w64-mingw32-windres |
| 51 | +elif test ${1:-native} = "And64" ; then |
| 52 | + target="aarch64-linux-android" |
| 53 | + incs="incsAnd64" |
| 54 | + libs="libsAnd64" |
| 55 | + export ANDROIDAPI=26 |
| 56 | + export NDK=/home/user/dev/android-ndk-r25 |
| 57 | + export HOST_TAG=linux-x86_64 |
| 58 | + export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG |
| 59 | + export CC=$TOOLCHAIN/bin/aarch64-linux-android$ANDROIDAPI-clang |
| 60 | + export CXX=$TOOLCHAIN/bin/aarch64-linux-android$ANDROIDAPI-clang++ |
| 61 | +elif test ${1:-native} = "And32" ; then |
| 62 | + target="armv7-linux-androideabi" |
| 63 | + incs="incsAnd32" |
| 64 | + libs="libsAnd32" |
| 65 | + export ANDROIDAPI=19 |
| 66 | + export NDK=/home/user/dev/android-ndk-r25 |
| 67 | + export HOST_TAG=linux-x86_64 |
| 68 | + export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG |
| 69 | + export CC=$TOOLCHAIN/bin/armv7a-linux-androideabi$ANDROIDAPI-clang |
| 70 | + export CXX=$TOOLCHAIN/bin/armv7a-linux-androideabi$ANDROIDAPI-clang++ |
| 71 | +fi |
| 72 | + |
| 73 | +cd ${deps} |
| 74 | + |
| 75 | +mkdir incs |
| 76 | +mkdir libs |
| 77 | + |
| 78 | +unzip ${json}.zip -d ${json} |
| 79 | + |
| 80 | +tar -xf ${curl}.tar.gz |
| 81 | +cd ${curl} |
| 82 | +./configure --host ${target} -disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-ldap --disable-ldaps --disable-pop3 --disable-rtsp --disable-smtp --disable-telnet --disable-tftp --without-ssl --without-libssh2 --without-zlib --without-brotli --without-zstd --without-libidn2 --without-librtmp --without-libpsl --disable-headers-api --without-nghttp2 --disable-shared --disable-libcurl-option --disable-alt-svc |
| 83 | +make -j $(nproc) |
| 84 | + |
| 85 | +mv include/curl ../incs |
| 86 | +mv lib/.libs/libcurl.a ../libs |
| 87 | +cd .. |
| 88 | + |
| 89 | +tar -xf ${gmp}.tar.xz |
| 90 | +cd ${gmp} |
| 91 | +cp configfsf.guess config.guess |
| 92 | +cp configfsf.sub config.sub |
| 93 | +if test ${1:-native} = "And32" ; then |
| 94 | + ./configure --host ${target} --disable-shared --enable-cxx --enable-fat ABI=32 CFLAGS='-fPIC -m32' CPPFLAGS=-DPIC |
| 95 | +else |
| 96 | + ./configure --host ${target} --disable-shared --enable-cxx --enable-fat |
| 97 | +fi |
| 98 | +make -j $(nproc) |
| 99 | +mv gmp.h gmpxx.h ../incs |
| 100 | +mv .libs/libgmp.a .libs/libgmpxx.a ../libs |
| 101 | +cd .. |
| 102 | + |
| 103 | +cp -r ${json}/include/nlohmann incs |
| 104 | + |
| 105 | +mv incs ../${incs} |
| 106 | +mv libs ../${libs} |
| 107 | +rm -r ${json} |
| 108 | +rm -r ${curl} |
| 109 | +rm -r ${gmp} |
0 commit comments