BSDBuild Logo

BSDBuild Manual

(Printable Version)
mkconfigure(1)

SYNOPSIS

mkconfigure [--verbose] [--output-lua=file] [--output-cmake=file]

DESCRIPTION

The mkconfigure program reads a BSDBuild configure.in source from the standard input and produces a portable Bourne configure script.

The configure.in source may include valid Bourne shell script, along with special directives interpreted by mkconfigure.

Directives are case-insensitive. Long lines can be wrapped with a terminating \ character.

COMMAND-LINE OPTIONS

The --verbose option prints extra debugging output during the generation of the script.

The --output-lua option arranges for the configure script to write definitions in the Lua language to the given output file. Lua definitions are used when generating project files with the Premake method (deprecated).

The --output-cmake option arranges for a Cmake macro package to be generated under the given output file. The Cmake macro package will include macros named "Check_Foo" and "Disable_Foo" for every BSDBuild test which supports Cmake.

INFORMATION DIRECTIVES

The following directives provide information about the package:
package (name)
Short name for the package. Included in generated messages and comments.
version (string)
Specify current package version.
release (string)
Specify a release codename.
register (name, desc)
Describe a configure script argument to show in ./configure --help. name is the name of the getopt_long(3) style argument (e.g., --with-foo,--enable-foo)and desc is a one-line description.
register_env_var (name, desc)
Describe an influential environment variable to show in ./configure --help. name is the name of the environment variable and desc is a one-line description.
register_section (text)
Provide a title for a section of arguments in ./configure --help.

CONFIGURE SCRIPT DIRECTIVES

The following directives alter the operation of the configure script.
config_cache (bool)
Enable support for caching of test results (./configure --cache option). Set to "yes" (enable caching) or "no" (the default).
config_guess (path)
Specify an alternate path to config.guess (default is mk/config.guess).
success_fn (fname)
Instead of printing the default "Configuration successful" message at the end of the script, run the indicated Bourne shell function fname instead.

DEFINITION OUTPUT DIRECTIVES

The following directives generate make(1) definitions as well as definitions accessible from C / C++.
mappend (opt, val)
Append a space and val to the exported make(1) variable opt.
mdefine (opt, val)
Define an exported make(1) variable opt with value val.
default_dir (dirname, path)
Override one of the standard installation path defaults. dirname may be one of: PREFIX, BINDIR, LIBDIR, LIBEXECDIR, DATADIR, STATEDIR, SYSCONFDIR, LOCALEDIR or MANDIR. The path argument may include variable references such as "${PREFIX}".
hdefine (opt, val)
Define a C preprocessor style header option. opt is an unquoted string (uppercase by convention), and the value val is a string enclosed in double quotes. For example, if opt is ENABLE_FOO, a file config/enable_foo.h will be generated by configure.
hdefine_unquoted (opt, val)
Variant of hdefine() which keeps val unquoted instead of interpreting it as a string.
hdefine_if (condition, opt)
If condition evaluates true, then generate a define with hdefine (opt)
otherwise call hundef (opt) .
to generate an #undef.
hundef (opt)
Write an #undef directive to which writes an #undef directive to config/<option>.h (the opposite of hdefine()).
hundef_if (condition, opt)
If condition evaluates true, then call hundef (opt) .

BSDBUILD MODULE DIRECTIVES

The following directives invoke installed BSDBuild test modules. Modules generate Bourne script for performing tests and returning results as variables. For instance, a test for a package "foo" would set variable HAVE_FOO to "yes" or "no" and return detected compilation flags under FOO_CFLAGS and FOO_LIBS.
check (pkg[,ver[,pfx]])
Invoke the BSDBuild module called pkg. A <pkg>.pm module file should exist under ${PREFIX}/share/bsdbuild/BSDBuild/.

If ver is given and non-zero, check the version and set MK_VERSION_OK to "yes" if the installed version is compatible with ver.

If pfx is given, look under that installation prefix (and fail if it is not installed there). Typically, the value "${prefix_foo}" (from user-given --enable-foo=VALUE or --with-foo=VALUE) is used here.
require (pkg[,ver[,pfx]])
Variant of check() which implicitely terminates the script with an error message if pkg is not found or the ver is incompatible.
disable (pkg)
Short-circuit a test module. Emit the defines that would have resulted from a failed test, without actually running any tests.
test_dir (path)
Specify an extra directory in which to search for BSDBuild test modules (.pm files). The default module path is ${PREFIX}/share/bsdbuild/BSDBuild/.

