Skip to content

Commit

Permalink
Merge branch 'optimization_defaults'
Browse files Browse the repository at this point in the history
  • Loading branch information
v4hn committed Nov 24, 2013
2 parents 360bbcb + 12225a7 commit 0adc950
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
17 changes: 13 additions & 4 deletions compilers/gcc/plugin.d/optimize-gcc_4_8.plugin
Expand Up @@ -2,17 +2,24 @@
# gcc-4.8.x compiler optimizations plugin
#

compiler_gcc_optimize_defaults()
{
# default optimizations
BOPT=Faster
CC_OPTS=( Pipe Fortify )
CPU=$(arch | sed 's;_;-;')
}

plugin_compiler_gcc_4_8_optimize()
{
if [ "${LUNAR_COMPILER:-GCC_4_8}" != "GCC_4_8" ]; then
return 2
fi

# default optimizations
BOPT=Fast
CC_OPTS=( Pipe Fortify )

debug_msg "plugin_compiler_gcc_4_8_optimize($@)"

compiler_gcc_optimize_defaults

if [ -f /etc/lunar/local/optimizations.GCC_4_8 ]; then
. /etc/lunar/local/optimizations.GCC_4_8
fi
Expand Down Expand Up @@ -214,6 +221,8 @@ STACK=$STACK
EOF
}

compiler_gcc_optimize_defaults

if [ -f /etc/lunar/local/optimizations.GCC_4_8 ]; then
. /etc/lunar/local/optimizations.GCC_4_8
fi
Expand Down
9 changes: 8 additions & 1 deletion devel/binutils/plugin.d/optimize-gnu_ld.plugin
Expand Up @@ -2,10 +2,15 @@
# GNU ld linker optimizations plugin
#

plugin_gnu_ld_optimize()
gnu_ld_optimize_defaults()
{
# default optimizations
LDF=( Strip )
}

plugin_gnu_ld_optimize()
{
gnu_ld_optimize_defaults

if [ -f /etc/lunar/local/optimizations.GNU_LD ]; then
. /etc/lunar/local/optimizations.GNU_LD
Expand Down Expand Up @@ -63,6 +68,8 @@ plugin_gnu_ld_optimize_menu()
return 2
fi

gnu_ld_optimize_defaults

# load previous optimizations
if [ -e /etc/lunar/local/optimizations.GNU_LD ]; then
. /etc/lunar/local/optimizations.GNU_LD
Expand Down
7 changes: 5 additions & 2 deletions utils/ccache/plugin.d/optimize-ccache.plugin
Expand Up @@ -9,7 +9,7 @@ plugin_ccache_optimize()
. /etc/lunar/local/optimizations.CCACHE
fi

if [ "$USE_CCACHE" == "yes" ]; then
if [ "${USE_CCACHE:-yes}" == "yes" ]; then
# we PRE-pend ccache in case distcc is also used to make sure that ccache goes first!
echo $CC_EXT | grep -q "ccache" || CC_EXT="ccache $CC_EXT"
echo $CXX_EXT | grep -q "ccache" || CXX_EXT="ccache $CXX_EXT"
Expand Down Expand Up @@ -37,6 +37,9 @@ plugin_ccache_optimize_menu()
return 2
fi

# Defaults
USE_CCACHE="yes"

# load previous optimizations
if [ -e /etc/lunar/local/optimizations.CCACHE ]; then
. /etc/lunar/local/optimizations.CCACHE
Expand All @@ -58,7 +61,7 @@ EOF
if [ $? != 0 ]; then
break
else
if [ "$USE_CCACHE" == 'yes' ]; then
if [ "$USE_CCACHE" == "yes" ]; then
USE_CCACHE=no
else
USE_CCACHE=yes
Expand Down

0 comments on commit 0adc950

Please sign in to comment.