Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/setup-helper|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 [[https://wiki.call-cc.org/chicken-projects/egg-index-5.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[tags: egg]] == 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 <parameter>(extension-name-and-version) => list</parameter> <parameter>(extension-name-and-version NAME+VERSION)</parameter> {{NAME+VERSION}} is {{(list NAME VERSION)}}. ==== extension-name <procedure>(extension-name) => string</procedure> Returns the {{extension-name}} component of {{(extension-name-and-version)}}. ==== extension-version <procedure>(extension-version [DEFAULT]) => string</procedure> 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 <procedure>(verify-extension-name NAME)</procedure> 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) => string</procedure> Returns the {{INSTALL-HOME}}. ==== installation-repository-path <procedure>(installation-repository-path) => string</procedure> Returns the {{INSTALL-REPOSITORY}}. ==== directory-separator? <procedure>(directory-separator? X) => boolean</procedure> Is {{X}} a directory separator? {{X}} is a {{string}}, {{character}}, or {{symbol}}. ==== filename <procedure>(filename FILE [EXTENSION]) => string</procedure> Returns a filename for {{FILE}} and {{EXTENSION}}. ==== make-directory-name <procedure>(make-directory-name DIRECTORY) => string</procedure> Returns a dirname, ensuring no trailing directory separator. {{DIRECTORY}} is a {{string}}, {{symbol}}, or a {{list}}. ==== document-filename <procedure>(document-filename FILE) => string</procedure> Returns a "html" filename for {{FILE}}. ==== source-filename <procedure>(source-filename FILE) => string</procedure> Returns "scm" filename for {{FILE}}. ==== shared-library-filename <procedure>(shared-library-filename FILE) => string</procedure> Returns a platform-specific dynamic-link-library filename for {{FILE}}. ==== shared-filename <procedure>(shared-filename FILE) => string</procedure> 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 <procedure>(static-library-filename FILE) => string</procedure> Returns a platform-specific static-link-library filename for {{FILE}}. ==== static-filename <procedure>(static-filename FILE) => string</procedure> Returns a platform-specific object-file filename for {{FILE}}. ==== import-filename <procedure>(import-filename FILE) => string</procedure> Returns an "import" filename for {{FILE}}. ==== source-import-filename <procedure>(source-import-filename FILE) => string</procedure> Returns an "import.scm" filename for {{FILE}}. ==== shared-import-filename <procedure>(shared-import-filename FILE) => string</procedure> Returns a platform-specific dynamic-load-file "import" filename for {{FILE}}. ==== inline-filename <procedure>(inline-filename FILE) => string</procedure> Returns an "inline" filename for {{FILE}}. ==== types-filename <procedure>(types-filename FILE) => string</procedure> Returns an "types" filename for {{FILE}}. ==== program-filename <procedure>(program-filename FILE) => string</procedure> Returns a platform-specific executable filename for {{FILE}}. ==== make-home-pathname <procedure>(make-home-pathname FILE) => string</procedure> Returns a pathname for {{FILE}} in the {{INSTALL-HOME}}. ==== make-repository-pathname <procedure>(make-repository-pathname FILE) => string</procedure> Returns a pathname for {{FILE}} in the {{INSTALL-REPOSITORY}}. ==== srfi-29-bundles-home <procedure>(srfi-29-bundles-home) => string</procedure> Returns 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) => string</procedure> 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 <procedure>(copy-file-relative FILENAME DIRECTORY)</procedure> Copies the file {{FILENAME}} to the {{DIRECTORY}}. The {{DIRECTORY}} be relative. ==== copy-file-absolute <procedure>(copy-file-absolute FILENAME DIRECTORY)</procedure> 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)</procedure> Copies the local file {{FILENAME}} to the ''{{(chicken-repository)}}''. ==== copy-to-home <procedure>(copy-to-home FILENAME)</procedure> 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)</procedure> 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?])</procedure> 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?])</procedure> Compiles to shared file. ==== compile-static-module <procedure>(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 <procedure>(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 <procedure>(install-in-repository FILENAME)</procedure> Like {{copy-to-repository}} but observes the ''no-install'' status. ==== install-in-home <procedure>(install-in-home FILENAME)</procedure> Like {{copy-to-home}} but observes the ''no-install'' status. ==== install-srfi-29-bundle <procedure>(install-srfi-29-bundle NAME [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 <procedure>(install-static-extension NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])</procedure> Installs a compiled-static-extension. ==== install-shared-extension <procedure>(install-shared-extension NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])</procedure> Installs a compiled-shared-extension. ==== install-static-extension-module <procedure>(install-static-extension-module NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])</procedure> Installs a compiled-static-extension-module. ==== install-shared-extension-module <procedure>(install-shared-extension-module NAME VERSION [#:options INSTALL-OPTIONS] [#:files FILENAMES])</procedure> Installs a compiled-shared-extension-module. ==== install-shared+static-extension-module <procedure>(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 <procedure>(install-extension-tag NAME VERSION)</procedure> 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])</procedure> 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])</procedure> 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])</procedure> 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])</procedure> 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])</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 <parameter>(default-static-compile-options) => list</parameter> <parameter>(default-static-compile-options COMPILE-OPTIONS)</parameter> Built-in is {{(-c -optimize-leaf-routines -inline)}}. ==== default-shared-compile-options <parameter>(default-shared-compile-options) => list</parameter> <parameter>(default-shared-compile-options COMPILE-OPTIONS)</parameter> Built-in is {{(-shared -optimize-leaf-routines -inline)}}. ==== default-import-compile-options <parameter>(default-import-compile-options) => list</parameter> <parameter>(default-import-compile-options COMPILE-OPTIONS)</parameter> 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> <parameter>(default-static-install-options INSTALL-OPTIONS)</parameter> ==== default-shared-install-options <parameter>(default-static-install-options) => list</parameter> <parameter>(default-static-install-options INSTALL-OPTIONS)</parameter> ==== default-static-module-install-options <parameter>(default-static-module-install-options) => list</parameter> <parameter>(default-static-module-install-options INSTALL-OPTIONS)</parameter> ==== default-shared-module-install-options <parameter>(default-shared-module-install-options) => list</parameter> <parameter>(default-shared-module-install-options INSTALL-OPTIONS)</parameter> ==== default-shared+static-module-install-options <parameter>(default-shared+static-module-install-options) => list</parameter> <parameter>(default-shared+static-module-install-options INSTALL-OPTIONS)</parameter> == Usage <enscript language=scheme> (use setup-helper-mod) </enscript> == Examples <enscript language=scheme> ;;;; 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))) </enscript> == Bugs and Limitations * The {{inline?}} parameter should be named {{global-inline?}}. * Static library support is incompletely tested. == Requirements [[test]] == Author [[/users/kon-lovett|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.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you add 1 to 18?