ADA LANGUAGE DIRECTIVES

The following directives deal with Ada code compilation.
ada_option (option)
Append an option to the ADAFLAGS which will be passed to the Ada compiler.
ada_bflag (option)
Append an option to the ADABFLAGS which will be passed to the Ada binder.

C/C++ LANGUAGE DIRECTIVES

The following directives apply to C, C++ and other C-like languages.
c_define (optname)
Specify a C preprocessor definition. For example, an optname of "FOO" would result in the -DFOO flag being passed to the C compiler.
cxx_define (optname)
Specify a C++ preprocessor definition. For example, an optname of "FOO" would result in the -DFOO flag being passed to the C++ compiler.
c_incdir (dir)
Specify a directory containing C include files. For example, if dir is /usr/include then the -I/usr/include option would be passed to the C preprocessor.
cxx_incdir (dir)
Specify a directory containing C++ include files. For example, if dir is /usr/include then the -I/usr/include option would be passed to the C++ preprocessor.
c_incdir_config (dir)
Specify a target directory for individual include files with configure-script generated statements (i.e., HAVE_FOO is written to have_foo.h in the specified directory). Pass an empty argument to disable. By default, config/ is used.
c_include_config (file)
Specify a monolithic C include file which will contain configure-script generated statements (i.e., HAVE_FOO defines). Pass an empty argument to disable (default).
c_incprep (dir)
Specify a target directory for preprocessed C header files. The ./configure option --includes is a BSDBuild extension which gives the user the option of either generating preprocessed headers in the working directory ("--includes=yes", the default) or alternatively, to create a set of symbolic links to the original headers in the source directory ("--includes=link").
c_option (option)
Pass a general command-line option to the C compiler.
cxx_option (option)
Pass a general command-line option to the C++ compiler.
check_c_func (fn[, ...])
Check for the existence of one or more C functions. If a function fn called foo() exists, then HAVE_FUNCTION_FOO will be set.
check_cxx_func (fn[, ...])
Check for the existence of one or more C++ functions. If a function fn called foo() exists, then HAVE_FUNCTION_FOO will be set.
check_c_func_opts (cflags, libs, fn[, ...])
Variant of check_c_func() with additional CFLAGS and LIBS.
check_cxx_func_opts (cxxflags, libs, fn[, ...])
Variant of check_cxx_func() with additional CXXFLAGS and LIBS.
check_c_header (name[, ...])
Check for the existence of one or more C header files. For example, if sys/foo.h exists then HAVE_SYS_FOO_H will be set.
check_cxx_header (name[, ...])
Check for the existence of one or more C++ header files. For example, if sys/foo.h exists then HAVE_SYS_FOO_H will be set.
check_c_header_opts (cflags, libs, header[, ...])
Variant of check_c_header() with additional CFLAGS and LIBS.
check_cxx_header_opts (cflags, libs, header[, ...])
Variant of check_cxx_header() with additional CXXFLAGS and LIBS.
ld_option (option)
Provide a ld-style linker option, such as -g or -nostdlib.

PERL LANGUAGE DIRECTIVES

The following directives deal with the installation of Perl modules.
check_perl_module (mod)
Check that the specified Perl module is installed and functioning. For example, if mod is "Time::Zone", the macro will set the variable "HAVE_TIME_ZONE" accordingly.
require_perl_module (mod)
Variant of check_perl_module() which aborts the configure script if the module is not found.

CONFIGURATION OUTPUT DIRECTIVES

The following directives produce output scripts and modules for integration by external packages.
config_script (name[,args])
Generate a standard "foo-config" script. name specifies the name of the script. For C/C++ style packages, the arguments are usually the --cflags output, followed by the --libs output.
pkgconfig_module (name, desc, req, confl, cflags, libs, pvtLibs)
Output a pkgconf(1) compatible pc(5) file to "name.pc" (which may be then installed into PKGCONFIG_LIBDIR). desc is the "Description" string, req is the "Required" modules list (space-separated), confl is the "Conflicts" list, cflags is the "Cflags" field, libs is Libs (for --libs) and pvtLibs is Libs.private (for --static --libs).

SEE ALSO


Csoft.net ElectronTubeStore