You are looking at historical revision 13553 of this page. It may differ significantly from its current revision.

setup-helper

Documentation

Shortcut routines providing common install process patterns of Chicken extensions.

A Chicken extension has the usage:

(require-extension EXTENSION-NAME)

or

(require-library EXTENSION-NAME)
...
(import EXTENSION-NAME)

Extension Information

EXTENSION-NAME is a string or symbol.

EXTENSION-VERSION is a string or number.

(Note - extension-name-and-version, extension-name and extension-version are actually part of the setup-api.)

extension-name-and-version

[parameter] (extension-name-and-version) => EXTENSION-NAME+VERSION
[parameter] (extension-name-and-version EXTENSION-NAME+VERSION)

EXTENSION-NAME+VERSION is a list of EXTENSION-NAME-STRING and EXTENSION-VERSION-STRING.

extension-name

[procedure] (extension-name) => EXTENSION-NAME-STRING

Returns the extension-name component of (extension-name-and-version).

extension-version

[procedure] (extension-version [DEFAULT-EXTENSION-VERSION]) => EXTENSION-VERSION-STRING

Returns the extension-version component of (extension-name-and-version). Should the extension-version be "" the DEFAULT-EXTENSION-VERSION is returned.

verify-extension-name

[procedure] (verify-extension-name EXTENSION-NAME)

Reports an error should chicken-install know the extension by a different name.

Filename Support

FILE is a string or symbol.

EXTENSION is a string or symbol.

DIRECTORY is as (make-pathname (pathname-directory DIRECTORY) (pathname-file DIRECTORY)).

