.\" .\" Copyright (c) 2007-2024 Julien Nadeau Carriere .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES .\" (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd March 1, 2024 .Dt MKCONFIGURE 1 .Os BSDBuild 3.2 .Sh NAME .Nm mkconfigure .Nd Compile BSDBuild configure scripts .Sh SYNOPSIS .Nm .Op Fl \-verbose .Op Fl \-output-lua Ns = Ns Ar file .Op Fl \-output-cmake Ns = Ns Ar file .Sh DESCRIPTION The .Nm program reads a BSDBuild .Pa configure.in source from the standard input and produces a portable Bourne configure script. .Pp The .Pa configure.in source may include valid Bourne shell script, along with special directives interpreted by .Nm . .Pp Directives are case-insensitive. Long lines can be wrapped with a terminating \\ character. .Sh COMMAND-LINE OPTIONS The .Fl \-verbose option prints extra debugging output during the generation of the script. .Pp The .Fl \-output-lua option arranges for the configure script to write definitions in the Lua language to the given output .Fa file . Lua definitions are used when generating project files with the Premake method (deprecated). .Pp The .Fl \-output-cmake option arranges for a Cmake macro package to be generated under the given output .Fa file . The Cmake macro package will include macros named "Check_Foo" and "Disable_Foo" for every BSDBuild test which supports Cmake. .Sh INFORMATION DIRECTIVES The following directives provide information about the package: .Bl -tag -width "register_env_var(name, desc) " .It Fn package "name" Short name for the package. Included in generated messages and comments. .It Fn version "string" Specify current package version. .It Fn release "string" Specify a release codename. .It Fn register "name, desc" Describe a configure script argument to show in ./configure --help. .Fa name is the name of the .Xr getopt_long 3 style argument (e.g., .Ar --with-foo , .Ar --enable-foo ) and .Fa desc is a one-line description. .It Fn register_env_var "name, desc" Describe an influential environment variable to show in ./configure --help. .Fa name is the name of the environment variable and .Fa desc is a one-line description. .It Fn register_section "text" Provide a title for a section of arguments in ./configure --help. .El .Sh CONFIGURE SCRIPT DIRECTIVES The following directives alter the operation of the configure script. .Bl -tag -width "default_dir(dirname, path) " .It Fn config_cache "bool" Enable support for caching of test results (./configure --cache option). Set to "yes" (enable caching) or "no" (the default). .It Fn config_guess "path" Specify an alternate path to .Pa config.guess (default is .Pa mk/config.guess ) . .It Fn success_fn "fname" Instead of printing the default "Configuration successful" message at the end of the script, run the indicated Bourne shell function .Fa fname instead. .El .Sh DEFINITION OUTPUT DIRECTIVES The following directives generate .Xr make 1 definitions as well as definitions accessible from C / C++. .Bl -tag -width "default_dir(dirname, path) " .It Fn mappend "opt, val" Append a space and .Fa val to the exported .Xr make 1 variable .Fa opt . .It Fn mdefine "opt, val" Define an exported .Xr make 1 variable .Fa opt with value .Fa val . .It Fn default_dir "dirname, path" Override one of the standard installation path defaults. .Fa dirname may be one of: PREFIX, BINDIR, LIBDIR, LIBEXECDIR, DATADIR, STATEDIR, SYSCONFDIR, LOCALEDIR or MANDIR. The .Fa path argument may include variable references such as "${PREFIX}". .It Fn hdefine "opt, val" Define a C preprocessor style header option. .Fa opt is an unquoted string (uppercase by convention), and the value .Fa val is a string enclosed in double quotes. For example, if .Fa opt is .Sq ENABLE_FOO , a file .Pa config/enable_foo.h will be generated by configure. .It Fn hdefine_unquoted "opt, val" Variant of .Fn hdefine which keeps .Fa val unquoted instead of interpreting it as a string. .It Fn hdefine_if "condition, opt" If .Fa condition evaluates true, then generate a define with .Fn hdefine "opt" otherwise call .Fn hundef "opt" . to generate an #undef. .It Fn hundef "opt" Write an #undef directive to which writes an #undef directive to .Pa config/