[Lunar-commits] r18937 - in lunar/trunk: sbin var/lib/lunar/functions var/lib/lunar/menu
Auke Kok
sofar at lunar-linux.org
Tue Feb 28 05:58:57 UTC 2006
Author: sofar
Date: 2006-02-28 05:58:48 +0000 (Tue, 28 Feb 2006)
New Revision: 18937
Removed:
lunar/trunk/var/lib/lunar/menu/optimize.menu
Modified:
lunar/trunk/sbin/lunar
lunar/trunk/var/lib/lunar/functions/aliases.lunar
lunar/trunk/var/lib/lunar/functions/build.lunar
lunar/trunk/var/lib/lunar/functions/check.lunar
lunar/trunk/var/lib/lunar/functions/main.lunar
lunar/trunk/var/lib/lunar/functions/misc.lunar
lunar/trunk/var/lib/lunar/functions/optimize.lunar
lunar/trunk/var/lib/lunar/functions/plugins.lunar
lunar/trunk/var/lib/lunar/functions/tracking.lunar
lunar/trunk/var/lib/lunar/functions/updatelog.lunar
Log:
* New optimization architecture - based on plugins
* All optimization menu's and code will move to moonbase plugins
* removed optimize.menu
* optimize.lunar is now only a plugin stub
* pre-compile optimizations are set using the BUILD_BUILD plugin type
* remove 'optimize' main call to optimizations
* Added "custom_filters" to allow on-the-fly compression of man-pages
* Attempt to display success/fail log when checking modules
* small performance tweak to unmap_device
* bugfix for aliases code (bug was not be noticeable to people)
Modified: lunar/trunk/sbin/lunar
===================================================================
--- lunar/trunk/sbin/lunar 2006-02-28 04:34:20 UTC (rev 18936)
+++ lunar/trunk/sbin/lunar 2006-02-28 05:58:48 UTC (rev 18937)
@@ -663,7 +663,7 @@
F) feature_menu ;;
I) integrity_menu ;;
M) mirror_menu ;;
- O) . /var/lib/lunar/menu/optimize.menu && optimize_menu ;;
+ O) optimize_menu ;;
L) set_default_module ;;
A) set_accepted_licenses ;;
R) set_rejected_licenses ;;
@@ -823,7 +823,7 @@
renew ) renew ;;
update ) update ;;
rebuild ) rebuild ;;
- optimize ) . /var/lib/lunar/menu/optimize.menu && optimize_menu ;;
+ optimize ) optimize_menu ;;
set ) shift && setvar $@ ;;
unset ) shift && unsetvar $@ ;;
fix ) shift && run_fix $@ ;;
Modified: lunar/trunk/var/lib/lunar/functions/aliases.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/aliases.lunar 2006-02-28 04:34:20 UTC (rev 18936)
+++ lunar/trunk/var/lib/lunar/functions/aliases.lunar 2006-02-28 05:58:48 UTC (rev 18937)
@@ -89,7 +89,7 @@
done
read CHOICE
# test directly first
- if $(echo $TARGETS | grep -qw "$CHOICE") ; then
+ if echo $TARGETS | grep -qw "$CHOICE" ; then
echo $TARGET
return
# then the number
Modified: lunar/trunk/var/lib/lunar/functions/build.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/build.lunar 2006-02-28 04:34:20 UTC (rev 18936)
+++ lunar/trunk/var/lib/lunar/functions/build.lunar 2006-02-28 05:58:48 UTC (rev 18937)
@@ -152,8 +152,6 @@
{
debug_msg "_configure($@)"
if [ -e ./configure ]; then
- verbose_msg "CFLAGS=\"$CFLAGS\""
- verbose_msg "LDFLAGS=\"$LDFLAGS\""
verbose_msg "./configure $@"
./configure $@
elif [ -e Makefile -o -e makefile ]; then
@@ -196,8 +194,6 @@
default_cvs_config() {
debug_msg "default_cvs_config ($@)"
verbose_msg "running \"default_cvs_config\""
- verbose_msg "CFLAGS=\"$CFLAGS\""
- verbose_msg "LDFLAGS=\"$LDFLAGS\""
verbose_msg "MODULE_PREFIX=\"$MODULE_PREFIX\""
./autogen.sh --build=$BUILD \
@@ -341,7 +337,7 @@
run_pre_build() {
debug_msg "run_pre_build ($@)"
- message "${MESSAGE_COLOR}Building ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}${MESSAGE_COLOR} version ${MODULE_COLOR}$VERSION${DEFAULT_COLOR}"
+ message "${MESSAGE_COLOR}Building ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}"
cd $BUILD_DIRECTORY
Modified: lunar/trunk/var/lib/lunar/functions/check.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/check.lunar 2006-02-28 04:34:20 UTC (rev 18936)
+++ lunar/trunk/var/lib/lunar/functions/check.lunar 2006-02-28 05:58:48 UTC (rev 18937)
@@ -109,6 +109,9 @@
MODULES=$(list_installed | grep -v moonbase)
fi
+ export TMP_LIN_SUCCESS=$(temp_create "successful")
+ export TMP_LIN_FAIL=$(temp_create "failed")
+
for MODULE in $MODULES ; do
# ENV separation required here!
(
@@ -143,6 +146,11 @@
fi
)
done
+
+ display_update_log fix
+ temp_destroy $TMP_LIN_SUCCESS
+ temp_destroy $TMP_LIN_FAIL
+
}
Modified: lunar/trunk/var/lib/lunar/functions/main.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/main.lunar 2006-02-28 04:34:20 UTC (rev 18936)
+++ lunar/trunk/var/lib/lunar/functions/main.lunar 2006-02-28 05:58:48 UTC (rev 18937)
@@ -40,7 +40,7 @@
prune
fi
- display_update_log
+ display_update_log renew
temp_destroy $TMP_LIN_SUCCESS
temp_destroy $TMP_LIN_FAIL
@@ -110,8 +110,15 @@
temp_destroy $TMP_QUEUE
if [ -n "$QUEUE" ] ; then
+ export TMP_LIN_SUCCESS=$(temp_create "successful")
+ export TMP_LIN_FAIL=$(temp_create "failed")
+
message "${MESSAGE_COLOR}Starting rebuild of modules${DEFAULT_COLOR}"
lin -c $QUEUE
+
+ display_update_log rebuild
+ temp_destroy $TMP_LIN_SUCCESS
+ temp_destroy $TMP_LIN_FAIL
fi
}
@@ -281,10 +288,7 @@
# now entering the physical BUILD stage
if ! current_locked && ! solo_locked ; then
echo $$ > $linING &&
- start_logging &&
- if [ -z "$BUILD" ] ; then
- optimize
- fi &&
+ start_logging
if ! run_pre_build ; then
LIN_ERROR="PRE_BUILD"
Modified: lunar/trunk/var/lib/lunar/functions/misc.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/misc.lunar 2006-02-28 04:34:20 UTC (rev 18936)
+++ lunar/trunk/var/lib/lunar/functions/misc.lunar 2006-02-28 05:58:48 UTC (rev 18937)
@@ -117,7 +117,7 @@
unmap_device()
{
local DEVICE REAL
- REAL=$(readlink -f $1)
+ REAL=$(readlink -f $1)
for DEVICE in $(ls -1d /dev/[hs]d* 2> /dev/null); do
if [[ "$(readlink -f $DEVICE)" == "$REAL" ]]; then
echo $DEVICE
@@ -143,3 +143,25 @@
}
+custom_filters()
+{
+ local FILE
+ if [[ "${COMPRESS_MANPAGES:=on}" == "on" ]]; then
+ while read FILE; do
+ if [[ -f "$FILE" ]] ; then
+ if echo "$FILE" | grep '^/usr/share/man/man' | grep -q -v '\.gz$'; then
+ gzip -9 < "$FILE" > "$FILE.gz"
+ debug_msg "Compressing man page \"$FILE\""
+ rm -f "$FILE"
+ echo "$FILE.gz"
+ else
+ echo "$FILE"
+ fi
+ else
+ echo "$FILE"
+ fi
+ done
+ else
+ cat -
+ fi
+}
Modified: lunar/trunk/var/lib/lunar/functions/optimize.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/optimize.lunar 2006-02-28 04:34:20 UTC (rev 18936)
+++ lunar/trunk/var/lib/lunar/functions/optimize.lunar 2006-02-28 05:58:48 UTC (rev 18937)
@@ -1,782 +1,24 @@
#!/bin/bash
+############################################################
+# #
+# optimize.lunar - Lunar general optimization code #
+# #
+############################################################
+# #
+# Copyright 2006 by Auke Kok under GPLv2 #
+# #
+############################################################
-# All specified optimizations are system wide,
-# and apply to any module built using lin.
-# All settings in this function may be adjusted
-# in each modules BUILD script.
-
-# $PLATFORM = This sets the platform (x86, Sparc, PPC, etc..)
-# specific optimizations for the machine
-# $BOPT = This sets the base optimizations (the -O level)
-# it is applicable to all platforms and cpu types.
-# $CPU = This sets the specific cpu and arch type.
-# $SPD = This sets options that can increase the speed
-# of compiled binaries.
-# $XTRA = This specifies what type of extra instructions
-# to use for the specified cpu and platform.
-# $FPM = This sets the Floating Point Math use
-# of SSE instructions.
-# $LDF = This sets the system wide linking optimizations.
-
-
-
-# Usage : bad_flags "list of flags to remove"
-# Example : bad_flags -ffast-math -funroll-loops
-bad_flags() {
- debug_msg "bad_flags ($@)"
- verbose_msg "bad_flags \"$@\""
- if [[ "$1" == "ALL" ]]; then
- unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
- elif [[ "$1" == "compiler" ]]; then
- unset CFLAGS CXXFLAGS CPPFLAGS
- elif [[ "$1" == "linker" ]]; then
- unset LDFLAGS
- else
- for BAD_FLAG in "$@" ; do
- CFLAGS=$(echo $CFLAGS | sed s/$BAD_FLAG//)
- CXXFLAGS=$(echo $CXXFLAGS | sed s/$BAD_FLAG//)
- CPPFLAGS=$(echo $CPPFLAGS | sed s/$BAD_FLAG//)
- LDFLAGS=$(echo $LDFLAGS | sed s/$BAD_FLAG//)
- done
- fi
-}
-
-
-use_wrappers() {
- debug_msg "use_wrappers ($@)"
- if [ "$GCCWRAPPERS" == "on" ] ; then
- verbose_msg "Enabling gcc wrapper scripts to force optimizations"
- export PATH=/var/lib/lunar/compilers:${PATH}
- fi
-}
-
-
-optimize_make() {
- debug_msg "optimize_make ($@)"
- if [ "$PSAFE" == "no" ] ; then
- unset MAKES
- elif [ "$MAKES" == "1" ] ; then
- unset MAKES
- fi
- if module_installed linux-openmosix; then
- $MAKE_EXT="$MAKE_EXT mosrun -h"
- fi
-}
-
-
-optimize_base() {
- debug_msg "optimize_base ($@)"
- if ! [ "$1" ] ; then
- BOPT="None"
- fi
-
- if [[ $CFLAGS ]]; then
- unset CFLAGS CXXFLAGS
- fi
-
- case $1 in
- None) CFLAGS="-O0"
- CXXFLAGS="-O0"
- ;;
- Fast) CFLAGS="-O1"
- CXXFLAGS="-O1"
- ;;
- Faster) CFLAGS="-O2"
- CXXFLAGS="-O2"
- ;;
- Fastest) CFLAGS="-O3"
- CXXFLAGS="-O3"
- ;;
- Small) CFLAGS="-Os"
- CXXFLAGS="-Os"
- ;;
- esac
-}
-
-
-optimize_cpu() {
- debug_msg "optimize_cpu ($@)"
- if ! [[ $1 ]]; then
- if [[ $PLATFORM == "Alpha" ]]; then
- CPU="ev4"
- elif [[ $PLATFORM == "PowerPC" ]]; then
- CPU="powerpc"
- elif [[ $PLATFORM == "SPARC" ]]; then
- CPU="ultrasparc"
- elif [[ $PLATFORM == "x86_64" ]]; then
- CPU="x86_64"
- else
- CPU="I386"
- fi
- fi
-
-# Begin x86 options
- case $1 in
- I386) CFLAGS="$CFLAGS -march=i386"
- CXXFLAGS="$CXXFLAGS -march=i386"
- BUILD="i386-pc-linux-gnu"
- ;;
- I486) CFLAGS="$CFLAGS -march=i486"
- CXXFLAGS="$CXXFLAGS -march=i486"
- BUILD="i486-pc-linux-gnu"
- ;;
- I586) CFLAGS="$CFLAGS -march=i586"
- CXXFLAGS="$CXXFLAGS -march=i586"
- BUILD="i586-pc-linux-gnu"
- ;;
- I686) CFLAGS="$CFLAGS -march=i686"
- CXXFLAGS="$CXXFLAGS -march=i686"
- BUILD="i686-pc-linux-gnu"
- ;;
- Pentium) CFLAGS="$CFLAGS -march=pentium"
- CXXFLAGS="$CXXFLAGS -march=pentium"
- BUILD="i586-pc-linux-gnu"
- ;;
- PentiumMMX) CFLAGS="$CFLAGS -march=pentium-mmx"
- CXXFLAGS="$CXXFLAGS -march=pentium-mmx"
- BUILD="i586-pc-linux-gnu"
- ;;
- PentiumPro) CFLAGS="$CFLAGS -march=pentiumpro"
- CXXFLAGS="$CXXFLAGS -march=pentiumpro"
- BUILD="i686-pc-linux-gnu"
- ;;
- Pentium2) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=pentium2"
- CXXFLAGS="$CXXFLAGS -march=pentium2"
- BUILD="i686-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i686"
- CXXFLAGS="$CXXFLAGS -march=i686"
- BUILD="i686-pc-linux-gnu"
- fi
- ;;
- Pentium3) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=pentium3"
- CXXFLAGS="$CXXFLAGS -march=pentium3"
- BUILD="i686-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i686"
- CXXFLAGS="$CXXFLAGS -march=i686"
- BUILD="i686-pc-linux-gnu"
- fi
- ;;
- Pentium4) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=pentium4"
- CXXFLAGS="$CXXFLAGS -march=pentium4"
- BUILD="i686-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i686"
- CXXFLAGS="$CXXFLAGS -march=i686"
- BUILD="i686-pc-linux-gnu"
- fi
- ;;
- K6) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=k6"
- CXXFLAGS="$CXXFLAGS -march=k6"
- BUILD="i586-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i586"
- CXXFLAGS="$CXXFLAGS -march=k6"
- BUILD="i586-pc-linux-gnu"
- fi
- ;;
- K62) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=k6-2"
- CXXFLAGS="$CXXFLAGS -march=k6-2"
- BUILD="i586-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i586"
- CXXFLAGS="$CXXFLAGS -march=i586"
- BUILD="i586-pc-linux-gnu"
- fi
- ;;
- K63) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=k6-3"
- CXXFLAGS="$CXXFLAGS -march=k6-3"
- BUILD="i586-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i586"
- CXXFLAGS="$CXXFLAGS -march=i586"
- BUILD="i586-pc-linux-gnu"
- fi
- ;;
- Athlon) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=athlon"
- CXXFLAGS="$CXXFLAGS -march=athlon"
- BUILD="i686-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i686"
- CXXFLAGS="$CXXFLAGS -march=i686"
- BUILD="i686-pc-linux-gnu"
- fi
- ;;
- AthlonTBird) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=athlon-tbird"
- CXXFLAGS="$CXXFLAGS -march=athlon-tbird"
- BUILD="i686-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i686"
- CXXFLAGS="$CXXFLAGS -march=i686"
- BUILD="i686-pc-linux-gnu"
- fi
- ;;
- Athlon4) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=athlon-4"
- CXXFLAGS="$CXXFLAGS -march=athlon-4"
- BUILD="i686-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i686"
- CXXFLAGS="$CXXFLAGS -march=i686"
- BUILD="i686-pc-linux-gnu"
- fi
- ;;
- AthlonXP) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=athlon-xp"
- CXXFLAGS="$CXXFLAGS -march=athlon-xp"
- BUILD="i686-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i686"
- CXXFLAGS="$CXXFLAGS -march=i686"
- BUILD="i686-pc-linux-gnu"
- fi
- ;;
- AthlonMP) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=athlon-mp"
- CXXFLAGS="$CXXFLAGS -march=athlon-mp"
- BUILD="i686-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i686"
- CXXFLAGS="$CXXFLAGS -march=i686"
- BUILD="i686-pc-linux-gnu"
- fi
- ;;
- Athlon64) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -march=athlon64"
- CXXFLAGS="$CXXFLAGS -march=athlon64"
- BUILD="i686-pc-linux-gnu"
- else
- CFLAGS="$CFLAGS -march=i686"
- CXXFLAGS="$CXXFLAGS -march=i686"
- BUILD="i686-pc-linux-gnu"
- fi
- ;;
-
-# Begin PowerPC options
- common) CFLAGS="$CFLAGS -mcpu=common"
- CXXFLAGS="$CXXFLAGS -mcpu=common"
- BUILD="power-linux"
- ;;
- rios) CFLAGS="$CFLAGS -mcpu=rios"
- CXXFLAGS="$CXXFLAGS -mcpu=rios"
- BUILD="power-linux"
- ;;
- rios1) CFLAGS="$CFLAGS -mcpu=rios1"
- CXXFLAGS="$CXXFLAGS -mcpu=rios1"
- BUILD="power-linux"
- ;;
- rsc) CFLAGS="$CFLAGS -mcpu=rsc"
- CXXFLAGS="$CXXFLAGS -mcpu=rsc"
- BUILD="power-linux"
- ;;
- rios2) CFLAGS="$CFLAGS -mcpu=rios2"
- CXXFLAGS="$CXXFLAGS -mcpu=rios2"
- BUILD="power-linux"
- ;;
- rs64a) CFLAGS="$CFLAGS -mcpu=rs64a"
- CXXFLAGS="$CXXFLAGS -mcpu=rs64a"
- BUILD="powerpc64-linux"
- ;;
- 403) CFLAGS="$CFLAGS -mcpu=403"
- CXXFLAGS="$CXXFLAGS -mcpu=403"
- BUILD="powerpc-linux"
- ;;
- 505) CFLAGS="$CFLAGS -mcpu=505"
- CXXFLAGS="$CXXFLAGS -mcpu=505"
- BUILD="powerpc-linux"
- ;;
- 601) CFLAGS="$CFLAGS -mcpu=601"
- CXXFLAGS="$CXXFLAGS -mcpu=601"
- BUILD="powerpc-linux"
- ;;
- 602) CFLAGS="$CFLAGS -mcpu=602"
- CXXFLAGS="$CXXFLAGS -mcpu=602"
- BUILD="powerpc-linux"
- ;;
- 603) CFLAGS="$CFLAGS -mcpu=603"
- CXXFLAGS="$CXXFLAGS -mcpu=603"
- BUILD="powerpc-linux"
- ;;
- 603e) CFLAGS="$CFLAGS -mcpu=603e"
- CXXFLAGS="$CXXFLAGS -mcpu=603e"
- BUILD="powerpc-linux"
- ;;
- 604) CFLAGS="$CFLAGS -mcpu=604"
- CXXFLAGS="$CXXFLAGS -mcpu=604"
- BUILD="powerpc-linux"
- ;;
- 604e) CFLAGS="$CFLAGS -mcpu=604e"
- CXXFLAGS="$CXXFLAGS -mcpu=604e"
- BUILD="powerpc-linux"
- ;;
- 620) CFLAGS="$CFLAGS -mcpu=620"
- CXXFLAGS="$CXXFLAGS -mcpu=620"
- BUILD="powerpc64-linux"
- ;;
- 630) CFLAGS="$CFLAGS -mcpu=630"
- CXXFLAGS="$CXXFLAGS -mcpu=630"
- BUILD="powerpc-linux"
- ;;
- 740) CFLAGS="$CFLAGS -mcpu=740"
- CXXFLAGS="$CXXFLAGS -mcpu=740"
- BUILD="powerpc-linux"
- ;;
- 7400) CFLAGS="$CFLAGS -mcpu=7400"
- CXXFLAGS="$CXXFLAGS -mcpu=7400"
- BUILD="powerpc-linux"
- ;;
- 7450) CFLAGS="$CFLAGS -mcpu=7450"
- CXXFLAGS="$CXXFLAGS -mcpu=7450"
- BUILD="powerpc-linux"
- ;;
- 750) CFLAGS="$CFLAGS -mcpu=750"
- CXXFLAGS="$CXXFLAGS -mcpu=750"
- BUILD="powerpc-linux"
- ;;
- 801) CFLAGS="$CFLAGS -mcpu=801"
- CXXFLAGS="$CXXFLAGS -mcpu=801"
- BUILD="powerpc-linux"
- ;;
- 821) CFLAGS="$CFLAGS -mcpu=821"
- CXXFLAGS="$CXXFLAGS -mcpu=821"
- BUILD="powerpc-linux"
- ;;
- 823) CFLAGS="$CFLAGS -mcpu=823"
- CXXFLAGS="$CXXFLAGS -mcpu=823"
- BUILD="powerpc-linux"
- ;;
- 860) CFLAGS="$CFLAGS -mcpu=860"
- CXXFLAGS="$CXXFLAGS -mcpu=860"
- BUILD="powerpc-linux"
- ;;
- power) CFLAGS="$CFLAGS -mcpu=power"
- CXXFLAGS="$CXXFLAGS -mcpu=power"
- BUILD="power-linux"
- ;;
- power2) CFLAGS="$CFLAGS -mcpu=power2"
- CXXFLAGS="$CXXFLAGS -mcpu=power2"
- BUILD="power-linux"
- ;;
- PowerPC) CFLAGS="$CFLAGS -mcpu=powerpc"
- CXXFLAGS="$CXXFLAGS -mcpu=powerpc"
- BUILD="powerpc-linux"
- ;;
-
-
-
-
-
-# Begin Alpha options
- ev4) CFLAGS="$CFLAGS -mcpu=ev4"
- CXXFLAGS="$CXXFLAGS -mcpu=ev4"
- BUILD="alpha-linux"
- ;;
- ev45) CFLAGS="$CFLAGS -mcpu=ev4"
- CXXFLAGS="$CXXFLAGS -mcpu=ev4"
- BUILD="alpha-linux"
- ;;
- ev5) CFLAGS="$CFLAGS -mcpu=ev5"
- CXXFLAGS="$CXXFLAGS -mcpu=ev5"
- BUILD="alpha-linux"
- ;;
- ev56) CFLAGS="$CFLAGS -mcpu=ev56"
- CXXFLAGS="$CXXFLAGS -mcpu=ev56"
- BUILD="alpha-linux"
- ;;
- pca56) CFLAGS="$CFLAGS -mcpu=pca56"
- CXXFLAGS="$CXXFLAGS -mcpu=pca56"
- BUILD="alpha-linux"
- ;;
- ev6) CFLAGS="$CFLAGS -mcpu=ev6"
- CXXFLAGS="$CXXFLAGS -mcpu=ev6"
- BUILD="alpha-linux"
- ;;
- ev67) CFLAGS="$CFLAGS -mcpu=ev67"
- CXXFLAGS="$CXXFLAGS -mcpu=ev67"
- BUILD="alpha-linux"
- ;;
- ev68) CFLAGS="$CFLAGS -mcpu=ev67"
- CXXFLAGS="$CXXFLAGS -mcpu=ev67"
- BUILD="alpha-linux"
- ;;
-# Begin SPARC options
- v7) CFLAGS="$CFLAGS -mcpu=v7"
- CXXFLAGS="$CXXFLAGS -mcpu=v7"
- BUILD="sparc-linux"
- ;;
- cypress) CFLAGS="$CFLAGS -mcpu=cypress"
- CXXFLAGS="$CXXFLAGS -mcpu=cypress"
- BUILD="sparc-linux"
- ;;
- v8) CFLAGS="$CFLAGS -mcpu=v8"
- CXXFLAGS="$CXXFLAGS -mcpu=v8"
- BUILD="sparc-linux"
- ;;
- supersparc) CFLAGS="$CFLAGS -mcpu=supersparc"
- CXXFLAGS="$CXXFLAGS -mcpu=supersparc"
- BUILD="sparc-linux"
- ;;
- sparclite) CFLAGS="$CFLAGS =mcpu=sparclite"
- CXXFLAGS="$CXXFLAGS =mcpu=sparclite"
- BUILD="sparc-linux"
- ;;
- hypersparc) CFLAGS="$CFLAGS -mcpu=hypersparc"
- CXXFLAGS="$CXXFLAGS -mcpu=hypersparc"
- BUILD="sparc-linux"
- ;;
- sparclite86x) CFLAGS="$CFLAGS -mcpu=sparclite86x"
- CXXFLAGS="$CXXFLAGS -mcpu=sparclite86x"
- BUILD="sparc-linux"
- ;;
- f930) CFLAGS="$CFLAGS -mcpu=f930"
- CXXFLAGS="$CXXFLAGS -mcpu=f930"
- BUILD="sparc-linux"
- ;;
- f934) CFLAGS="$CFLAGS -mcpu=f934"
- CXXFLAGS="$CXXFLAGS -mcpu=f934"
- BUILD="sparc-linux"
- ;;
- sparclet) CFLAGS="$CFLAGS -mcpu=sparclet"
- CXXFLAGS="$CXXFLAGS -mcpu=sparclet"
- BUILD="sparc-linux"
- ;;
- tsc701) CFLAGS="$CFLAGS -mcpu=tsc701"
- CXXFLAGS="$CXXFLAGS -mcpu=tsc701"
- BUILD="sparc-linux"
- ;;
- v9) CFLAGS="$CFLAGS -mcpu=v9"
- CXXFLAGS="$CXXFLAGS -mcpu=v9"
- BUILD="sparc-linux"
- ;;
- ultrasparc) CFLAGS="$CFLAGS -mcpu=ultrasparc"
- CXXFLAGS="$CXXFLAGS -mcpu=ultrasparc"
- BUILD="sparc-linux"
- ;;
- x86_64) CFLAGS="$CFLAGS"
- CXXFLAGS="$CXXFLAGS"
- BUILD="x86_64-pc-linux-gnu"
- ;;
- esac
-}
-
-
-optimize_speed() {
- debug_msg "optimize_speed ($@)"
- for A in ${SPD[@]}; do
- case $A in
- None) CFLAGS="$CFLAGS"
- CXXFLAGS="$CXXFLAGS"
- ;;
- Speedy) CFLAGS="$CFLAGS -funroll-loops"
- CXXFLAGS="$CXXFLAGS -funroll-loops"
- ;;
- Risky) CFLAGS="$CFLAGS -ffast-math"
- CXXFLAGS="$CXXFLAGS -ffast-math"
- ;;
- Pointers) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -fomit-frame-pointer"
- CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
- fi
- ;;
- Siblings) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -foptimize-sibling-calls"
- CXXFLAGS="$CXXFLAGS"
- fi
- ;;
- Profiling) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -fprofile-arcs"
- CXXFLAGS="$CXXFLAGS -fprofile-arcs"
- set_local_config "KEEP_SOURCE" "on"
- fi
- ;;
- Branching) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -fbranch-probabilities"
- CXXFLAGS="$CXXFLAGS -fbranch-probabilities"
- fi
- ;;
- Aliasing) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -fstrict-aliasing"
- CXXFLAGS="$CXXFLAGS -fstrict-aliasing"
- fi
- ;;
- Cprop) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -fno-cprop-registers"
- CXXFLAGS="$CXXFLAGS -fno-cprop-registers"
- fi
- ;;
- Float) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -ffloat-store"
- CXXFLAGS="$CXXFLAGS -ffloat-store"
- fi
- ;;
- Address) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -fforce-addr"
- CXXFLAGS="$CXXFLAGS -fforce-addr"
- fi
- ;;
- Align) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -falign-functions -falign-loops -falign-jumps"
- CXXFLAGS="$CXXFLAGS -falign-functions -falign-loops -falign-jumps"
- fi
- ;;
- Expensive) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -fexpensive-optimizations"
- CXXFLAGS="$CXXFLAGS -fexpensive-optimizations"
- fi
- ;;
- Doubles) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -malign-double"
- CXXFLAGS="$CXXFLAGS -malign-double"
- fi
- ;;
- Tracer) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -ftracer"
- CXXFLAGS="$CXXFLAGS -ftracer"
- fi
- ;;
- Blocks) if [[ $GCCVER == "3" ]] ; then
- CFLAGS="$CFLAGS -freorder-blocks"
- CXXFLAGS="$CXXFLAGS -freorder-blocks"
- fi
- ;;
- esac
- done
-}
-
-
-optimize_stack() {
- debug_msg "optimize_stack ($@)"
- if [[ $STACK > 0 ]] ; then
- if [ $PLATFORM == "x86" ] ; then
- CFLAGS="$CFLAGS -mpreferred-stack-boundary=$STACK"
- CXXFLAGS="$CXXFLAGS -mpreferred-stack-boundary=$STACK"
- CPPFLAGS="$CPPFLAGS -mpreferred-stack-boundary=$STACK"
- fi
- fi
-}
-
-
-optimize_extra() {
- debug_msg "optimize_extra ($@)"
- for A in ${XTRA[@]}; do
- case $A in
- None) CFLAGS="$CFLAGS"
- CXXFLAGS="$CXXFLAGS"
- ;;
- MMX) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -mmmx"
- CXXFLAGS="$CXXFLAGS -mmmx"
- fi
- ;;
- SSE) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -msse"
- CXXFLAGS="$CXXFLAGS -msse"
- fi
- ;;
- SSE2) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -msse2"
- CXXFLAGS="$CXXFLAGS -msse2"
- fi
- ;;
- SSE3) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -msse3"
- CXXFLAGS="$CXXFLAGS -msse3"
- fi
- ;;
- dnow) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -m3dnow"
- CXXFLAGS="$CXXFLAGS -m3dnow"
- fi
- ;;
- Altivec) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -maltivec"
- CXXFLAGS="$CXXFLAGS -maltivec"
- fi
- ;;
- esac
- done
-}
-
-
-# Set how floating point math is done
-optimize_fp() {
- debug_msg "optimize_fp ($@)"
- case $1 in
- x387) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -mfpmath=387"
- CXXFLAGS="$CXXFLAGS -mfpmath=387"
- fi
- ;;
- SSE) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -mfpmath=sse"
- CXXFLAGS="$CXXFLAGS -mfpmath=sse"
- fi
- ;;
- Both) if [[ $GCCVER == "3" ]]; then
- CFLAGS="$CFLAGS -mfpmath=sse,387"
- CXXFLAGS="$CXXFLAGS -mfpmath=sse,387"
- fi
- ;;
- None) CFLAGS="$CFLAGS"
- CXXFLAGS="$CXXFLAGS"
- ;;
- esac
-}
-
-
-# Set up the Linker optimizations
-optimize_ld() {
- local WL
- debug_msg "optimize_ld ($@)"
- if [[ $LDFLAGS ]]; then
- unset LDFLAGS
- fi
-
- 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
-}
-
-
-optimize_addon() {
- debug_msg "optimize_addon ($@)"
- if ! [[ `grep ADDON /etc/lunar/local/optimizations` ]]; then
- echo ADDON=\( None \) >> /etc/lunar/local/optimizations
- ADDON=( None )
- fi
-
- for A in ${ADDON[@]}; do
- case $A in
- DistCC) if module_installed distcc; then
- CC_EXT="$CC_EXT distcc"
- CXX_EXT="$CXX_EXT distcc"
- else
- CC_EXT="$CC_EXT"
- CXX_EXT="$CXX_EXT"
- fi
- ;;
- CCache) if module_installed ccache; then
- CC_EXT="ccache $CC_EXT"
- CXX_EXT="ccache $CXX_EXT"
- else
- CC_EXT="$CC_EXT"
- CXX_EXT="$CXX_EXT"
- fi
- ;;
- GECC) CC_EXT="gecc"
- CXX_EXT="gecc"
- ;;
- esac
- done
- verbose_msg "CC_EXT=\"$CC_EXT\", CXX_EXT=\"$CXX_EXT\""
-}
-
-
-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"
- ;;
- ccpipe)
- COPT="$COPT -pipe"
- ;;
- cxxpipe)
- CCOPT="$CCOPT -pipe"
- ;;
- esac
- done
-}
-
-
-optimize() {
- debug_msg "optimize ($@)"
- # Source in the optimization settings if it exists.
- if [ -s /etc/lunar/local/optimizations ] ; then
- . /etc/lunar/local/optimizations
- else
- verbose_msg "initializing optimizations with hard-coded defaults"
- echo -e PLATFORM=x86 '\n' \
-BUILD=i386-pc-linux-gnu '\n' \
-MAKES= '\n' \
-BOPT=-O0 '\n' \
-CPU=i386 '\n' \
-SPD=\( \) '\n' \
-STACK= '\n' \
-XTRA=\( \) '\n' \
-FPM= '\n' \
-CC_OPTS=\( \) '\n' \
-LDF=\( \) '\n' \
-ADDON=\( \) > /etc/lunar/local/optimizations
- fi
-
- #lets get the BUILD if it is not defined
- [ -z "$BUILD" ] && optimize_cpu $CPU
- [ -n "$BUILD" ] && export BUILD ||
- echo "Set your optimization preferences via lunar"
-
- 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_stack
- ;;
- esac
-
- local GCC_REALVERSION=$(${COMPILER_PATH:-/usr/bin}/gcc --version | head -n 1 | awk '{print $3}')
- if [ "$(echo $GCC_REALVERSION | cut -d. -f1,2)" == "3.4" \
- -o "$(echo $GCC_REALVERSION | cut -d. -f1)" == "4" ] ; then
- CFLAGS=$(echo $CFLAGS | sed 's:-mcpu:-mtune:')
- CXXFLAGS=$(echo $CXXFLAGS | sed 's:-mcpu:-mtune:')
- fi
-
- export CC_EXT
- export CXX_EXT
- export MAKE_EXT
- export COPT
- export CCOPT
- export CFLAGS
- export CXXFLAGS
- export LDFLAGS
- export MAKES
-
- use_wrappers
- verbose_msg "BUILD=\"$BUILD\""
- verbose_msg "GCCVER=\"$GCCVER\""
- verbose_msg "CFLAGS=\"$CFLAGS\""
- verbose_msg "CXXFLAGS=\"$CXXFLAGS\""
- verbose_msg "LDFLAGS=\"$LDFLAGS\""
-}
-
-
+optimize_menu()
+{(
+ export IFS=$'\t\n'
+ while true; do
+ PLUGIN=`$DIALOG --cancel-label "Close" --menu "Select a component for which to configure optimizations" 0 0 0 $(plugin_call OPTIMIZE_MENU)`
+ if [ $? != 0 ]; then
+ return
+ fi
+
+ plugin_call OPTIMIZE_MENU $PLUGIN
+ done
+)}
Modified: lunar/trunk/var/lib/lunar/functions/plugins.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/plugins.lunar 2006-02-28 04:34:20 UTC (rev 18936)
+++ lunar/trunk/var/lib/lunar/functions/plugins.lunar 2006-02-28 05:58:48 UTC (rev 18937)
@@ -37,6 +37,7 @@
# 12 - BUILD_POST_INSTALL ,, ,, ,, POST_INSTALL
# 13 - BUILD_PRE_REMOVE ,, ,, ,, PRE_REMOVE
# 14 - BUILD_POST_REMOVE ,, ,, ,, POST_REMOVE
+ # 15 - OPTIMIZE_MENU Display optimization menu's
LUNAR_PLUGINS=(${LUNAR_PLUGINS[@]} "$1:$2")
((LUNAR_PLUGIN_COUNT++))
debug_msg "Registered plugin #$LUNAR_PLUGIN_COUNT, $1 -> $2()"
Modified: lunar/trunk/var/lib/lunar/functions/tracking.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/tracking.lunar 2006-02-28 04:34:20 UTC (rev 18936)
+++ lunar/trunk/var/lib/lunar/functions/tracking.lunar 2006-02-28 05:58:48 UTC (rev 18937)
@@ -73,7 +73,7 @@
export IFS="$TAB_ENTER_IFS"
- parse_iw | sort | uniq | filter "$LOCAL_EXCLUDED" | exists > $TMP_INST_LOG
+ parse_iw | sort | uniq | filter "$LOCAL_EXCLUDED" | custom_filters | exists > $TMP_INST_LOG
echo "$INSTALL_LOGS/$MODULE-$VERSION" >> $TMP_INST_LOG
echo "$COMPILE_LOGS/$MODULE-$VERSION.bz2" >> $TMP_INST_LOG
echo "$MD5SUM_LOGS/$MODULE-$VERSION" >> $TMP_INST_LOG
Modified: lunar/trunk/var/lib/lunar/functions/updatelog.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/updatelog.lunar 2006-02-28 04:34:20 UTC (rev 18936)
+++ lunar/trunk/var/lib/lunar/functions/updatelog.lunar 2006-02-28 05:58:48 UTC (rev 18937)
@@ -24,7 +24,7 @@
rm -f /var/log/lunar/update
{
if [ -e "$TMP_LIN_SUCCESS" -a -e "$TMP_LIN_FAIL" ] ; then
- display_success_info
+ display_success_info $1
fi
} | tee /var/log/lunar/update
}
@@ -41,7 +41,7 @@
NUMFAILURES=$(cat $TMP_LIN_FAIL | wc -l)
message
- message "${MESSAGE_COLOR}Lunar renew completed at `date`${DEFAULT_COLOR}"
+ message "${MESSAGE_COLOR}Lunar $1 completed at `date`${DEFAULT_COLOR}"
message "Successful : " $NUMSUCCESS
message "Failed : " $NUMFAILURES
message
Deleted: lunar/trunk/var/lib/lunar/menu/optimize.menu
More information about the Lunar-commits
mailing list