[Lunar-commits] <lunar> tree sync with theedge: optimization rewrite, in_depends() fix, lvu submit merged. Mailman protected additions.

Auke Kok sofar at lunar-linux.org
Mon Jul 2 04:43:02 CEST 2012


commit 099376029cbd6e4bee3cb766d8cf047b563406b6
Author: Auke Kok <sofar at lunar-linux.org>
Date:   Sun May 8 20:44:40 2005 +0000

    tree sync with theedge: optimization rewrite, in_depends() fix, lvu submit merged. Mailman protected additions.
---
 bin/lvu                                |    4 +-
 sbin/lunar                             |    4 +-
 var/lib/lunar/functions/depends.lunar  |    4 +-
 var/lib/lunar/functions/optimize.lunar |  277 ++--------
 var/lib/lunar/menu/optimize.menu       |  871 +++++++++++++++++++-------------
 var/lib/lunar/protected                |    4 +
 6 files changed, 596 insertions(+), 568 deletions(-)

diff --git a/bin/lvu b/bin/lvu
index 7ef86a5..1421a04 100755
--- a/bin/lvu
+++ b/bin/lvu
@@ -831,7 +831,9 @@ main()  {
       for MODULE in $(list_installed); do
         VERSION=$(installed_version $MODULE)
         if grep -q "$2" $INSTALL_LOGS/$MODULE-$VERSION ; then
-          echo "$MODULE $VERSION"
+		  for FILE in $(grep "$2" $INSTALL_LOGS/$MODULE-$VERSION | cut -d: -f2) ; do
+            echo "$MODULE:$FILE"
+          done
         fi
       done
       ;;
diff --git a/sbin/lunar b/sbin/lunar
index f501580..c379491 100755
--- a/sbin/lunar
+++ b/sbin/lunar
@@ -675,7 +675,7 @@ option_menu()  {
       F)  feature_menu           ;;
       I)  integrity_menu         ;;
       M)  mirror_menu            ;;
-      O)  optimize_architecture  ;;
+      O)  . /var/lib/lunar/menu/optimize.menu && optimize_menu          ;;
       L)  set_default_module     ;;
     esac
   done
@@ -835,7 +835,7 @@ else
     renew      ) renew                                  ;;
     update     ) update                                 ;;
     rebuild    ) rebuild                                ;;
-    optimize   ) optimize_architecture                  ;;
+    optimize   ) . /var/lib/lunar/menu/optimize.menu && optimize_menu  ;;
     set        ) shift && setvar $@                     ;;
     unset      ) shift && unsetvar $@                   ;;
     fix        ) shift && run_fix $@                    ;;
diff --git a/var/lib/lunar/functions/depends.lunar b/var/lib/lunar/functions/depends.lunar
index e6f7572..78084ee 100644
--- a/var/lib/lunar/functions/depends.lunar
+++ b/var/lib/lunar/functions/depends.lunar
@@ -104,7 +104,7 @@ is_depends()  {
 in_depends()  {
   debug_msg "in_depends ($@)"
   # Was $2 presented as a depenency for module $1
-  return $(grep -q "^$1:$2:" $DEPENDS_STATUS)
+  return $(grep -q "^$1:$2:on:" $DEPENDS_STATUS)
 }
                                                                                 
                                                                                 
@@ -187,7 +187,7 @@ run_depends() {
     #              $4 = description of why to use this module
 
     DEP=$(unalias $1)
-    if ! in_depends "$MODULE" "$DEP" ; then
+    if ! grep -q "^$MODULE:$DEP:" $DEPENDS_STATUS ; then
                                                                                
       if module_exiled $DEP ; then
         verbose_msg "\"$MODULE\" optionally depends on exiled module \"$DEP\""
diff --git a/var/lib/lunar/functions/optimize.lunar b/var/lib/lunar/functions/optimize.lunar
index 110e8ff..38d144e 100644
--- a/var/lib/lunar/functions/optimize.lunar
+++ b/var/lib/lunar/functions/optimize.lunar
@@ -486,101 +486,69 @@ optimize_speed() {
          Pointers) if [[ $GCCVER == "3" ]] ; then
                      CFLAGS="$CFLAGS -fomit-frame-pointer"
                      CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
-                   else
-                     CFLAGS="$CFLAGS"
-                     CXXFLAGS="$CXXFLAGS"
                    fi
                  ;;
          Siblings) if [[ $GCCVER == "3" ]] ; then
                      CFLAGS="$CFLAGS -foptimize-sibling-calls"
                      CXXFLAGS="$CXXFLAGS"
-                   else
-                     CFLAGS="$CFLAGS"
-                     CXXFLAGS="$CXXFLAGS"
                    fi
                  ;;
         Profiling) if [[ $GCCVER == "3" ]] ; then
                      CFLAGS="$CFLAGS -fprofile-arcs"
                      CXXFLAGS="$CXXFLAGS -fprofile-arcs"
 		     set_local_config "KEEP_SOURCE" "on"
-                   else
-                     CFLAGS="$CFLAGS"
-                     CXXFLAGS="$CXXFLAGS"
                    fi
                  ;;
         Branching) if [[ $GCCVER == "3" ]] ; then
                      CFLAGS="$CFLAGS -fbranch-probabilities"
                      CXXFLAGS="$CXXFLAGS -fbranch-probabilities"
-                   else
-                     CFLAGS="$CFLAGS"
-                     CXXFLAGS="$CXXFLAGS"
                    fi
                  ;; 
          Aliasing) if [[ $GCCVER == "3" ]] ; then
                       CFLAGS="$CFLAGS -fstrict-aliasing"
                       CXXFLAGS="$CXXFLAGS -fstrict-aliasing"
-                    else
-                      CFLAGS="$CFLAGS"
-                      CXXFLAGS="$CXXFLAGS"
                     fi
                  ;;
             Cprop) if [[ $GCCVER == "3" ]] ; then
                      CFLAGS="$CFLAGS -fno-cprop-registers"
                      CXXFLAGS="$CXXFLAGS -fno-cprop-registers"
-                   else
-                     CFLAGS="$CFLAGS"
-                     CXXFLAGS="$CXXFLAGS"
                    fi
                  ;;
             Float) if [[ $GCCVER == "3" ]] ; then
                      CFLAGS="$CFLAGS -ffloat-store"
                      CXXFLAGS="$CXXFLAGS -ffloat-store"
-                   else
-                     CFLAGS="$CFLAGS"
-                     CXXFLAGS="$CXXFLAGS"
                    fi
                  ;;
           Address) if [[ $GCCVER == "3" ]] ; then
                      CFLAGS="$CFLAGS -fforce-addr"
                      CXXFLAGS="$CXXFLAGS -fforce-addr"
-                   else
-                     CFLAGS="$CFLAGS"
-                     CXXFLAGS="$CXXFLAGS"
                    fi
                  ;;
             Align) if [[ $GCCVER == "3" ]] ; then
                      CFLAGS="$CFLAGS -falign-functions -falign-loops -falign-jumps"
                      CXXFLAGS="$CXXFLAGS -falign-functions -falign-loops -falign-jumps"
-                   else
-                     CFLAGS="$CFLAGS"
-                     CXXFLAGS="$CXXFLAGS"
                    fi
                  ;;
         Expensive) if [[ $GCCVER == "3" ]] ; then
                      CFLAGS="$CFLAGS -fexpensive-optimizations"
                      CXXFLAGS="$CXXFLAGS -fexpensive-optimizations"
-                   else
-                     CFLAGS="$CFLAGS"
-                     CXXFLAGS="$CXXFLAGS"
                    fi
                  ;;
           Doubles) if [[ $GCCVER == "3" ]] ; then
                      CFLAGS="$CFLAGS -malign-double"
                      CXXFLAGS="$CXXFLAGS -malign-double"
-                   else
-                     CFLAGS="$CFLAGS"
-                     CXXFLAGS="$CXXFLAGS"
                    fi
 		 ;;
 	   Tracer) if [[ $GCCVER == "3" ]] ; then
 	             CFLAGS="$CFLAGS -ftracer"
 		     CXXFLAGS="$CXXFLAGS -ftracer"
-		   else
-		     CFLAGS="$CFLAGS"
-		     CXXFLAGS="$CXXFLAGS"
 		   fi
                  ;;
-
+	   Blocks) if [[ $GCCVER == "3" ]] ; then
+	             CFLAGS="$CFLAGS -freorder-blocks"
+		     CXXFLAGS="$CXXFLAGS -freorder-blocks"
+		   fi
+                 ;;
       esac
    done
 }
@@ -590,11 +558,10 @@ optimize_stack() {
   debug_msg "optimize_stack ($@)"
   if [[ $STACK > 0 ]] ; then
     if [ $PLATFORM == "x86" ] ; then
-      STACK="-mpreferred-stack-boundary=$STACK" 
+      CFLAGS="$CFLAGS -mpreferred-stack-boundary=$STACK"
+      CXXFLAGS="$CXXFLAGS -mpreferred-stack-boundary=$STACK"
+      CPPFLAGS="$CPPFLAGS -mpreferred-stack-boundary=$STACK"
     fi
-      CFLAGS="$CFLAGS $STACK"
-      CXXFLAGS="$CXXFLAGS $STACK"
-      CPPFLAGS="$CPPFLAGS $STACK"
   fi
 }
 
@@ -665,30 +632,22 @@ optimize_fp() {
 # Set up the Linker optimizations
 optimize_ld() {
   debug_msg "optimize_ld ($@)"
-   if [[ $LDFLAGS ]]; then
-      unset LDFLAGS
-   fi
+  if [[ $LDFLAGS ]]; then
+    unset LDFLAGS
+  fi
 
-   for A in ${LDF[@]}; do
-      case $A in
-         Strip)     LDFLAGS="$LDFLAGS -s"
-                    ;;
-         Optimize)  LDFLAGS="$LDFLAGS -Wl,-O1"
-                    ;;
-         Reduce)    LDFLAGS="$LDFLAGS -Wl,--as-needed"
-                    ;;
-# The Debug option breaks some modules (eg: tar and gzip, just to mention a
-# few), so this option should either be removed, or remain "deactivated"
-# untill this has been resolved but the hatch is that we don't know how many
-# modules is affected by it... See bug No. 75. Or contact me (Niki Guldbran
-# <nikig at vip.cybercity.dk>)
-#
-#         Debug)     LDFLAGS="$LDFLAGS -S"
-#                    ;;
-         Combreloc) LDFLAGS="$LDFLAGS -z combreloc"
-                    ;;
-      esac
-   done
+  for A in ${LDF[@]}; do
+    case $A in
+      Strip)     LDFLAGS="$LDFLAGS -s"           ;;
+      Optimize)  WL="$WL,-O1"                    ;;
+      Reduce)    WL="$WL,--as-needed"            ;;
+      Debug)     LDFLAGS="$LDFLAGS -S"           ;;
+      Combreloc) LDFLAGS="$LDFLAGS -z combreloc" ;;
+    esac
+  done
+  if [ -n "$WL" ]; then
+    LDFLAGS="$LDFLAGS -Wl$WL"
+  fi
 }
 
 
