[Lunar-commits] <moonbase-core> Merge branch 'optimization_defaults'

v4hn me at v4hn.de
Sun Nov 24 19:00:11 CET 2013


commit 0adc950a87ca18827b3c7f52f97714c417aeb3af
Author: v4hn <me at v4hn.de>
Date: Sun, 24 Nov 2013 09:59:17 -0800
URL: https://github.com/lunar-linux/moonbase-core/commit/0adc950a87ca18827b3c7f52f97714c417aeb3af

Merge branch 'optimization_defaults'
---
  compilers/gcc/plugin.d/optimize-gcc_4_8.plugin | +13/-4    
  devel/binutils/plugin.d/optimize-gnu_ld.plugin | +8/-1     
  utils/ccache/plugin.d/optimize-ccache.plugin   | +5/-2     
  3 files changed, 26 insertions(+), 7 deletions(-)

--- a/compilers/gcc/plugin.d/optimize-gcc_4_8.plugin
+++ b/compilers/gcc/plugin.d/optimize-gcc_4_8.plugin
@@ -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
@@ -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
--- a/devel/binutils/plugin.d/optimize-gnu_ld.plugin
+++ b/devel/binutils/plugin.d/optimize-gnu_ld.plugin
@@ -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
@@ -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
--- a/utils/ccache/plugin.d/optimize-ccache.plugin
+++ b/utils/ccache/plugin.d/optimize-ccache.plugin
@@ -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"
@@ -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
@@ -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




More information about the Lunar-commits mailing list