diff options
author | Andrew Shadura <andrew@shadura.me> | 2015-07-25 14:44:37 +0200 |
---|---|---|
committer | Andrew Shadura <andrew@shadura.me> | 2015-07-25 14:44:37 +0200 |
commit | 6ec061aabc159e3f37591e92fa1df407cdca6246 (patch) | |
tree | 25e11a31b402c65581e0b342c3afb6d405a83206 /scripts/mk-configure.7.in | |
parent | aba913436a8521abe405a04ed71388989e1d646f (diff) |
Imported Upstream version 0.26.0
Diffstat (limited to 'scripts/mk-configure.7.in')
-rw-r--r-- | scripts/mk-configure.7.in | 235 |
1 files changed, 181 insertions, 54 deletions
diff --git a/scripts/mk-configure.7.in b/scripts/mk-configure.7.in index 7b0e4bc..316d6ae 100644 --- a/scripts/mk-configure.7.in +++ b/scripts/mk-configure.7.in @@ -2,7 +2,7 @@ .\" .\" This file contains parts of NetBSD's bsd.README file .\" -.\" Copyright (c) 2009-2010 by Aleksey Cheusov (vle@gmx.net) +.\" Copyright (c) 2009-2014 by Aleksey Cheusov (vle@gmx.net) .\" Absolutely no warranty. .\" .\" ------------------------------------------------------------------ @@ -31,7 +31,9 @@ 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. Unless SRCTOP variable is set, "../Makefile.inc" +included. 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. These files may define any of the variables described below. Below in square brackets the default value for variables are specified. @@ -54,7 +56,7 @@ include files provide the following targets: .IP all build everything. .IP clean -clean temporary files and directories created while building with a help of +clean temporary files and directories with a help of ${CLEANFILES_CMD} and ${CLEANDIRS_CMD} commands. .IP cleandir remove all of the files removed by the target clean, as @@ -92,32 +94,6 @@ The target .I bin_deb expects debian control files in DEBIAN subdirectory, see examples/hello_files for the sample. -.IP "<subdir> and <subdir:T>" -<subdir> is a subdirectory listed in SUBDIR or SUBPRJ. -This target is equivalent to all-<subdir> and is provided by -.BR mkc.subdir.mk " and " mkc.subprj.mk -only. For details see -.BR mkc.subdir.mk " or " mkc.subprj.mk -sections below. <subdir:T> means the last component of the directory. -This target is created if ${SHORTPRJNAME} is "yes". -.IP <target>-<subdir> -runs the specified <target> for the specified <subdir>. -This target is provided by -.BR mkc.subdir.mk " and " mkc.subprj.mk -only. For details see -.BR mkc.subdir.mk " or " mkc.subprj.mk -sections below. The target <target>-<subdir:T> is also provided -if ${SHORTPRJNAME} is "yes". -.IP "subdir-<target>-<subdir> and nodeps-<target>-<subdir>" -runs the specified <target> for the specified <subdir> without dependencies. -These targets are provided by -.BR mkc.subprj.mk -only. For details see -.BR mkc.subprj.mk -section below. -Targets subdir-<target>-<subdir:T> -and nodeps-<target>-<subdir:T> are also provided -if ${SHORTPRJNAME} is "yes". .P .B NOTE: Commands associated with targets @@ -294,6 +270,11 @@ rm(1) tool. List section sizes and total size. .RI < Iu > .RI [ size ] +.IP SRC_PATHADD +List of directories added to +.IR .PATH . +.RI < Im > +.RI [ "" ] .IP STRIP Discard symbols from object files. .RI < Iu > @@ -710,6 +691,9 @@ libraries, use: .RI < "U" > .IP LDADD_<project> Similar to LDADD but for project ${PROJECTNAME}. +.IP LDADD0 +The same as LDADD but LDFLAGS0 and LDADD0 are passed to the linker before LDFLAGS and LDADD. +.RI < "M" > .IP LDFLAGS Additional linker flags. Often used for specifying library directories. .VS @@ -718,6 +702,11 @@ Additional linker flags. Often used for specifying library directories. .RI < "Mu I" > .IP LDFLAGS_<project> 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 +be set from environment by user. +.RI < "M" > .IP "BINDIR, BINMODE, BINOWN and BINGRP" See .IR "Common variables " and " mkc.files.mk" @@ -923,6 +912,9 @@ and all its dependencies while See .I examples/hello_dictd subdirectory for the sample of use. +.P +.B mkc.subprj.mk +provides the following variables: .IP SUBPRJ List of subprojects (subdirectories) and dependencies. If the subdirectory doesn't exist the subproject becomes "virtual" and may be @@ -934,8 +926,6 @@ The default is all projects listed in SUBPRJ. .RI < "IMu" > .IP EXPORT_VARNAMES List of variables to export before running make for subdirectories. -By default MKC_CACHEDIR variable is exported. As a result cache files -for subprojects are created in a top-level directory. .RI < "Mu" > .RI [ MKC_CACHEDIR ] .IP NOEXPORT_VARNAMES @@ -962,6 +952,12 @@ Value of ${.OBJDIR} inside subdirectory. Slash symbols inside <dir> are replaced with underlines. In addition, OBJDIR_<dir:T> variable is set to ${OBJDIR_<dir>} if ${SHORTPRJNAME} is "yes". +.IP SRCDIR_<dir> +Value of ${.CURDIR} inside +.I dir +subdirectory. Slash symbols inside <dir> are replaced with underlines. +In addition, SRCDIR_<dir:T> variable is set to ${SRCDIR_<dir>} +if ${SHORTPRJNAME} is "yes". .IP TARGETS List of recursive targets supported by the project and all its subprojects. .RI < "Im" > @@ -980,6 +976,26 @@ are used. Unlike MAKEOBJDIRPREFIX object directories do not contain top-level ${.CURDIR} in paths. .RI < "Iu" > .RI [ no ] +.P +.B mkc.subprj.mk +provides the following targets: +.IP "<subdir> and <subdir:T>" +<subdir> is a subdirectory listed in SUBDIR or SUBPRJ. +This target is equivalent to all-<subdir>. +<subdir:T> means the last component of the directory +and is created if ${SHORTPRJNAME} is "yes". +.IP <target>-<subdir> +Runs the specified <target> for the specified <subdir>. +The target <target>-<subdir:T> is provided +if ${SHORTPRJNAME} is "yes". +.IP "subdir-<target>-<subdir> and nodeps-<target>-<subdir>" +Runs the specified <target> for the specified <subdir> without dependencies. +Targets subdir-<target>-<subdir:T> +and nodeps-<target>-<subdir:T> are provided +if ${SHORTPRJNAME} is "yes". +.IP print_deps +Outputs the dependency graph on targets in tsort(1) format +taking NODEPS and NOSUBDIR variables into account. .SS "mkc.subdir.mk" The include file .B mkc.subdir.mk @@ -1097,6 +1113,15 @@ added to SRCS unless MKC_NOAUTO=1. Res: SRCS+= getline.c HAVE_FUNCLIB.getline= 0 .VE +.IP "MKC_SOURCE_DIR, MKC_SOURCE_DIR.<source>" +Directory with sources for MKC_SOURCE_FUNCLIBS. If MKC_SOURCE_DIR.<source> is unset, +MKC_SOURCE_DIR is used that defaults to ${.CURDIR}. +.VS + Ex: MKC_SOURCE_FUNCLIBS += getline + MKC_SOURCE_DIR.getline.c = ${.CURDIR}/../missing + Res: SRCS+= ${.CURDIR}/../missing/getline.c + HAVE_FUNCLIB.getline= 0 +.VE .IP MKC_CHECK_DEFINES List of define:header to check. <header> part is optional. @@ -1215,7 +1240,7 @@ treated as a fatal error (See target. .IP MKC_CHECK_FUNCS<N> List of <func>:<header> to be check. <header> part is optional. - +Here <N> means the number of arguments. As a result of the check bmake's variable HAVE_FUNC<N>.<func>.<header> (or HAVE_FUNC<N>.<func>) is set to either 0 or 1. @@ -1248,7 +1273,6 @@ MKC_CUSTOM_FN.<custom_check_name> is a for your custom check, e.g., filename.c, filename.cc, subdir/filename.cxx, filename.C, filename.cpp, mychecks/filename.f or subdir/executable_script. - .B mk-configure tries to compile or run the specified file and sets CUSTOM.<custom_check_name> variable to 1, 0 or other value. @@ -1306,8 +1330,8 @@ as .BR prog_mkdep ", " prog_nbmkdep Find traditional BSD mkdep(1) or recent NetBSD version of it respectively. .TP -.B endianess -BUILTIN.endianess variable is set to either +.B endianness +BUILTIN.endianness variable is set to either .IR little ", " big " or " unknown depending on a hardware. .RE @@ -1366,6 +1390,33 @@ unless MKC_NOAUTO is set to 1 -DSIZEOF_LONG_LONG=4 \\ -DSIZEOF_OFF_T_SYS_TYPES_H=8 .VE +.IP MKC_CHECK_PROTOTYPES +A list of checks (list of names) for C function prototypes. +MKC_PROTOTYPE_FUNC.<name> is a C function prototype. +MKC_PROTOTYPE_HEADERS.<name> is a list of headers to #include. +mk-configure verifies that the specified prototype is correct and if +so, HAVE_PROTOTYPE.<name> bmake variable is set to 1 and +-DHAVE_PROTOTYPE_<NAME>=1 is added to CFLAGS unless MKC_NOAUTO is set to 1. +Otherwise, HAVE_PROTOTYPE.<name> variable is set to 0. +.VS +Ex. + MKC_CHECK_PROTOTYPES = posix_iconv const_iconv + MKC_PROTOTYPE_FUNC.posix_iconv = \ + size_t iconv(iconv_t,char**,size_t*,char**,size_t*) + MKC_PROTOTYPE_FUNC.const_iconv = \ + size_t iconv(iconv_t,const char**,size_t*,char**,size_t*) + MKC_PROTOTYPE_HEADERS.posix_iconv = iconv.h + MKC_PROTOTYPE_HEADERS.const_iconv = iconv.h +Res. + HAVE_PROTOTYPE.posix_iconv=0 + HAVE_PROTOTYPE.const_iconv=1 + CFLAGS += -DHAVE_PROTOTYPE_CONST_ICONV=1 +.VE +.IP MKC_REQUIRE_PROTOTYPES +The same as MKC_CHECK_PROTOTYPES, but incorrect prototype is +treated as a fatal error (See +.B errorcheck +target. .IP MKC_NOAUTO_FUNCLIBS See MKC_CHECK_FUNCLIBS .IP MKC_NOAUTO @@ -1394,11 +1445,10 @@ The same as MKC_COMMON_DEFINES but only for OPSYS (uname -s). .IP MKC_CACHEDIR Directory where intermediate and cache files are created. It defaults to ${.OBJDIR}. -.\" Setting this variable to something common for huge amount of -.\" projects can save lots of time/energy wasted on unnecessary -.\" rechecking. Idea: to use hash from options passed to compiler -.\" for calculating the cache directory -.\" ( remove -Wxxx etc. + sort + uniq + crc32/md5/...). +By default MKC_CACHEDIR variable is exported for subprojects. +As a result cache files +for subprojects are created in the top-level directory. +If cache directory doesn't exist, it is created automatically. .IP MKC_SHOW_CACHED Setting it to 0 will hide .VS @@ -1410,8 +1460,66 @@ If set to 1, temporary files are removed. .IP MKC_NOCACHE All results are cached unless MKC_NOCACHE variable is set non-empty value -.SS "mkc_imp.scripts.mk" -.B mkc_imp.scripts.mk +.IP MKC_FEATURES +This is a list of "features" required by project. In general, a feature +is something that has problems with portability. This may be a +function name or header missing on some platforms, for example. +What developer +needs to do is to add FEATURENAME to MKC_FEATURES variable and add +#include <mkc_FEATURENAME.h> where it is needed. Internally, system +requiremets are checked in the automatically included +mkc_imp.f_FEATURENAME.mk +file and all required actions (includes, define checks etc.) +are made in mkc_FEATURENAME.h header file. +Currently the following features are provided: +.RS +.TP +.B strlcat +This feature corresponds to strlcat(3) function available on almost +all systems except glibc-based Linux-es. mkc_imp.f_strlcat.mk checks +whether strlcat declaration is available in string.h and +implementation is available in libc. If not, strlcat.c provided by +mk-configure is added to SRCS and declaration is provided in +mkc_strlcat.h header. +.TP +.B strlcpy +The same as strlcat. +.TP +.B getline +This feature corresponds to getline(3) function which is a part of POSIX2008 +unavailable on some +systems. mkc_imp.f_getline.mk checks +whether getline declaration is available in stdio.h and +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 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 +not. mkc_imp.f_libm.mk checks whether libm library is available and if yes, +-lm is added to LDADD. +.TP +.B libdl +This feature checks whether libdl library is available and dlopen(3) +is declared in dlfcn.h. If yes, -ldl is added to LDADD. mkc_libdl.h +provides declarations for dlopen(3), dlsym(3), dlclose(3) etc. +.TP +.B "RB SPLAY" +BSD systems provide sys/tree.h header where RB_* and SPLAY_* macroses +are defined for red-black tree and splay. These features check whether +sys/tree.h and appropriate macroses are available. If yes, mkc_RB.h +and mkc_SPLAY.h include system-wide sys/tree.h, otherwise NetBSD +version of sys/tree.h provided by mk-configure is included. +.TP +.B "SLIST SIMPLEQ STAILQ LIST TAILQ CIRCLEQ" +BSD systems provide sys/queue.h header where SLIST_* etc. macroses are +defined for lists and queues. These features check whether sys/queue.h +and appropriate macroses are available. If yes, mkc_SLIST.h and others +include system-wide sys/queue.h, otherwise NetBSD version of +sys/queue.h provided by mk-configure is included. +.RE +.SS mkc_imp.scripts.mk is internal include file which is included from .BR mkc.prog.mk ", " mkc.lib.mk " and " mkc.files.mk . Do not use it directly! @@ -1526,15 +1634,15 @@ expanding the following @@ patterns: .VS Pattern Result ---------------------- -@prefix@ ${PREFIX} -@bindir@ ${BINDIR} -@mandir@ ${MANDIR} -@sbindir@ ${SBINDIR} -@libdir@ ${LIBDIR} -@libexecdir@ ${LIBEXECDIR} -@datadir@ ${DATADIR} -@sysconfdir@ ${SYSCONFDIR} -@incsdir@ ${INCSDIR} +.RI @ "" "prefix@ ${PREFIX}" +.RI @ "" "bindir@ ${BINDIR}" +.RI @ "" "mandir@ ${MANDIR}" +.RI @ "" "sbindir@ ${SBINDIR}" +.RI @ "" "libdir@ ${LIBDIR}" +.RI @ "" "libexecdir@ ${LIBEXECDIR}" +.RI @ "" "datadir@ ${DATADIR}" +.RI @ "" "sysconfdir@ ${SYSCONFDIR}" +.RI @ "" "incsdir@ ${INCSDIR}" .VE The following variables are provided: .IP INFILES @@ -1692,9 +1800,22 @@ This module supports dependencies controlled by program. As a result CPPFLAGS and LDADD variables are modified according to "pkg-config --cflags ..." and "pkg-config --libs ...". The following variables are provided: -.IP PKG_CONFIG_DEPS -List of dependency libraries. Spaces around <=, >=, =, < and > are not allowed. +.IP MKC_CHECK_PKGCONFIG +List of libraries to check, for example, glib-2.0>=2.1. +Spaces around <=, >=, =, < and > are not allowed. +As a result of the check bmake's variable +PKG_CONFIG.exists.<lib> is set to 1 for success or 0 for failure. +Unless MKC_NOAUTO is set to 1 -DHAVE_PKGCONFIG_<LIB>=1 +is also added to CFLAGS if <lib> was found. <LIB> is tr/a-z+.-/A-ZP__/ of <lib>. +.RI < "M" > +.IP MKC_REQUIRE_PKGCONFIG +The same as MKC_REQUIRE_PKGCONFIG, but absense of library is +treated as a fatal error (See +.B errorcheck +target. .RI < "M" > +.IP PKG_CONFIG_DEPS +Synonym for MKC_REQUIRE_PKGCONFIG. Deprecated. .IP PKG_CONFIG.exists.<lib> If "1", <lib> exists, "0" otherwise. Inside <lib> <=, >=, =, < and > and replaced with @@ -1759,7 +1880,11 @@ and List of source files which are needed for generating dependencies, but are not needed in ${SRCS}. .SH "CROSS COMPILATION" -The following variables are used for compiling software using cross-rools. +The following variables are used for compiling software using cross-tools. +.IP MACHINE_GNU_PLATFORM +See TOOLCHAIN_PREFIX. +.IP OPSYS_TARGET +OPSYS for target OS. .IP SYSROOT Root directory for headers and libraries. If set, the following variables @@ -1767,6 +1892,8 @@ are set to ${TOOLCHAIN_DIR}/${TOOLCHAIN_PREFIX}<toolname>: AR, AS, CXX, CPP, CC, INSTALL, LD, NM, OBJCOPY, OBJDUMP, RANLIB, SIZE and STRIP. .RI < "U" > .RI [ "" ]. +.IP TOOLDIR +See TOOLCHAIN_DIR. .IP TOOLCHAIN_DIR Directory that contains cross-toolchain. .RI < "U" > |