@@ -726,14 +685,20 @@ optimize_addon() {
 }
 
 
-optimize_ccc_warn() {
-  debug_msg "optimize_ccc_warn ($@)"
-  for W in ${CCC_WARN[@]}; do
+optimize_cc_opt() {
+  debug_msg "optimize_cc_opt ($@)"
+  for W in ${CC_OPTS[@]}; do
     case $W in
-    Deprecated)
-      CXXFLAGS="$CXXFLAGS -Wno-deprecated"
-      CPPFLAGS="$CPPFLAGS -Wno-deprecated"
-      ;;
+      Deprecated)
+        CXXFLAGS="$CXXFLAGS -Wno-deprecated"
+        CPPFLAGS="$CPPFLAGS -Wno-deprecated"
+        ;;
+	  ccpipe)
+	    COPT="$COPT -pipe"
+	    ;;
+	  cxxpipe)
+	    CCOPT="$CCOPT -pipe"
+	    ;;
     esac
   done
 }
@@ -749,16 +714,13 @@ optimize() {
     echo -e PLATFORM=x86            '\n'    \
 BUILD=i386-pc-linux-gnu '\n'    \
 MAKES=                  '\n'    \
-COPT=                   '\n'    \
-CCOPT=                  '\n'    \
 BOPT=-O0                '\n'    \
 CPU=i386                '\n'    \
 SPD=( )                 '\n'    \
 STACK=                  '\n'    \
 XTRA=( )                '\n'    \
 FPM=                    '\n'    \
-CC_WARN=( )             '\n'    \
-CCC_WARN=( )            '\n'    \
+CC_OPTS=( )             '\n'    \
 LDF=( )                 '\n'    \
 ADDON=( ) > /etc/lunar/local/optimizations
   fi
@@ -770,51 +732,24 @@ ADDON=( ) > /etc/lunar/local/optimizations
 
   unset CFLAGS CXXFLAGS LDFLAGS
 
+  optimize_make     $MAKES     &&
+  optimize_base     $BOPT      &&
+  optimize_cpu      $CPU       &&
+  optimize_speed    ${SPD[@]}  &&
+  optimize_extra    ${XTRA[@]} &&
+  optimize_fp       $FPM       &&
+  optimize_cc_opt              &&
+  optimize_ld       ${LDF[@]}  &&
+  optimize_addon               &&
+
   case $PLATFORM in
-      x86)      optimize_make     $MAKES     &&
-                optimize_base     $BOPT      &&
-                optimize_cpu      $CPU       &&
-                optimize_speed    ${SPD[@]}  &&
-                optimize_extra    ${XTRA[@]} &&
-		optimize_stack               &&
-                optimize_fp       $FPM       &&
-		optimize_ccc_warn            &&
-                optimize_ld       ${LDF[@]}  &&
-		optimize_addon
-                ;;
-      Alpha)    optimize_make     $MAKES     &&
-                optimize_base     $BOPT      &&
-                optimize_cpu      $CPU       &&
-                optimize_speed    ${SPD[@]}  &&
-                optimize_extra    ${XTRA[@]} &&
-                optimize_fp       $FPM       &&
-		optimize_ccc_warn            &&
-                optimize_ld       ${LDF[@]}  &&
-		optimize_addon
-                ;;
-      PowerPC)  optimize_make     $MAKES     &&
-                optimize_base     $BOPT      &&
-                optimize_cpu      $CPU       &&
-                optimize_speed    ${SPD[@]}  &&
-                optimize_extra    ${XTRA[@]} &&
-                optimize_fp       $FPM       &&
-		optimize_ccc_warn            &&
-                optimize_ld       ${LDF[@]}  &&
-		optimize_addon
-                ;;
-      SPARC)    optimize_make     $MAKES     &&
-                optimize_base     $BOPT      &&
-                optimize_cpu      $CPU       &&
-                optimize_speed    ${SPD[@]}  &&
-                optimize_extra    ${XTRA[@]} &&
-                optimize_fp       $FPM       &&
-		optimize_ccc_warn            &&
-                optimize_ld       ${LDF[@]}  &&
-		optimize_addon
-                ;;
+    x86)
+      optimize_stack
+      ;;
   esac
 
-  if [ "$(installed_version gcc | cut -d. -f1,2)" == "3.4" ] ; then
+  if [ "$(installed_version gcc | cut -d. -f1,2)" == "3.4" \
+       -o "$(installed_version gcc | cut -d. -f1)" == "4" ] ; then
     CFLAGS=$(echo $CFLAGS | sed 's:-mcpu:-mtune:')
     CXXFLAGS=$(echo $CXXFLAGS | sed 's:-mcpu:-mtune:')
   fi
@@ -836,111 +771,3 @@ ADDON=( ) > /etc/lunar/local/optimizations
 }
 
 
-# This is the flow control and error checking for the menus.
-optimize_architecture()  {
-  debug_msg "optimize_architecture ($@)"
-  # Make sure optimizations file exists, if not create it.
-  if ! [[ -f /etc/lunar/local/optimizations ]]; then
-    touch /etc/lunar/local/optimizations
-  fi
-
-  # Make sure our menu script exists and source it in, or exit.
-  if [[ -f /var/lib/lunar/menu/optimize.menu ]]; then
-    . /var/lib/lunar/menu/optimize.menu
-  else
-    exit 0
-  fi
-
-  if [ -f /etc/lunar/local/optimizations ] ; then
-    .  /etc/lunar/local/optimizations
-  fi
-
-  # Flow control for the menus. This will also check for gcc3,
-  # if it exists it will allow more options.
-  TITLE="Lunar Optimizations"
-
-  help compiler_help          &&
-  compiler_options            &&
-  menu radiolist              &&
-  GCCVER=$RESULT
-  
-  help cc_help                &&
-  cc_options                  &&
-  menu checklist              &&
-  COPT=$RESULT
-
-  help ccc_help               &&
-  ccc_options                 &&
-  menu checklist              &&
-  CCOPT=$RESULT
-
-  help platform_help          &&
-  platform_options            &&
-  menu radiolist              &&
-  PLATFORM=$RESULT
-
-  help bopt_help              &&
-  bopt_options                &&
-  menu radiolist              &&
-  BOPT=$RESULT
-
-  help cpu_help $PLATFORM     &&
-  cpu_options $PLATFORM       &&
-  menu radiolist              &&
-  CPU=$RESULT
-  optimize_cpu $CPU           &&
-  BUILD=$BUILD
-
-  help spd_help               &&
-  spd_options                 &&
-  menu checklist              &&
-  SPD=( $RESULT )
-
-  help xtra_help              &&
-  xtra_options                &&
-  menu checklist              &&
-  XTRA=( $RESULT )
-
-  help fpm_help               &&
-  fpm_options                 &&
-  menu radiolist              &&
-  FPM=$RESULT
-
-  help ccc_warn_help          &&
-  ccc_warn                    &&
-  menu checklist              &&
-  CCC_WARN=$RESULT  
-
-  help ldf_help               &&
-  ldf_options                 &&
-  menu checklist              &&
-  LDF=( $RESULT )
-  
-  help addon_help             &&
-  addon_options               &&
-  menu checklist              &&
-  ADDON=( $RESULT )
-
-  MAKES=`dialog --title "Make - parallellizing" \
-                --nocancel                       \
-		--stdout                         \
-		--inputbox                       \
-		"Enter the number of concurrent makes ( a value > 1 ) or leave this field empty."  \
-		0 55 $MAKES`
-  # people WILL fill in 1... so, we knock them down and take their money:
-  if [[ $MAKES -lt 2 ]] ; then
-    unset MAKES
-  fi
-
-  STACK=`dialog --title "Set stack parameters. (WARNING! Best left empty!)" \
-                --nocancel                       \
-		--stdout                         \
-		--inputbox                       \
-		"Enter the number to set the stack to, leave empty for default."  \
-		0 55 $STACK`
-
-  set_optimize
-
-}
-
-
diff --git a/var/lib/lunar/menu/optimize.menu b/var/lib/lunar/menu/optimize.menu
index 671e166..a085a60 100644
--- a/var/lib/lunar/menu/optimize.menu
+++ b/var/lib/lunar/menu/optimize.menu
@@ -1,390 +1,411 @@
 #Copyrighted Jason Johnston  2002 under GPLv2
 
