.\" .\" Copyright (c) 2009 .\" The DragonFly Project. 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. .\" 3. Neither the name of The DragonFly Project nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific, prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" ``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 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS 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 October 20, 2020 .Dt COMPILERS.CONF 5 .Os .Sh NAME .Nm compilers.conf .Nd configuration file for external compilers .Sh SYNOPSIS .Pa /etc/compilers.conf .Sh DESCRIPTION The .Nm file allows to configure .Dq external compilers for usage with the .Dx .Xr build 7 system. .Pp The .Pa /etc/defaults/compilers.conf file specifies the default settings for all variables, the .Pa /etc/compilers.conf file specifies override settings. .Pp The following variable definitions are mandatory: .Bl -tag -width ".Va _INCOPTCXX" .It Va _CC The pathname of the .Nm cc compiler. .It Va _CXX The pathname of the .Nm c++ and .Nm CC compilers. .It Va _CPP The pathname of the .Nm cpp pre-processor. .It Va _INCOPT The include flags passed to the invocation of every version of c compiler, c++ compiler, and pre-processor program. This is normally set to the predefined STD_INCOPT variable. .It Va _INCOPTCXX The include flags passed to the invocation of every version of c++ compiler. This is normally set to either the DPORT_GCC_STD_INCOPTXX or DPORT_CLANG_STD_INCOPTXX predefined variables. .El .Pp These variables are optionally available: .Bl -tag -width ".Va _INCOPTCXX" .It Va _GCC The pathname of the .Nm gcc compiler. .It Va _GXX The pathname of the .Nm g++ compiler. .It Va _GCOV The pathname of the .Nm gcov coverage testing tool. .\" .\" Uncomment the following after clang is brought into base .\".It Va _CLANG .\"The pathname of the .\".Nm clang .\"compiler. .\".It Va _CLANGCXX .\"The pathname of the .\".Nm clang++ .\"compiler. .\".It Va _CLANGCPP .\"The pathname of the .\".Nm clang-cpp .\"pre-processor. .\" .It Va _CFLAGS Additional flags to pass to the c compilers. .It Va _CXXFLAGS Additional flags to pass to the c++ compilers. .It Va _CPPFLAGS Additional flags to pass to the pre-processors. .El .Pp Currently, defaults are provided for the .Xr dports 7 compilers of .Nm clang10 .Pa ( devel/clang10 ) . .Sh IMPLEMENTATION NOTES In .Dx , compilers are selected by setting the .Ev CCVER variable. The .Pa cpp , .Pa cc , etc\&. programs in .Pa /usr/bin are actually links to the .Xr objformat 1 deflector program which is responsible for executing the correct programs (located in .Pa /usr/libexec/$CCVER ) . .Pp Traditionally, .Dx has 2 compilers in base, one of which is the default compiler and the other is either a newer or older version. In order to allow additional non-base compilers into .Dx Ap s build process, .Xr objformat 1 deflects to .Pa /usr/libexec/custom when .Ev CCVER Ap s setting is not one of the compilers in base. This directory contains a .Pa cc wrapper script (and some links to it). The wrapper script then takes care of making the compiler look and behave like a compiler in base. .Pp The settings in .Nm specify paths and flags for the .Pa /usr/libexec/custom/cc script. .Sh FILES .Bl -tag -width ".Pa /etc/compilers.conf" -compact .It Pa /etc/compilers.conf external compiler configuration file .El .Sh EXAMPLES Once configured the compiler can be used like this: .Bd -literal -offset indent env CCVER= make .Ed .Pp To try building world and kernel, use: .Bd -literal -offset indent cd /usr/src env WORLD_CCVER= make buildworld env WORLD_CCVER= make buildkernel KERNCONF=MYCONF .Ed .Sh SEE ALSO .Xr objformat 1 , .Xr build 7 .Sh HISTORY The .Nm file first appeared in .Dx 2.3 .