mkconfig_env

Name
Description
Environment Units
See Also
Bugs
Website
Author

Name

mkconfig_env - mkconfig environment units

Description

The environment units create an output file that can be used as shell script input to set your environment.

Environment Units

env-main

The env-main unit creates a shell script with the exported shell variables.
source
<source-file>

The source directive will source another shell script. This is useful to make other variables accessible when the the created shell script is executed.

env-systype

The systype environment unit determines what type, revision and architecture of the system you are running on.
standard_system

Runs the ’system type’, ’system rev’ and ’system arch’ commands.

system {type|rev|arch}

The system directive with the type, rev and arch arguments will create the _MKCONFIG_SYSTYPE, _MKCONFIG_SYSREV, and _MKCONFIG_SYSARCH environment variables respectively. These correspond to the output of uname -s, uname -r and uname -m. On AIX, the oslevel command is used to attempt to resolve the revision of the operating system. On MacOS X, the revision is the kernel revision and does not correspond to the marketing version.

env-cc

The cc environment unit determines basic flags needed to run the C compiler. Use the ’standard_cc’ check.

The checks are interdependent on each other and should be configured in the order: 32bitflags, cc, using_gcc, using_clang, using_cplusplus. cflags, ldflags, and libs.

The CC, CFLAGS, LDFLAGS, LIBS, CFLAGS_SHARED, and LDFLAGS_SHARED environment variables may be set in the options file. Any value set in the environment will override the settings in the options file.

standard_cc

Runs the cc, using_gcc, using_gnu_ld, using_clang and using_cplusplus tests.

32bitflags

If used, this directive must appear before the cc, cflags, etc. commands. It turns off use of the ’getconf’ command and other 64-bit flags.

cc

Determines the C compiler being used (default cc). Sets the CC environment variable.

using_gcc

Sets the _MKCONFIG_USING_GCC environment variable to ’Y’ if the gcc compiler is being used.

using_clang

Sets the _MKCONFIG_USING_CLANG environment variable to ’Y’ if the clang compiler is being used.

using_cplusplus

Sets the _MKCONFIG_USING_CPLUSPLUS environment variable to ’Y’ if a c++ compiler is being used. Required.

cflags

Sets the CFLAGS_DEBUG, CFLAGS_OPTIMIZE, CFLAGS_INCLUDE, CFLAGS_USER, CFLAGS_COMPILER, CFLAGS_APPLICATION and CFLAGS_SYSTEM environment variable according to the ’getconf’ program and appropriate to the operating system and compiler.

The CFLAGS environment variable will populate the CFLAGS_USER environment variable. The CFLAGS_ALL environment variable can be used to override the c flags.

addcflag compiler-flag

Checks to see if compiler-flag is valid for the compiler and if ok, adds it to the CFLAGS environment variable.

findconfig config-file

Locates the config-file (someConfig.sh) and loads it.

findpc pkgconfig-file

Deprecated. Locates the pkgconfig-file (someConfig.pc) and loads it.

addconfig env-var mkconfig-var

After a configuration or pkgconfig file is loaded, the environment variables contained therein can be loaded into mkconfig variables. Typical mkconfig variables are: cflags_include, ldflags_lib_application, etc.

ldflags

Sets the LDFLAGS_DEBUG, LDFLAGS_OPTIMIZE, LDFLAGS_USER, LDFLAGS_COMPILER, LDFLAGS_APPLICATION and LDFLAGS_SYSTEM environment variables according to the ’getconf’ program and appropriate to the operating system and compiler.

The LDFLAGS environment variable will populate the LDFLAGS_USER environment variable. The LDFLAGS_ALL environment variable can be used to override the load flags.

libs

Sets the LDFLAGS_LIBS_USER, LDFLAGS_LIBS_APPLICATION and LDFLAGS_LIBS_SYSTEM environment variable according to the ’getconf’ program and appropriate to the operating system and compiler.

The LDFLAGS_LIBS_ALL environment variable can be used to override the libraries.

cflags_shared

Sets the CFLAGS_SHARED environment variable for building position independent code as appropriate to the operating system and compiler.

ldflags_shared

Sets the LDFLAGS_SHARED_LIBLINK environment variable for building a shared library as appropriate to the operating system and compiler.

pkg {cflags|include|libs} name-of-package [package-path]

Use the PKG_CONFIG_PATH environment variable if the package you want to load is in a non-standard location. Or specify package-path in the pkg directive.

With the cflags and include directive, adds the package’s CFLAGS to CFLAGS_APPLICATION.

With the libs directive, adds the package’s LDFLAGS to LDFLAGS_LIBS_APPLICATION.

shareexeclinkflag

Sets the LDFLAGS_EXEC_LINK environment variable for building an executable against shared libraries as appropriate to the operating system and compiler.

sharerunpathflag

Sets the LDFLAGS_RUNPATH environment variable to the flag for setting the shared run path as appropriate to the operating system and compiler.

env-dc

The dc environment unit determines basic flags needed to run the D compiler. The D compiler may also be dependent on the C compiler, so the env-cc unit should also be loaded and the C compiler environment should be set up. The DC and DFLAGS environment variables may be set in the options file. Any value set in the environment will override the settings in the options file.

dc

Determines the D compiler being used. Sets the DC environment variable. Due to major differences in compiler command line options, the following environment variables are also set:

DC_OPT - Optimizer option for the compiler.
DC_OF - Option prepended to the output file (e.g. -ofoutname or -ooutname). Must be used w/o a space due to the dmd compiler usage.
DC_RELEASE - Option for release code.
DC_INLINE - Option for inline code generation.
DC_UNITTEST - Option for unittest code generation.
DC_DEBUG - Option for debug code generation.
DC_INTFC - Option for interface file generation.
DC_COV - Option for code coverage generation.
DC_LINK - Option to prepend to linker commands. This should be prepended without a space. Needed for the dmd compiler. e.g. ${DC_LINK}-L/somepath ${DC_LINK}-lmylib

dflags

Sets the DFLAGS environment variable.

env-extension

extension {obj|exe|shlib}

The obj and exe arguments correspond to the OBJ_EXT, EXE_EXT and SHLIB_EXT environment variables. These variables are set to the object file extension (.o, .obj), executable file extension (none or .exe) or the shared library extension (.so, .sl, per the operating system and compiler.

env-msgfmt

cmd_msgfmt

Sets the XMSGFMT environment variable to the path of the msgfmt or gmsgfmt command, if any.

See Also

iffe(1) autoconf(1) dist(7) mkconfig(7) mkconfig_d(7) mkconfig_c(7)

Bugs

Send bug reports to: brad.lanam.di_at_gmail.com

Website

http://www.gentoo.com/di/mkconfig.html

Author

This program is Copyright 2011-2012 by Brad Lanam, Walnut Creek CA

Brad Lanam, Walnut Creek, CA (brad.lanam.di_at_gmail.com)