55usage ()
66{
77 echo " Usage: $0 [BuildArch] [CodeName] [lldbx.y] [llvmx[.y]] [--skipunmount] --rootfsdir <directory>]"
8- echo " BuildArch can be: arm(default), armel, arm64, x86"
8+ echo " BuildArch can be: arm(default), armel, arm64, x86, x64 "
99 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."
1010 echo " for FreeBSD can be: freebsd12, freebsd13"
1111 echo " for illumos can be: illumos."
@@ -21,6 +21,9 @@ __CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
2121__InitialDir=$PWD
2222__BuildArch=arm
2323__AlpineArch=armv7
24+ __FreeBSDArch=arm
25+ __FreeBSDMachineArch=armv7
26+ __IllumosArch=arm7
2427__QEMUArch=arm
2528__UbuntuArch=armhf
2629__UbuntuRepo=" http://ports.ubuntu.com/"
@@ -115,6 +118,8 @@ while :; do
115118 __UbuntuArch=arm64
116119 __AlpineArch=aarch64
117120 __QEMUArch=aarch64
121+ __FreeBSDArch=arm64
122+ __FreeBSDMachineArch=aarch64
118123 ;;
119124 armel)
120125 __BuildArch=armel
@@ -140,6 +145,14 @@ while :; do
140145 __UbuntuPackages=$( echo ${__UbuntuPackages} | sed ' s/ libomp5//' )
141146 unset __LLDB_Package
142147 ;;
148+ x64)
149+ __BuildArch=x64
150+ __UbuntuArch=amd64
151+ __FreeBSDArch=amd64
152+ __FreeBSDMachineArch=amd64
153+ __illumosArch=x86_64
154+ __UbuntuRepo=
155+ ;;
143156 x86)
144157 __BuildArch=x86
145158 __UbuntuArch=i386
@@ -205,11 +218,6 @@ while :; do
205218 __LLDB_Package=" liblldb-6.0-dev"
206219 ;;
207220 tizen)
208- if [ " $__BuildArch " != " arm" ] && [ " $__BuildArch " != " armel" ] && [ " $__BuildArch " != " arm64" ] && [ " $__BuildArch " != " x86" ] ; then
209- echo " Tizen is available only for arm, armel, arm64 and x86."
210- usage;
211- exit 1;
212- fi
213221 __CodeName=
214222 __UbuntuRepo=
215223 __Tizen=tizen
@@ -228,19 +236,16 @@ while :; do
228236 ;;
229237 freebsd12)
230238 __CodeName=freebsd
231- __BuildArch=x64
232239 __SkipUnmount=1
233240 ;;
234241 freebsd13)
235242 __CodeName=freebsd
236243 __FreeBSDBase=" 13.0-RELEASE"
237244 __FreeBSDABI=" 13"
238- __BuildArch=x64
239245 __SkipUnmount=1
240246 ;;
241247 illumos)
242248 __CodeName=illumos
243- __BuildArch=x64
244249 __SkipUnmount=1
245250 ;;
246251 --skipunmount)
@@ -312,8 +317,8 @@ if [[ "$__CodeName" == "alpine" ]]; then
312317elif [[ " $__CodeName " == " freebsd" ]]; then
313318 mkdir -p $__RootfsDir /usr/local/etc
314319 JOBS=" $( getconf _NPROCESSORS_ONLN) "
315- 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
316- 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
320+ 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
321+ 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
317322 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
318323 mkdir -p $__RootfsDir /tmp
319324 # get and build package manager
@@ -335,7 +340,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then
335340 echo " Building binutils. Please wait.."
336341 wget -O - https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf -
337342 mkdir build-binutils && cd build-binutils
338- ../binutils-2.33.1/configure --prefix=" $__RootfsDir " --target=" x86_64 -sun-solaris2.10" --program-prefix=" x86_64 -illumos-" --with-sysroot=" $__RootfsDir "
343+ ../binutils-2.33.1/configure --prefix=" $__RootfsDir " --target=" ${__illumosArch} -sun-solaris2.10" --program-prefix=" ${__illumosArch} -illumos-" --with-sysroot=" $__RootfsDir "
339344 make -j " $JOBS " && make install && cd ..
340345 echo " Building gcc. Please wait.."
341346 wget -O - https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf -
@@ -345,15 +350,15 @@ elif [[ "$__CodeName" == "illumos" ]]; then
345350 CFLAGS_FOR_TARGET=" -fPIC"
346351 export CFLAGS CXXFLAGS CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET
347352 mkdir build-gcc && cd build-gcc
348- ../gcc-8.4.0/configure --prefix=" $__RootfsDir " --target=" x86_64 -sun-solaris2.10" --program-prefix=" x86_64 -illumos-" --with-sysroot=" $__RootfsDir " --with-gnu-as \
353+ ../gcc-8.4.0/configure --prefix=" $__RootfsDir " --target=" ${__illumosArch} -sun-solaris2.10" --program-prefix=" ${__illumosArch} -illumos-" --with-sysroot=" $__RootfsDir " --with-gnu-as \
349354 --with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \
350355 --disable-libquadmath-support --disable-shared --enable-tls
351356 make -j " $JOBS " && make install && cd ..
352357 BaseUrl=https://pkgsrc.joyent.com
353358 if [[ " $__UseMirror " == 1 ]]; then
354359 BaseUrl=http://pkgsrc.smartos.skylime.net
355360 fi
356- BaseUrl=" $BaseUrl " /packages/SmartOS/2020Q1/x86_64 /All
361+ BaseUrl=" $BaseUrl " /packages/SmartOS/2020Q1/${__illumosArch} /All
357362 echo " Downloading dependencies."
358363 read -ra array <<< " $__IllumosPackages"
359364 for package in " ${array[@]} " ; do
0 commit comments