#!/bin/bash
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.

# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.

CUSTOM_CONFIG_DIR=/etc/portage/make.conf.d/

# Import layman overlays
#source /var/lib/layman/make.conf

# Import CPU optimization settings
#source /etc/portage/make.conf.d/00-cpu_optimization.conf

#ABI_X86="64"
ABI_X86="64 32"

# Common settings
PORTAGE_ELOG_CLASSES="info warn error log"
#PORTAGE_ELOG_CLASSES="qa"
PORTAGE_ELOG_SYSTEM="save"
#PORT_LOGDIR

LDFLAGS="$LDFLAGS -Wl,-O2 -Wl,--as-needed -Wl,--hash-style=both"
#LDEMULATION="elf_x86_64"

# Generate code for LTO
# in compile stage
#CFLAGS="$CFLAGS -flto -fwhole-program"

# Change linker and its settings
#LD="/usr/x86_64-pc-linux-gnu/bin/ld.bfd"
#LD="/usr/bin/i686-pc-linux-gnu-ld.gold"
# Use gold linker advantages
#CFLAGS="$CFLAGS -fuse-linker-plugin"
# Turn on linker time optimize
# in linking stage
#LDFLAGS="${LDFLAGS} -Wl,-flto,-O2"

# Athlon 760K
CFLAGS="-march=bdver2 -mtune=bdver2 \
-mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mabm -mlwp -mfma -mfma4 \
-mxop -mbmi -mno-bmi2 -mtbm -mavx -mno-avx2 -msse4.2 -msse4.1 \
-mlzcnt -mno-rtm -mno-hle -mno-rdrnd -mf16c \
-mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mxsave -mno-xsaveopt \
--param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 \
"
CXXFLAGS="$CLAGS"

CPU_FLAGS_X86="aes avx fma3 fma4 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop"

PKGDIR="/usr/portage/binpkg"
PORTDIR_OVERLAY=" \
/usr/local/portage \
$PORTDIR_OVERLAY"

PORTAGE_PATCHDIR="/etc/portage/patches"

MAKEOPTS="-j5"

FEATURES="$FEATURES parallel-fetch collision-protect"
FEATURES="$FEATURES fixlafiles"
FEATURES="$FEATURES preserve-libs"
FEATURES="$FEATURES buildsyspkg"
#FEATURES="$FEATURES metadata-transfer"
#FEATURES="$FEATURES distcc"

#FETCHCOMMAND="/usr/bin/getdelta.sh \${URI}"
ACCEPT_KEYWORDS="~amd64"
DISTCC_DIR="/tmp/.distcc"

#PORTDIR=/usr/portage
#DISTDIR=${PORTDIR}/distfiles
#PKGDIR=${PORTDIR}/packages
#PORT_LOGDIR=/var/log/portage
#PORTDIR_OVERLAY=/usr/local/portage

# Select python interpreters
PYTHON_TARGETS="python2_7 python3_3 python3_4"
RUBY_TARGETS="ruby19 ruby22"
PHP_TARGETS="php5-4"

USE="
plugins

X xorg Xorg wayland
xvfb
xkb
xinerama xrandr

rdesktop vnc

xv ggi dmx
fontconfig
wxwidgets widgets
qt qt4 qt3support qml kde kde4
gtk -gnome
kdepim semantic-desktop
tk
optimized-qmake pch
vaapi vdpau xvmc

calligra word-perfect

aalib

declarative private-headers
webkit
dbus upower
-mpi
systemd udev udisks
-consolekit
policykit
hwdb
keymap
acpi
gudev

pci usb

evdev

opengl glsl egl gbm
gles gles1 gles2
glew
opencl

openal alsa canberra
multimedia
gstreamer phonon
pulseaudio equalizer jack libsamplerate realtime
gstreamer
sdl

mesa gallium shared-dricore xa osmesa openmax
dri dri2 dri3
g3dvl
libkms
r600-llvm-compiler
d3d9
-openvg

