source: project/chicken/branches/prerelease/manual/chicken-setup @ 9424

Last change on this file since 9424 was 9424, checked in by Ivan Raikov, 12 years ago

Merged with trunk

File size: 25.3 KB
Line 
1[[tags: manual]]
2[[toc:]]
3
4== chicken-setup
5
6=== Extension libraries
7
8Extension libraries (''eggs'') are extensions to the core
9functionality provided by the basic CHICKEN system, to be built and
10installed separately.  The mechanism for loading compiled extensions
11is based on dynamically loadable code and as such is only available on
12systems on which loading compiled code at runtime is
13supported. Currently these are most UNIX-compatible platforms that
14provide the {{libdl}} functionality like Linux, Solaris, BSD, Mac OS X
15and Windows using Cygwin.
16
17Note: Extension may also be normal applications or shell scripts, but
18are usually libraries.
19
20{{chicken-setup}} will download the source code for extension
21automatically from the canonical server at
22[[http://www.call-with-current-continuation.org/eggs]] if the
23requested egg does not exist in the current directory. Various
24command-line options exist for customizing the process and/or
25retrieving the egg from other locations or in other formats.
26
27
28=== Installing extensions
29
30To install an extension library, run the {{chicken-setup}} program
31with the extension name as argument. The extension archive is
32downloaded, its contents extracted and the contained ''setup'' script
33is executed. This setup script is a normal Scheme source file, which
34will be interpreted by {{chicken-setup}}. The complete language
35supported by {{csi}} is available, and the library units {{srfi-1
36regex utils posix tcp}} are loaded. Additional libraries can be loaded
37at run-time.
38
39The setup script should perform all necessary steps to build the new
40library (or application). After a successful build, the extension can
41be installed by invoking one of the procedures {{install-extension}},
42{{install-program}} or {{install-script}}.  These procedures will copy
43a number of given files into the extension repository or in the path
44where the CHICKEN executables are located (in the case of executable
45programs or scripts). Additionally the list of installed files, and
46user-defined metadata is stored in the repository.
47
48If no extension name is given on the command-line, and if none of the
49options {{-list}}, {{-version}}, {{-repository}} (without argument),
50{{-program-path}} (without argument), {{-fetch}}, {{-fetch-tree}} or
51{{-docindex}} is given, then all {{.setup}} scripts in the current
52directory are processed.
53
54
55=== Creating extensions
56
57Extensions can be created by creating an (optionally gzipped) {{tar}}
58archive named {{EXTENSION.egg}} containing all needed files plus a
59{{.setup}} script in the root directory.  After {{chicken-setup}} has
60extracted the files, the setup script will be invoked. There are no
61additional constraints on the structure of the archive, but the setup
62script has to be in the root path of the archive.
63
64
65=== Procedures and macros available in setup scripts
66
67==== install-extension
68
69 (install-extension ID FILELIST [INFOLIST])
70
71Installs the extension library with the name {{ID}}. All files given in the list of strings
72{{FILELIST}} will be copied to the extension repository. It should be noted here that
73the extension id has to be identical to the name of the file implementing the extension. The
74extension may load or include other files, or may load other extensions at runtime specified
75by the {{require-at-runtime}} property.
76
77{{FILELIST}} may be a filename, a list of filenames, or a list of pairs of
78the form {{(SOURCE DEST)}} (if you want to copy into a particular sub-directory - the
79destination directory will be created as needed). If {{DEST}} is a relative pathname,
80< it will be copied into the extension repository.
81
82The optional argument {{INFOLIST}} should be an association list that
83maps symbols to values, this list will be stored as {{ID.setup-info}} at the same
84location as the extension code. Currently the following properties are used:
85
86===== syntax
87
88 [extension property] (syntax)
89
90Marks the extension as syntax-only. No code is compiled, the extension is intended
91as a file containing macros to be loaded at compile/macro-expansion time.
92
93===== require-at-runtime
94
95 [extension property] (require-at-runtime ID ...)
96
97Specifies extensions that should be loaded (via {{require}}) at runtime. This is mostly
98useful for syntax extensions that need additional support code at runtime.
99
100===== version
101
102 [extension property] (version STRING)
103
104Specifies version string.
105
106===== documentation
107
108 [extension property] (documentation FILENAME)
109
110The filename of a HTML document containing extension-specific documentation.
111This file should be given in the file-list passed to {{install-extension}} and
112a link to it will be automatically included in the index page (accessible via
113{{chicken-setup -docindex}}).
114
115===== examples
116
117 [extension property] (examples FILENAME ...)
118
119Copies the given files into the examples directory, which is usually
120{{$prefix/share/chicken/examples}}
121or {{(make-pathname (chicken-home) "examples")}}).
122
123Note that the files listed in this property should not be listed in the normal
124list of files to install passed to {{install-extension}}. This is the only
125exception - other files that are installed in the repository must be given
126in the file list.
127
128===== exports
129
130 [extension property] (exports EXPORT ...)
131
132Add export-information to the generated extension-information. {{EXPORT}} may be
133a symbol naming an exported toplevel variable or a string designating a file with
134exported variables, as generated by the {{-emit-exports}} option or the
135{{emit-exports}} declaration specifier.
136
137===== static
138
139 [extension property] (static STRING)
140
141If the extension also provides a static library, then STRING should
142contain the name of that library. Used by {{csc}} when compiling with
143the {{-static-extensions}} option.
144
145===== static-options
146
147 [extension property] (static-options STRING)
148
149Additional options that should be passed to the linker when linking
150with the static version of an extension (see {{static}} above). Used
151by {{csc}} when compiling with the {{-static-extensions}} option.
152
153All other properties are currently ignored. The {{FILELIST}} argument may also be a single
154string.
155
156==== install-program
157
158 [procedure] (install-program ID FILELIST [INFOLIST])
159
160Similar to {{install-extension}}, but installs an executable program in the
161executable path (usually {{/usr/local/bin}}).
162
163==== install-script
164
165 [procedure] (install-script ID FILELIST [INFOLIST])
166
167Similar to {{install-program}}, but additionally changes the file permissions of all
168files in {{FILELIST}} to executable (for installing shell-scripts).
169
170
171==== run
172
173 [syntax] (run FORM ...)
174
175Runs the shell command {{FORM}}, which is wrapped in an implicit {{quasiquote}}.
176{{(run (csc ...))}} is treated specially and passes {{-v}} (if {{-verbose}} has been given
177to {{chicken-setup}}) and {{-feature compiling-extension}} options to the compiler.
178
179==== compile
180
181 [syntax] (compile FORM ...)
182
183Equivalent to {{(run (csc FORM ...))}}.
184
185==== make
186
187 [syntax] (make ((TARGET (DEPENDENT ...) COMMAND ...) ...) ARGUMENTS)
188
189A ''make'' macro that executes the expressions {{COMMAND ...}}, when any of the dependents
190{{DEPENDENT ...}} have changed, to build {{TARGET}}. This is the same as the {{make}}
191extension, which is available separately. For more information, see
192[[http://www.call-with-current-continuation.org/eggs/make.html|make]].
193
194
195==== patch
196
197 [procedure] (patch WHICH REGEX SUBST)
198
199Replaces all occurrences of the regular expression {{REGEX}} with the string {{SUBST}},
200in the file given in {{WHICH}}. If {{WHICH}} is a string, the file will be patched and
201overwritten. If {{WHICH}} is a list of the form {{OLD NEW}}, then a different file named
202{{NEW}} will be generated.
203
204==== copy-file
205
206 [procedure] (copy-file FROM TO)
207
208Copies the file or directory (recursively) given in the string {{FROM}} to the destination
209file or directory {{TO}}.
210
211==== move-file
212
213 [procedure] (move-file FROM TO)
214
215Moves the file or directory (recursively) given in the string {{FROM}} to the destination
216file or directory {{TO}}.
217
218==== remove-file*
219
220 [procedure] (remove-file* PATH)
221
222Removes the file or directory given in the string {{PATH}}.
223
224
225==== find-library
226
227 [procedure] (find-library NAME PROC)
228
229Returns {{#t}} if the library named {{libNAME.[a|so]}} (unix) or {{NAME.lib}} (windows)
230could be found by compiling and linking a test program. {{PROC}} should be the name of a
231C function that must be provided by the library. If no such library was found or the function could not
232be resolved, {{#f}} is returned.
233
234==== find-header
235
236 [procedure] (find-header NAME)
237
238Returns {{#t}} if a C include-file with the given name is available, or {{#f}} otherwise.
239
240==== try-compile
241
242 [procedure] (try-compile CODE #!key cc cflags ldflags compile-only c++)
243
244Returns {{#t}} if the C code in {{CODE}} compiles and links successfully, or {{#f}} otherwise.
245The keyword parameters {{cc}} (compiler name, defaults to the C compiler used to build this system),
246{{cflags}} and {{ldflags}} accept additional compilation and
247linking options. If {{compile-only}} is true, then no linking step takes place.
248If the keyword argument {{c++}} is given and true, then the code will be compiled in C++ mode.
249
250
251==== create-directory
252
253 [procedure] (create-directory PATH)
254
255Creates the directory given in the string {{PATH}}, with all parent directories as needed.
256
257
258==== chicken-prefix
259
260 [parameter] chicken-prefix
261
262The installation prefix specified when CHICKEN was built.
263
264==== installation-prefix
265
266 [parameter] installation-prefix
267
268An alternative installation prefix that will be prepended to extension
269installation paths if specified. It is set by the {{-install-prefix}}
270option or environment variable {{CHICKEN_INSTALL_PREFIX}}.
271
272==== program-path
273
274 [parameter] (program-path [PATH])
275
276Holds the path where executables are installed and defaults to either {{$CHICKEN_PREFIX/bin}},
277if the environment variable {{CHICKEN_PREFIX}} is set or the
278path where the CHICKEN binaries ({{chicken}}, {{csi}}, etc.) are installed.
279
280
281==== setup-root-directory
282
283 [parameter] (setup-root-directory [PATH])
284
285Contains the path of the directory where {{chicken-setup}} was invoked.
286
287==== setup-build-directory
288
289 [parameter] (setup-build-directory [PATH])
290
291Contains the path of the directory where the extension is built. This is not necessarily identical
292to {{setup-root-directory}}.
293
294
295==== setup-verbose-flag
296
297 [parameter] (setup-verbose-flag [BOOL])
298
299Reflects the setting of the {{-verbose}} option, i.e. is {{#t}}, if {{-verbose}} was
300given.
301
302
303==== setup-install-flag
304
305 [parameter] (setup-install-flag [BOOL])
306
307Reflects the setting of the {{--no-install}} option, i.e. is {{#f}}, if {{-no-install}} was
308given.
309
310==== required-chicken-version
311
312 [procedure] (required-chicken-version VERSION)
313
314Signals an error if the version of CHICKEN that this script runs under is lexicographically less than
315{{VERSION}} (the argument will be converted to a string, first).
316
317
318==== required-extension-version
319
320 [procedure] (required-extension-version EXTENSION1 VERSION1 ...)
321
322Checks whether the extensions {{EXTENSION1 ...}} are installed and at least of version {{VERSION1 ...}}.
323The test is made by lexicographically comparing the string-representations of the given version with the version
324of the installed extension. If one of the listed extensions is not installed, has no associated version information
325or is of a version older than the one specified.
326
327
328==== cross-chicken
329
330 [procedure] (cross-chicken)
331
332Returns {{#t}} if this system is configured for cross-compilation or {{#f}}
333otherwise.
334
335
336==== host-extension
337
338 [parameter] host-extension
339
340For a cross-compiling CHICKEN, when compiling an extension, then it
341should be built for the host environment (as opposed to the target
342environment). This parameter is controlled by the {{-host-extension}} command-line
343option. A setup script should perform the proper steps of compiling any
344code by passing {{-host}} when invoking {{csc}} or using the {{compile}}
345macro.
346
347
348=== Examples for extensions
349
350The simplest case is a single file that does not export any syntax. For example
351
352<enscript highlight=scheme>
353;;;; hello.scm
354
355(define (hello name)
356  (print "Hello, " name " !") )
357</enscript>
358
359We need a {{.setup}} script to build and install our nifty extension:
360
361<enscript highlight=scheme>
362;;;; hello.setup
363
364;; compile the code into a dynamically loadable shared object
365;; (will generate hello.so)
366(compile -s hello.scm)
367
368;; Install as extension library
369(install-extension 'hello "hello.so")
370</enscript>
371
372After entering
373
374 $ chicken-setup hello
375
376at the shell prompt (and in the same directory where the two files
377exist), the file {{hello.scm}} will be compiled into a dynamically
378loadable library. If the compilation succeeds, {{hello.so}} will
379be stored in the repository, together with a file named
380{{hello.setup-info}} containing an a-list with metadata.
381If no extension name is given to {{chicken-setup}}, it will simply
382execute the first file with the {{.setup}} extension it can find.
383
384Use it like any other CHICKEN extension:
385
386 $ csi -q
387 #;1> (require-extension hello)
388 ; loading /usr/local/lib/chicken/1/hello.so ...
389 #;2> (hello "me")
390 Hello, me!
391 #;3>
392
393Here we create a simple application:
394
395<enscript highlight=scheme>
396;;;; hello2.scm
397
398(print "Hello, ")
399(for-each (lambda (x) (printf "~A " x)) (command-line-arguments))
400(print "!")
401</enscript>
402
403We also need a setup script:
404
405<enscript highlight=scheme>
406;;;; hello2.setup
407
408(compile hello2.scm)  ; compile `hello2'
409(install-program 'hello2 "hello2") ; name of the extension and files to be installed
410</enscript>
411
412To use it, just run {{chicken-setup}} in the same directory:
413
414 $ chicken-setup
415
416(Here we omit the extension name)
417
418Now the program {{hello2}} will be installed in the same location as
419the other CHICKEN tools (like {{chicken}}, {{csi}}, etc.), which will
420normally be {{/usr/local/bin}}.  Note that you need write-permissions
421for those locations and may have to run {{chicken-setup}} with
422administrative rights.
423
424Uninstallation is just as easy:
425
426 $ chicken-setup -uninstall hello2
427
428{{chicken-setup}} provides a {{make}} macro, so build operations can
429be of arbitrary complexity. When running {{chicken-setup}} with an
430argument {{NAME}}, for which no associated file {{NAME.setup}},
431{{NAME.egg}} or {{NAME.scm}} exists will ask you to download the
432extension via HTTP from the default URL
433[[http://www.call-with-current-continuation.org/eggs]]. You can use
434the {{-host}} option to specify an alternative source
435location. Extensions that are required to compile and/or use the
436requested extension are downloaded and installed automatically.
437
438If the given extension name contains a path prefix and the {{-host}}
439option is given, then {{chicken-setup}} can also download and install
440eggs from an arbitrary HTTP server. Alternatively you can pass a full
441URL (including the {{http://}} prefix. Note that no dependency checks
442are done when downloading eggs directly with the URL syntax.
443
444Finally a somewhat more complex example: We want to package a syntax
445extension with additional support code that is to be loaded at
446run-time of any Scheme code that uses that extension. We create a
447''glass'' lambda, a procedure with free variables that can be
448manipulated from outside:
449
450<enscript highlight=scheme>
451;;;; glass.scm
452
453(define-macro (glass-lambda llist vars . body)
454  ;; Low-level macros are fun!
455  (let ([lvar (gensym)]
456        [svar (gensym)]
457        [x (gensym)]
458        [y (gensym)]
459        [yn (gensym)] )
460    `(let ,(map (lambda (v) (list v #f)) vars)
461       (define (,svar ,x . ,y)
462         (let* ([,yn (pair? ,y)]
463                [,y (and ,yn (car ,y))] )
464           (case ,x
465             ,@(map (lambda (v)
466                      `([,v] (if ,yn
467                                 (set! ,v ,y)
468                                 ,v) ) )
469                    vars)
470             (else (error "variable not found" ,x)) ) ) )
471       (define ,lvar (lambda ,llist ,@body))
472       (extend-procedure ,lvar ,svar) ) ) )
473</enscript>
474
475Here some support code that needs to be loaded at runtime:
476
477<enscript highlight=scheme>
478;;;; glass-support.scm
479
480(require-extension lolevel)
481
482(define glass-lambda-accessor procedure-data)
483(define (glass-lambda-ref gl v) ((procedure-data gl) v))
484(define (glass-lambda-set! gl v x) ((procedure-data gl) v x))
485</enscript>
486
487The setup script looks like this:
488
489<enscript highlight=scheme>
490(compile -s glass-support.scm)
491
492(install-extension
493  'glass
494  '("glass.scm" "glass-support.so")
495  '((syntax) (require-at-runtime glass-support)) )
496</enscript>
497
498The invocation of {{install-extension}} provides the files that are to
499be copied into the extension repository, and a metadata list that
500specifies that the extension {{glass}} is a syntax extension and that,
501if it is declared to be used by other code (either with the
502{{require-extension}} or {{require-for-syntax}} form), then client
503code should perform an implicit {{(require 'glass-support)}} at
504startup.
505
506This can be conveniently packaged as an ''egg'':
507
508 $ tar cfz glass.egg glass.setup glass.scm glass-support.scm
509
510And now we use it:
511
512 $ chicken-setup glass
513 $ csi -quiet
514 #;1> (require-extension glass)
515 ; loading /usr/local/lib/chicken/1/glass.scm ...
516 ; loading /usr/local/lib/chicken/1/glass-support.so ...
517 #;2> (define foo (glass-lambda (x) (y) (+ x y)))
518 #;3> (glass-lambda-set! foo 'y 99)
519 #;4> (foo 33)
520 132
521=== chicken-setup reference
522
523Available options:
524
525; {{-h  -help}} : Show usage information and exit.
526; {{-V  -version}} : Display version and exit.
527; {{-R  -repository [PATHNAME]}} : When used without an argument, the path of the extension repository is displayed on standard output. When given an argument, the repository pathname (and the {{repository-path}} parameter) will be set to {{PATHNAME}} for all subsequent operations. The default repository path is the installation library directory (usually {{/usr/local/lib/chicken}}), or (if set) the directory given in the environment variable {{CHICKEN_REPOSITORY}}. {{PATHNAME}} should be an absolute pathname.
528; {{-P  -program-path [PATHNAME]}} : When used without an argument, the path for executables is displayed on standard output. When given an argument, the program path for installing executables and scripts will be set to {{PATHNAME}} for all subsequent operations. {{PATHNAME}} should be an absolute pathname.
529; {{-h  -host HOSTNAME[:PORT]}} : Specifies alternative host for downloading extensions, optionally with a TCP port number (which defaults to 80).
530; {{-u  -uninstall EXTENSION}} : Removes all files that were installed for {{EXTENSION}} from the file-system, together with any metadata that has been stored.
531; {{-l  -list [NAME ...]}} : List all installed extensions or show extension information.
532; {{-r  -run FILENAME}} : Load and execute given file.
533; {{-s  -script FILENAME}} :Executes the given Scheme source file with all remaining arguments and exit. The ''she-bang'' shell script header is recognized, so you can write Scheme scripts that use {{chicken-setup}} just as with {{csi}}.
534; {{-e  -eval EXPRESSION}} : Evaluates the given expression(s)
535; {{-v  -verbose}} : Display additional debug information
536; {{-k  -keep}} : Keep temporary files and directories
537; {{-c  -csc-option OPTION}} : Passes {{OPTION}} as an extra argument to invocations of the compiler-driver ({{csc}}); this works only if {{csc}} is invoked as {{(run (csc ...))}}
538; {{-d  -dont-ask}} : Do not ask the user before trying to download required extensions
539; {{-n  -no-install}} : Do not install generated binaries and/or support files; any invocations of {{install-program}}, {{install-extension}} or {{install-script}} will be be no-ops
540; {{-i  -docindex}} : Displays the path to the index-page of any installed extension-documentation; if the index page does not exist, it is created
541; {{-t  -test EXTENSION ...}} : return success if all given extensions are installed
542; {{-ls EXTENSION}} : List installed files for extension
543; {{-fetch-tree}} : Download and print the repository catalog
544; {{-create-tree DIRECTORY}} : Create a fresh, minimal repository catalog and writes it to stdout
545; {{-t  -test}} : If the extension sources contain a directory named {{tests}} and this directory includes a file named {{run.scm}} then this file is executed (with {{tests}} being the current working directory)
546; {{-tree FILENAME}} : Download and show the repository catalog
547; {{-svn URL}} : Fetch extension from [[http://subversion.tigris.org|Subversion]] repository
548; {{-revision REV}} : Specifies SVN revision to check out
549; {{-local PATHNAME}} : Fetch extension from local file
550; {{-install-prefix PATHNAME}} : Specify alternative installation prefix (for packaging)
551; {{-host-extension}} : Compile extension in "host" mode (sets the parameter {{host-extension}} to {{#f}})
552; {{-build-prefix PATHNAME}} : Location where chicken-setup will create egg build directories  (default: the value of environment variable CHICKEN_TMPDIR, or {{/tmp/chicken-{MAJOR-VERSION-build-{USER}}}})
553; {{-download-path PATHNAME}} : Location where chicken-setup will save downloaded files  (default: {{build-prefix/downloads}})
554; {{--}} : Ignore all following arguments
555
556Note that the options are processed exactly in the order in which they appear in the command-line.
557
558
559=== Windows notes
560
561{{chicken-setup}} works on Windows, when compiled with Visual C++, but
562depends on the {{tar}} and {{gunzip}} tools to extract the contents of
563an egg. The best way is to download an egg either manually (or with
564{{chicken-setup -fetch}}) and extract its contents with a separate
565program (like {{winzip}}). the {{CHICKEN_REPOSITORY}} environment
566variable has to be set to a
567directory where your compiled extensions should be located.
568
569The {{.setup}} scripts will not always work under Windows, and the
570extensions may require libraries that are not provided for Windows or
571work differently. Under these circumstances it is recommended to
572perform the required steps to build an extension manually.
573
574The required UNIX tools are also available as Windows binaries.
575Google or ask on the CHICKEN mailing list if you need help locating
576them.
577
578
579=== Security
580
581When extensions are downloaded and installed one is executing code
582from potentially compromised systems. This applies also when {{chicken-setup}}
583executes system tests for required extensions. As the code has been
584retrieved over the network effectively untrusted code is going to be
585evaluated. When {{chicken-setup}} is run as ''root'' the whole system
586is at the mercy of the build instructions (note that this is also
587the case every time you install software via {{sudo make install}}, so this
588is not specific to the CHICKEN extension mechanism).
589
590Security-conscious users should never run {{chicken-setup}} as root.
591A simple remedy is to set the environment variable {{CHICKEN_REPOSITORY}},
592which will transparently place the repository at an arbitrary user-selected
593location. Alternatively obtain write/execute access to the default location
594of the repository (usually {{/usr/local/lib/chicken}}) to avoid running
595as root.
596
597
598=== Other modes of installation
599
600It is possible to install extensions directly from a
601[[http://subversion.tigris.org|Subversion]] repository or from a local
602checkout by using the {{-svn}} or {{-local}} options. By using
603either the {{svn}} client program (which must be installed) or
604file-system operations, all necessary files will be copied into the
605current directory (creating a subdirectory named
606{{EXTENSIONNAME.egg-dir}}), built and subsequently installed.
607
608Dependency information, which is necessary to ensure required
609extensions are also installed, is downloaded automatically.  If you
610have no internet connection or don't want to connect, you can also use
611a local file containing the necessary dependency information.  The
612{{-fetch-tree}} option retrieves the canonical ''repository file'' at
613[[http://www.call-with-current-continuation.org/eggs/repository]],
614writing it to stdout. Redirecting this output into a file and passing
615the file via the {{-tree}} option to {{chicken-setup}} allows you now
616to use the local repository file:
617
618Retrieve complete extension repository (big):
619
620 % cd /opt
621 % svn co https://galinha.ucpel.tche.br/svn/chicken-eggs/release/3 eggs
622
623Get your own copy of the repository file:
624
625 % chicken-setup -fetch-tree >~/my-repository-file
626
627Now you can install eggs from your local checkout, with full
628dependency tracking and without being connected to the internet:
629
630 % cd ~/tmp
631 % chicken-setup -local /opt/eggs -tree ~/my-repository-file opengl
632
633
634=== Linking extensions statically
635
636The compiler and [[chicken-setup]] support statically linked
637eggs. The general approach is to generate an object file or static
638library (in addition to the usual
639shared library) in your {{.setup}} script and install it along with the
640dynamically loadable extension. The setup properties {{static}}
641should contain the name of the object file (or static library) to be
642linked, when {{csc}} gets passed the {{-static-extensions}} option:
643
644<enscript highlight=scheme>
645(compile -s -O2 -d1 my-ext.scm)   ; dynamically loadable "normal" version
646(compile -c -O2 -d1 my-ext -unit my-ext)  ; statically linkable version
647(install-extension
648  'my-ext
649  '("my-ext.so" "my-ext.o")
650  '((static "my-ext.o")) )
651</enscript>
652
653Note the use of the {{-unit}} option in the second compilation step: static
654linking must use static library units. {{chicken-setup}} will perform
655platform-dependent file-extension translation for the file list, but does currently
656not do that for the {{static}} extension property.
657
658To actually link with the static version of {{my-ext}}, do:
659
660 % csc -static-extensions my-program.scm -uses my-ext
661
662The compiler will try to do the right thing, but can not handle all
663extensions, since the ability to statically link eggs is relatively
664new. Eggs that support static linking are designated as being able to
665do so. If you require a statically linkable version of an egg that has
666not been converted yet, contact the extension author or the CHICKEN
667mailing list.
668
669
670Previous: [[Interface to external functions and variables]]
671
672Next: [[Data representation]]
Note: See TracBrowser for help on using the repository browser.