Skip to Content.
Sympa Menu

sm-discuss - Re: Re: [SM-Discuss] Persistence wiki

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Andrew <afrayedknot AT thefrayedknot.armory.com>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: Re: [SM-Discuss] Persistence wiki
  • Date: Mon, 23 Aug 2004 14:21:46 -0700

On Mon, Aug 23, 2004 at 08:59:56PM -0000, evraire AT tuwg.com wrote:
> Hello,
>
> Eric Sandalle said:
> > If we could have default_build have CONF_OPTS (or whatever) passed to
> > ./configure, then we could have CONFIGURE just use CONF_OPTS="neat stuff"
> > and
> > not need extra BUILD files. Would this be too much work for the gain?
> > Should
> > spells just do the OPTS="$OPTS $CONF_OPTS" in BUILD when they need it and
> > add
> > CONF_OPTS to persistent_add where they want?
>
> My recent (brief) foray into spell writing had me annoyed at needing to
> provide a BUILD file simply to add items to the ./configure command. It
> would certainly be convenient for spell writers to have an easier, well
> defined method of doing this from within CONFIGURE.
I agree, and thats what we're working on :)

> This whole idea of adding another specially defined variable seems like a
> bit of a hack to me. Wouldn't a cleaner interface be something like an
> add_configure_switch() function in sorcery, that accepts a string to append
> to the configure command?

How is it a hack? What do you think add_configure_switch would do? It
would make another variable in yet another obscure place and then
somewhere we would have to take that magic variable and append it to
the options in super secret place to make it seem transparent.

It would basically amount to
function add_configure_switch() {
persistent_add __SUPER_DUPER_OBSCURE_HIDDEN_OPTS
__SUPER_DUPER_OBSCURE_HIDDEN_OPTS="$__SUPER_DUPER_OBSCURE_HIDDEN_OPTS $1"
}
Then somewhere before BUILD doing an append.

The only other choices we have add way too much complexity for the scale
of this problem. For instance we could start storing the junk in yet
another special file then pull it out of that file and append it to the
options. Thats a lot more work than i plan on doing.

Besides we already have a very good api for defining variables through the
persistence api I see no reason not to use make full use of it. Its
almost transparent to just say

config_query_option CONF_OPTS "Use X ?" y "--with-x" "--without-x"
config_query_option CONF_OPTS "Use jpeg ?" y "--with-jpeg"
"--do-not-use-jpeg"
...

As opposed to
if query "Use X ?" y ; then
add_configure_switch --with-x
else
add_configure_switch --without-x
fi

if query "Use jpeg ?" y; then
add_configure_switch "--with-jpeg"
else
add_configure_switch "--do-not-use-jpeg"
fi
...

We'd end up providing another query wrapper to do all that when you've
already got one in config_query_option CONF_OPTS.

I strongly advocate using the config_query* api, its simple, clean.
and reduces spell complexity. It also is extensible like this, we can
define some variables with special meaning as time goes on rather than
making overly complex functions for special purposes and dealing with
missing functions in the case of spell/sorcery out of sync problems.

Theres really nothing bad about it IMO so long as we document that
CONF_OPTS has this special meaning.

-Andrew


--
__________________________________________________________________________
|Andrew D. Stitt | astitt at sourcemage.org |
|irc: afrayedknot | afrayedknot at t.armory.com |
|aim: thefrayedknot or iteratorplusplus | |
|Sorcery Team Lead, Porting Team Lead | |
|Grimoire Guru ham/smgl | ftp://t.armory.com |
|Author and Maintainer of Prometheus | |
--------------------------------------------------------------------------




Archive powered by MHonArc 2.6.24.

Top of Page