-set_optimize() {
+save_optimizations() {
 
   GCCVER=${GCCVER:=3}
   set_local_config "GCCVER" "$GCCVER"
 
-  echo -e PLATFORM=$PLATFORM            '\n'\
-          BUILD=$BUILD                  '\n'\
-	  MAKES=$MAKES                  '\n'\
-          COPT=$COPT                    '\n'\
-          CCOPT=$CCOPT                  '\n'\
-          BOPT=$BOPT                    '\n'\
-          CPU=$CPU                      '\n'\
-          SPD=( ${SPD[@]} )             '\n'\
-	  STACK=$STACK                  '\n'\
-          XTRA=( ${XTRA[@]} )           '\n'\
-          FPM=$FPM                      '\n'\
-	  CC_WARN=( ${CC_WARN[@]} )     '\n'\
-	  CCC_WARN=( ${CCC_WARN[@]} )   '\n'\
-          LDF=( ${LDF[@]} )             '\n'\
-          ADDON=( ${ADDON[@]} ) > /etc/lunar/local/optimizations
+  cat > /etc/lunar/local/optimizations <<EOF
+PLATFORM=$PLATFORM
+BUILD=$BUILD
+CPU=$CPU
+BOPT=$BOPT
+XTRA=( $(echo ${XTRA[@]}) )
+SPD=( $(echo ${SPD[@]} ) )
+FPM=$FPM
+CC_OPTS=( $(echo ${CC_OPTS[@]} ) )
+LDF=( $(echo ${LDF[@]} ) )
+ADDON=( $(echo ${ADDON[@]} ) )
+MAKES=$MAKES
+STACK=$STACK
+EOF
 }
 
 # Setup the help to be used for descriptions
-help() {
-   case $1 in
+optimizations_help() {
+ case $1 in
 
    # Help for selecting preferred compiler.
-   compiler_help)
-                MENU="Preferred Compiler"
-           GCC2_HELP="Sets GCC 2x as the preferred compiler."
-           GCC3_HELP="Sets GCC 3x as the preferred compiler."
-                 ;;
+   compiler)
+     MENU="Lunar allows you to use gcc version 2 (deprecated) or 3.x (standard). If you have both installed then you need to select the one that lunar uses here."
+     GCC2_HELP="Sets GCC 2x as the preferred compiler."
+     GCC3_HELP="Sets GCC 3x as the preferred compiler."
+     ;;
                  
-         cc_help)
-                  MENU="Options for the C compiler"
-             Pipe_HELP="Enable gcc to use named pipes."
-                ;;
-                
-        ccc_help)
-                  MENU="Options for the C++ compiler"
-             Pipe_HELP="Enable gcc to use named pipes."
-                ;;
-                
    # Help for the platform selections.
-   platform_help)
-                MENU="Platform"
-            x86_HELP="Intel and AMD hardware"
-          Alpha_HELP="Compaq Alpha hardware"
-        PowerPC_HELP="IBM and Apple hardware (Power and PowerPC)"
-          SPARC_HELP="SUN Hardware"
-                 ;;
+   platform)
+     MENU="The so-called platform is the name of the hardware architecture. Most people will use 'x86'"
+     x86_HELP="Intel and AMD hardware"
+     Alpha_HELP="Compaq Alpha hardware"
+     PowerPC_HELP="IBM and Apple hardware (Power and PowerPC)"
+     SPARC_HELP="SUN Hardware"
+     ;;
 
    # Help for the basic optimizations.
-     bopt_help)
-             MENU="Basic Optimization"
-        None_HELP="-O0"
-        Fast_HELP="-O1"
-      Faster_HELP="-O2"
+   bopt)
+     MENU="Choose the base compile-time optimization. Most people will use -O2 or -O3. Note that some modules set their own level."
+     None_HELP="-O0"
+     Fast_HELP="-O1"
+     Faster_HELP="-O2"
      Fastest_HELP="-O3"
-       Small_HELP="-Os"
-               ;;
+     Small_HELP="-Os"
+     ;;
 
    # Help for the cpu selections.
-      cpu_help)
-          MENU="$2 CPUs, according to the kernel you have a$(cat /proc/cpuinfo | grep 'model name' | cut -d: -f2 | head -n 1)"
-         case $2 in
-            x86)
-          I386_HELP="I386 processors"
-          I486_HELP="I486 processors"
-          I586_HELP="I586 processors"
-       Pentium_HELP="Pentium processors"
-    PentiumMMX_HELP="Pentium processors with mmx"
-          I686_HELP="I686 processors"
-    PentiumPro_HELP="Pentium Pro processors"
-            P2_HELP="Pentium II processors"
-            P3_HELP="Pentium III processors"
-            P4_HELP="Pentium 4 processors"
-            K6_HELP="AMD K6 processors"
-           K62_HELP="AMD K6-2 processors"
-           K63_HELP="AMD K6-3 processors"
-        Athlon_HELP="AMD Athlon processors"
-   AthlonTBird_HELP="AMD Athlon Thunderbird processors"
-       Athlon4_HELP="AMD Athlon 4 processors"
-      AthlonXP_HELP="AMD Athlon XP processors"
-      AthlonMP_HELP="AMD Athlon MP processors"
-                 ;;
-           Alpha)
-              ev4_HELP="Alpha EV4 (21064)"
-             ev45_HELP="Alpha EV45 (21064a)"
-              ev5_HELP="Alpha EV5 (21164)"
-             ev56_HELP="Alpha EV56 (21164a)"
-            pca56_HELP="Alpha pca56 (21164PC)"
-              ev6_HELP="Alpha EV6 (21264)"
-             ev67_HELP="Alpha EV67 (21264a)"
-	     ev68_HELP="Alpha EV68 (21264b)"
-                 ;;
-         PowerPC)
-           common_HELP="Common PowerPC"
-             rios_HELP="Rios PowerPC"
-            rios1_HELP="Rios1 PowerPC"
-              rsc_HELP="RSC PowerPC"
-            rios2_HELP="Rios2 PowerPC"
-            rs64a_HELP="RS64a PowerPC"
-             p403_HELP="403 PowerPC"
-             p505_HELP="505 PowerPC"
-             p601_HELP="601 PowerPC"
-             p602_HELP="602 PowerPC"
-             p603_HELP="603 PowerPC"
-            p603a_HELP="603a PowerPC"
-             p604_HELP="604 PowerPC"
-            p604e_HELP="604e PowerPC"
-             p620_HELP="620 PowerPC"
-             p630_HELP="630 PowerPC"
-             p740_HELP="740 PowerPC"
-            p7400_HELP="7400 PowerPC"
-            p7450_HELP="7450 PowerPC"
-             p750_HELP="750 PowerPC"
-             p801_HELP="801 PowerPC"
-             p821_HELP="821 PowerPC"
-             p823_HELP="823 PowerPC"
-             p860_HELP="860 PowerPC"
-            Power_HELP="Power PowerPC"
-           Power2_HELP="Power2 PowerPC"
-          PowerPC_HELP="PowerPC"
-                 ;;
-           SPARC)
-              v7_HELP="V7 SPARC"
+   cpu)
+     MENU="$2 CPUs, according to the kernel you have a$(cat /proc/cpuinfo | grep 'model name' | cut -d: -f2 | head -n 1)"
+     case $2 in
+       x86)
+         I386_HELP="I386 processors"
+         I486_HELP="I486 processors"
+         I586_HELP="I586 processors, identical to 'pentium'"
+         PentiumMMX_HELP="Pentium processors with mmx"
+         I686_HELP="I686 processors, identical to 'pentiumpro'"
+         P2_HELP="Pentium II processors"
+         P3_HELP="Pentium III processors"
+         P4_HELP="Pentium 4 processors"
+         K6_HELP="AMD K6 processors"
+         K62_HELP="AMD K6-2 processors"
+         K63_HELP="AMD K6-3 processors"
+         Athlon_HELP="AMD Athlon processors"
+         AthlonTBird_HELP="AMD Athlon Thunderbird processors"
+         Athlon4_HELP="AMD Athlon 4 processors"
+         AthlonXP_HELP="AMD Athlon XP processors"
+         AthlonMP_HELP="AMD Athlon MP processors"
+         ;;
+       Alpha)
+         ev4_HELP="Alpha EV4 (21064)"
+         ev45_HELP="Alpha EV45 (21064a)"
+         ev5_HELP="Alpha EV5 (21164)"
+         ev56_HELP="Alpha EV56 (21164a)"
+         pca56_HELP="Alpha pca56 (21164PC)"
+         ev6_HELP="Alpha EV6 (21264)"
+         ev67_HELP="Alpha EV67 (21264a)"
+	 ev68_HELP="Alpha EV68 (21264b)"
+         ;;
+       PowerPC)
+         common_HELP="Common PowerPC"
+         rios_HELP="Rios PowerPC"
+         rios1_HELP="Rios1 PowerPC"
+         rsc_HELP="RSC PowerPC"
+         rios2_HELP="Rios2 PowerPC"
+         rs64a_HELP="RS64a PowerPC"
+         p403_HELP="403 PowerPC"
+         p505_HELP="505 PowerPC"
+         p601_HELP="601 PowerPC"
+         p602_HELP="602 PowerPC"
+         p603_HELP="603 PowerPC"
+         p603a_HELP="603a PowerPC"
+         p604_HELP="604 PowerPC"
+         p604e_HELP="604e PowerPC"
+         p620_HELP="620 PowerPC"
+         p630_HELP="630 PowerPC"
+         p740_HELP="740 PowerPC"
+         p7400_HELP="7400 PowerPC"
+         p7450_HELP="7450 PowerPC"
+         p750_HELP="750 PowerPC"
+         p801_HELP="801 PowerPC"
+         p821_HELP="821 PowerPC"
+         p823_HELP="823 PowerPC"
+         p860_HELP="860 PowerPC"
+         Power_HELP="Power PowerPC"
+         Power2_HELP="Power2 PowerPC"
+         PowerPC_HELP="PowerPC"
+         ;;
+       SPARC)
+         v7_HELP="V7 SPARC"
          cypress_HELP="Cypress SPARC"
-              v8_HELP="V8 SPARC"
-      supersparc_HELP="SuperSPARC"
-       sparclite_HELP="SPARCLite"
-      hypersparc_HELP="HyperSPARC"
-      sparclite86x_HELP="SPARCLite86x"
-            f930_HELP="f930 SPARC"
-            f934_HELP="f934 SPARC"
-        sparclet_HELP="SPARCLet"
-          tsc701_HELP="tsc701 SPARC"
-              v9_HELP="V9 SPARC"
-      ultrasparc_HELP="ULTRASPARC"
-                 ;;
-           esac
+         v8_HELP="V8 SPARC"
+         supersparc_HELP="SuperSPARC"
+         sparclite_HELP="SPARCLite"
+         hypersparc_HELP="HyperSPARC"
+         sparclite86x_HELP="SPARCLite86x"
+         f930_HELP="f930 SPARC"
+         f934_HELP="f934 SPARC"
+         sparclet_HELP="SPARCLet"
+         tsc701_HELP="tsc701 SPARC"
+         v9_HELP="V9 SPARC"
+         ultrasparc_HELP="ULTRASPARC"
          ;;
+     esac
+     ;;
 
    # Help for speed options.
