Skip to Content.
Sympa Menu

sm-sorcery-bugs - [SM-Sorcery-Bugs] [Bug 8463] Build system selection

sm-sorcery-bugs AT lists.ibiblio.org

Subject: Bugs for Sorcery are reported here

List archive

Chronological Thread  
  • From: bugzilla-daemon AT bugs.sourcemage.org
  • To: sm-sorcery-bugs AT lists.ibiblio.org
  • Subject: [SM-Sorcery-Bugs] [Bug 8463] Build system selection
  • Date: Fri, 23 Sep 2005 19:59:50 -0700 (PDT)

http://bugs.sourcemage.org/show_bug.cgi?id=8463


acedit AT armory.com changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |grimoire AT sourcemage.org




------- Additional Comments From acedit AT armory.com 2005-09-23 19:59 -------
how about variables in DETAILS for each major phase whose contents is a
function
name:
PRE_BUILD_CMD=custom_pre_build
BUILD_CMD=jam_build
INSTALL_CMD=default_install
FINAL_CMD=custom_final

We could expand that beyond the build system to other pipelines like depends
resolution, dispel, etc.

When going to run a spell file, sorcery would then check if the variable is
defined, if it is execute the contents, if not, check for the relavent file -x
and finally calling its own default function. Spell writers could come up with
their own various build systems in grimoire libraries and combine them as they
see fit. As build system functions mature they could be migrated to more
permanent locations.

Other cool things could happen such as the hook doing some pre-actions (adjust
gcc versions, do some workaround, etc) then calling the spell file if its -x
or
the default_ function. This would give spell writers a lot more power and
control over common tasks without having to add spell files all over the
place.
For example, adjusting the gcc used in a spell could be done by:

GCC_VERSION=3.4
DEPENDS_CMD="gcc_depends
PRE_BUILD_CMD=gcc_pre_build

Then in FUNCTIONS
gcc_depends() {
case $GCC_VERSION in
3.4) depends gcc34 ;;
3.3) depends gcc33 ;;
*) echo "Unknown gcc version"; return 1 ;;
esac &&
if test -x $SCRIPT_DIRECTORY/DEPENDS; then
source $SCRIPT_DIRECTORY/DEPENDS
fi
}

gcc_pre_build() {
invoke_gcc &&
if test -x $SCRIPT_DIRECTORY/PRE_BUILD; then
source $SCRIPT_DIRECTORY/PRE_BUILD
else
default_pre_build
fi
}

Another example would be to eliminate BUILD when the only thing that needs
setting OPTS.

BUILD_CMD="opts_default_build ${SPELL}_OPTS"

function opts_default_build() {
eval OPTS="$OPTS \"\$$1\""
default_build
}
That would put a (presumably persistent) variable named after the spell into
OPTS, then run the usual build.

--
Configure bugmail: http://bugs.sourcemage.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




Archive powered by MHonArc 2.6.24.

Top of Page