summaryrefslogtreecommitdiff
path: root/scripts/mk-configure.7.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mk-configure.7.in')
-rw-r--r--scripts/mk-configure.7.in236
1 files changed, 198 insertions, 38 deletions
diff --git a/scripts/mk-configure.7.in b/scripts/mk-configure.7.in
index e9579a5..ab6c9da 100644
--- a/scripts/mk-configure.7.in
+++ b/scripts/mk-configure.7.in
@@ -18,7 +18,7 @@
.sp
..
.\" ------------------------------------------------------------------
-.TH MK-CONFIGURE 7 "Dec 1, 2013" "" ""
+.TH MK-CONFIGURE 7 "Aug 21, 2014" "" ""
.SH NAME
mk-configure \- lightweight replacement for GNU autotools
.SH DESCRIPTION
@@ -27,11 +27,48 @@ is a collection of include files for bmake (portable version of
NetBSD make) and a number of executables. It is intended to simplify
crossplatform development and software building.
.P
-To get system-specific configuration parameters, mkc.*.mk include
-files try to include the file specified by the "MAKECONF"
-variable. If MAKECONF is not set, or no such file exists, the system
-make configuration file, @sysconfdir@/mk.conf or /etc/mk.conf, is
-included. If "${SRCTOP}/Makefile.common" file exists it is also included
+There are only a few top-level makefiles:
+.BR mkc.init.mk ", " mkc.mk ", " mkc.configure.mk ", " mkc.minitest.mk .
+Everything else
+.RB ( mkc_imp.*.mk " files)"
+is included implicitely. Do not use
+.B mkc_imp.*.mk
+files directly! If you do, I cannot guarantee backward compatibility.
+.B mkc.configure.mk
+is included automatically by
+.BR mkc.mk ,
+but can be included explicitely.
+.B mkc.minitest.mk
+provides a trivial support for regression tests and should be included explicitely.
+Usually mk-c makefiles consist of variables assignments
+and inclusion of
+.B mkc.mk
+in the and.
+One can also use
+.BR mkc.prog.mk ", " mkc.lib.mk ", " mkc.files.mk ", " mkc.subdir.mk " and " mkc.subprj.mk
+instead of
+.BR mkc.mk .
+The latter activates
+.B mkc.lib.mk
+if variable LIB is set,
+.B mkc.prog.mk
+if variables PROG or PROGS are set,
+.B mkc.subprj.mk
+if variable SUBPRJ is set,
+.B mkc.subdir.mk
+if variable SUBDIR is set,
+and
+.B mkc.files.mk
+otherwise.
+.B
+.P
+To get system-wide configuration parameters, mkc.init.mk loads
+"${MAKECONF}" file if it exists.
+Otherwise, it loads
+@sysconfdir@/mk-c.conf if it exists.
+If neither ${MAKECONF} nor @sysconfdir@/mk-c.conf exist,
+it tries to load @sysconfdir@/mk.conf file.
+If "${SRCTOP}/Makefile.common" file exists it is also included
by all subprojects.
Unless SRCTOP variable is set, "../Makefile.inc"
is also included if exists.
@@ -51,8 +88,7 @@ means "May be set or changed in project's Makefile" and
.I Mu
means "May be set in project's Makefile but may be initialized or overriden by user".
.SS "Targets"
-.BR mkc.prog.mk ", " mkc.lib.mk ", " mkc.files.mk ", " mkc.subdir.mk ", and " mkc.subprj.mk
-include files provide the following targets:
+Mk-configure provides the following targets:
.IP all
build everything.
.IP clean
@@ -86,6 +122,9 @@ output a list of destination files of the project, one per line, e.g.
if MKOBJDIR is "yes", creates object directories (${.OBJDIR}) according
to MAKEOBJDIR and MAKEOBJPREFIX variables. Current umask is used for
this.
+.VE
+.IP mkgen
+.RB See " mkc_imp.foreign_autotools.mk" .
.IP "bin_tar, bin_targz, bin_tarbz2, bin_zip, bin_deb"
build software, install it to a temporary directory (using DESTDIR)
and create .tar/.tar.gz/.tar.bz2/.zip/.deb archive
@@ -104,8 +143,12 @@ in Makefile override the standard behaviour.
All targets in this list have
.IR pre\_* ", " do\_* " and " post\_*
counterparts. See ALLTARGETS for details.
-.SS "Common variables"
-The following variables control how various files are compiled/built.
+.SS "mkc.init.mk"
+This file is included by
+.BR mkc.mk " and " mkc.configure.mk
+automatically but can be used by users directly.
+.B mkc.init.mk
+uses the following variables.
.IP AR
Create, modify, and extract from archives.
.RI < Iu >
@@ -176,6 +219,10 @@ Additional flags to the C pre-processor.
.IP CPPFLAGS_<project>
Similar to CPPFLAGS but for project ${PROJECTNAME}.
.RI < "U" >
+.IP CPPFLAGS0
+The same as CPPFLAGS but CPPFLAGS0 are passed to the compiler before CPPFLAGS.
+Normally, CPPFLAGS0 should be modified in makefiles and should not
+be set from environment by user.
.IP FC
Fortran compiler.
.RI < Iu >
@@ -370,6 +417,18 @@ Target directory for system utilities.
Target directory for architecture-independent text files.
.RI < "Iu" >
.RI [ ${PREFIX}/share ]
+.IP SHAREDSTATEDIR
+Target directory for modifiable architecture-independent data files.
+.RI < "Iu" >
+.RI [ ${PREFIX}/com ]
+.IP VARDIR
+Target directory for modifiable single-machine data files.
+.RI < "Iu" >
+.RI [ ${PREFIX}/var ]
+.IP INCSDIR
+Target directory for header files.
+.RI < "Iu" >
+.RI [ ${PREFIX}/include ]
.IP SYSCONFDIR
Target directory for configuration files.
.RI < "Iu" >
@@ -551,17 +610,12 @@ will be translated to
Top-level object directory which
defaults to ${.OBJDIR} if ${.MAKE.LEVEL} is 0.
.RI < I >
-.SS "mkc.init.mk"
-This file sets most important mk-configure variables, for example,
-OPSYS, PREFIX, CC_TYPE etc. and is included automatically by
-.BR mkc.files.mk ", " mkc.lib.mk ", " mkc.prog.mk ", " mkc.subdir.mk " and " mkc.subprj.mk
.SS "mkc.files.mk"
The include file
.B mkc.files.mk
-handles the FILES variables and is included
+handles the FILES variable and is included
from
.BR mkc.lib.mk " and " mkc.prog.mk .
-.B mkc_imp.files.mk
List of supported variables:
.IP FILES
The list of files to install.
@@ -709,7 +763,7 @@ Additional linker flags. Often used for specifying library directories.
Similar to LDFLAGS but for project ${PROJECTNAME}.
.IP LDFLAGS0
The same as LDFLAGS but LDFLAGS0 and LDADD0 are passed to the linker before LDFLAGS and LDADD.
-Normally LDFLAGS0 and LDADD0 should be modified in makefiles and should not
+Normally, LDFLAGS0 and LDADD0 should be modified in makefiles and should not
be set from environment by user.
.RI < "M" >
.IP "BINDIR, BINMODE, BINOWN and BINGRP"
@@ -740,6 +794,15 @@ objects), otherwise only symbols referenced by some object file will
be exported.
.RI < "M" >
.RI [ no ]
+.IP DPINCDIRS
+See LIBDEPS in section
+.BR mk.subprj.mk .
+.IP DPLIBDIRS
+See LIBDEPS in section
+.BR mk.subprj.mk .
+.IP DPLDADD
+See LIBDEPS in section
+.BR mk.subprj.mk .
.PP
.B mkc.prog.mk
includes
@@ -748,8 +811,7 @@ and therefore supports all variables supported by it.
.SS "mkc.lib.mk"
The include file
.B mkc.lib.mk
-has support for building a static or dynanic library. It has a
-limited number of suffixes.
+has support for building a static and dynanic library or DLL.
.B mkc.lib.mk
uses the following variables:
.IP LIB
@@ -824,11 +886,6 @@ List of source files to build the library. Suffix types
.\"
.\" It has rules for building profiled objects; profiled libraries are
.\" built by default.
-.IP LDCOMPILER
-If "yes", ${CC} is used for linking instead of ${LD}.
-For C++ sources ${CXX} is used for linking.
-.RI < "Iu" >
-.RI [ yes ]
.IP MKSHLIB
If not "no", build and install shared library provided that SHLIB_MAJOR is defined.
.RI < "IMu" >
@@ -857,6 +914,15 @@ exported. This variable has no effect on some platforms. By default
all symbols are exported.
.RI < "M" >
[]
+.IP DPINCDIRS
+See LIBDEPS in section
+.BR mk.subprj.mk .
+.IP DPLIBDIRS
+See LIBDEPS in section
+.BR mk.subprj.mk .
+.IP DPLDADD
+See LIBDEPS in section
+.BR mk.subprj.mk .
.\" .IP "COPTS.lib<lib> OBJCCOPTS.lib<lib> LDADD.lib<lib> CPPFLAGS.lib<lib> CXXFLAGS.lib<lib>"
.\" These provide a way to specify additions to the associated
.\" variables in a way that applies only to a particular
@@ -925,6 +991,46 @@ List of subprojects (subdirectories) and dependencies. If the
subdirectory doesn't exist the subproject becomes "virtual" and may be
used to group several subprojects into a new virtual one.
.RI < "M" >
+.IP LIBDEPS
+A list of library dependencies. Each token is a colon-separated pair.
+Its first component is a library subproject (dependency), the second
+one is the subproject for library or executable. The value of this
+variable is automatically added to SUBPRJ. Library dependencies listed
+in LIBDEPS automatically change CPPFLAGS0, LDFLAGS0 and LDADD0 of
+approptiate subprojects.
+.RI < "M" >
+Suppose, we have <library:program> pair in LIBDEPS, also suppose that variable
+.B library
+is set to "library" subdirectory and variable
+.B program
+is set to "program" subdirectory.
+${SRCDIR_library}/linkme.mk file is automatically included from
+${SRCDIR_program}/Makefile if it exists. In this file
+.RI "DPLDADD [" "${library:T:S/^lib//}" "],"
+.RI "DPLIBDIRS [" "${OBJDIR_${library:S,/,_,g}}" "] and"
+.RI "DPINCDIRS [" "${SRCDIR_${library:S,/,_,g}} ${OBJDIR_${library:S,/,_,g}}" "],"
+may be set to non-default values. These three variables then changes
+LDADD0, LDFLAGS0 and CPPFLAGS0 respectively in subproject "program".
+The dependency graph specified by variable LIBDEPS is available to all
+subproject via environment.
+.IP STATICLIBS
+A list of subprojects (basenames) with static libraries. If dependency is
+mentioned in this variable, the suffix _pic is automatically added
+for PIE-executables or shared libraries that depend on this library.
+This variable is automatically passed to subprojects via environment.
+.RI < Mu >
+.RI [ "" ]
+.IP INTERNALLIBS
+A list of subprojects (basenames) with internal libraries.
+These libraries are static and not installed by target "install".
+.RI < M >
+.RI [ "" ]
+.IP COMPATLIB
+Subproject's basename for compatibility library.
+If this variable is set, MKC_SOURCE_FUNCLIBS and FEATURES
+do not change SRCS for subprojects other than ${COMPATLIB}.
+.RI < M >
+.RI [ "" ]
.IP SUBPRJ_DFLT
List of projects built and installed by default.
The default is all projects listed in SUBPRJ.
@@ -993,6 +1099,10 @@ are used. Unlike MAKEOBJDIRPREFIX object directories do not contain
top-level ${.CURDIR} in paths.
.RI < "Iu" >
.RI [ no ]
+.IP SUBPRJSRCTOP
+This variables contains ${.CURDIR} directory and is passed to subprojects.
+.RI < "I" >
+.RI [ ${.CURDIR} ]
.P
.B mkc.subprj.mk
provides the following targets:
@@ -1326,10 +1436,11 @@ Checks listed in MKC_CHECK_BUILTINS will be run.
.RS
Avalable values:
.TP
-.BR prog_flex ", " prog_bison ", " prog_gawk ", " prog_gm4
-Find flex, bison, GNU awk or GNU m4 by analysing program's help and/or
-version messages. If found, BUILTIN.prog_<progname> is set to a path,
-otherwise it is set to an empty string. Note that
+.BR prog_flex ", " prog_bison ", " prog_gawk ", " prog_gm4 ", " prog_gmake
+Find flex, bison, GNU awk, GNU m4 or GNU make respectively
+by analysing program's help and/or
+version messages. If found, BUILTIN.prog_<progname> is set to the path,
+otherwise it is set to empty string. Note that
.I gawk
may be found as
.IR awk ,
@@ -1338,11 +1449,13 @@ as
.IR yacc ,
.I gm4
as
-.IR m4
-and
+.IR m4 ,
.I flex
as
-.IR lex .
+.IR lex " and"
+.I gmake
+as
+.IR make .
.TP
.BR prog_mkdep ", " prog_nbmkdep
Find traditional BSD mkdep(1) or recent NetBSD version of it respectively.
@@ -1500,7 +1613,7 @@ mk-configure is added to SRCS and declaration is provided in
mkc_strlcat.h header.
.TP
.B strlcpy
-The same as strlcat.
+Similar to strlcat.
.TP
.B getline
This feature corresponds to getline(3) function which is a part of POSIX2008
@@ -1511,6 +1624,19 @@ implementation is available in libc. If not, getline.c provided by
mk-configure is added to SRCS and declaration is provided in
mkc_getline.h header.
.TP
+.B progname
+This feature provides getprogname(3) and setprogname(3) functions
+available in *BSD.
+.TP
+.B fgetln
+This feature provides fgetln(3) BSD-ism.
+.TP
+.B err
+This feature provides err(3), errx(3), verr(3) and verrx(3) BSD-isms.
+.TP
+.B warn
+This feature provides warn(3), warnx(3), vwarn(3) and vwarnx(3) BSD-isms.
+.TP
.B libm
This feature checks whether libm is available and if yes, adds -lm to
LDADD. Most UNIX-like systems have libm but Haiku, for example, does
@@ -1660,6 +1786,8 @@ expanding the following @@ patterns:
.RI @ "" "datadir@ ${DATADIR}"
.RI @ "" "sysconfdir@ ${SYSCONFDIR}"
.RI @ "" "incsdir@ ${INCSDIR}"
+.RI @ "" "vardir@ ${VARDIR}"
+.RI @ "" "sharedstate@ ${SHAREDSTATEDIR}"
.VE
The following variables are provided:
.IP INFILES
@@ -1777,9 +1905,8 @@ Do not use it directly!
This module provides installation of header files and provides
the following variables:
.IP INCSDIR
-Target directory for includes.
-.RI < "Iu" >
-.RI [ ${PREFIX}/include ]
+See
+.BR mkc.init.mk .
.IP INCS
The list of include files.
.RI < "M" >
@@ -1900,6 +2027,41 @@ dependencies, but are not needed in ${SRCS}.
Compiler passed to mkdep(1).
.RI < "Iu" >
.RI [ "${CC}" ].
+.SS "mkc_imp.foreign_autotools.mk"
+This module is activated if variable FOREIGN is set to "autotools" and provides
+support for building external projects using autotools.
+It also provides a recursive target
+.B mkgen
+for generating "configure" script, "Makefile.in" file etc. using
+.BR autoreconf(1) " utility."
+The following variables are provided:
+.IP FSRCDIR
+Relative (to ${.CURDIR}) or absolute directory to autotools-based sources.
+.IP AT_MAKE
+Make(1)-like utility for the project.
+.RI < "Imu" >
+.RI [ "${MAKE}" ].
+.IP AT_USE_AUTOMAKE
+If "yes",
+.B automake(1)
+is used.
+.RI < "M" >
+.RI [ yes ].
+.IP AT_CONFIGURE_ARGS
+Extra arguments passed to "configure" script set in addition to
+standard ones (--prefix, --bindir etc.).
+.RI < "Mu" >
+.RI [ "" ].
+.IP AT_CONFIGURE_ENV
+Environment variables for "configure" script set in addition to
+standard ones (CC, CFLAGS etc.).
+.RI < "Mu" >
+.RI [ "" ].
+.IP AT_AUTORECONF_ARGS
+Arguments passed to
+.BR autoreconf(1) .
+.RI < "U" >
+.RI [ "-sif" ].
.SH "CROSS COMPILATION"
The following variables are used for compiling software using cross-tools.
.IP MACHINE_GNU_PLATFORM
@@ -1928,9 +2090,7 @@ See SYSROOT.
Path to mk.conf file .include-ed by mkc.*.mk files
.SH "FILES"
.IP @sysconfdir@/mk.conf
- .include-ed by mkc.*.mk if exists
-.IP /etc/mk.conf
- .include-ed by mkc.*.mk if exists
+ .include-ed by mkc.init.mk if exists
.SH "BUGS"
Target
.IR errorcheck " (" configure ")"