LL Decade の会場の場所をチェックするなど。
.msi なインストーラーパッケージが。
Windows .msi available for Rakudo Star 2012.07 | rakudo.org
Windows .msi available for Rakudo Star 2012.07
Posted on 2012.07.30 by pmichaud
I'm pleased to announce that starting with the current Rakudo Star release (2012.07), we will now
be providing Windows .msi distributions with precompiled binaries for Rakudo Star. The .msi
distribution is available in the same location as other Rakudo Star releases, at
https://github.com/rakudo/star/downloads/ .
On this site, on IRC, and at YAPC::NA 2012 I heard many people comment that Windows users really
wanted a binary install option. We've occasionally done .msi and .exe installers for Rakudo Star
releases in the past, but didn't have any dedicated tools or sufficient environments to be able
to produce them consistently each month. So, this month I dedicated some time to create scripts
and tools that can automate much of the process of building .msi distributions from the Rakudo
Star release tarballs. Over the next couple of weeks I will be documenting the process so that
others can hopefully follow it as well. With the new tools in place I think we'll be able to
consistently provide Rakudo .msi distributions within a few days (if not hours) of each monthly
tarball release.
(ry)
Enjoy!
やっぱ要望あったのね。> binary install option
gawk の拡張ライブラリの仕様が以前のものとは変わったけど固まりつつあるとか聞いて
ちょっと眺めてみた。
/*
* ext.c - Builtin function that links external gawk functions and related
* utilities.
*
* Christos Zoulas, Thu Jun 29 17:40:41 EDT 1995
* Arnold Robbins, update for 3.1, Mon Nov 23 12:53:39 EST 1998
*/
/*
* Copyright (C) 1995 - 2001, 2003-2012 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
*
* GAWK 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 3 of the License, or
* (at your option) any later version.
*
* GAWK 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 program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "awk.h"
#ifdef DYNAMIC
#include <dlfcn.h>
/* do_ext --- load an extension at run-time: interface to load_ext */
NODE *
do_ext(int nargs)
{
NODE *obj, *fun, *ret = NULL;
SRCFILE *s;
extern SRCFILE *srcfiles;
fun = POP_STRING();
obj = POP_STRING();
s = add_srcfile(SRC_EXTLIB, obj->stptr, srcfiles, NULL, NULL);
if (s != NULL)
ret = load_ext(s->fullpath, fun->stptr, obj);
DEREF(obj);
DEREF(fun);
if (ret == NULL)
ret = dupnode(Nnull_string);
return ret;
}
/* load_ext --- load an external library */
NODE *
load_ext(const char *lib_name, const char *init_func, NODE *obj)
{
NODE *tmp = NULL;
NODE *(*func)(NODE *, void *);
void *dl;
int flags = RTLD_LAZY;
int *gpl_compat;
if (do_sandbox)
fatal(_("extensions are not allowed in sandbox mode"));
if (do_traditional || do_posix)
fatal(_("`extension' is a gawk extension"));
#ifdef RTLD_GLOBAL
flags |= RTLD_GLOBAL;
#endif
if ((dl = dlopen(lib_name, flags)) == NULL)
fatal(_("extension: cannot open library `%s' (%s)\n"), lib_name,
dlerror());
/* Per the GNU Coding standards */
gpl_compat = (int *) dlsym(dl, "plugin_is_GPL_compatible");
if (gpl_compat == NULL)
fatal(_("extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"),
lib_name, dlerror());
func = (NODE *(*)(NODE *, void *)) dlsym(dl, init_func);
if (func == NULL)
fatal(_("extension: library `%s': cannot call function `%s' (%s)\n"),
lib_name, init_func, dlerror());
if (obj == NULL) {
obj = make_string(lib_name, strlen(lib_name));
tmp = (*func)(obj, dl);
unref(tmp);
unref(obj);
return NULL;
}
tmp = (*func)(obj, dl);
return tmp;
}
/* make_builtin --- register name to be called as func with a builtin body */
void
make_builtin(const char *name, NODE *(*func)(int), int count)
{
NODE *symbol, *f;
INSTRUCTION *b;
const char *sp;
char c;
sp = name;
if (sp == NULL || *sp == '\0')
fatal(_("extension: missing function name"));
while ((c = *sp++) != '\0') {
if ((sp == &name[1] && c != '_' && ! isalpha((unsigned char) c))
|| (sp > &name[1] && ! is_identchar((unsigned char) c)))
fatal(_("extension: illegal character `%c' in function name `%s'"), c, name);
}
f = lookup(name);
if (f != NULL) {
if (f->type == Node_func) {
/* user-defined function */
fatal(_("extension: can't redefine function `%s'"), name);
} else if (f->type == Node_ext_func) {
/* multiple extension() calls etc. */
if (do_lint)
lintwarn(_("extension: function `%s' already defined"), name);
return;
} else
/* variable name etc. */
fatal(_("extension: function name `%s' previously defined"), name);
} else if (check_special(name) >= 0)
fatal(_("extension: can't use gawk built-in `%s' as function name"), name);
if (count < 0)
fatal(_("make_builtin: negative argument count for function `%s'"),
name);
b = bcalloc(Op_symbol, 1, 0);
b->builtin = func;
b->expr_count = count;
/* NB: extension sub must return something */
symbol = install_symbol(estrdup(name, strlen(name)), Node_ext_func);
symbol->code_ptr = b;
}
/* get_argument --- get the i'th argument of a dynamically linked function */
NODE *
get_argument(int i)
{
NODE *t;
int arg_count, pcount;
INSTRUCTION *pc;
pc = TOP()->code_ptr; /* Op_ext_builtin instruction */
pcount = (pc + 1)->expr_count; /* max # of arguments */
arg_count = pc->expr_count; /* # of arguments supplied */
if (i < 0 || i >= pcount || i >= arg_count)
return NULL;
t = PEEK(arg_count - i);
if (t->type == Node_param_list)
t = GET_PARAM(t->param_cnt);
if (t->type == Node_array_ref)
t = t->orig_array;
if (t->type == Node_var) /* See Case Node_var in setup_frame(), eval.c */
return Nnull_string;
/* Node_var_new, Node_var_array or Node_val */
return t;
}
/* get_actual_argument --- get the i'th scalar or array argument of a
dynamically linked function, allowed to be optional.
*/
NODE *
get_actual_argument(int i, bool optional, bool want_array)
{
NODE *t;
char *fname;
int pcount;
INSTRUCTION *pc;
pc = TOP()->code_ptr; /* Op_ext_builtin instruction */
fname = (pc + 1)->func_name;
pcount = (pc + 1)->expr_count;
t = get_argument(i);
if (t == NULL) {
if (i >= pcount) /* must be fatal */
fatal(_("function `%s' defined to take no more than %d argument(s)"),
fname, pcount);
if (! optional)
fatal(_("function `%s': missing argument #%d"),
fname, i + 1);
return NULL;
}
if (t->type == Node_var_new) {
if (want_array)
return get_array(t, false);
else {
t->type = Node_var;
t->var_value = dupnode(Nnull_string);
return t->var_value;
}
}
if (want_array) {
if (t->type != Node_var_array)
fatal(_("function `%s': argument #%d: attempt to use scalar as an array"),
fname, i + 1);
} else {
if (t->type != Node_val)
fatal(_("function `%s': argument #%d: attempt to use array as a scalar"),
fname, i + 1);
}
assert(t->type == Node_var_array || t->type == Node_val);
return t;
}
そういやこのチェックがどうのって以前に見かけたなあ
gpl_compat = (int *) dlsym(dl, "plugin_is_GPL_compatible");
インタープリターをバイトコードマシンに変更しているので
(この変更は3.7→3.8で入ったものだけど)、
拡張ライブラリの関数呼び出しのところが確かに変わってる。
そういやこのコメントは
/* Per the GNU Coding standards */
gpl_compat = (int *) dlsym(dl, "plugin_is_GPL_compatible");
if (gpl_compat == NULL)
if の条件式の中で代入しないで分けるってことを言ってるのかな
(たしかそういう規則があったはず)。
LL Decade の会場ではあの出版社やらあの出版社の出張販売があるだろうから
(割引とノベルティつき)、アレとかアレはそこで買うか。
あとは翌週の薄い本祭りでどれだけ使うかだなあ。