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
- Outdated egg!
- setup-helper
- Documentation
- Extension Information
- Filename Support
- CHICKEN-SOURCE-EXTENSION
- CHICKEN-IMPORT-EXTENSION
- CHICKEN-INLINE-EXTENSION
- CHICKEN-TYPES-EXTENSION
- HTML-EXTENSION
- STATIC-ARCHIVE-EXTENSION
- OBJECT-BINARY-EXTENSION
- EXECUTABLE-EXTENSION
- DIRECTORY-SEPARATOR
- installation-chicken-home
- installation-repository-path
- directory-separator?
- filename
- make-directory-name
- document-filename
- source-filename
- shared-library-filename
- shared-filename
- static-library-filename
- static-filename
- import-filename
- source-import-filename
- shared-import-filename
- inline-filename
- types-filename
- program-filename
- make-home-pathname
- make-repository-pathname
- srfi-29-bundles-home
- make-srfi-29-bundle-directory-name
- File Copy Support
- Compile Support
- Install Support
- Setup Support
- Parameters
- Usage
- Examples
- Bugs and Limitations
- Requirements
- Author
- Version history
- License
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
[parameter] (extension-name-and-version) => list[parameter] (extension-name-and-version NAME+VERSION)
NAME+VERSION is (list NAME VERSION).
extension-name
[procedure] (extension-name) => stringReturns the extension-name component of (extension-name-and-version).
extension-version
[procedure] (extension-version [DEFAULT]) => stringReturns 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
[procedure] (verify-extension-name NAME)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
[procedure] (installation-chicken-home) => stringReturns the INSTALL-HOME.
installation-repository-path
[procedure] (installation-repository-path) => stringReturns the INSTALL-REPOSITORY.
directory-separator?
[procedure] (directory-separator? X) => booleanIs X a directory separator?
X is a string, character, or symbol.
filename
[procedure] (filename FILE [EXTENSION]) => stringReturns a filename for FILE and EXTENSION.
make-directory-name
[procedure] (make-directory-name DIRECTORY) => stringReturns a dirname, ensuring no trailing directory separator.
DIRECTORY is a string, symbol, or a list.
document-filename
[procedure] (document-filename FILE) => stringReturns a "html" filename for FILE.
source-filename
[procedure] (source-filename FILE) => stringReturns "scm" filename for FILE.
shared-library-filename
[procedure] (shared-library-filename FILE) => stringReturns a platform-specific dynamic-link-library filename for FILE.
shared-filename
[procedure] (shared-filename FILE) => stringReturns a platform-specific dynamic-load-file filename for FILE.
Note this superfluous now as all shared binaries have the "so" extension.
static-library-filename
[procedure] (static-library-filename FILE) => stringReturns a platform-specific static-link-library filename for FILE.
static-filename
[procedure] (static-filename FILE) => stringReturns a platform-specific object-file filename for FILE.
import-filename
[procedure] (import-filename FILE) => stringReturns an "import" filename for FILE.
source-import-filename
[procedure] (source-import-filename FILE) => stringReturns an "import.scm" filename for FILE.
shared-import-filename
[procedure] (shared-import-filename FILE) => stringReturns a platform-specific dynamic-load-file "import" filename for FILE.
inline-filename
[procedure] (inline-filename FILE) => stringReturns an "inline" filename for FILE.
types-filename
[procedure] (types-filename FILE) => stringReturns an "types" filename for FILE.
program-filename
[procedure] (program-filename FILE) => stringReturns a platform-specific executable filename for FILE.
make-home-pathname
[procedure] (make-home-pathname FILE) => stringReturns a pathname for FILE in the INSTALL-HOME.
make-repository-pathname
[procedure] (make-repository-pathname FILE) => stringReturns a pathname for FILE in the INSTALL-REPOSITORY.
srfi-29-bundles-home
[procedure] (srfi-29-bundles-home) => stringReturns the root dirname for SRFI 29 bundles.
Please see the srfi-29 extension documentation.
make-srfi-29-bundle-directory-name
[procedure] (make-srfi-29-bundle-directory-name SPEC) => stringReturns 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
[procedure] (copy-file-relative FILENAME DIRECTORY)Copies the file FILENAME to the DIRECTORY. The DIRECTORY be relative.
copy-file-absolute
[procedure] (copy-file-absolute FILENAME DIRECTORY)Copies the file FILENAME to the DIRECTORY. Should the DIRECTORY be relative it will be coerced to absolute (by copy-file).
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 directory (installation-prefix) share chicken. This is usually the same as (chicken-home).
file-chmod
[procedure] (file-chmod FILENAME MODE)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
[procedure] (compile-static NAME [#:options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?])Compiles to object file with unit-name NAME.
No linking is performed!
compile-shared
[procedure] (compile-shared NAME [#:options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?])Compiles to shared file.
compile-static-module
[procedure] (compile-static-module NAME [#:options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?])Compiles to object file with unit-name NAME and import to shared file.
compile-shared-module
[procedure] (compile-shared-module NAME [#:options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?])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
[procedure] (install-in-repository FILENAME)Like copy-to-repository but observes the no-install status.
install-in-home
[procedure] (install-in-home FILENAME)Like copy-to-home but observes the no-install status.
install-srfi-29-bundle
[procedure] (install-srfi-29-bundle NAME [BUNDLE-SPECIFICATION-COMPONENT...])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
[procedure] (install-static-extension NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])Installs a compiled-static-extension.
install-shared-extension
[procedure] (install-shared-extension NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])Installs a compiled-shared-extension.
install-static-extension-module
[procedure] (install-static-extension-module NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])Installs a compiled-static-extension-module.
install-shared-extension-module
[procedure] (install-shared-extension-module NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])Installs a compiled-shared-extension-module.
install-shared+static-extension-module
[procedure] (install-shared+static-extension-module NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])Installs a compiled-shared-extension-module and a compiled-static-extension.
install-extension-tag
[procedure] (install-extension-tag NAME VERSION)Installs an empty extension with NAME and VERSION.
Setup Support
Compiles & installs the extension for NAME.
setup-static-extension
[procedure] (setup-static-extension NAME VERSION [#:compile-options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?] [#:install-options INSTALL-OPTIONS] [#:files FILENAMES])Compiles & installs a static-extension.
setup-shared-extension
[procedure] (setup-shared-extension NAME VERSION [#:compile-options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?] [#:install-options INSTALL-OPTIONS] [#:files FILENAMES])Compiles & installs a shared-extension.
setup-static-extension-module
[procedure] (setup-static-extension-module NAME VERSION [#:compile-options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?] [#:install-options INSTALL-OPTIONS] [#:files FILENAMES])Compiles & installs a static-extension-module.
setup-shared-extension-module
[procedure] (setup-shared-extension-module NAME VERSION [#:compile-options COMPILE-OPTIONS] [#:inline? INLINE?] [#:types? TYPES?] [#:install-options INSTALL-OPTIONS] [#:files FILENAMES])Compiles & installs a shared-extension-module.
setup-shared+static-extension-module
[procedure] (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])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
[parameter] (default-static-compile-options) => list[parameter] (default-static-compile-options COMPILE-OPTIONS)
Built-in is (-c -optimize-leaf-routines -inline).
default-shared-compile-options
[parameter] (default-shared-compile-options) => list[parameter] (default-shared-compile-options COMPILE-OPTIONS)
Built-in is (-shared -optimize-leaf-routines -inline).
default-import-compile-options
[parameter] (default-import-compile-options) => list[parameter] (default-import-compile-options COMPILE-OPTIONS)
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
[parameter] (default-static-install-options) => list[parameter] (default-static-install-options INSTALL-OPTIONS)
default-shared-install-options
[parameter] (default-static-install-options) => list[parameter] (default-static-install-options INSTALL-OPTIONS)
default-static-module-install-options
[parameter] (default-static-module-install-options) => list[parameter] (default-static-module-install-options INSTALL-OPTIONS)
default-shared-module-install-options
[parameter] (default-shared-module-install-options) => list[parameter] (default-shared-module-install-options INSTALL-OPTIONS)
default-shared+static-module-install-options
[parameter] (default-shared+static-module-install-options) => list[parameter] (default-shared+static-module-install-options INSTALL-OPTIONS)
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
- The inline? parameter should be named global-inline?.
- Static library support is incompletely tested.
Requirements
Author
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.