chickadee » setup-helper

Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

setup-helper

TOC »

Documentation

Shortcut routines providing common install process patterns of Chicken extensions.

Extension Information

NAME is a string or symbol. The name of the 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

extension-name-and-versionparameter
extension-name-and-version NAME+VERSIONparameter

NAME+VERSION is (list NAME VERSION).

extension-name

extension-nameprocedure

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

extension-version

extension-version #!optional DEFAULTprocedure

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

Should the (second (extension-name-and-version)) be empty the DEFAULT is returned.

verify-extension-name

verify-extension-name NAMEprocedure

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

Use when paranoid.

Filename Support

Makes stereotypical filenames & pathnames.

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]).

INSTALL-REPOSITORY is the installation Chicken repository directory.

INSTALL-HOME is the installation Chicken home directory.

CHICKEN-SOURCE-EXTENSION

CHICKEN-IMPORT-EXTENSION

CHICKEN-INLINE-EXTENSION

CHICKEN-TYPES-EXTENSION

HTML-EXTENSION

STATIC-ARCHIVE-EXTENSION

OBJECT-BINARY-EXTENSION

EXECUTABLE-EXTENSION

Values suitable for use as the EXT argument to make-pathname.

DIRECTORY-SEPARATOR

The platform specific directory separator string.

installation-chicken-home

installation-chicken-homeprocedure

Returns the INSTALL-HOME.

installation-repository-path

installation-repository-pathprocedure

Returns the INSTALL-REPOSITORY.

directory-separator?

directory-separator? Xprocedure

Is X a directory separator?

X is a string, character, or symbol.

filename

filename FILE #!optional EXTENSIONprocedure

Returns a filename for FILE and EXTENSION.

make-directory-name

make-directory-name DIRECTORYprocedure

Returns a dirname, ensuring no trailing directory separator.

DIRECTORY is a string, symbol, or a list.

document-filename

document-filename FILEprocedure

Returns a "html" filename for FILE.

source-filename

source-filename FILEprocedure

Returns "scm" filename for FILE.

shared-library-filename

shared-library-filename FILEprocedure

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

shared-filename

shared-filename FILEprocedure

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

Note this superfluous now as all shared binaries have the "so" extension.

static-library-filename

static-library-filename FILEprocedure

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

static-filename

static-filename FILEprocedure

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

import-filename

import-filename FILEprocedure

Returns an "import" filename for FILE.

source-import-filename

source-import-filename FILEprocedure

Returns an "import.scm" filename for FILE.

shared-import-filename

shared-import-filename FILEprocedure

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

inline-filename

inline-filename FILEprocedure

Returns an "inline" filename for FILE.

types-filename

types-filename FILEprocedure

Returns an "types" filename for FILE.

program-filename

program-filename FILEprocedure

Returns a platform-specific executable filename for FILE.

make-home-pathname

make-home-pathname FILEprocedure

Returns a pathname for FILE in the INSTALL-HOME.

make-repository-pathname

make-repository-pathname FILEprocedure

Returns a pathname for FILE in the INSTALL-REPOSITORY.

srfi-29-bundles-home

srfi-29-bundles-homeprocedure

Returns the root dirname for SRFI 29 bundles.

Please see the srfi-29 extension documentation.

make-srfi-29-bundle-directory-name

make-srfi-29-bundle-directory-name SPECprocedure

Returns the SRFI 29 bundle installation dirname for the supplied SPEC.

SPEC is a list BUNDLE-SPECIFICATION-COMPONENT....

Please see the srfi-29 extension documentation.

File Copy Support

Copy local file (local to the building egg directory) to some directory. These use the copy-file setup-api routine.

copy-file-relative

copy-file-relative FILENAME DIRECTORYprocedure

Copies the file FILENAME to the DIRECTORY. The DIRECTORY be relative.

copy-file-absolute

copy-file-absolute FILENAME DIRECTORYprocedure