-      spd_help)
-              MENU="Speed optimizations"
-       Speedy_HELP="Optimize to increase performance of generated code"
-        Risky_HELP="Optimize to increase performance ... by violating ANSI and IEEE FP rules"
+   spd)
+     MENU="Select additional flags to optimize specific areas of the created code. Note that some of these flags are turned on automatically with -O2 or -O3. See 'man gcc' for more information"
+     Speedy_HELP="Optimize to increase performance of generated code"
+     Risky_HELP="Optimize to increase performance ... by violating ANSI and IEEE FP rules"
      Pointers_HELP="Optimize by omitting frame pointers"
      Siblings_HELP="Optimize sibling calls"
-    Profiling_HELP="Generate profiles (For later use with Branching)"
-    Branching_HELP="Predict branching (For using profiled sources)"
+     Profiling_HELP="Generate profiles (For later use with Branching)"
+     Branching_HELP="Predict branching (For using profiled sources)"
      Aliasing_HELP="Enable strict aliasing (enabled by default -O1 and above)"
-        Cprop_HELP="Reduce scheduling dependencies and remove copies"
-        Float_HELP="Enable float store"
-      Address_HELP="Force memory address"
-        Align_HELP="Align functions, loops, and jumps"
-    Expensive_HELP="Perform expensive optimizations"
-      Doubles_HELP="Align double, long double, and long long on two word boundaries"
-       Tracer_HELP="Perform tail duplication to enlarge superblock size."
-               ;;
+     Cprop_HELP="Reduce scheduling dependencies and remove copies"
+     Float_HELP="Enable float store"
+     Address_HELP="Force memory address"
+     Align_HELP="Align functions, loops, and jumps"
+     Expensive_HELP="Perform expensive optimizations"
+     Doubles_HELP="Align double, long double, and long long on two word boundaries"
+     Tracer_HELP="Perform tail duplication to enlarge superblock size."
+     Blocks_HELP="Reorder basic blocks in order to reduce number of taken branches."
+     ;;
 
    # Help for extra options
-     xtra_help)
-                  # do NOT change the next line unless you too smart
-                  CPUINFO=$(echo "`grep flags /proc/cpuinfo` ")
-		  for EXT in mmx sse sse2 3dnow altivec ; do
-		    if echo $CPUINFO | grep -q " $EXT " ; then
-		      FLAGS="$FLAGS $EXT"
-		    fi
-		  done
+   xtra)
+     # do NOT change the next line unless you too smart
+     CPUINFO=$(echo "`grep flags /proc/cpuinfo` ")
+     for EXT in mmx sse sse2 3dnow altivec ; do
+       if echo $CPUINFO | grep -q " $EXT " ; then
+         FLAGS="$FLAGS $EXT"
+       fi
+     done
 
-             MENU="Extra Features, the kernel reports to have:$FLAGS"
-         MMX_HELP="Enable MMX"
-         SSE_HELP="Enable SSE"
-        SSE2_HELP="Enable SSE2"
-        dnow_HELP="3dnow"
+     MENU="Select compiler use of extra instruction sets. The kernel reports that this system has: $FLAGS"
+     MMX_HELP="Multi-Media instruction code eXtensions"
+     SSE_HELP="Streaming SIMD (Single Instruction, Multiple Data) Extensions"
+     SSE2_HELP="Streaming SIMD (Single Instruction, Multiple Data) Extensions v2"
+     dnow_HELP="3dnow"
      Altivec_HELP="Enables Altivec"
-                  unset CPUINFO EXT FLAGS
-               ;;
+     unset CPUINFO EXT FLAGS
+     ;;
 
    # Help for floating point math
-      fpm_help)
-                  # do NOT change the next line unless you too smart
-                  CPUINFO=$(echo "`grep flags /proc/cpuinfo` ")
-		  for EXT in fpu sse altivec ; do
-		    if echo $CPUINFO | grep -q " $EXT " ; then
-		      FLAGS="$FLAGS $EXT"
-		    fi
-		  done
-		  FLAGS=${FLAGS/fpu/387}
+   fpm)
+     # do NOT change the next line unless you too smart
+     CPUINFO=$(echo "`grep flags /proc/cpuinfo` ")
+     for EXT in fpu sse altivec ; do
+       if echo $CPUINFO | grep -q " $EXT " ; then
+         FLAGS="$FLAGS $EXT"
+       fi
+     done
+     FLAGS=${FLAGS/fpu/387}
+     FLAGS=${FLAGS/387 sse/387 and sse (both)}
 
-          MENU="Floating Point Math, the kernel reports to have: $FLAGS"
+     MENU="Select available Floating Point Math compile extenstions. The kernel reports that this sytem has: $FLAGS"
      None_HELP="Do not enable any extra features."
-     x387_HELP="387"
-      SSE_HELP="SSE"
-     Both_HELP="SSE and 387"
-  Altivec_HELP="Altivec"
-                  unset CPUINFO EXT FLAGS
-               ;;
-   # Warn help
- ccc_warn_help)
-          MENU="Enable/Disable C++ compiler warnings"
-     Deprecated_HELP="Disable warnings of deprecated..."
-              ;;
+     x387_HELP="Classic 387 or higher Floating Point Co-Processor"
+     SSE_HELP="Streaming SIMD (Single Instruction, Multiple Data) Extensions"
+     Both_HELP="Both SSE and 387"
+     Altivec_HELP="Altivec"
+     unset CPUINFO EXT FLAGS
+     ;;
+     
+   # General C/C++ options
+   cc_opt)
+     MENU="General C/C++ compiler settings"
+     Deprecated_HELP="Disable warnings of deprecated symbols in C++"
+     CPipe_HELP="Enable cc to use named pipes."
+     CCPipe_HELP="Enable c++ to use named pipes."
+     ;;
           
    # Help for linker options
-      ldf_help)
-            MENU="Linker options"
-      Strip_HELP="Strip all symbols"
-   Optimize_HELP="Optimize hash tables during linking"
+   ldf)
+     MENU="Select linker optimizations. These options only apply to the link stage of binaries."
+     Strip_HELP="Strip all symbols"
+     Optimize_HELP="Optimize hash tables during linking"
      Reduce_HELP="Reduce the amount of linked libraries if possible"
-  Combreloc_HELP="Combreloc"
-#     Debug_HELP="Strip debug symbols only"
-               ;;
+     Combreloc_HELP="Combreloc"
+     Debug_HELP="Strip debug symbols only"
+     ;;
 
    # Addon help for extra programs
-    addon_help)
-            MENU="Addon program support"
-       None_HELP="No compiler addons"
+   addon)
+     MENU="Lunar can automatically use certain compiler wrapper programs that perform certain tasks. You might need to install additions packages before you can use these."
+     None_HELP="No compiler addons"
      DistCC_HELP="Distributed compiler support"
      CCache_HELP="Compiler output caching"
-              ;;
+     ;;
   esac
 }
 
