[Lunar-commits] <lunar> backport fix: new wrappers, adding gcc compiler path detection, remove reference to non-used core file, and 'aliases' now lives in $MOONBASE.
Auke Kok
sofar at lunar-linux.org
Mon Jul 2 04:43:07 CEST 2012
commit dd08860753fd9face5c608717a6523a9a30fa71d
Author: Auke Kok <sofar at lunar-linux.org>
Date: Sun Aug 21 20:47:02 2005 +0000
backport fix: new wrappers, adding gcc compiler path detection, remove reference to non-used core file, and 'aliases' now lives in $MOONBASE.
---
etc/lunar/config | 1 -
usr/share/doc/lunar/module-example/README | 6 ++----
var/lib/lunar/compilers/c++ | 4 ++--
var/lib/lunar/compilers/cc | 6 +++---
var/lib/lunar/compilers/g++ | 6 +++---
var/lib/lunar/compilers/gcc | 6 +++---
var/lib/lunar/compilers/make | 4 ++--
var/lib/lunar/functions/aliases.lunar | 8 ++++++++
var/lib/lunar/functions/optimize.lunar | 5 +++--
9 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/etc/lunar/config b/etc/lunar/config
index 376a066..40747e2 100755
--- a/etc/lunar/config
+++ b/etc/lunar/config
@@ -22,7 +22,6 @@ export DIALOGRC=/etc/lunar/dialogrc
FUNCTIONS=/var/lib/lunar/functions
MENUS=/var/lib/lunar/menu
SUSTAINED=/var/lib/lunar/sustained
- ALIASES=/var/lib/lunar/aliases
PLUGIN_DIR=/var/lib/lunar/plugins
SOUND_DIRECTORY=/var/lib/lunar/sound
diff --git a/usr/share/doc/lunar/module-example/README b/usr/share/doc/lunar/module-example/README
index 562b7e6..c8f3eba 100644
--- a/usr/share/doc/lunar/module-example/README
+++ b/usr/share/doc/lunar/module-example/README
@@ -70,10 +70,6 @@ the package is built.
Use this file if you need to tweak the compiles sources before it is
installed.
-* PRE_INSTALL
-
-This file lets you prepare the installation process for the package.
-
* POST_INSTALL
When you need to additionally tweak things after installation, this is
@@ -114,6 +110,8 @@ Some contents of subdirs are automatically handled, here's a list:
- xinetd.d - for xinetd service definitions
- init.d - for init.d startup scripts
- profile.d - for bash shell settings
+ - plugin.d - for lunar code plugins
+ - skel - for /etc/skel/ files
The file 'services' can be used to add tcp/ip or udp service port
diff --git a/var/lib/lunar/compilers/c++ b/var/lib/lunar/compilers/c++
index 237bcf0..7ef04ca 100755
--- a/var/lib/lunar/compilers/c++
+++ b/var/lib/lunar/compilers/c++
@@ -1,8 +1,8 @@
#!/bin/bash
if [ -n "$LUNAR_DEBUG" ] ; then
- echo "++ $CXX_EXT g++ $CCOPT \"$@\"" >&2
+ echo "++ $CXX_EXT ${COMPILER_PATH:-/usr/bin}/g++ $CCOPT \"$@\"" >&2
fi
-$CXX_EXT /usr/bin/g++ $CCOPT "$@"
+$CXX_EXT ${COMPILER_PATH:-/usr/bin}/g++ $CCOPT "$@"
diff --git a/var/lib/lunar/compilers/cc b/var/lib/lunar/compilers/cc
index 5ef5bd4..e3bc069 100755
--- a/var/lib/lunar/compilers/cc
+++ b/var/lib/lunar/compilers/cc
@@ -1,8 +1,8 @@
#!/bin/bash
if [ -n "$LUNAR_DEBUG" ] ; then
- echo "++ $CC_EXT gcc $COPT \"$@\"" >&2
+ echo "++ $CC_EXT ${COMPILER_PATH:-/usr/bin}/gcc $COPT \"$@\"" >&2
fi
-
-$CC_EXT /usr/bin/gcc $COPT "$@"
+
+$CC_EXT ${COMPILER_PATH:-/usr/bin}/gcc $COPT "$@"
diff --git a/var/lib/lunar/compilers/g++ b/var/lib/lunar/compilers/g++
index 6a7f765..867b2d8 100755
--- a/var/lib/lunar/compilers/g++
+++ b/var/lib/lunar/compilers/g++
@@ -1,8 +1,8 @@
#!/bin/bash
if [ -n "$LUNAR_DEBUG" ] ; then
- echo "++ $CXX_EXT g++ $CCOPT \"$@\"" >&2
+ echo "++ $CXX_EXT ${COMPILER_PATH:-/usr/bin}/g++ $CCOPT \"$@\"" >&2
fi
-
-$CXX_EXT /usr/bin/g++ $CCOPT "$@"
+
+$CXX_EXT ${COMPILER_PATH:-/usr/bin}/g++ $CCOPT "$@"
diff --git a/var/lib/lunar/compilers/gcc b/var/lib/lunar/compilers/gcc
index 5ef5bd4..e3bc069 100755
--- a/var/lib/lunar/compilers/gcc
+++ b/var/lib/lunar/compilers/gcc
@@ -1,8 +1,8 @@
#!/bin/bash
if [ -n "$LUNAR_DEBUG" ] ; then
- echo "++ $CC_EXT gcc $COPT \"$@\"" >&2
+ echo "++ $CC_EXT ${COMPILER_PATH:-/usr/bin}/gcc $COPT \"$@\"" >&2
fi
-
-$CC_EXT /usr/bin/gcc $COPT "$@"
+
+$CC_EXT ${COMPILER_PATH:-/usr/bin}/gcc $COPT "$@"
diff --git a/var/lib/lunar/compilers/make b/var/lib/lunar/compilers/make
index d87629b..d03d395 100755
--- a/var/lib/lunar/compilers/make
+++ b/var/lib/lunar/compilers/make
@@ -1,8 +1,8 @@
#!/bin/bash
if [ -n "$LUNAR_DEBUG" ] ; then
- echo "++ $MAKE_EXT make ${MAKES:+-j$MAKES} \"$@\"" >&2
+ echo "++ $MAKE_EXT ${MAKE_PATH:-/usr/bin}/make ${MAKES:+-j$MAKES} \"$@\"" >&2
fi
-$MAKE_EXT /usr/bin/make ${MAKES:+-j$MAKES} "$@"
+$MAKE_EXT ${MAKE_PATH:-/usr/bin}/make ${MAKES:+-j$MAKES} "$@"
diff --git a/var/lib/lunar/functions/aliases.lunar b/var/lib/lunar/functions/aliases.lunar
index 6e5ec3b..50e6c90 100644
--- a/var/lib/lunar/functions/aliases.lunar
+++ b/var/lib/lunar/functions/aliases.lunar
@@ -13,6 +13,14 @@
# and add it to the dependency chain if needed
unalias() {
local TARGET TARGETS TARGETBYNUM N CHOICE
+ # try to figure out where the aliases file is:
+ if [ -z "$ALIASES" -o ! -f "$ALIASES" ]; then
+ if [ -f "$MOONBASE/aliases" ] ; then
+ ALIASES="$MOONBASE/aliases"
+ else
+ ALIASES="/var/lib/lunar/aliases"
+ fi
+ fi
if [ "${1:0:1}" == "%" ] ; then
debug_msg "unalias($@)"
TARGETS=$(grep "^$1:" $ALIASES | cut -d: -f2-)
diff --git a/var/lib/lunar/functions/optimize.lunar b/var/lib/lunar/functions/optimize.lunar
index c366605..27981bf 100644
--- a/var/lib/lunar/functions/optimize.lunar
+++ b/var/lib/lunar/functions/optimize.lunar
@@ -743,8 +743,9 @@ ADDON=( ) > /etc/lunar/local/optimizations
;;
esac
- if [ "$(installed_version gcc | cut -d. -f1,2)" == "3.4" \
- -o "$(installed_version gcc | cut -d. -f1)" == "4" ] ; then
+ 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
More information about the Lunar-commits
mailing list