Copies the file FILENAME to the DIRECTORY. Should the DIRECTORY be relative it will be coerced to absolute (by copy-file).

copy-to-repository

copy-to-repository FILENAMEprocedure

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

copy-to-home

copy-to-home FILENAMEprocedure

Copies the local file FILENAME to the directory (installation-prefix) share chicken. This is usually the same as (chicken-home).

file-chmod

file-chmod FILENAME MODEprocedure

Modifies the filemode of FILENAME to the MODE symbol.

MODE is a symbol form of the "chmod" mode syntax. Ex: 'a+rx

Correctly handles a true (sudo-install) mode.

Compile Support

Compiles the source-file NAME. NAME is the basename of the source-file.

COMPILE-OPTIONS is a (list-of COMPILE-OPTION ...). COMPILE-OPTION is any object acceptable as a compile option. The COMPILE-OPTIONS are always expanded in the compile command from the last position.

INLINE? is a boolean indicating whether a global inline file is created. The inline file is named (make-pathname #f NAME "inline"). Chicken 4.0.0+ only.

TYPES? is a boolean indicating whether a types database file is created. The types database file is named (make-pathname #f NAME "types"). Chicken 4.7.3+ only.

compile-static

(compile-static NAME [#:options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?])procedure

Compiles to object file with unit-name NAME.

No linking is performed!

compile-shared

(compile-shared NAME [#:options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?])procedure

Compiles to shared file.

compile-static-module

(compile-static-module NAME [#:options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?])procedure

Compiles to object file with unit-name NAME and import to shared file.

compile-shared-module

(compile-shared-module NAME [#:options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?])procedure

Compiles source and import to shared files.

Install Support

Installs the compiled-extension for NAME.

INSTALL-OPTION is any object acceptable as an install-extension command options list option.

INSTALL-OPTIONS is (list-of INSTALL-OPTION ...).

The INSTALL-OPTIONS is always expanded in the install-extension command options list in the last position.

FILENAMES is a (list-of FILENAME ...). These name local files (local to the building egg directory) that are to expanded in the install-extension command files list.

install-in-repository

install-in-repository FILENAMEprocedure

Like copy-to-repository but observes the no-install status.

install-in-home

install-in-home FILENAMEprocedure

Like copy-to-home but observes the no-install status.

install-srfi-29-bundle

install-srfi-29-bundle NAME #!optional BUNDLE-SPECIFICATION-COMPONENT...procedure

Copies the local SRFI 29 bundle to the (srfi-29-bundle-directory).

The bundle is a single file with NAME that may be at the bottom of a BUNDLE-SPECIFICATION-COMPONENT hierarchy.

Each directory in the BUNDLE-SPECIFICATION filesystem representation has a filemode of 'a+rx'. (non-windows only)

install-static-extension

(install-static-extension NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])procedure

Installs a compiled-static-extension.

install-shared-extension

(install-shared-extension NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])procedure

Installs a compiled-shared-extension.

install-static-extension-module

(install-static-extension-module NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])procedure

Installs a compiled-static-extension-module.

install-shared-extension-module

(install-shared-extension-module NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])procedure

Installs a compiled-shared-extension-module.

install-shared+static-extension-module

(install-shared+static-extension-module NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])procedure

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

install-extension-tag

install-extension-tag NAME VERSIONprocedure

Installs an empty extension with NAME and VERSION.

Setup Support

Compiles & installs the extension for NAME.

setup-static-extension

(setup-static-extension NAME VERSION [#:compile-options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?] [#:install-options INSTALL-OPTIONS] [#:files FILENAMES])procedure

Compiles & installs a static-extension.

setup-shared-extension

(setup-shared-extension NAME VERSION [#:compile-options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?] [#:install-options INSTALL-OPTIONS] [#:files FILENAMES])procedure

Compiles & installs a shared-extension.

setup-static-extension-module

(setup-static-extension-module NAME VERSION [#:compile-options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?] [#:install-options INSTALL-OPTIONS] [#:files FILENAMES])procedure

Compiles & installs a static-extension-module.

setup-shared-extension-module

(setup-shared-extension-module NAME VERSION [#:compile-options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?] [#:install-options INSTALL-OPTIONS] [#:files FILENAMES])procedure

Compiles & installs a shared-extension-module.

setup-shared+static-extension-module

(setup-shared+static-extension-module NAME VERSION [#:compile-options COMPILE-OPTIONS] [#:shared-compile-options COMPILE-OPTIONS] [#:static-compile-options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?] [#:install-options INSTALL-OPTIONS] [#:files FILENAMES])procedure

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

The COMPILE-OPTIONS, INLINE?, AND TYPES? are applied to both the shared and static builds. As such the -o|-output-file' option cannot be supported.

Parameters

Compile Support

These are always expanded in the comple command in the first position.

default-static-compile-options

default-static-compile-optionsparameter
default-static-compile-options COMPILE-OPTIONSparameter

Built-in is (-c -optimize-leaf-routines -inline).

default-shared-compile-options

default-shared-compile-optionsparameter
default-shared-compile-options COMPILE-OPTIONSparameter

Built-in is (-shared -optimize-leaf-routines -inline).

default-import-compile-options

default-import-compile-optionsparameter
default-import-compile-options COMPILE-OPTIONSparameter

Built-in is (-shared -optimize-leaf-routines -local -inline -no-trace -no-lambda-info).

Install Support

These are always expanded in the install-extension command options list in the first position.

default-static-install-options

default-static-install-optionsparameter
default-static-install-options INSTALL-OPTIONSparameter

default-shared-install-options

default-static-install-optionsparameter
default-static-install-options INSTALL-OPTIONSparameter

default-static-module-install-options

default-static-module-install-optionsparameter
default-static-module-install-options INSTALL-OPTIONSparameter

default-shared-module-install-options

default-shared-module-install-optionsparameter
default-shared-module-install-options INSTALL-OPTIONSparameter

default-shared+static-module-install-options

default-shared+static-module-install-optionsparameter
default-shared+static-module-install-options INSTALL-OPTIONSparameter

Usage

(use setup-helper-mod)

Examples

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

(use setup-helper-mod)

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

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

Bugs and Limitations

Requirements

test

Author

Kon Lovett

Version history

2.1.1
Needs tests.
2.1.0
-emit-inline-file suspended.
2.0.0
Include form removed.
1.5.5
Remove print statement.
1.5.4
Fix for filemode. [Bug #773]
1.5.3
Fix for deployment mode installation prefix. [Bug #904]
1.5.2
Fix for types filename generation.
1.5.1
Conditional expansion of types & inline. Fix consultation of inline & types info.
1.5.0
Added types generation support.
1.4.1
Fixed missing file.
1.4.0
Compiled version setup-helper-mod. Include form deprecated.
1.3.3
Remove -unboxing as default option.
1.3.2
Use 'repository-path' function (Ticket #722). Install in (repository-path) & (chicken-home) (Ticket #722 & Ticket #773).
1.3.1
Added "static module". Fix for setup-shared+static-extension-module not installing the static object file.
1.3.0
Deprecated copy-file-to-directory. Documented more of the exposed API.
1.2.0
Add install-in-home & install-in-repository. install-srfi-29-bundle observes no-install status.
1.1.4
Fix for 'copy-to-home' when '(installation-prefix)' is #f. [Ivan Raikov]
1.1.3
Fix for 'copy-to-home' when '(chicken-home)' is not proper location of ".../share/chicken". [Ivan Raikov]
1.1.2
Need for explicit use of "setup-api". [Ivan Raikov]
1.1.1
Fix for SRFI 29 bundle directory support.
1.1.0
Added 'install-extension-tag'.
1.0.0
Initial release.

License

Copyright (C) 2009-2016 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.

Contents »