-compiler_options() {
-   OPTIONS=( "2" "GCC version 2x"  $( [ "$GCCVER" == "2" ] && echo "on" || echo "off" )  "$GCC2_HELP"
-             "3" "GCC version 3x"  $( [ "$GCCVER" == "3" ] && echo "on" || echo "off" )  "$GCC3_HELP" )
-}
-
-cc_options(){
-  OPTIONS=( '-pipe'   "-pipe"  $( [ "$COPT" == "-pipe" ] && echo "on" || echo "off" )   "$Pipe_HELP" )
-}
-ccc_options(){
-  OPTIONS=( '-pipe'   "-pipe"  $( [ "$CCOPT" == "-pipe" ] && echo "on" || echo "off" )   "$Pipe_HELP" )
-}
-
-platform_options() {
-   OPTIONS=( "x86"     "Intel, AMD, and clones"  $( [ "$PLATFORM" == "x86" ] && echo "on" || echo "off" )      "$x86_HELP"
-             "Alpha"   "Compaq Alpha"            $( [ "$PLATFORM" == "Alpha" ] && echo "on" || echo "off" )    "$Alpha_HELP"
-             "PowerPC" "PowerPC"                 $( [ "$PLATFORM" == "PowerPC" ] && echo "on" || echo "off" )  "$PowerPC_HELP"
-             "SPARC"   "Sun SPARC"               $( [ "$PLATFORM" == "SPARC" ] && echo "on" || echo "off" )    "$SPARC_HELP" )
-}
-
-bopt_options() {
-   OPTIONS=( "None"     "-O0"   $( [ "$BOPT" == "None" ] && echo "on" || echo "off" )    "$None_HELP"
-             "Fast"     "-O1"   $( [ "$BOPT" == "Fast" ] && echo "on" || echo "off" )    "$Fast_HELP"
-             "Faster"   "-O2"   $( [ "$BOPT" == "Faster" ] && echo "on" || echo "off" )  "$Fasert_HELP"
-             "Fastest"  "-O3"   $( [ "$BOPT" == "Fastest" ] && echo "on" || echo "off" ) "$Fastest_HELP"
-             "Small"    "-Os"   $( [ "$BOPT" == "Small" ] && echo "on" || echo "off" )   "$Small_HELP" )
 
-}
-
-cpu_options() {
-   case $1 in
-      x86) OPTIONS=( "I386"        "I386"         $( [ "$CPU" == "I386" ] && echo "on" || echo "off" )        "$I386_HELP"
-                     "I486"        "I486"         $( [ "$CPU" == "I486" ] && echo "on" || echo "off" )        "$I486_HELP"
-                     "I586"        "I586"         $( [ "$CPU" == "I586" ] && echo "on" || echo "off" )        "$I586_HELP"
-                     "Pentium"     "Pentium"      $( [ "$CPU" == "Pentium" ] && echo "on" || echo "off" )     "$Pentium_HELP"
-                     "PentiumMMX"  "PentiumMMX"   $( [ "$CPU" == "PentiumMMX" ] && echo "on" || echo "off" )  "$PentiumMMX_HELP"
-                     "I686"        "I686"         $( [ "$CPU" == "I686" ] && echo "on" || echo "off" )        "$I686_HELP"
-                     "PentiumPro"  "PentiumPro"   $( [ "$CPU" == "PentiumPro" ] && echo "on" || echo "off" )  "$PentiumPro_HELP"
-                     "Pentium2"    "P2"           $( [ "$CPU" == "Pentium2" ] && echo "on" || echo "off" )    "$P2_HELP"
-                     "Pentium3"    "P3"           $( [ "$CPU" == "Pentium3" ] && echo "on" || echo "off" )    "$P3_HELP"
-                     "Pentium4"    "P4"           $( [ "$CPU" == "Pentium4" ] && echo "on" || echo "off" )    "$P4_HELP"
-                     "K6"          "K6"           $( [ "$CPU" == "K6" ] && echo "on" || echo "off" )          "$K6_HELP"
-                     "K62"         "K62"          $( [ "$CPU" == "K62" ] && echo "on" || echo "off" )         "$K62_HELP"
-                     "K63"         "K63"          $( [ "$CPU" == "K63" ] && echo "on" || echo "off" )         "$K63_HELP"
-                     "Athlon"      "Athlon"       $( [ "$CPU" == "Athlon" ] && echo "on" || echo "off" )      "$Athlon_HELP"
-                     "AthlonTBird" "AthlonTBird"  $( [ "$CPU" == "AthlonTBird" ] && echo "on" || echo "off" ) "$AthlonTBird_HELP"
-                     "Athlon4"     "Athlon4"      $( [ "$CPU" == "Athlon4" ] && echo "on" || echo "off" )     "$Athlon4_HELP"
-                     "AthlonXP"    "AthlonXP"     $( [ "$CPU" == "AthlonXP" ] && echo "on" || echo "off" )    "$AthlonXP_HELP"
-                     "AthlonMP"    "AthlonMP"     $( [ "$CPU" == "AthlonMP" ] && echo "on" || echo "off" )    "$AthlonMP_HELP" )
-                     ;;
+optimizations_options() {
+  unset OPTIONS
+  case $1 in
+    compiler)
+      OPTIONS=( "2" "GCC version 2x"  $( [ "$GCCVER" == "2" ] && echo "on" || echo "off" )  "$GCC2_HELP"
+                "3" "GCC version 3x"  $( [ "$GCCVER" == "3" ] && echo "on" || echo "off" )  "$GCC3_HELP" )
+      ;;
+    platform)
+      OPTIONS=( "x86"     "Intel, AMD, and clones"  $( [ "$PLATFORM" == "x86" ] && echo "on" || echo "off" )      "$x86_HELP"
+                "Alpha"   "Compaq Alpha"            $( [ "$PLATFORM" == "Alpha" ] && echo "on" || echo "off" )    "$Alpha_HELP"
+                "PowerPC" "PowerPC"                 $( [ "$PLATFORM" == "PowerPC" ] && echo "on" || echo "off" )  "$PowerPC_HELP"
+                "SPARC"   "Sun SPARC"               $( [ "$PLATFORM" == "SPARC" ] && echo "on" || echo "off" )    "$SPARC_HELP" )
+      ;;
+    bopt)
+      OPTIONS=( "None"     "-O0"   $( [ "$BOPT" == "None" ] && echo "on" || echo "off" )    "$None_HELP"
+                "Fast"     "-O1"   $( [ "$BOPT" == "Fast" ] && echo "on" || echo "off" )    "$Fast_HELP"
+                "Faster"   "-O2"   $( [ "$BOPT" == "Faster" ] && echo "on" || echo "off" )  "$Fasert_HELP"
+                "Fastest"  "-O3"   $( [ "$BOPT" == "Fastest" ] && echo "on" || echo "off" ) "$Fastest_HELP"
+                "Small"    "-Os"   $( [ "$BOPT" == "Small" ] && echo "on" || echo "off" )   "$Small_HELP" )
+      ;;
+   cpu)
+     case $2 in
+       x86)
+         OPTIONS=( "I386"        "I386"         $( [ "$CPU" == "I386" ] && echo "on" || echo "off" )        "$I386_HELP"
+                   "I486"        "I486"         $( [ "$CPU" == "I486" ] && echo "on" || echo "off" )        "$I486_HELP"
+                   "I586"        "I586 (Pentium)"    $( [ "$CPU" == "I586" ] && echo "on" || echo "off" )   "$I586_HELP"
+                   "PentiumMMX"  "PentiumMMX"   $( [ "$CPU" == "PentiumMMX" ] && echo "on" || echo "off" )  "$PentiumMMX_HELP"
+                   "I686"        "I686 (PentiumPro)" $( [ "$CPU" == "I686" ] && echo "on" || echo "off" )   "$I686_HELP"
+                   "Pentium2"    "P2"           $( [ "$CPU" == "Pentium2" ] && echo "on" || echo "off" )    "$P2_HELP"
+                   "Pentium3"    "P3 (Celeron)" $( [ "$CPU" == "Pentium3" ] && echo "on" || echo "off" )    "$P3_HELP"
+                   "Pentium4"    "P4 (Xeon)"    $( [ "$CPU" == "Pentium4" ] && echo "on" || echo "off" )    "$P4_HELP"
+                   "K6"          "K6"           $( [ "$CPU" == "K6" ] && echo "on" || echo "off" )          "$K6_HELP"
+                   "K62"         "K62"          $( [ "$CPU" == "K62" ] && echo "on" || echo "off" )         "$K62_HELP"
+                   "K63"         "K63"          $( [ "$CPU" == "K63" ] && echo "on" || echo "off" )         "$K63_HELP"
+                   "Athlon"      "Athlon"       $( [ "$CPU" == "Athlon" ] && echo "on" || echo "off" )      "$Athlon_HELP"
+                   "AthlonTBird" "AthlonTBird"  $( [ "$CPU" == "AthlonTBird" ] && echo "on" || echo "off" ) "$AthlonTBird_HELP"
+                   "Athlon4"     "Athlon4"      $( [ "$CPU" == "Athlon4" ] && echo "on" || echo "off" )     "$Athlon4_HELP"
+                   "AthlonXP"    "AthlonXP"     $( [ "$CPU" == "AthlonXP" ] && echo "on" || echo "off" )    "$AthlonXP_HELP"
+                   "AthlonMP"    "AthlonMP"     $( [ "$CPU" == "AthlonMP" ] && echo "on" || echo "off" )    "$AthlonMP_HELP" )
+         ;;
 
-    Alpha) OPTIONS=( "ev4"         "ev4"          $( [ "$CPU" == "ev4" ] && echo "on" || echo "off" )         "$ev4_HELP"
-                     "ev45"        "ev45"         $( [ "$CPU" == "ev45" ] && echo "on" || echo "off" )        "$ev45_HELP"
-                     "ev5"         "ev5"          $( [ "$CPU" == "ev5" ] && echo "on" || echo "off" )         "$ev5_HELP"
-                     "ev56"        "ev56"         $( [ "$CPU" == "ev56" ] && echo "on" || echo "off" )         "$ev56_HELP"
-                     "pca56"       "pca56"        $( [ "$CPU" == "pca56" ] && echo "on" || echo "off" )         "$pca56_HELP"
-                     "ev6"         "ev6"          $( [ "$CPU" == "ev6" ] && echo "on" || echo "off" )         "$ev6_HELP"
-                     "ev67"        "ev67"         $( [ "$CPU" == "ev67" ] && echo "on" || echo "off" )         "$ev67_HELP"
-		     "ev68"        "ev68"         $( [ "$CPU" == "ev68" ] && echo "on" || echo "off" )         "$ev68_HELP" )
-                     ;;
+       Alpha)
+         OPTIONS=( "ev4"         "ev4"          $( [ "$CPU" == "ev4" ] && echo "on" || echo "off" )         "$ev4_HELP"
+                   "ev45"        "ev45"         $( [ "$CPU" == "ev45" ] && echo "on" || echo "off" )        "$ev45_HELP"
+                   "ev5"         "ev5"          $( [ "$CPU" == "ev5" ] && echo "on" || echo "off" )         "$ev5_HELP"
+                   "ev56"        "ev56"         $( [ "$CPU" == "ev56" ] && echo "on" || echo "off" )        "$ev56_HELP"
+                   "pca56"       "pca56"        $( [ "$CPU" == "pca56" ] && echo "on" || echo "off" )       "$pca56_HELP"
+                   "ev6"         "ev6"          $( [ "$CPU" == "ev6" ] && echo "on" || echo "off" )         "$ev6_HELP"
+                   "ev67"        "ev67"         $( [ "$CPU" == "ev67" ] && echo "on" || echo "off" )        "$ev67_HELP"
+		   "ev68"        "ev68"         $( [ "$CPU" == "ev68" ] && echo "on" || echo "off" )        "$ev68_HELP" )
+         ;;
 
