[Lunar-commits] <lunar> fully backmerge all changes: - delete optimize.menu - add optimize-wrappers plugin - remove COPT CCOPT CFLAGS and CXX flags from wrappers
Auke Kok
sofar at lunar-linux.org
Mon Jul 2 04:43:10 CEST 2012
commit db815edbe53c32a88a47bc782d8163e2474cb8e4
Author: Auke Kok <sofar at lunar-linux.org>
Date: Wed Mar 22 18:28:06 2006 +0000
fully backmerge all changes:
- delete optimize.menu
- add optimize-wrappers plugin
- remove COPT CCOPT CFLAGS and CXX flags from wrappers
---
var/lib/lunar/compilers/c++ | 4 +-
var/lib/lunar/compilers/cc | 4 +-
var/lib/lunar/compilers/g++ | 4 +-
var/lib/lunar/compilers/gcc | 4 +-
var/lib/lunar/compilers/ld | 2 +-
var/lib/lunar/menu/optimize.menu | 627 ------------------------
var/lib/lunar/plugins/optimize-wrappers.plugin | 70 +++
7 files changed, 79 insertions(+), 636 deletions(-)
diff --git a/var/lib/lunar/compilers/c++ b/var/lib/lunar/compilers/c++
index dfa9256..ba4f65c 100755
--- a/var/lib/lunar/compilers/c++
+++ b/var/lib/lunar/compilers/c++
@@ -3,8 +3,8 @@
PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/})
if [[ -n "$LUNAR_DEBUG" ]] ; then
- echo "++ $CXX_EXT $PROG $CCOPT $CXXFLAGS $@" >&2
+ echo "++ $CXX_EXT $PROG $@" >&2
fi
-exec $CXX_EXT $PROG $CCOPT $CXXFLAGS "$@"
+exec $CXX_EXT $PROG "$@"
diff --git a/var/lib/lunar/compilers/cc b/var/lib/lunar/compilers/cc
index e59e387..5859b44 100755
--- a/var/lib/lunar/compilers/cc
+++ b/var/lib/lunar/compilers/cc
@@ -3,8 +3,8 @@
PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/})
if [[ -n "$LUNAR_DEBUG" ]] ; then
- echo "++ $CC_EXT $PROG $COPT $CFLAGS $@" >&2
+ echo "++ $CC_EXT $PROG $@" >&2
fi
-exec $CC_EXT $PROG $COPT $CFLAGS "$@"
+exec $CC_EXT $PROG "$@"
diff --git a/var/lib/lunar/compilers/g++ b/var/lib/lunar/compilers/g++
index 81b1611..3d3edfa 100755
--- a/var/lib/lunar/compilers/g++
+++ b/var/lib/lunar/compilers/g++
@@ -3,8 +3,8 @@
PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/})
if [[ -n "$LUNAR_DEBUG" ]] ; then
- echo "++ $CXX_EXT $PROG $CCOPT $CXXFLAGS $@" >&2
+ echo "++ $CXX_EXT $PROG $@" >&2
fi
-exec $CXX_EXT $PROG $CCOPT $CXXFLAGS "$@"
+exec $CXX_EXT $PROG "$@"
diff --git a/var/lib/lunar/compilers/gcc b/var/lib/lunar/compilers/gcc
index e59e387..5859b44 100755
--- a/var/lib/lunar/compilers/gcc
+++ b/var/lib/lunar/compilers/gcc
@@ -3,8 +3,8 @@
PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/})
if [[ -n "$LUNAR_DEBUG" ]] ; then
- echo "++ $CC_EXT $PROG $COPT $CFLAGS $@" >&2
+ echo "++ $CC_EXT $PROG $@" >&2
fi
-exec $CC_EXT $PROG $COPT $CFLAGS "$@"
+exec $CC_EXT $PROG "$@"
diff --git a/var/lib/lunar/compilers/ld b/var/lib/lunar/compilers/ld
index 50cef5f..e543d88 100755
--- a/var/lib/lunar/compilers/ld
+++ b/var/lib/lunar/compilers/ld
@@ -3,7 +3,7 @@
PROG=$(PATH=${PATH//\/var\/lib\/lunar\/compilers/} type -p ${0##*/})
if [[ -n "$LUNAR_DEBUG" ]] ; then
- echo "++ $PROG $@" >&2
+ echo "++ $PROG $@" >&2
fi
exec $PROG "$@"
diff --git a/var/lib/lunar/menu/optimize.menu b/var/lib/lunar/menu/optimize.menu
deleted file mode 100644
index 5223b71..0000000
--- a/var/lib/lunar/menu/optimize.menu
+++ /dev/null
@@ -1,627 +0,0 @@
-#Copyrighted Jason Johnston 2002 under GPLv2
-
-save_optimizations() {
-
- GCCVER=${GCCVER:=3}
- set_local_config "GCCVER" "$GCCVER"
-
- 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
-optimizations_help() {
- case $1 in
-
- # Help for selecting 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."
- ;;
-
- # Help for the platform selections.
- 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"
- x86_64_HELP="Both AMD64 and Intel EM64T machines"
- ;;
-
- # Help for the basic optimizations.
- 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"
- ;;
-
- # Help for the cpu selections.
- 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"
- Athlon64_HELP="AMD Athlon 64 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"
- ;;
- x86_64)
- x86_64_HELP="x86_64"
- ;;
- esac
- ;;
-
- # Help for speed options.
- 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)"
- 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."
- Blocks_HELP="Reorder basic blocks in order to reduce number of taken branches."
- ;;
-
- # Help for extra options
- xtra)
- # do NOT change the next line unless you too smart
- CPUINFO=$(echo "`grep flags /proc/cpuinfo` ")
- for EXT in mmx sse sse2 pni 3dnow altivec ; do
- if echo $CPUINFO | grep -q " $EXT " ; then
- FLAGS="$FLAGS $EXT"
- fi
- done
-
- 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"
- SSE3_HELP="Streaming SIMD (Single Instruction, Multiple Data) Extensions v3"
- dnow_HELP="3dnow"
- Altivec_HELP="Enables Altivec"
- unset CPUINFO EXT FLAGS
- ;;
-
- # Help for floating point math
- 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="Select available Floating Point Math compile extensions. The kernel reports that this system has: $FLAGS"
- None_HELP="Do not enable any extra features."
- 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)
- 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"
- ;;
-
- # Addon help for extra programs
- 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
-}
-
-
-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"
- "x86_64" "AMD64/EM64T" $( [ "$PLATFORM" == "x86_64" ] && echo "on" || echo "off" ) "$x86_64_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"
- "Athlon64" "Athlon64" $( [ "$CPU" == "Athlon64" ] && echo "on" || echo "off" ) "$Athlon64_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" )
- ;;
-
- 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" )
- ;;
- x86_64)
- OPTIONS=( "x86_64" "x86_64" $( [ "$CPU" == "x86_64" ] && echo "on" || echo "off" ) "$x86_64_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 pni /proc/cpuinfo ; then
- OPTIONS=( ${OPTIONS[@]} "SSE3" "SSE3" $( echo ${XTRA[@]} | grep -q "SSE3" && echo "on" || echo "off" ) "$SSE3_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
- RESULT=`dialog --title "$TITLE" \
- --stdout \
- --no-cancel \
- --item-help \
- --separate-output \
- --checklist "$MENU" \
- 0 0 0 \
- "${OPTIONS[@]}"`
- elif [ "$1" == "radiolist" ] ; then
- unset RESULT
- while [ -z "$RESULT" ]; do
- RESULT=`dialog --title "$TITLE" \
- --stdout \
- --no-cancel \
- --item-help \
- --radiolist "$MENU" \
- 0 0 0 \
- "${OPTIONS[@]}"`
- done
- else
- RESULT=`dialog --title "$TITLE" \
- --stdout \
- --no-cancel \
- --item-help \
- --menu "$MENU" \
- 0 0 0 \
- "${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/plugins/optimize-wrappers.plugin b/var/lib/lunar/plugins/optimize-wrappers.plugin
new file mode 100644
index 0000000..f8e16f3
--- /dev/null
+++ b/var/lib/lunar/plugins/optimize-wrappers.plugin
@@ -0,0 +1,70 @@
+#
+# wrappers linker optimizations plugin
+#
+
+plugin_wrappers_optimize()
+{
+ if [[ -z "$USE_WRAPPERS" ]] ; then
+ if [ -f /etc/lunar/local/optimizations.WRAPPERS ]; then
+ . /etc/lunar/local/optimizations.WRAPPERS
+ fi
+ fi
+
+ if [ "${USE_WRAPPERS:-yes}" == "yes" ]; then
+ verbose_msg "Enabled wrapper script usage"
+ export PATH=/var/lib/lunar/compilers/:${PATH}
+ fi
+ return 2
+}
+
+
+plugin_wrappers_optimize_menu()
+{
+ # The main code calls this function WITHOUT $1 to find out which
+ # compiler optimization plugins exist. It then returns the version
+ # number which will be saved in $LUNAR_COMPILER as the user's
+ # choice for COMPILERS
+ if [ -z "$1" ]; then
+ echo "WRAPPERS"
+ echo "Compiler wrappers"
+ return 2
+ elif [ "$1" != "WRAPPERS" ]; then
+ # we don't display anything when the user selected a
+ # different menu
+ return 2
+ fi
+
+ # load previous optimizations
+ if [ -e /etc/lunar/local/optimizations.WRAPPERS ]; then
+ . /etc/lunar/local/optimizations.WRAPPERS
+ fi
+
+ save_optimizations()
+ {
+ debug_msg "save_optimizations($@)"
+ cat > /etc/lunar/local/optimizations.WRAPPERS <<EOF
+USE_WRAPPERS=$USE_WRAPPERS
+EOF
+ }
+
+ export IFS=$'\t\n'
+ TITLE="Lunar CCache Optimizations"
+
+ while true; do
+ RESULT=`$DIALOG --ok-label "Select" --cancel-label "Close" --menu "Use the Compiler wrapper scripts? This will enable all optimizations for most programs even if the Makefile doesn't support them, and allows for more debugging output." 0 0 0 "USE_WRAPPERS" "Use the compile wrappers [$USE_WRAPPERS]"`
+ if [ $? != 0 ]; then
+ break
+ else
+ if [ $USE_WRAPPERS == 'yes' ]; then
+ USE_WRAPPERS=no
+ else
+ USE_WRAPPERS=yes
+ fi
+ save_optimizations
+ fi
+ done
+}
+
+
+plugin_register BUILD_BUILD plugin_wrappers_optimize
+plugin_register OPTIMIZE_MENU plugin_wrappers_optimize_menu
More information about the Lunar-commits
mailing list