Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (64352c292459ae6f42dd4369673321c15ce31178)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (64352c292459ae6f42dd4369673321c15ce31178)
  • Date: Sun, 14 Dec 2008 14:51:14 -0600

GIT changes to master sorcery by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

ChangeLog | 9 ++
var/lib/sorcery/modules/build_api/api1 | 2
var/lib/sorcery/modules/build_api/api2 | 2
var/lib/sorcery/modules/libapi | 31 ++++++++
var/lib/sorcery/modules/libgcc | 115
++++++++++++++++++++++++++++++++
var/lib/sorcery/modules/libgcc2 | 116
---------------------------------
6 files changed, 157 insertions(+), 118 deletions(-)

New commits:
commit 64352c292459ae6f42dd4369673321c15ce31178
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libgcc: added missing quotes in a check in real_using_gcc

commit 4ce2e19daf1c5b76686cdd3c60c723a8b0f429a3
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libgcc: readded use_gcc and use_gcc2 for archspecs

commit 4462cea5c2aef9b0581cbb9bb2dfeb5c1c79859e
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libgcc: synced also the initial description of the module

commit 2c32f66a7d9f8d323fdbb693889cd99f995f4405
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libgcc2: renamed to libgcc, since it no longer is version specific

commit 812b25929db832f57765058b2b47a3ab5324c61b
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

expanded the description of using_gcc and made the matching stricter

commit 87651022cb3d88fdc3764eba4bc2505ada59eb7b
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libapi, libgcc2: renamed use_gcc to real_using_gcc and added
using_gcc to the public api

commit b26e9e123ddeed916b91570e4fc3c7997397f96e
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libgcc2, api1, api2: Merged with the newer grimoire version, changing
uses of invoke_gcc2 to invoke_gcc and removing use_gcc2

diff --git a/ChangeLog b/ChangeLog
index 12fa5e4..d96fa60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,15 @@
triggered by appending + to the passed version #14620, based on a
patch by Fredrik Carlström
Made invoke_gcc2 slightly more efficient and style-conformant
+ * libgcc2, api1, api2: Merged with the newer grimoire version,
changing
+ uses of invoke_gcc2 to invoke_gcc and removing use_gcc2
+ * libapi, libgcc2: renamed use_gcc to real_using_gcc and added
+ using_gcc to the public api
+ expanded the description of using_gcc and made the matching stricter
+ * libgcc2: renamed to libgcc, since it no longer is version specific
+ * libgcc: synced also the initial description of the module
+ readded use_gcc and use_gcc2 for archspecs
+ added missing quotes in a check in real_using_gcc