-  PowerPC) OPTIONS=( "common" "common"	$( [ "$CPU" == "common" ] && echo "on" || echo "off" )   "$common_HELP"
-                     "rios"    "rios" 	$( [ "$CPU" == "rios" ] && echo "on" || echo "off" )   "$rios_HELP"
-                     "rios1"   "rios1" 	$( [ "$CPU" == "rios1" ] && echo "on" || echo "off" )  "$rios1_HELP"
-                     "rsc"     "rsc" 	$( [ "$CPU" == "rsc" ] && echo "on" || echo "off" )    "$rsc_HELP"
-                     "rios2"   "rios2" 	$( [ "$CPU" == "rios2" ] && echo "on" || echo "off" )  "$rios2_HELP"
-                     "rs64a"   "rs64a" 	$( [ "$CPU" == "rs64a" ] && echo "on" || echo "off" )  "$rs64a_HELP"
-                     "403"     "403" 	$( [ "$CPU" == "403" ] && echo "on" || echo "off" )    "$p403_HELP"
-                     "505"     "505" 	$( [ "$CPU" == "505" ] && echo "on" || echo "off" )    "$p505_HELP"
-                     "601"     "601" 	$( [ "$CPU" == "601" ] && echo "on" || echo "off" )    "$p601_HELP"
-                     "602"     "602" 	$( [ "$CPU" == "602" ] && echo "on" || echo "off" )    "$p602_HELP"
-                     "603"     "603" 	$( [ "$CPU" == "603" ] && echo "on" || echo "off" )    "$p603_HELP"
-                     "603a"    "603a" 	$( [ "$CPU" == "603a" ] && echo "on" || echo "off" )   "$p603a_HELP"
-                     "604"     "604" 	$( [ "$CPU" == "604" ] && echo "on" || echo "off" )    "$p604_HELP"
-                     "604e"    "604e" 	$( [ "$CPU" == "604e" ] && echo "on" || echo "off" )   "$p604e_HELP"
-                     "620"     "620" 	$( [ "$CPU" == "620" ] && echo "on" || echo "off" )    "$p620_HELP"
-                     "630"     "630" 	$( [ "$CPU" == "630" ] && echo "on" || echo "off" )    "$p630_HELP"
-                     "740"     "740" 	$( [ "$CPU" == "740" ] && echo "on" || echo "off" )    "$p740_HELP"
-                     "7400"    "7400" 	$( [ "$CPU" == "7400" ] && echo "on" || echo "off" )   "$p7400_HELP"
-                     "7450"    "7450" 	$( [ "$CPU" == "7450" ] && echo "on" || echo "off" )   "$p7450_HELP"
-                     "750"     "750" 	$( [ "$CPU" == "750" ] && echo "on" || echo "off" )    "$p750_HELP"
-                     "801"     "801" 	$( [ "$CPU" == "801" ] && echo "on" || echo "off" )    "$p801_HELP"
-                     "821"     "821" 	$( [ "$CPU" == "821" ] && echo "on" || echo "off" )    "$p821_HELP"
-                     "823"     "823" 	$( [ "$CPU" == "823" ] && echo "on" || echo "off" )    "$p823_HELP"
-                     "Power"   "Power" 	$( [ "$CPU" == "Power" ] && echo "on" || echo "off" )  "$Power_HELP"
-                     "Power2"  "Power2" $( [ "$CPU" == "Power2" ] && echo "on" || echo "off" ) "$Power2_HELP"
-                     "PowerPC" "PowerPC" $( [ "$CPU" == "PowerPC" ] && echo "on" || echo "off" ) "$PowerPC_HELP" )
-                     ;;
+       PowerPC)
+         OPTIONS=( "common"  "common"	 $( [ "$CPU" == "common" ] && echo "on" || echo "off" )  "$common_HELP"
+                   "rios"    "rios" 	 $( [ "$CPU" == "rios" ] && echo "on" || echo "off" )    "$rios_HELP"
+                   "rios1"   "rios1" 	 $( [ "$CPU" == "rios1" ] && echo "on" || echo "off" )   "$rios1_HELP"
+                   "rsc"     "rsc" 	 $( [ "$CPU" == "rsc" ] && echo "on" || echo "off" )     "$rsc_HELP"
+                   "rios2"   "rios2" 	 $( [ "$CPU" == "rios2" ] && echo "on" || echo "off" )   "$rios2_HELP"
+                   "rs64a"   "rs64a" 	 $( [ "$CPU" == "rs64a" ] && echo "on" || echo "off" )   "$rs64a_HELP"
+                   "403"     "403" 	 $( [ "$CPU" == "403" ] && echo "on" || echo "off" )     "$p403_HELP"
+                   "505"     "505" 	 $( [ "$CPU" == "505" ] && echo "on" || echo "off" )     "$p505_HELP"
+                   "601"     "601" 	 $( [ "$CPU" == "601" ] && echo "on" || echo "off" )     "$p601_HELP"
+                   "602"     "602" 	 $( [ "$CPU" == "602" ] && echo "on" || echo "off" )     "$p602_HELP"
+                   "603"     "603" 	 $( [ "$CPU" == "603" ] && echo "on" || echo "off" )     "$p603_HELP"
+                   "603a"    "603a" 	 $( [ "$CPU" == "603a" ] && echo "on" || echo "off" )    "$p603a_HELP"
+                   "604"     "604" 	 $( [ "$CPU" == "604" ] && echo "on" || echo "off" )     "$p604_HELP"
+                   "604e"    "604e" 	 $( [ "$CPU" == "604e" ] && echo "on" || echo "off" )    "$p604e_HELP"
+                   "620"     "620" 	 $( [ "$CPU" == "620" ] && echo "on" || echo "off" )     "$p620_HELP"
+                   "630"     "630" 	 $( [ "$CPU" == "630" ] && echo "on" || echo "off" )     "$p630_HELP"
+                   "740"     "740" 	 $( [ "$CPU" == "740" ] && echo "on" || echo "off" )     "$p740_HELP"
+                   "7400"    "7400" 	 $( [ "$CPU" == "7400" ] && echo "on" || echo "off" )    "$p7400_HELP"
+                   "7450"    "7450" 	 $( [ "$CPU" == "7450" ] && echo "on" || echo "off" )    "$p7450_HELP"
+                   "750"     "750" 	 $( [ "$CPU" == "750" ] && echo "on" || echo "off" )     "$p750_HELP"
+                   "801"     "801" 	 $( [ "$CPU" == "801" ] && echo "on" || echo "off" )     "$p801_HELP"
+                   "821"     "821" 	 $( [ "$CPU" == "821" ] && echo "on" || echo "off" )     "$p821_HELP"
+                   "823"     "823" 	 $( [ "$CPU" == "823" ] && echo "on" || echo "off" )     "$p823_HELP"
+                   "Power"   "Power" 	 $( [ "$CPU" == "Power" ] && echo "on" || echo "off" )   "$Power_HELP"
+                   "Power2"  "Power2"    $( [ "$CPU" == "Power2" ] && echo "on" || echo "off" )  "$Power2_HELP"
+                   "PowerPC" "PowerPC"   $( [ "$CPU" == "PowerPC" ] && echo "on" || echo "off" ) "$PowerPC_HELP" )
+         ;;
   
