<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=GB2312" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I made this:<br>
<br>
<tt>(module pre-installer mzscheme<br>
(require (lib "setup-extension.ss" "make")<br>
(lib "compile.ss" "dynext")<br>
(lib "link.ss" "dynext")<br>
(lib "file.ss"))<br>
<br>
(define (pre-installer plthome roos-dir)<br>
(display (format "Pre installing c-roos.c ~%"))<br>
(display (format " plthome = ~a ~%" plthome))<br>
(display (format " roos-dir = ~a ~%" roos-dir))<br>
(pre-install plthome<br>
(build-path roos-dir)<br>
"c-roos.c"<br>
(build-path roos-dir)<br>
;; header subdirs<br>
(list)<br>
;; unix libs<br>
(list)<br>
;; windows libs<br>
(list)<br>
;; unix extra libs (assume always there)<br>
null<br>
;; Windows extra libs (assume always there)<br>
null<br>
;; Extra depends:<br>
(list "c-roos.scm")<br>
;; Last-chance k:<br>
(lambda (k) (k))<br>
;; 3m, too:<br>
#t))</tt><br>
<tt><br>
(provide pre-installer))<br>
</tt><br>
<br>
Chongkai Zhu schreef:
<blockquote cite="mid200512282130.jBSLU4fo022114@pegasus" type="cite">
<pre wrap="">As I understood the doc (and my experience to package my collection both as a normal
.plt file or through PLaneT), you do NOT need any makefile, but only need to write
some easy Scheme code:
In "info.ss":
(define pre-install-collection "installer.ss")
and create a "installer.ss<a class="moz-txt-link-rfc2396E" href="file:(moduleinstallermzscheme(require(lib">" file:
(module installer mzscheme
(require (lib "</a>setup-extension.ss" "make"))
(provide pre-installer)
(define (pre-installer PLTHOME)
(pre-install PLTHOME
(collection-path "collection-name")
"c-file-name.c"
PLTHOME
'()
'()
'()
'()
'()
'()
(lambda (t) (t)))))
then just make the .plt file by
mze --collection
or
PLaneT --create-archive
</pre>
<blockquote type="cite">
<pre wrap="">Thanks for your fast reply. I setup a info.ss file for ROOS and was able
to create a package that works, using:
(from the makfile:)
planet: plt
@echo "A collection package has been made to be distributed using planet"
#planet: scms docs precompile
# $(PLANET) --create-archive $(PREFIX)/$(PACKAGE)
plt: scms docs precompile
$(MZC) --all-users --collection-plt roos-$(VERSION).plt roos
#$(MZC) --collection-plt roos-$(VERSION).plt roos
precompile:
$(MZC) --cc c-roos.c
$(MZC) --ld c-roos$(SHL) c-roos.obj
mkdir -p $(PREFIX)/$(PACKAGE)/$(MZSCHEME_PRECOMP_DIR)
cp c-roos$(SHL) $(PREFIX)/$(PACKAGE)/$(MZSCHEME_PRECOMP_DIR)
collects: zos
@if [ ! -d $(PREFIX)/roos ];then echo "Please install roos package
first";exit 1;fi
$(MZC) --collection-extension roos
zos: scms
$(MZC) --collection-zos roos
scms:
mkdir -p $(PREFIX)/$(PACKAGE)
cp roos.scm $(PREFIX)/$(PACKAGE)/roos.scm
cp c-roos.c $(PREFIX)/$(PACKAGE)/c-roos.c
cp c-roos.scm $(PREFIX)/$(PACKAGE)/c-roos.scm
cp pre-installer.ss $(PREFIX)/$(PACKAGE)/pre-installer.ss
cat info.ss | sed -e s/__VERSION__/$(VERSION)/g
</pre>
<blockquote type="cite">
<pre wrap="">$(PREFIX)/$(PACKAGE)/info.ss
</pre>
</blockquote>
<pre wrap="">docs:
spod2html --indent-toc-with-spaces=4 --stylesheet=roos.css
doc/roos_manual.pod roos_manual.html
mkdir -p $(PREFIX)/$(PACKAGE)/html
cp roos_manual.html $(PREFIX)/$(PACKAGE)/html/index.html
-dos2unix $(PREFIX)/$(PACKAGE)/html/index.html
cp doc/style.css $(PREFIX)/$(PACKAGE)/html/roos.css
cp doc.txt $(PREFIX)/$(PACKAGE)/doc.txt
However, *planet --create-archive <dir>* doesn't seem to generate a
package that
can be used to compile (or use the pre-compiled) c-roos.c.
Another question: Is it advisable to (at least for WIN32) add a
pre-compiled variant
of c sources or will they be mzscheme version specific?
</pre>
</blockquote>
<pre wrap=""><!---->
I can't fully understood you question. Compiled C file (.dll under WIN32)
is mzscheme version specific. C source file is not mzscheme version specific
(but PLT v20x and v30x are not compatible). What's your intention to add
the "variant"?
</pre>
<blockquote type="cite">
<pre wrap="">Thanks in advance for your answers,
Hans Oesterholt-Dijkema
Chongkai Zhu schreef:
</pre>
<blockquote type="cite">
<pre wrap="">_setup-extension.ss_
--------------------
[index entry: _Setup PLT compile extension_]
The "setup-extension.ss" library helps compile C code via Setup PLT's
"pre-install" phase (triggered by a `pre-installer' item in "info.ss";
see the "setup" collection for further information).
</pre>
<blockquote type="cite">
<pre wrap="">I believe that question was answered here before.
The answer is : YES.
Please refer to "Documentation for the Make collection" in the help
disk for details.
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
I recently posted a question about using PlaNET with C modules.
I'm not quite sure if it is supported or not. Can someone point
out if it is possible to include C parts in a planet package and
get it automatically compiled on requiring the planet package?
Thanks in advance for your answers,
Hans
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>