2008-12-12 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libcast: fixed a syntax error in custom cppflag setting, patch from
diff --git a/var/lib/sorcery/modules/build_api/api1
b/var/lib/sorcery/modules/build_api/api1
index 0ac1664..71c4132 100755
--- a/var/lib/sorcery/modules/build_api/api1
+++ b/var/lib/sorcery/modules/build_api/api1
@@ -112,7 +112,7 @@ function run_build() {
cd $SOURCE_DIRECTORY

invoke_build_dir
- invoke_gcc2
+ invoke_gcc
optimize
invoke_installwatch

diff --git a/var/lib/sorcery/modules/build_api/api2
b/var/lib/sorcery/modules/build_api/api2
index 35d653d..d4f3cd1 100755
--- a/var/lib/sorcery/modules/build_api/api2
+++ b/var/lib/sorcery/modules/build_api/api2
@@ -157,7 +157,7 @@ function run_build() {
fi &&

invoke_build_dir
- invoke_gcc2
+ invoke_gcc
optimize

message -n "Building in dir: "
diff --git a/var/lib/sorcery/modules/libapi b/var/lib/sorcery/modules/libapi
index d5a4465..7971b7b 100755
--- a/var/lib/sorcery/modules/libapi
+++ b/var/lib/sorcery/modules/libapi
@@ -81,6 +81,7 @@
# unpack (libunpack) (deprecated)
# unpack_file (libunpack)
# unpack_file_simple (libunpack)
+# using_gcc (libgcc2)
# verify_file (libunpack)
#
# The following are implicitly defined for each spell file
@@ -1276,6 +1277,36 @@ function verify_file () {
}

#---------------------------------------------------------------------
+## @param gcc version (digits and dots, followed by an optional +)
+## @return 0 if the version of the installed gcc that will be used is equal
+## to the passed version
+## @return 0 if the parameter is of the form "version+" and the version of
the
+## installed gcc is at least "version"
+## @return 1 otherwise
+## @See <@function var.lib.sorcery.modules.libgcc.html,real_using_gcc> for
more details.
+##
+## Checks if the system gcc version is equal to the passed version or
+## when the version ends with a + marker, if it the system version is
+## greater or equal to it.
+## The gcc version is of the major.minor.patchlevel form, but trailing
+## digits can be omitted and will default to 0 in the comparison.
+##
+## <pre>
+## Example:
+## if using_gcc 4.3+; then # same as 4.3.0+
+## patch -p1 < $SPELL_DIRECTORY/gcc43-compilation-fixes.patch
+## elif using_gcc 4.0.0; then
+## # gcc 4.0.0 triggers a memleak when -O3 is used
+## CFLAGS=${CFLAGS/-O3/-O2}
+## fi
+## </pre>
+#---------------------------------------------------------------------
+function using_gcc() {
+ debug "libapi" "$FUNCNAME - $*"
+ real_using_gcc "$@"
+}
+
+#---------------------------------------------------------------------
## @Type API
## @param Target of the trigger
## @param Action to execute
diff --git a/var/lib/sorcery/modules/libgcc b/var/lib/sorcery/modules/libgcc
new file mode 100755
index 0000000..f3d5b8a
--- /dev/null
+++ b/var/lib/sorcery/modules/libgcc
@@ -0,0 +1,115 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+## @Synopsis Set of functions for dealing with the problem of having to
+## @Synopsis use different version of the gcc compilers.
+##
+## The basic usage is as follows:
+## <pre>
+## - If a spell works with the latest version of gcc, do nothing.
+## - To change the compiler version for a spell, add a GCC_VERSION field
+## to the spells DETAILS specifying major.minor version of gcc it needs,
+## e.g. GCC_VERSION=3.4
+## - add a 'depends gccXX' to the spell where XX == majorminor,
+## e.g. 'depends gcc34'
+## - add 'invoke_gcc' to the top of PRE_BUILD if the spell has a
+## custom PRE_BUILD file
+## </pre>
+##
+## @Implementation These functions were added to allow the use of
+## @Implementation several versions of gcc in parallel.
+##
+##
+## @Copyright Copyright 2005 by the Source Mage Team
+##
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+## @param gcc version (digits and dots, followed by an optional +)
+## @return 0 if the version of the installed gcc that will be used is equal
+## to the passed version
+## @return 0 if the parameter is of the form "version+" and the version of
the
+## installed gcc is at least "version"
+## @return 1 otherwise
+#---------------------------------------------------------------------
+function real_using_gcc() {
+ local needed_version=${1%+}
+ local installed_version=$(gcc -dumpversion)
+
+ if [[ "$needed_version" == "$1" ]]; then
+ grep -qE "^$(esc_str $needed_version)(\.0)*$" <<< "$installed_version"
+ else
+ local i=0 needed_version2 installed_version2
+ explode "$needed_version" . needed_version2
+ explode "$installed_version" . installed_version2
+
+ while [[ ${needed_version2[$i]} ]] || [[ ${installed_version2[$i]} ]]; do
+ if [[ ${needed_version2[$i]:-0} == ${installed_version2[$i]:-0} ]];
then
+ let i++
+ continue
+ fi
+ # capturing the return value of arithmetic comparison inverts it
+ return $(( ${needed_version2[$i]:-0} > ${installed_version2[$i]:-0} ))
+ done
+ fi
+}
+
+#---------------------------------------------------------------------
+## @param path
+##
+## Alters the environment so that the gcc in the specified directory
+## will be used for compiling
+##
+#---------------------------------------------------------------------
+function gcc_add_paths() {
+ export PATH=$(envar_prepend_path $1/bin $PATH)
+ export LD_LIBRARY_PATH=$(envar_prepend_path $1/lib $LD_LIBRARY_PATH)
+ export LD_RUN_PATH=$(envar_prepend_path $1/lib $LD_RUN_PATH)
+ export INFOPATH=$(envar_prepend_path $1/info $INFOPATH)
+ export CPPFLAGS="-I $1/include $CPPFLAGS"
+}
+
+#---------------------------------------------------------------------
+##
+## Determines if the spell specifies a gcc version to use. If so, it
+## alters the environment so that that gcc version is used for compilation.
+##
+#---------------------------------------------------------------------
+function invoke_gcc() {
+ # $GCC_VERSION contains only two of the version fields, but any patchlevel
+ # will do, so we pass a regex to the otherwise stricter real_using_gcc
+ if [[ $GCC_VERSION ]] && ! real_using_gcc "$GCC_VERSION(\.[0-9])?"; then
+ gcc_add_paths /opt/gcc${GCC_VERSION//.}
+ elif [[ -f $SCRIPT_DIRECTORY/USEGCC2 ]]; then
+ gcc_add_paths /opt/gcc2
+ fi
+ echo "Using gcc version: $(gcc -dumpversion)"
+}
+
+# backward compatibility functions; currently still used in archspecs,
+# since they were part of sorcery before
+function use_gcc() {
+ real_using_gcc "$@"
+}
+function use_gcc2() {
+ real_using_gcc 2.95
+}
+
+#---------------------------------------------------------------------
+##
+## This software is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This software is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this software; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libgcc2 b/var/lib/sorcery/modules/libgcc2
deleted file mode 100755
index 26cda10..0000000
--- a/var/lib/sorcery/modules/libgcc2
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/bin/bash
-#---------------------------------------------------------------------
-##
-## @Synopsis Set of functions for dealing with the problem (hopefully a
-## @Synopsis temporary problem) of having to use both the gcc2 and gcc3
-## @Synopsis compilers.
-##
-## The migration to gcc3 will take place in the following steps:
-## <pre>
-## - The gcc spell will be updated to gcc 3
-## - gcc2 will be a new spell that installs gcc2 in /opt/gcc2.
-## - The gcc spell will have gcc2 as a dependency.
-## - Spells that will only compile with gcc3 will have a USEGCC2 file
-## in the spell directory.
-## - Sorcery will test for the existance of the USEGCC2 flag in a
-## spell's directory. If it's there, it will alter the environment
-## so that gcc2 is used for building the spell.
-## </pre>
-##
-## @Implementation These functions were added to allow the use of both the
gcc2 and
-## @Implementation gcc3 compiler at the same time within sorcery. The code
can be
-## @Implementation removed once only one compiler is supported.
-##
-##
-## @Copyright Copyright 2002 by the Source Mage Team
-##
-##
-#---------------------------------------------------------------------
-
-
-#---------------------------------------------------------------------
-## @param gcc version (digits and dots)
-## @return 0 if version of installed gcc contains the parameter as a
substring
-## @return 0 if the parameter is of the form "version+" and the version of
the
-## installed gcc is at least "version"
-## @return 1 otherwise
-#---------------------------------------------------------------------
-function use_gcc() {
- local needed_version=${1%+}
- local installed_version=$(gcc -dumpversion)
-
- if [[ $needed_version == $1 ]]; then
- grep -q $(esc_str $needed_version) <<< "$installed_version"
- else
- local i=0 needed_version2 installed_version2
- explode "$needed_version" . needed_version2
- explode "$installed_version" . installed_version2
-
- while [[ ${needed_version2[$i]} ]] || [[ ${installed_version2[$i]} ]]; do
- if [[ ${needed_version2[$i]:-0} == ${installed_version2[$i]:-0} ]];
then
- let i++
- continue
- fi
- # capturing the return value of arithmetic comparison inverts it
- return $(( ${needed_version2[$i]:-0} > ${installed_version2[$i]:-0} ))
- done
- fi
-}
-
-#---------------------------------------------------------------------
-## @return 0 if gcc 2.95 is being used to compile
-## @return 1 otherwise
-#---------------------------------------------------------------------
-function use_gcc2() {
-
- use_gcc 2.95.
-
-}
-
-#---------------------------------------------------------------------
-## @param path
-##
-## Alters the environment so that gcc2 will be used for compiling and
-## building spells when the "gcc" command is used.
-##
-#---------------------------------------------------------------------
-function gcc2_add_paths() {
-
- export PATH=$( envar_prepend_path $1/bin $PATH )
- export LD_LIBRARY_PATH=$( envar_prepend_path $1/lib $LD_LIBRARY_PATH )
- export LD_RUN_PATH=$( envar_prepend_path $1/lib $LD_RUN_PATH )
- export INFOPATH=$( envar_prepend_path $1/info $INFOPATH )
- export CPPFLAGS="-I $1/include $CPPFLAGS"
-
-}
-
-
-#---------------------------------------------------------------------
-##
-## Determines if gcc2 should be used for a spell. If so, it alters
-## the environment so that gcc2 is used for compilation.
-##
-#---------------------------------------------------------------------
-function invoke_gcc2() {
- [[ -f $SCRIPT_DIRECTORY/USEGCC2 ]] && gcc2_add_paths /opt/gcc2
- echo "Using gcc version: `gcc -dumpversion`"
-}
-
-
-#---------------------------------------------------------------------
-##
-## This software is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or
-## (at your option) any later version.
-##
-## This software is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this software; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##
-#---------------------------------------------------------------------



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (64352c292459ae6f42dd4369673321c15ce31178), Jaka Kranjc, 12/14/2008

Archive powered by MHonArc 2.6.24.

Top of Page