-    SPARC) OPTIONS=( "v7"         "v7"         $( [ "$CPU" == "v7" ] && echo "on" || echo "off" ) "$v7_HELP"
-                     "cypress"    "cypress"    $( [ "$CPU" == "cypress" ] && echo "on" || echo "off" ) "$cypress_HELP"
-                     "v8"         "v8"         $( [ "$CPU" == "v8" ] && echo "on" || echo "off" ) "$v8_HELP"
-                     "supersparc" "supersparc" $( [ "$CPU" == "supersparc" ] && echo "on" || echo "off" ) "$supersparc_HELP"
-                     "sparclite"  "sparclite"  $( [ "$CPU" == "sparclite" ] && echo "on" || echo "off" ) "$sparclite_HELP"
-                     "hypersparc" "hypersparc" $( [ "$CPU" == "hypersparc" ] && echo "on" || echo "off" ) "$hypersparc_HELP"
-                     "sparclite86x" "sparclite86x"  $( [ "$CPU" == "sparclite86x" ] && echo "on" || echo "off" ) "$sparclite86x_HELP"
-                     "f930"       "f930"       $( [ "$CPU" == "f930" ] && echo "on" || echo "off" ) "$f930_HELP"
-                     "f934"       "f934"       $( [ "$CPU" == "f934" ] && echo "on" || echo "off" ) "$f934_HELP"
-                     "sparclet"   "sparclet"   $( [ "$CPU" == "sparclet" ] && echo "on" || echo "off" ) "$sparclet_HELP"
-                     "tsc701"     "tsc701"     $( [ "$CPU" == "tsc701" ] && echo "on" || echo "off" ) "$ts701_HELP"
-                     "v9"         "v9"         $( [ "$CPU" == "v9" ] && echo "on" || echo "off" ) "$v9_HELP"
-                     "ultrasparc" "ultrasparc" $( [ "$CPU" == "ultrasparc" ] && echo "on" || echo "off" ) "$ultrasparc_HELP" )
-                     ;;
-   esac
-
-}
-
-spd_options() {
-   OPTIONS=( "Speedy"    "-funroll-loops"            $( echo ${SPD[@]} | grep -q "Speedy" && echo "on" || echo "off" )    "$Speedy_HELP"
-             "Risky"     "-ffast-math"               $( echo ${SPD[@]} | grep -q "Risky" && echo "on" || echo "off" )     "$Risky_HELP" 
-             "Pointers"  "-fomit-frame-pointer"      $( echo ${SPD[@]} | grep -q "Pointers" && echo "on" || echo "off" )  "$Pointer_HELP"
-             "Siblings"  "-foptimize-sibling-calls"  $( echo ${SPD[@]} | grep -q "Siblings" && echo "on" || echo "off" )  "$Siblings_HELP"
-             "Profiling" "-fprofile-arcs"            $( echo ${SPD[@]} | grep -q "Profiling" && echo "on" || echo "off" ) "$Profiling_HELP"
-	     "Branching" "-fbranching-probabilities" $( echo ${SPD[@]} | grep -q "Branching" && echo "on" || echo "off" ) "$Branching_HELP"
-             "Aliasing"  "-fstrict-aliasing"         $( echo ${SPD[@]} | grep -q "Aliasing" && echo "on" || echo "off" )  "$Aliasing_HELP"
-             "Cprop"     "-fno-cprop-registers"      $( echo ${SPD[@]} | grep -q "Cprop" && echo "on" || echo "off" )     "$Cprop_HELP"
-	     "Float"     "-ffloat-store"             $( echo ${SPD[@]} | grep -q "Float" && echo "on" || echo "off" )     "$Float_HELP"
-             "Address"   "-fforce-addr"              $( echo ${SPD[@]} | grep -q "Address" && echo "on" || echo "off" )   "$Address_HELP"
-             "Align"     "-falign-functions"        $( echo ${SPD[@]} | grep -q "Align" && echo "on" || echo "off" )     "$Align_HELP" 
-             "Expensive" "-fexpensive-optimizations" $( echo ${SPD[@]} | grep -q "Expensive" && echo "on" || echo "off" ) "$Expensive_HELP" 
-             "Doubles"   "-malign-double"            $( echo ${SPD[@]} | grep -q "Doubles" && echo "on" || echo "off" )   "$Doubles_HELP"
-             "Tracer"   "-ftracer"                   $( echo ${SPD[@]} | grep -q "Tracer" && echo "on" || echo "off" )   "$Tracer_HELP" ) 
-}
-
-xtra_options() {
-   OPTIONS=( "MMX"       "MMX"     $( echo ${XTRA[@]} | grep -q "MMX" && echo "on" || echo "off" )      "$MMX_HELP"
-             "SSE"       "SSE"     $( echo ${XTRA[@]} | grep -q "SSE" && echo "on" || echo "off" )      "$SSE_HELP"
-             "SSE2"      "SSE2"    $( echo ${XTRA[@]} | grep -q "SSE2" && echo "on" || echo "off" )     "$SSE2_HELP"
-             "dnow"      "3dnow"   $( echo ${XTRA[@]} | grep -q "dnow" && echo "on" || echo "off" )     "$dnow_HELP"
-             "Altivec"   "Altivec" $( echo ${XTRA[@]} | grep -q "Altivec" && echo "on" || echo "off" )  "$Altivec_HELP" )
-}
-
-fpm_options() {
-   OPTIONS=( "None"      ""   $([ "$FPM" == "None" ] && echo "on" || echo "off" )     "$None_HELP"
-             "x387"      ""   $([ "$FPM" == "x387" ] && echo "on" || echo "off" )     "$x387_HELP"
-             "SSE"       ""   $([ "$FPM" == "SSE" ] && echo "on" || echo "off" )      "$SSE_HELP"
-             "Both"      ""   $([ "$FPM" == "Both" ] && echo "on" || echo "off" )     "$Both_HELP"
-             "Altivec"   ""   $([ "$FPM" == "Altivec" ] && echo "on" || echo "off" )  "$Altivec_HELP" )
-}
-
-ccc_warn() { 
-  OPTIONS=( "Deprecated" "-Wno-deprecated" $( echo ${CCC_WARN[@]} | grep -q "Deprecated" && echo "on" || echo "off" )  "$Deprecated_HELP" )
-}
-
-ldf_options() {
-   OPTIONS=( "Strip"      "-s"            $( echo ${LDF[@]} | grep -q "Strip" && echo "on" || echo "off" )     "$Strip_HELP"
-            "Optimize"      "-Wl,-O1"     $( echo ${LDF[@]} | grep -q "Optimize" && echo "on" || echo "off" )     "$Optimize_HELP"
-            "Reduce"      "-Wl,--as-needed"     $( echo ${LDF[@]} | grep -q "Reduce" && echo "on" || echo "off" )     "$Reduce_HELP"
-#            "Debug"      "-S"            $( echo ${LDF[@]} | grep -q "Debug" && echo "on" || echo "off" )     "$Debug_HELP"
-             "Combreloc"  "-z combreloc"  $( echo ${LDF[@]} | grep -q "Combreloc" && echo "on" || echo "off" ) "$Combreloc_HELP" )
-
-}
-
-addon_options() {
-  OPTIONS=( "CCache" "ccache" $( echo ${ADDON[@]} | grep -q "CCache" && echo "on" || echo "off" ) "$CCache_HELP"
-            "DistCC" "distcc" $( echo ${ADDON[@]} | grep -q "DistCC" && echo "on" || echo "off" ) "$DistCC_HELP" )
+       SPARC)
+         OPTIONS=( "v7"           "v7"           $( [ "$CPU" == "v7" ] && echo "on" || echo "off" )           "$v7_HELP"
+                   "cypress"      "cypress"      $( [ "$CPU" == "cypress" ] && echo "on" || echo "off" )      "$cypress_HELP"
+                   "v8"           "v8"           $( [ "$CPU" == "v8" ] && echo "on" || echo "off" )           "$v8_HELP"
+                   "supersparc"   "supersparc"   $( [ "$CPU" == "supersparc" ] && echo "on" || echo "off" )   "$supersparc_HELP"
+                   "sparclite"    "sparclite"    $( [ "$CPU" == "sparclite" ] && echo "on" || echo "off" )    "$sparclite_HELP"
+                   "hypersparc"   "hypersparc"   $( [ "$CPU" == "hypersparc" ] && echo "on" || echo "off" )   "$hypersparc_HELP"
+                   "sparclite86x" "sparclite86x" $( [ "$CPU" == "sparclite86x" ] && echo "on" || echo "off" ) "$sparclite86x_HELP"
+                   "f930"         "f930"         $( [ "$CPU" == "f930" ] && echo "on" || echo "off" )         "$f930_HELP"
+                   "f934"         "f934"         $( [ "$CPU" == "f934" ] && echo "on" || echo "off" )         "$f934_HELP"
+                   "sparclet"     "sparclet"     $( [ "$CPU" == "sparclet" ] && echo "on" || echo "off" )     "$sparclet_HELP"
+                   "tsc701"       "tsc701"       $( [ "$CPU" == "tsc701" ] && echo "on" || echo "off" )       "$ts701_HELP"
+                   "v9"           "v9"           $( [ "$CPU" == "v9" ] && echo "on" || echo "off" )           "$v9_HELP"
+                   "ultrasparc"   "ultrasparc"   $( [ "$CPU" == "ultrasparc" ] && echo "on" || echo "off" )   "$ultrasparc_HELP" )
+         ;;
+     esac
+     ;;
+   spd)
+     OPTIONS=( "Speedy"    "-funroll-loops"            $( echo ${SPD[@]} | grep -q "Speedy" && echo "on" || echo "off" )    "$Speedy_HELP"
+               "Risky"     "-ffast-math"               $( echo ${SPD[@]} | grep -q "Risky" && echo "on" || echo "off" )     "$Risky_HELP" 
+               "Pointers"  "-fomit-frame-pointer"      $( echo ${SPD[@]} | grep -q "Pointers" && echo "on" || echo "off" )  "$Pointer_HELP"
+               "Siblings"  "-foptimize-sibling-calls"  $( echo ${SPD[@]} | grep -q "Siblings" && echo "on" || echo "off" )  "$Siblings_HELP"
+               "Profiling" "-fprofile-arcs"            $( echo ${SPD[@]} | grep -q "Profiling" && echo "on" || echo "off" ) "$Profiling_HELP"
+	       "Branching" "-fbranching-probabilities" $( echo ${SPD[@]} | grep -q "Branching" && echo "on" || echo "off" ) "$Branching_HELP"
+               "Aliasing"  "-fstrict-aliasing"         $( echo ${SPD[@]} | grep -q "Aliasing" && echo "on" || echo "off" )  "$Aliasing_HELP"
+               "Cprop"     "-fno-cprop-registers"      $( echo ${SPD[@]} | grep -q "Cprop" && echo "on" || echo "off" )     "$Cprop_HELP"
+	       "Float"     "-ffloat-store"             $( echo ${SPD[@]} | grep -q "Float" && echo "on" || echo "off" )     "$Float_HELP"
+               "Address"   "-fforce-addr"              $( echo ${SPD[@]} | grep -q "Address" && echo "on" || echo "off" )   "$Address_HELP"
+               "Align"     "-falign-functions"         $( echo ${SPD[@]} | grep -q "Align" && echo "on" || echo "off" )     "$Align_HELP" 
+               "Expensive" "-fexpensive-optimizations" $( echo ${SPD[@]} | grep -q "Expensive" && echo "on" || echo "off" ) "$Expensive_HELP" 
+               "Doubles"   "-malign-double"            $( echo ${SPD[@]} | grep -q "Doubles" && echo "on" || echo "off" )   "$Doubles_HELP"
+               "Tracer"    "-ftracer"                  $( echo ${SPD[@]} | grep -q "Tracer" && echo "on" || echo "off" )    "$Tracer_HELP"
+	       "Blocks"    "-freorder-blocks"          $( echo ${SPD[@]} | grep -q "Blocks" && echo "on" || echo "off" )    "$Blocks_HELP" )
+     ;;
+   xtra)
+     case $2 in
+       x86)
+         if grep -qw mmx /proc/cpuinfo ; then
+	   OPTIONS=( ${OPTIONS[@]} "MMX"     "MMX"     $( echo ${XTRA[@]} | grep -q "MMX" && echo "on" || echo "off" )      "$MMX_HELP" )
+	 fi
+	 if grep -qw sse /proc/cpuinfo ; then
+	   OPTIONS=( ${OPTIONS[@]} "SSE"     "SSE"     $( echo ${XTRA[@]} | grep -q "SSE" && echo "on" || echo "off" )      "$SSE_HELP" )
+	 fi
+	 if grep -qw sse2 /proc/cpuinfo ; then
+           OPTIONS=( ${OPTIONS[@]} "SSE2"    "SSE2"    $( echo ${XTRA[@]} | grep -q "SSE2" && echo "on" || echo "off" )     "$SSE2_HELP" )
+	 fi
+	 if grep -qw 3dnow /proc/cpuinfo ; then
+           OPTIONS=( ${OPTIONS[@]} "dnow"    "3dnow"   $( echo ${XTRA[@]} | grep -q "dnow" && echo "on" || echo "off" )     "$dnow_HELP" )
+	 fi
+         ;;
+       PowerPC)
+         if grep -qw altivec /proc/cpuinfo ; then
+           OPTIONS=( "Altivec" "Altivec" $( echo ${XTRA[@]} | grep -q "Altivec" && echo "on" || echo "off" )  "$Altivec_HELP" )
+	 fi
+         ;;
+     esac
+     ;;
+   fpm)
+     case $2 in
+       x86)
+         OPTIONS=( "None"    "Use compiler default"                    $([ "$FPM" == "None" ] && echo "on" || echo "off" )     "$None_HELP" )
+         if grep '^fpu' /proc/cpuinfo | grep -qw yes ; then
+	   OPTIONS=( ${OPTIONS[@]} "x387" "Floating point coprocessor" $([ "$FPM" == "x387" ] && echo "on" || echo "off" ) "$x387_HELP" )
+	 fi
+	 if grep -qw sse /proc/cpuinfo ; then
+	   OPTIONS=( ${OPTIONS[@]} "SSE"  "Streaming SIMD Extensions"  $([ "$FPM" == "SSE" ] && echo "on" || echo "off" )  "$SSE_HELP" )
+	   if grep '^fpu' /proc/cpuinfo | grep -qw yes ; then
+	     OPTIONS=( ${OPTIONS[@]} "Both" "x387 and SSE"             $([ "$FPM" == "Both" ] && echo "on" || echo "off" ) "$Both_HELP" )
+	   fi
+	 fi
+         ;;
+       PowerPC)
+         if grep -qw altivec /proc/cpuinfo ; then
+           OPTIONS=( "Altivec" "PowerPC only"               $([ "$FPM" == "Altivec" ] && echo "on" || echo "off" )  "$Altivec_HELP" )
+	 fi
+         ;;
+     esac
+     ;;
+   cc_opt)
+     OPTIONS=( "Deprecated" "-Wno-deprecated for C++"     $( echo ${CC_OPTS[@]} | grep -q "Deprecated" && echo "on" || echo "off" ) "$Deprecated_HELP" 
+               "ccpipe"     "-pipe for C (RECOMMENDED)"   $( echo ${CC_OPTS[@]} | grep -q "ccpipe" && echo "on" || echo "off" )     "$CPipe_HELP"
+               "cxxpipe"    "-pipe for C++ (RECOMMENDED)" $( echo ${CC_OPTS[@]} | grep -q "cxxpipe" && echo "on" || echo "off" )    "$CCPipe_HELP" )
+     ;;
+   ldf)
+     case $SAFE_OPTIMIZATIONS in
+       on)
+         OPTIONS=( "Strip"      "-s (RECOMMENDED)" $( echo ${LDF[@]} | grep -q "Strip" && echo "on" || echo "off" )     "$Strip_HELP" )
+         ;;
+       off)
+         OPTIONS=( "Strip"      "-s (RECOMMENDED)" $( echo ${LDF[@]} | grep -q "Strip" && echo "on" || echo "off" )     "$Strip_HELP"
+                   "Optimize"   "-Wl,-O1"          $( echo ${LDF[@]} | grep -q "Optimize" && echo "on" || echo "off" )  "$Optimize_HELP"
+                   "Reduce"     "-Wl,--as-needed"  $( echo ${LDF[@]} | grep -q "Reduce" && echo "on" || echo "off" )    "$Reduce_HELP"
+                   "Debug"      "-S"               $( echo ${LDF[@]} | grep -q "Debug" && echo "on" || echo "off" )     "$Debug_HELP"
+                   "Combreloc"  "-z combreloc"     $( echo ${LDF[@]} | grep -q "Combreloc" && echo "on" || echo "off" ) "$Combreloc_HELP" )
+         ;;
+     esac
+     ;;
+  addon)
+    OPTIONS=( "CCache" "ccache" $( echo ${ADDON[@]} | grep -q "CCache" && echo "on" || echo "off" ) "$CCache_HELP"
+              "DistCC" "distcc" $( echo ${ADDON[@]} | grep -q "DistCC" && echo "on" || echo "off" ) "$DistCC_HELP" )
+    ;;
+  esac
 }
 
 menu() {
-   if [[ $1 == "checklist" ]]; then
+   if [ "$1" == "checklist" ] ; then
        RESULT=`dialog --title "$TITLE"          \
                       --stdout                  \
                       --no-cancel               \
@@ -393,7 +414,7 @@ menu() {
                       --checklist  "$MENU"      \
                         0 0 0                   \
                       "${OPTIONS[@]}"`
-   elif [[ $1 == "radiolist" ]]; then
+   elif [ "$1" == "radiolist" ] ; then
      unset RESULT
      while [ -z "$RESULT" ]; do
        RESULT=`dialog --title "$TITLE"          \
@@ -414,5 +435,179 @@ menu() {
                       "${OPTIONS[@]}"`
    fi
    RESULT=$(echo $RESULT | sed -e 's:^"::' -e 's:"$::')
+}
+
+
+optimize_menu()  {
+  debug_msg "optimize_architecture ($@)"
+  # Make sure optimizations file exists, if not create it.
+  if [ ! -f /etc/lunar/local/optimizations ] ; then
+    touch /etc/lunar/local/optimizations
+  else
+    . /etc/lunar/local/optimizations
+  fi
+
+  # Flow control for the menus. This will also check for gcc3,
+  # if it exists it will allow more options.
+  TITLE="Lunar Compiler Optimizations"
+
+  # by default, turn on safety
+  SAFE_OPTIMIZATIONS=${SAFE_OPTIMIZATIONS:-on}
+
+  export IFS="$TAB_ENTER_IFS"
+
+  # loop until escape or exited
+  while true; do
+    DEFAULT=${CHOICE:-safe}
 
+    CHOICE=`$DIALOG --title "$TITLE" \
+                  --ok-label "Select" \
+                  --cancel-label "Close" \
+		  --default-item "$DEFAULT" \
+		  --item-help \
+		  --menu \
+		  "" \
+		  0 0 0 \
+		  $(if [ "$SAFE_OPTIMIZATIONS" == "off" ] ; then
+		      echo "safe"
+		      echo "Turn on optimization safety   [$SAFE_OPTIMIZATIONS]"
+		      echo "Only allow safe optimizations (removes dangerous settings!)"
+		    else
+		      echo "safe"
+		      echo "Turn off optimization safety  [$SAFE_OPTIMIZATIONS]"
+		      echo "Allow potentially unsafe optimizations (DANGEROUS!)"
+		    fi
+		    echo "compiler"
+		    echo "Compiler version              [$GCCVER]"
+		    echo "Select the default gcc version to be used"
+		    echo "platform"
+		    echo "Platform choice               [$PLATFORM]"
+		    echo "Select the specific architecture like x87, ppc"
+		    echo "bopt"
+		    echo "Base speed optimization       [$BOPT]"
+		    echo "Select the base optimization from -Os, -O0, -O1 etc"
+		    echo "cpu"
+		    echo "CPU selection                 [$CPU]"
+		    echo "Select the target CPU type"
+		    if [ "$SAFE_OPTIMIZATIONS" == "off" ] ; then
+		      echo "xtra"
+		      echo "CPU extensions                [${XTRA[@]}]"
+		      echo "Select CPU extensions"
+		      echo "spd"
+		      echo "Specialized optimizations     [${SPD[@]}]"
+		      echo "Select specific compiler flags for expensive and risky optimizations"
+		      echo "fpm"
+		      echo "Floating point optimizations  [$FPM]"
+		      echo "enable specific floating point optimizations"
+		    fi
+                    echo "cc_opt"
+		    echo "General C/C++ options         [${CC_OPTS[@]}]"
+		    echo "Select named pipes, warnings on deprecated symbols"
+                    echo "ldf"
+		    echo "Linker optimizations          [${LDF[@]}]"
+		    echo "Enable linker specific optimizations"
+                    echo "addon"
+		    echo "Compiler addons               [${ADDON[@]}]"
+		    echo "Enable compiler addons like ccache, distcc"
+		    if [ "$SAFE_OPTIMIZATIONS" == "off" ] ; then
+		      echo "makes"
+		      echo "parallelization               [$MAKES]"
+		      echo "Enable multiple parallel compiles"
+		      echo "stack"
+		      echo "Stack                         [$STACK]"
+		      echo "Set the stack size"
+		   fi) `
+    if [ $? != 0 ] ; then
+      verbose_msg "Saving optimizations"
+      save_optimizations
+      set_local_config SAFE_OPTIMIZATIONS $SAFE_OPTIMIZATIONS
+      return
+    fi
+
+    optimizations_help $CHOICE $PLATFORM
+    optimizations_options $CHOICE $PLATFORM
+
+    case $CHOICE in
+      safe)
+        if [ "$SAFE_OPTIMIZATIONS" == "off" ] ; then
+          SAFE_OPTIMIZATIONS=on
+	  # remove dangerous optimizations immediately
+	  unset SPD XTRA MAKES STACK
+	  FPM=( "None" )
+	  if echo ${LDF[@]} | grep -q Strip ; then
+	    LDF=( "Strip" )
+	  else
+	    unset LDF
+	  fi
+	else
+	  # annoy the user and make sure he reads this warning message
+	  $DIALOG --defaultno --yes-label "No" --no-label "Yes" --colors --yesno "                    \Z1*** WARNING ***\n\n\ZnPlease read this carefully. You are about to turn off the optimization safety. This means that you can possibly turn on compiler or linker optimizations that can and will break your box. Not only will the problem most likely occur only days, weeks or months after you turn this switch, but also it can corrupt all your personal data, make your machine unbootable, and cause serious personal distress, headache, loss of vision, heart failure, loss of income, or otherwise very bad things. Before you turn off this option, please think for yourself for a minute and ask yourself: Is it worth it?\n\nOnly use safe optimizations?" 20 70
+	  if [ $? == 0 ]; then
+	    # oookay, he must be knowing what he's doing!
+            SAFE_OPTIMIZATIONS=off
+	  fi
+	fi
+        ;;
+      compiler)
+        menu radiolist
+        GCCVER=$RESULT
+        ;;
+      platform)
+        menu radiolist
+        PLATFORM=$RESULT
+        ;;
+      bopt)
+        menu radiolist
+        BOPT=$RESULT
+        ;;
+      cpu)
+        menu radiolist
+        CPU=$RESULT
+        optimize_cpu $CPU
+        BUILD=$BUILD
+        ;;
+      spd)
+        menu checklist
+        SPD=( $RESULT )
+        ;;
+      fpm)
+        menu radiolist
+        FPM=$RESULT
+        ;;
+      xtra)
+        menu checklist
+        XTRA=( $RESULT )
+        ;;
+      cc_opt)
+        menu checklist
+        CC_OPTS=( $RESULT )
+        ;;
+      ldf)
+        menu checklist
+        LDF=( $RESULT )
+        ;;
+      addon)
+        menu checklist
+        ADDON=( $RESULT )
+        ;;
+      makes)
+        MAKES=`dialog --title "Make - parallellizing" \
+               --nocancel --stdout --inputbox         \
+               "Enter the number of concurrent makes ( a value > 1 ) or leave this field empty."  \
+               0 55 $MAKES`
+        # people WILL fill in 1... so, we knock them down and take their money:
+        if [[ $MAKES -lt 2 ]] ; then
+          unset MAKES
+        fi
+        ;;
+      stack)
+        STACK=`dialog --title "Set stack parameters. (WARNING! Best left empty!)" \
+               --nocancel --stdout --inputbox \
+               "Enter the number to set the stack to, leave empty for default. Only used on x86 platform."  \
+               0 55 $STACK`
+        ;;
+    esac
+  done
 }
+
+
diff --git a/var/lib/lunar/protected b/var/lib/lunar/protected
index 250a9de..39db0cb 100644
--- a/var/lib/lunar/protected
+++ b/var/lib/lunar/protected
@@ -112,6 +112,10 @@
 ^/var/lib/lunar/protected
 ^/var/lib/mysql/
 ^/var/mailman/Mailman/mm_cfg.py
+^/var/mailman/archives
+^/var/mailman/data
+^/var/mailman/lists
+^/var/mailman/qfiles
 ^/var/named/
 ^/var/nis/
 ^/var/spool/


More information about the Lunar-commits mailing list