mplayer bidi
vlc vlm stream twolame

gnash nsplugin agg
kparts

truetype type1 cleartype corefonts

cairo introspection
imagemagick fftw corefonts
jbig postscript
png apng svg wmf webp tga jpg jpeg tiff mng jpeg2k hdri fpx openexr
djvu pdf
graphviz
gd
ffmpeg win32codecs modplug mod postproc faac -libav
wma-fixed flac mp3 mad aac vorbis speex musepack dts gsm real silk opus aacplus amr celt
x264 webm mpeg mpeg4 xvid theora dirac schroedinger zvbi vpx
avi ogg matroska mp4
dot
encode

rtsp hls live

gimp

iproute2
network
rtmp
upnp zeroconf mtp

netlink

taglib
kate libass
cdda dvd a52 cdio

tar zip rar arj 7zip
bzip2 gzip lzma xz
minizip

git mercurial subversion

gcc lto pic libffi
llvm clang
multitarget

script
python bash javascript lua ruby perl php
python3
pcre16
pypy -shadowstack sandbox
python pep8 pylint
ipython

cpp objc objc++ objc-gc d lava
c++0x
java
-mono

android

unwind

xml html xhtml
curl

mime
xmp

book ebook epub mobi fb2

openmp graphite gmp

unicode nls icu

device-mapper
bash-completion
gmp
$CPU_FLAGS_X86
multilib 64bit 32bit
threads

dhcp
ip ipv6
udp tcp sctp
ftp http
bittorrent gopher finger nntp
fastcgi
tcpd xinetd
rpc

ssl tls gost crypt
openssl -gnutls
sasl
pkcs11
gcrypt gpg

proxy socks socks5
avahi mdnsresponder-compat
autoipd

web

tcpdump wireshark
smi geoip

ethernet wifi
bluetooth
lirc

xl2tpd dnsretry

connman

bind dlz idn filter-aaaa

sql mysql sqlite postgres
ldap
odbc

cpu bfq

fs xattr
samba winbind ads
nfs nfs3 nfs4 nfsv41

nptl
tts epos festival flite freetts mbrola

jabber captcha mod_irc mod_muc mod_proxy65 mod_pubsub mod_statsdx
mrim xmpp irc icq oscar purple
otr

openntpd

kerberos

ssh hpn

cups slp
gutenprint ppds foomaticdb
printsupport

v4l libv4l libv4l2

nginx
aio -libatomic pcre-jit

stats

extras
skins

caps

logwatch
rrdtool graph

math gsl
numpy lapack

calligra attica marble -opengtl spacenav
spell aspell hunspell

-doc -epydoc
latex jadetex xetex
extra examples
vim-syntax

logger
"

LIBREOFFICE_EXTENSIONS="presenter-minimizer nlpsolver scripting-beanshell
scripting-javascript wiki-publisher"

CALLIGRA_FEATURES="braindump flow karbon kexi krita plan sheets stage words"

INPUT_DEVICES="evdev"
#VIDEO_CARDS="radeon radeonsi"
#VIDEO_CARDS="fglrx"
VIDEO_CARDS="radeon radeonsi fglrx"
LIRC_DEVICES="devinput"

LINGUAS="ru en"

ACCEPT_LICENSE="
dlj-1.1
AdobeFlash-10.3
Oracle-BCLA-JavaSE
google-chrome
skype-4.0.0.7-copyright
Broadcom
Intel-SDP
"

#GRUB_PLATFORMS="efi-64"
GRUB_PLATFORMS="emu pc efi-64"
export I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS=1
GENTOO_MIRRORS="$GENTOO_MIRRORS ftp://mirror.yandex.ru/gentoo-distfiles/"
GENTOO_MIRRORS="$GENTOO_MIRRORS ftp://distfiles.gentoo.org/distfiles/"
