.\" .\" 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 14, 2012 .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 variables are available: .Bl -tag -width ".Va _CPPFLAGS" .It Va _CC The pathname of the .Nm cc program of the compiler. .It Va _CFLAGS Any additional flags to pass to .Va _CC . .It Va _CPP The pathname of the .Nm cpp program of the compiler. .It Va _CPPFLAGS Any additional flags to pass to .Va _CPP . .It Va _CXX The pathname of the .Nm c++ program of the compiler. .It Va _CXXFLAGS Any additional flags to pass to .Va _CXX . .El .Pp Currently, defaults are provided for .Nm clang (installed from .Xr pkgsrc 7 Ap s .Pa lang/clang ) , .Nm clangsvn (installed from SVN trunk as described in .Pa http://clang.llvm.org/get_started.html ) , .Nm gcc46 (installed from .Xr pkgsrc 7 Ap s .Pa lang/gnat-aux ) , and .Nm pcc (installed from .Xr pkgsrc 7 Ap s .Pa lang/pcc-current ) . .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=clang make .Ed .Pp To try building world and kernel, use: .Bd -literal -offset indent cd /usr/src env WORLD_CCVER= make -DNO_GCC47 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 .