1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, version 3 of the License ONLY.
5 # This program is distributed in the hope that it will be useful,
6 # but WITHOUT ANY WARRANTY; without even the implied warranty of
7 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8 # GNU General Public License for more details.
10 # You should have received a copy of the GNU General Public License
11 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 # OS specific variable settings
17 ###############################################################################
19 ###############################################################################
21 PATH_SEPARATOR = '\' ;
22 local SUPPORTED_TOOLSETS =
28 # if the JAM_TOOLSET environment variable is defined, check that it is
29 # one of our supported values
32 if ! $(JAM_TOOLSET) in $(SUPPORTED_TOOLSETS) {
33 Echo 'The JAM_TOOLSET environment variable is defined but its value' ;
34 Echo 'is invalid, please use one of the following:' ;
36 for t in $(SUPPORTED_TOOLSETS) { Echo ' ' $(t) ; }
42 Echo 'The JAM_TOOLSET environment variable is not defined, defaults to MINGW' ;
44 MINGW ?= 'c:\mingw\bin\' ;
57 if $(JAM_TOOLSET) = MINGW {
58 Echo 'Compiler is GCC with MinGW' ;
64 C++FLAGS ?= $(CCFLAGS) ;
67 LINKLIBS ?= -lkernel32 ;
69 CC.standard ?= -std=gnu11 ;
73 # MinGW-specific thingy
74 MINGW_GUI = '-Wl,-subsystem,windows' ;
75 MINGW_THREADS = '-mthreads' ;
85 CC = "$(MINGW)$(CC:J= )" ;
86 C++ = "$(MINGW)$(C++:J= )" ;
87 LINK = "$(MINGW)$(LINK:J= )" ;
88 C++LINK = "$(MINGW)$(C++LINK:J= )" ;
89 AR = "$(MINGW)$(AR:J= )" ;
90 if $(RANLIB) { RANLIB = "$(MINGW)$(RANLIB:J= )" ; }
92 } else if $(JAM_TOOLSET) = LCC {
93 Echo 'Compiler is Win32-LCC' ;
105 } else if $(JAM_TOOLSET) = PELLESC {
106 Echo 'Compiler is PellesC' ;
116 LINKLIBS ?= crt.lib oldnames.lib 'Win\kernel32.lib' ;
120 # XXX: We need better comments here !!
121 Exit "On NT, set MINGW to the root of the MinGW dir (but it won't help you anyway)" ;
126 ###############################################################################
128 ###############################################################################
130 PATH_SEPARATOR = '/' ;
136 OBJCFLAGS ?= $(CCFLAGS) ;
137 C++FLAGS ?= $(CCFLAGS) ;
142 LINKFLAGS ?= $(CCFLAGS) ;
145 CC.standard ?= -std=gnu11 ;
148 if $(OS) != 'LINUX' { RANLIB ?= ranlib ; }
156 STDHDRS ?= /usr/include ;
157 HDRPATH_IGNORE ?= /usr ; # no regexp yet
158 PKG-CONFIG ?= pkg-config ;
162 CCFLAGS += -D__cygwin__ ;
171 CC.standard = -qfullpath -qlanglvl=extc99 ;
172 C++.standard = -qfullpath -qlanglvl=extc99 ;
176 # shared library object file suffix. We assume that it is identical
177 # than the normal one
178 SUFOBJSHR ?= $(SUFOBJ) ;
179 SUFLIBSHR ?= $(SUFLIB) ;
186 # General defaults; a lot like UNIX
188 PATH_SEPARATOR ?= '/' ;
189 if $(OS) != 'LINUX' { AR ?= ar ru ; } else { AR ?= ar srUu ; }
193 BINDIR ?= /usr/local/bin ;
194 C++ ?= g++ ; # k8: was cc
196 CC ?= gcc ; # k8: was cc
204 JAMRULES ?= Jamrules ;
206 LIBDIR ?= /usr/local/lib ;
211 MANDIR ?= /usr/local/man ;
223 SHELLHEADER ?= '#!/bin/sh' ;
227 SUBDIRRESET ?= ASFLAGS HDRS C++FLAGS CCFLAGS HDRS DEFINES ;
231 UNDEFFLAG ?= '-u _' ;
241 GDCLINK ?= gdc -pipe ;
243 HDRPATTERN = '^\s*#\s*include\s+[<"]([^">]+)[">].*$' ;
244 PKG-CONFIG ?= pkg-config ;
247 OSFULL = $(OS)$(OSVER)$(OSPLAT) $(OS)$(OSPLAT) $(OS)$(OSVER) $(OS) ;
250 #C++OPTIM ?= $(OPTIM) ;
252 #C++LINKFLAGS ?= $(LINKFLAGS) ;
253 #C++LINKLIBS ?= $(LINKLIBS) ;
255 OBJCOPTIM ?= $(OPTIM) ;
257 OBJCLINKFLAGS ?= $(LINKFLAGS) ;
258 OBJCLINKLIBS ?= $(LINKLIBS) ;
259 OBJCLINKLIBS += -lobjc ;
262 if ( 'gcc' in $(CC) ) && ! ( '-pipe' in $(CC) ) { CC += -pipe ; }
263 if ( 'g++' in $(C++) ) && ! ( '-pipe' in $(C++) ) { C++ += -pipe ; }
267 #Echo 'OSFULL:' $(OSFULL) ;
268 #Echo 'UNIX:' $(UNIX) ;
272 if ( 'gcc' in $(CC) ) || ( 'g++' in $(C++) ) {
273 CFLAGS.all += -fno-aggressive-loop-optimizations ;
274 CFLAGS.all += -fno-delete-null-pointer-checks ;
275 CFLAGS.all += -fno-strict-aliasing ;
276 CFLAGS.all += -fno-strict-overflow ;
277 CFLAGS.all += -fwrapv ;
278 CFLAGS.all += -mstackrealign ;
279 CFLAGS.all += -fno-diagnostics-show-caret ;