~ chicken-core (master) /csc.mdoc
Trap1.\" Copyright (c) 2007-2022, The CHICKEN Team2.\" All rights reserved.3.\"4.\" Redistribution and use in source and binary forms, with or without5.\" modification, are permitted provided that the following conditions6.\" are met:7.\" 1. Redistributions of source code must retain the above copyright8.\" notice, this list of conditions and the following disclaimer.9.\" 2. Redistributions in binary form must reproduce the above copyright10.\" notice, this list of conditions and the following disclaimer in the11.\" documentation and/or other materials provided with the distribution.12.\" 3. The name of the authors may not be used to endorse or promote products13.\" derived from this software without specific prior written permission.14.\"15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.18.\" IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.25.\"26.\"27.Dd Apr 26, 201728.Dt CSC 129.Os30.Sh NAME31.Nm csc32.Nd driver program for the CHICKEN Scheme compiler33.Sh SYNOPSIS34.Nm35.Op Ar OPTION ...36.Op Ar FILENAME ...37.Sh DESCRIPTION38.Nm39is a program that invokes the CHICKEN compiler and the host systems C compiler to generate40an executable from a Scheme source file or C files generated by CHICKEN.41.Pp42.Ar FILENAME43is a Scheme source file name with optional extension or a C/C++/Objective-C source,44object or library file name with extension.45.Ar OPTION46may be one of the following:47.Pp48General options:49.Bl -tag -width Ds50.It Fl h , Fl help51Display usage text and exit.52.It Fl v , Fl verbose53Show compiler notes and tool-invocations.54.It Fl vv55Display information about translation progress.56.It Fl vvv57Display information about all compilation stages.58.It Fl version59Display Scheme compiler version and exit.60.It Fl release61Display release number and exit.62.El63.Pp64File and pathname options:65.Bl -tag -width Ds66.It Fl o Ar FILENAME , Fl output-file Ar FILENAME67Specifies target executable name.68.It Fl I Ar PATHNAME , Fl include-path Ar PATHNAME69Specifies alternative path for included files.70.It Fl to-stdout71Write compiler to stdout72.Po implies -t Pc .73.It Fl s , Fl shared , Fl dynamic74Generate dynamically loadable shared object file.75.El76.Pp77Language options:78.Bl -tag -width Ds79.It Fl D Ar SYMBOL , Fl feature Ar SYMBOL80Register feature identifier.81.It Fl no-feature Ar SYMBOL82Disable builtin feature identifier.83.It Fl c++84Compile via a C++ source file85.Pq .cpp .86.It Fl objc87Compile via Objective-C source file88.Pq \&.m .89.El90.Pp91Syntax related options:92.Bl -tag -width Ds93.It Fl i , Fl case-insensitive94Don't preserve case of read symbols.95.It Fl K , Fl keyword-style Ar STYLE96Enable alternative keyword-syntax97.Po prefix, suffix or none Pc .98.It Fl no-parentheses-synonyms99Disables list delimiter synonyms.100.It Fl no-symbol-escape101Disables support for escaped symbols.102.It Fl r7rs-syntax103Disables the CHICKEN extensions to R7RS syntax.104.It Fl compile-syntax105Macros are made available at run-time.106.It Fl j Ar MODULE , Fl emit-import-library Ar MODULE107Write compile-time module information into separate file.108.It Fl J , Fl emit-all-import-libraries109Emit import-libraries for all defined modules.110.It Fl no-compiler-syntax111Disable expansion of compiler-macros.112.It Fl m Ar NAME , Fl module Ar NAME113Wrap compiled code in module of the given name.114.It Fl M , Fl module-registration115Always generate module registration code, even when import libraries are emitted.116.It Fl N , Fl no-module-registration117Do not generate module registration code. Overrides118.Fl module-registration .119.El120.Pp121Translation options:122.Bl -tag -width Ds123.It Fl x , Fl explicit-use124Do not use units125.Sq library126and127.Sq eval128by default.129.It Fl P , Fl check-syntax130Stop compilation after macro-expansion.131.It Fl A , Fl analyze-only132Stop compilation after first analysis pass.133.El134.Pp135Debugging options:136.Bl -tag -width Ds137.It Fl w , Fl no-warnings138Disable warnings.139.It Fl d0 , Fl d1 , Fl d2 , Fl d3 , Fl debug-level Ar NUMBER140Set level of available debugging information.141.It Fl no-trace142Disable rudimentary debugging information.143.It Fl profile144Executable emits profiling information.145.It Fl accumulate-profile146Executable emits profiling information in append mode.147.It Fl profile-name Ar FILENAME148Name of the generated profile information file.149.It Fl types Ar FILENAME150Load additional type database.151.El152.Pp153Optimization options:154.Bl -tag -width Ds155.It Fl O , Fl optimize-level Ar NUMBER156Enable certain sets of optimization options.157.Bd -filled -offset indent158.It Fl O0159No optimization160.Po equivalent to Fl no-usual-integrations Fl no-compiler-syntax Pc .161.It Fl O1162Minimal optimization163.Po equivalent to Fl optimize-leaf-routines Fl merge-reusable-closures Pc .164.It Fl O2 No (Default)165Enable optimizations that do not break standard compliance166.Po equivalent to Fl optimize-leaf-routines Fl inline Fl lfa2 Fl merge-reusable-closures Fl merge-shareable-closures Pc .167.It Fl O3168Maximal optimization, while still "safe"169.Po equivalent to Fl optimize-leaf-routines Fl local Fl inline Fl lfa2 Fl inline-global Fl specialize Fl merge-reusable-closures Fl merge-shareable-closures Pc .170.It Fl O4171Maximal optimization, "unsafe"172.Po equivalent to Fl optimize-leaf-routines Fl local Fl inline Fl lfa2 Fl inline-global Fl specialize Fl unsafe Fl merge-reusable-closures Fl merge-shareable-closures Pc .173.It Fl O5174All possible optimizations, "unsafe"175.Po equivalent to Fl optimize-leaf-routines Fl block Fl inline Fl lfa2 Fl inline-global Fl specialize Fl unsafe Fl disable-interrupts Fl no-trace Fl no-lambda-info Fl merge-reusable-closures Fl merge-shareable-closures Pc .176.Ed177.It Fl optimize-leaf-routines178Enable leaf routine optimization.179.It Fl no-usual-integrations180Standard procedures may be redefined.181.It Fl u , Fl unsafe182Disable safety checks.183.It Fl local184Assume globals are only modified in current file.185.It Fl b , Fl block186Enable block-compilation.187.It Fl disable-interrupts188Disable interrupts in compiled code.189.It Fl f , Fl fixnum-arithmetic190Assume all numbers are fixnums.191.It Fl disable-stack-overflow-checks192Disables detection of stack-overflows.193.It Fl inline194Enable inlining.195.It Fl inline-limit Ar LIMIT196Set inlining threshold.197.It Fl inline-global198Enable cross-module inlining.199.It Fl specialize200Perform type-based specialization of primitive calls.201.It Fl oi Ar FILENAME , Fl emit-inline-file Ar FILENAME202Generate file with globally inlinable procedures203.Po implies Fl inline Fl local Pc .204.It Fl consult-inline-file Ar FILENAME205Explicitly load inline file.206.It Fl ot Ar FILENAME , Fl emit-types-file Ar FILENAME207Write type-declaration information into file.208.It Fl no-argc-checks209Disable argument count checks.210.It Fl no-bound-checks211Disable bound variable checks.212.It Fl no-procedure-checks213Disable procedure call checks.214.It Fl no-procedure-checks-for-usual-bindings215Disable procedure call checks only for usual bindings.216.It Fl no-procedure-checks-for-toplevel-bindings217Disable procedure call checks for toplevel bindings.218.It Fl strict-types219Assume variable do not change their type.220.It Fl lfa2221Perform additional lightweight flow-analysis pass.222.It Fl unroll-limit Ar LIMIT223Specifies inlining limit for self-recursive calls.224.It Fl merge-reusable-closures225Enables closure reuse.226.It Fl merge-shareable-closures227Enables closure sharing.228.El229.Pp230Configuration options:231.Bl -tag -width Ds232.It Fl unit Ar NAME233Compile file as a library unit.234.It Fl uses Ar NAME235Declare library unit as used.236.It Fl heap-size Ar NUMBER237Specifies heap-size of compiled executable.238.It Fl nursery Ar NUMBER Fl stack-size Ar NUMBER239Specifies nursery size of compiled executable.240.It Fl X Ar FILENAME , Fl extend Ar FILENAME241Load file before compilation commences.242.It Fl prelude Ar EXPRESSION243Add expression to beginning of source file.244.It Fl postlude Ar EXPRESSION245Add expression to end of source file.246.It Fl prologue Ar FILENAME247Include file before main source file.248.It Fl epilogue Ar FILENAME249Include file after main source file.250.It Fl e , Fl embedded251Compile as embedded252.Po don't generate253.Sq Fn main254.Pc .255.It Fl gui256Compile as GUI application.257.It Fl link Ar NAME258Link extension with compiled executable259.Po implies Sq Fl uses260.Pc .261.It Fl R Ar NAME , Fl require-extension Ar NAME262Require extension and import in compiled code.263.It Fl dll , Fl library264Compile multiple units into a dynamic library.265.It Fl libdir Ar DIRECTORY266Override location of runtime library directory.267.El268.Pp269Options to other passes:270.Bl -tag -width Ds271.It Fl C Ar OPTION272Pass option to C compiler.273.It Fl L Ar OPTION274Pass option to linker.275.It Fl I Ns Ar <DIR>276Pass277.Dq -I Ns Ar <DIR>278to C compiler279.Po add include path Pc .280.It Fl L Ns Ar <DIR>281Pass282.Dq -L Ns Ar <DIR>283to linker284.Po add library path Pc .285.It Fl k286Keep intermediate files.287.It Fl c288Stop after compilation to object files.289.It Fl t290Stop after translation to C.291.It Fl cc Ar COMPILER292Select a C compiler other than the default.293.It Fl cxx Ar COMPILER294Select a C++ compiler other than the default.295.It Fl ld Ar COMPILER296Select a linker other than the default.297.It Fl static298Link with static CHICKEN libraries and extensions.299.It Fl F Ns Ar <DIR>300Pass301.Dq -F Ns Ar <DIR>302to C compiler303.Po add framework header path on Mac OS X Pc .304.It Fl framework Ar NAME305Passed to linker on Mac OS X.306.It Fl rpath Ar PATHNAME307Add directory to runtime library search path.308.It Fl Wl,...309Pass linker options.310.It Fl strip311Strip resulting binary.312.El313.Pp314Inquiry options:315.Bl -tag -width Ds316.It Fl home317Show home-directory318.Po where support files go Pc .319.It Fl cflags320Show required C-compiler flags and exit.321.It Fl ldflags322Show required linker flags and exit.323.It Fl libs324Show required libraries and exit.325.It Fl cc-name326Show name of default C compiler used.327.It Fl cxx-name328Show name of default C++ compiler used.329.It Fl ld-name330Show name of default linker used.331.It Fl dry-run332Just show commands executed, don't run them333.Po implies Sq Fl v334.Pc .335.El336.Pp337Obscure options:338.Bl -tag -width Ds339.It Fl debug Ar MODES340Display debugging output for the given modes.341.It Fl compiler Ar PATHNAME342Use a compiler other than the default343.Sq chicken .344.It Fl raw345Do not generate implicit init- and exit code.346.It Fl emit-external-prototypes-first347Emit prototypes for callbacks before foreign declarations.348.It Fl regenerate-import-libraries349Always emit import libraries, even when their contents haven't changed.350The default behaviour is to preserve existing import libraries.351.It Fl ignore-repository352Do not refer to repository for extensions.353.It Fl keep-shadowed-macros354Do not remove shadowed macros.355.It Fl host356Compile for host when configured for cross-compiling.357.It Fl private-repository358Load extensions from executable path.359.It Fl deployed360Link support file to be used from a deployed executable361.Po sets362.Sq rpath363accordingly, if supported on this platform.364.Pc365.It Fl no-elevation366Embed manifest on Windows to supress elevation warnings for programs named367.Sq install368or369.Sq setup .370.El371.Pp372Options can be collapsed if unambiguous, so373.Dq -vkfO374is the same as375.Dq -v -k -fixnum-arithmetic -optimize .376.Sh ENVIRONMENT377The following environment variables change the behaviour of378.Nm Ns :379.Bl -tag -width CSC_OPTIONS380.It Ev CSC_OPTIONS381Can hold default options that should be passed to every invocation of382.Nm .383.El384.Sh EXIT STATUS385.Ex -std386.Sh SEE ALSO387.Xr chicken 1388.Pp389More information can be found in the390.Lk http://wiki.call-cc.org/manual/index "CHICKEN User's Manual".391.Sh AUTHORS392.An The CHICKEN Team393.Sh BUGS394Submit bug reports by e-mail to395.Mt chicken-janitors@nongnu.org