@ -5,7 +5,7 @@ set -e
usage( )
{
echo " Usage: $0 [BuildArch] [CodeName] [lldbx.y] [llvmx[.y]] [--skipunmount] --rootfsdir <directory>] "
echo "BuildArch can be: arm(default), armel, arm64, x86"
echo "BuildArch can be: arm(default), armel, arm64, x86, x64 "
echo "CodeName - optional, Code name for Linux, can be: xenial(default), zesty, bionic, alpine, alpine3.13 or alpine3.14. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen."
echo " for FreeBSD can be: freebsd12, freebsd13"
echo " for illumos can be: illumos."
@ -21,6 +21,9 @@ __CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__InitialDir = $PWD
__BuildArch = arm
__AlpineArch = armv7
__FreeBSDArch = arm
__FreeBSDMachineArch = armv7
__IllumosArch = arm7
__QEMUArch = arm
__UbuntuArch = armhf
__UbuntuRepo = "http://ports.ubuntu.com/"
@ -115,6 +118,8 @@ while :; do
__UbuntuArch = arm64
__AlpineArch = aarch64
__QEMUArch = aarch64
__FreeBSDArch = arm64
__FreeBSDMachineArch = aarch64
; ;
armel)
__BuildArch = armel
@ -140,6 +145,14 @@ while :; do
__UbuntuPackages = $( echo ${ __UbuntuPackages } | sed 's/ libomp5//' )
unset __LLDB_Package
; ;
x64)
__BuildArch = x64
__UbuntuArch = amd64
__FreeBSDArch = amd64
__FreeBSDMachineArch = amd64
__illumosArch = x86_64
__UbuntuRepo =
; ;
x86)
__BuildArch = x86
__UbuntuArch = i386
@ -205,11 +218,6 @@ while :; do
__LLDB_Package = "liblldb-6.0-dev"
; ;
tizen)
if [ " $__BuildArch " != "arm" ] && [ " $__BuildArch " != "armel" ] && [ " $__BuildArch " != "arm64" ] && [ " $__BuildArch " != "x86" ] ; then
echo "Tizen is available only for arm, armel, arm64 and x86."
usage;
exit 1;
fi
__CodeName =
__UbuntuRepo =
__Tizen = tizen
@ -228,19 +236,16 @@ while :; do
; ;
freebsd12)
__CodeName = freebsd
__BuildArch = x64
__SkipUnmount = 1
; ;
freebsd13)
__CodeName = freebsd
__FreeBSDBase = "13.0-RELEASE"
__FreeBSDABI = "13"
__BuildArch = x64
__SkipUnmount = 1
; ;
illumos)
__CodeName = illumos
__BuildArch = x64
__SkipUnmount = 1
; ;
--skipunmount)
@ -312,8 +317,8 @@ if [[ "$__CodeName" == "alpine" ]]; then
elif [ [ " $__CodeName " = = "freebsd" ] ] ; then
mkdir -p $__RootfsDir /usr/local/etc
JOBS = " $( getconf _NPROCESSORS_ONLN) "
wget -O - https://download.freebsd.org/ftp/releases/amd64 /${ __FreeBSDBase } /base.txz | tar -C $__RootfsDir -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version
echo " ABI = \"FreeBSD: ${ __FreeBSDABI } :amd64 \"; FINGERPRINTS = \" ${ __RootfsDir } /usr/share/keys\"; REPOS_DIR = [\" ${ __RootfsDir } /etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO; " > ${ __RootfsDir } /usr/local/etc/pkg.conf
wget -O - https://download.freebsd.org/ftp/releases/${ __FreeBSDArch } /${ __FreeBSDMachineArch } /${ __FreeBSDBase } /base.txz | tar -C $__RootfsDir -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version
echo " ABI = \"FreeBSD: ${ __FreeBSDABI } : ${ __FreeBSDMachineArch } \"; FINGERPRINTS = \"${ __RootfsDir } /usr/share/keys\"; REPOS_DIR = [\" ${ __RootfsDir } /etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO; " > ${ __RootfsDir } /usr/local/etc/pkg.conf
echo "FreeBSD: { url: " pkg+http://pkg.FreeBSD.org/\$ { ABI} /quarterly" , mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \" ${ __RootfsDir } /usr/share/keys/pkg\", enabled: yes } " > ${ __RootfsDir } /etc/pkg/FreeBSD.conf
mkdir -p $__RootfsDir /tmp
# get and build package manager
@ -335,7 +340,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then
echo "Building binutils. Please wait.."
wget -O - https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf -
mkdir build-binutils && cd build-binutils
../binutils-2.33.1/configure --prefix= " $__RootfsDir " --target= "x86_64-sun-solaris2.10" --program-prefix= "x86_64-illumos- " --with-sysroot= " $__RootfsDir "
../binutils-2.33.1/configure --prefix= " $__RootfsDir " --target= " ${ __illumosArch } -sun-solaris2.10 " --program-prefix= " ${ __illumosArch } -illumos- " --with-sysroot= " $__RootfsDir "
make -j " $JOBS " && make install && cd ..
echo "Building gcc. Please wait.."
wget -O - https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf -
@ -345,7 +350,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then
CFLAGS_FOR_TARGET = "-fPIC"
export CFLAGS CXXFLAGS CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET
mkdir build-gcc && cd build-gcc
../gcc-8.4.0/configure --prefix= " $__RootfsDir " --target= "x86_64-sun-solaris2.10" --program-prefix= "x86_64-illumos- " --with-sysroot= " $__RootfsDir " --with-gnu-as \
../gcc-8.4.0/configure --prefix= " $__RootfsDir " --target= " ${ __illumosArch } -sun-solaris2.10 " --program-prefix= " ${ __illumosArch } -illumos- " --with-sysroot= " $__RootfsDir " --with-gnu-as \
--with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \
--disable-libquadmath-support --disable-shared --enable-tls
make -j " $JOBS " && make install && cd ..
@ -353,7 +358,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then
if [ [ " $__UseMirror " = = 1 ] ] ; then
BaseUrl = http://pkgsrc.smartos.skylime.net
fi
BaseUrl = " $BaseUrl " /packages/SmartOS/2020Q1/x86_64 /All
BaseUrl = " $BaseUrl " /packages/SmartOS/2020Q1/${ __illumosArch } /All
echo "Downloading dependencies."
read -ra array <<< " $__IllumosPackages "
for package in " ${ array [@] } " ; do