[Lunar-commits] r19385 - in lunar/branches/stable/var/lib/lunar: compilers menu plugins

Auke Kok sofar at lunar-linux.org
Wed Mar 22 18:28:07 UTC 2006


Author: sofar
Date: 2006-03-22 18:28:06 +0000 (Wed, 22 Mar 2006)
New Revision: 19385

Added:
   lunar/branches/stable/var/lib/lunar/plugins/optimize-wrappers.plugin
Removed:
   lunar/branches/stable/var/lib/lunar/menu/optimize.menu
Modified:
   lunar/branches/stable/var/lib/lunar/compilers/c++
   lunar/branches/stable/var/lib/lunar/compilers/cc
   lunar/branches/stable/var/lib/lunar/compilers/g++
   lunar/branches/stable/var/lib/lunar/compilers/gcc
   lunar/branches/stable/var/lib/lunar/compilers/ld
Log:
fully backmerge all changes:
- delete optimize.menu
- add optimize-wrappers plugin
- remove COPT CCOPT CFLAGS and CXX flags from wrappers


Modified: lunar/branches/stable/var/lib/lunar/compilers/c++
===================================================================
--- lunar/branches/stable/var/lib/lunar/compilers/c++	2006-03-22 17:46:20 UTC (rev 19384)
+++ lunar/branches/stable/var/lib/lunar/compilers/c++	2006-03-22 18:28:06 UTC (rev 19385)
@@ -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 "$@"
 

Modified: lunar/branches/stable/var/lib/lunar/compilers/cc
===================================================================
--- lunar/branches/stable/var/lib/lunar/compilers/cc	2006-03-22 17:46:20 UTC (rev 19384)
+++ lunar/branches/stable/var/lib/lunar/compilers/cc	2006-03-22 18:28:06 UTC (rev 19385)
@@ -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 "$@"
 

Modified: lunar/branches/stable/var/lib/lunar/compilers/g++
===================================================================
--- lunar/branches/stable/var/lib/lunar/compilers/g++	2006-03-22 17:46:20 UTC (rev 19384)
+++ lunar/branches/stable/var/lib/lunar/compilers/g++	2006-03-22 18:28:06 UTC (rev 19385)
@@ -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 "$@"
 

Modified: lunar/branches/stable/var/lib/lunar/compilers/gcc
===================================================================
--- lunar/branches/stable/var/lib/lunar/compilers/gcc	2006-03-22 17:46:20 UTC (rev 19384)
+++ lunar/branches/stable/var/lib/lunar/compilers/gcc	2006-03-22 18:28:06 UTC (rev 19385)
@@ -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 "$@"
 

Modified: lunar/branches/stable/var/lib/lunar/compilers/ld
===================================================================
--- lunar/branches/stable/var/lib/lunar/compilers/ld	2006-03-22 17:46:20 UTC (rev 19384)
+++ lunar/branches/stable/var/lib/lunar/compilers/ld	2006-03-22 18:28:06 UTC (rev 19385)
@@ -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 "$@"

Deleted: lunar/branches/stable/var/lib/lunar/menu/optimize.menu

Added: lunar/branches/stable/var/lib/lunar/plugins/optimize-wrappers.plugin
===================================================================
--- lunar/branches/stable/var/lib/lunar/plugins/optimize-wrappers.plugin	                        (rev 0)
+++ lunar/branches/stable/var/lib/lunar/plugins/optimize-wrappers.plugin	2006-03-22 18:28:06 UTC (rev 19385)
@@ -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