FILENAME is as (make-pathname #f FILE [EXTENSION]).

PATHNAME is as (make-pathname DIRECTORY FILE [EXTENSION]).

filename

[procedure] (filename FILE [EXTENSION]) => FILENAME

Returns an filename for FILE and EXTENSION.

document-filename

[procedure] (document-filename FILE) => FILENAME

Returns a "html" filename for FILE.

source-filename

[procedure] (source-filename FILE) => FILENAME

Returns "scm" filename for FILE.

shared-library-filename

[procedure] (shared-library-filename FILE) => FILENAME

Returns a platform-specific dynamic-link-library filename for FILE.

shared-filename

[procedure] (shared-filename FILE) => FILENAME

Returns a platform-specific dynamic-load-file filename for FILE.

static-library-filename

[procedure] (static-library-filename FILE) => FILENAME

Returns a platform-specific static-link-library filename for FILE.

static-filename

[procedure] (static-filename FILE) => FILENAME

Returns a platform-specific object-file filename for FILE.

import-filename

[procedure] (import-filename FILE) => FILENAME

Returns an "import" filename for FILE.

source-import-filename

[procedure] (source-import-filename FILE) => FILENAME

Returns an "import.scm" filename for FILE.

shared-import-filename

[procedure] (shared-import-filename FILE) => FILENAME

Returns a platform-specific dynamic-load-file "import" filename for FILE.

inline-filename

[procedure] (inline-filename FILE) => FILENAME

Returns an "inline" filename for FILE.

program-filename

[procedure] (program-filename FILE) => FILENAME

Returns a platform-specific executable filename for FILE.

make-repository-pathname

[procedure] (make-repository-pathname FILE) => PATHNAME

Returns a pathname for FILE in the (chicken-repository).

File Support

copy-file-to-directory

[procedure] (copy-file-to-directory FILENAME DIRECTORY)

Copies the local file FILENAME to the {{DIRECTORY}.

copy-to-repository

[procedure] (copy-to-repository FILENAME)

Copies the local file FILENAME to the (chicken-repository).

copy-to-home

[procedure] (copy-to-home FILENAME)

Copies the local file FILENAME to the (chicken-home).

SRFI-29 Bundle Support

install-srfi-29-bundle

[procedure] (install-srfi-29-bundle EXTENSION-NAME [BUNDLE-SPECIFICATION-COMPONENT ...])

Copies the local srfi-29-bundle file to the srfi-29-bundle-directory.

See srfi-29 for BUNDLE-SPECIFICATION-COMPONENT discussion.

Compile Support

COMPILE-OPTION is any object acceptable as a compile option.

Compiles the source for EXTENSION-NAME to a compiled-extension.

default-static-compile-options

[parameter] (default-static-compile-options) => COMPILE-OPTION-LIST
[parameter] (default-static-compile-options COMPILE-OPTION-LIST)

default-shared-compile-options

[parameter] (default-shared-compile-options) => COMPILE-OPTION-LIST
[parameter] (default-shared-compile-options COMPILE-OPTION-LIST)

default-static-compile-options

[parameter] (default-import-compile-options) => COMPILE-OPTION-LIST
[parameter] (default-import-compile-options COMPILE-OPTION-LIST)

compile-static-extension

[procedure] (compile-static-extension EXTENSION-NAME [#:options COMPILE-OPTION-LIST])

Compiles to static-extension file with unit-name EXTENSION-NAME.

No linking is performed!

compile-shared-extension

[procedure] (compile-shared-extension EXTENSION-NAME [#:options COMPILE-OPTION-LIST])

Compiles to shared-extension file.

compile-shared-extension-module

[procedure] (compile-shared-extension-module EXTENSION-NAME [#:options COMPILE-OPTION-LIST])

Compiles to shared-extension and shared-import files.

Install Support

INSTALL-OPTION is any object acceptable as an install option.

Installs the compiled-extension for EXTENSION-NAME.

install-static-extension

[procedure] (install-static-extension EXTENSION-NAME EXTENSION-VERSION [#:options INSTALL-OPTION-LIST])

Installs a compiled-static-extension.

install-shared-extension

[procedure] (install-shared-extension EXTENSION-NAME EXTENSION-VERSION [#:options COMPILE-OPTION-LIST])

Installs a compiled-shared-extension.

install-shared-extension-module

[procedure] (install-shared-extension-module EXTENSION-NAME EXTENSION-VERSION [#:options COMPILE-OPTION-LIST])

Installs a compiled-shared-extension-module.

install-shared+static-extension-module

[procedure] (install-shared+static-extension-module EXTENSION-NAME EXTENSION-VERSION [#:options COMPILE-OPTION-LIST])

Installs a compiled-shared-extension-module and a compiled-static-extension.

Setup Support

COMPILE-OPTION-LIST is a list of COMPILE-OPTION.

INSTALL-OPTION-LIST is a list of INSTALL-OPTION.

Compiles & installs the extension for EXTENSION-NAME.

setup-static-extension

[procedure] (setup-static-extension EXTENSION-NAME EXTENSION-VERSION [#:compile-options COMPILE-OPTION-LIST] [#:install-options INSTALL-OPTION-LIST])

Compiles & installs a static-extension.

setup-shared-extension

[procedure] (setup-shared-extension EXTENSION-NAME EXTENSION-VERSION [#:compile-options COMPILE-OPTION-LIST] [#:install-options INSTALL-OPTION-LIST])

Compiles & installs a shared-extension.

setup-shared-extension-module

[procedure] (setup-shared-extension-module EXTENSION-NAME EXTENSION-VERSION [#:compile-options COMPILE-OPTION-LIST] [#:install-options INSTALL-OPTION-LIST])

Compiles & installs a shared-extension-module.

setup-shared+static-extension-module

[procedure] (setup-shared+static-extension-module EXTENSION-NAME EXTENSION-VERSION [#:shared-compile-options COMPILE-OPTION-LIST] [#:static-compile-options COMPILE-OPTION-LIST] [#:install-options INSTALL-OPTION-LIST])

Compiles & installs a shared-extension-module and a static-extension.

Usage

(include "setup-helper")

Examples

;;;; example.setup -*- Hen -*-

(include "setup-helper")

; Paranoid
(verify-extension-name "example")

(setup-shared-extension-module
  (extension-name) (extension-version)
  compile-options: '(-extend easyffi) install-options: '((syntax)))

Requirements

None

Notes

Probably should make this an extension module.

Bugs and Limitations

Author

kon lovett

Version history

1.0.0
Initial release.

License

Copyright (C) 2009 Kon Lovett. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.