CHOST=aarch64-unknown-linux-gnu
CBUILD=x86_64-pc-linux-gnu
ARCH=arm64

HOSTCC=x86_64-pc-linux-gnu-gcc

ROOT=/usr/${CHOST}/

ACCEPT_KEYWORDS="arm64 ~arm64"

#USE="${ARCH} -pam"
USE="${ARCH} egl icu minizip nss openssl pcre16 postproc python 
     qt5 script sqlite svc threads virt-network
     -pam"

L10N="en en-GB"
LINGUAS="en en-GB"

# free with crossdev
#CFLAGS="-O2 -pipe -fomit-frame-pointer"
#-march=armv8-a+crc -mtune=cortex-a53 -ftree-vectorize 
CFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -ftree-vectorize -O2 -pipe -fomit-frame-pointer"
# gcc-6.x has march native but we cross compile here, so its a good idea not to use it.
# CFLAGS="-march=native -mtune=cortex-a53 -O2 -pipe"

CXXFLAGS="${CFLAGS}"

# Prevent breakage with things that try to build for multilib
#EXTRA_ECONF="--disable-multilib"


FEATURES="-collision-protect sandbox buildpkg noman noinfo nodoc"
# Be sure we dont overwrite pkgs from another repo..
PKGDIR=${ROOT}packages/
PORTAGE_TMPDIR=${ROOT}tmp/

ELIBC="glibc"

PKG_CONFIG_PATH="${ROOT}usr/lib/pkgconfig/"
#PORTDIR_OVERLAY="/usr/portage/local/"

# added by NeddySeagoon from here down

############################################################################

# Where to find C and C++ KEEP THIS UP TO DATE!!!  Contains version numbers.
# Fixes broken build systems that try to use the native compiler 
CXX="/usr/x86_64-pc-linux-gnu/aarch64-unknown-linux-gnu/gcc-bin/8.2.0/aarch64-unknown-linux-gnu-g++"
CC="/usr/x86_64-pc-linux-gnu/aarch64-unknown-linux-gnu/gcc-bin/8.2.0/aarch64-unknown-linux-gnu-gcc"
#LD="/usr/x86_64-pc-linux-gnu/aarch64-unknown-linux-gnu/binutils-bin/2.30/ld.gold"
#AR="/usr/x86_64-pc-linux-gnu/aarch64-unknown-linux-gnu/gcc-bin/7.3.0/aarch64-unknown-linux-gnu-gcc-ar"

###########################################################################

MAKEOPTS="-j8"

# Dud mirrors
#                  http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/
#                  http://gentoo.tiscali.nl/


GENTOO_MIRRORS="http://ftp.heanet.ie/pub/gentoo/
                 http://mirror.mdfnet.se/gentoo
                 http://mirrors.163.com/gentoo/
                 http://gentoo.mirror.web4u.cz/
                  http://64.50.236.52/
                  http://gentoo.mneisen.org/
                  http://gentoo.mirror.pw.edu.pl/
                  http://gentoo.prz.rzeszow.pl
                  http://mirror.uni-c.dk/pub/gentoo/
                  http://mirror.mdfnet.se/mirror/gentoo
                  http://ftp.gentoo.bg/
                  http://distfiles.gentoo.bg/
                  http://mirrors.ludost.net/gentoo/
                  http://mirror.hamakor.org.il/pub/mirrors/gentoo/
                  http://ftp.dei.uc.pt/pub/linux/gentoo/"

INSTALL_MASK=" /usr/lib/systemd *.la"

PYTHON_SINGLE_TARGET="python3_4" 
PYTHON_TARGETS="python2_7 python3_4"

INPUT_DEVICES="evdev"
VIDEO_CARDS="fbdev vc4"

PORTAGE_OVERLAY="/usr/local/gentoo-static /usr/local/portage"