Changeset 2970 in project for wiki/chicken-setup


Ignore:
Timestamp:
02/01/07 17:20:10 (14 years ago)
Author:
felix winkelmann
Message:

wiki/doc update, chicken updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/chicken-setup

    r2904 r2970  
    601601
    602602
     603=== Linking extensions statically
     604
     605The compiler and [[chicken-setup]] support statically linked
     606eggs. The general approach is to generate an object file or static
     607library (in addition to the usual
     608shared library) in your {{.setup}} script and install it along with the
     609dynamically loadable extension. The setup properties {{static}}
     610should contain the name of the object file (or static library) to be
     611linked, when {{csc}} gets passed the {{-static-extensions}} option:
     612
     613<enscript highlight=scheme>
     614(compile -s -O2 -d1 my-ext.scm)   ; dynamically loadable "normal" version
     615(compile -c -O2 -d1 my-ext -unit my-ext)  ; statically linkable version
     616(install-extension
     617  'my-ext
     618  '("my-ext.so" "my-ext.o")
     619  '((static "my-ext.o")) )
     620</enscript>
     621
     622Note the use of the {{-unit}} option in the second compilation step: static
     623linking must use static library units. {{chicken-setup}} will perform
     624platform-dependent file-extension translation for the file list, but does currently
     625not do that for the {{static}} extension property.
     626
     627To actually link with the static version of {{my-ext}}, do:
     628
     629 % csc -static-extensions my-program.scm -uses my-ext
     630
     631The compiler will try to do the right thing, but can not handle all
     632extensions, since the ability to statically link eggs is relatively
     633new. Eggs that support static linking are designated as being able to
     634do so. If you require a statically linkable version of an egg that has
     635not been converted yet, contact the extension author or the CHICKEN
     636mailing list.
     637
     638
    603639Previous: [[Interface to external functions and variables]]
    604640
Note: See TracChangeset for help on using the changeset viewer.