2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00
Files
build/mingw-tools.jam
2003-03-08 09:53:45 +00:00

95 lines
2.9 KiB
Plaintext

# (C) Copyright David Abrahams 2001. Permission to copy, use,
# modify, sell and distribute this software is granted provided this
# copyright notice appears in all copies. This software is provided
# "as is" without express or implied warranty, and with no claim as
# to its suitability for any purpose.
# singleton variables...
set-as-singleton MINGW_ROOT_DIRECTORY MINGW_BIN_DIRECTORY MINGW_INCLUDE_DIRECTORY MINGW_STDLIB_DIRECTORY ;
# compute directories for invoking MINGW
# Get these variable set on the targets so that we can re-use the
# build actions for other toolsets using this one as a base.
flags mingw MINGW_BIN_DIRECTORY ;
flags mingw MINGW_INCLUDE_DIRECTORY ;
flags mingw MINGW_STDLIB_DIRECTORY ;
MINGW_BIN_DIRECTORY ?= $(MINGW_ROOT_DIRECTORY)$(SLASH)bin$(SLASH) ;
MINGW_BIN_DIRECTORY ?= "" ; # Don't clobber tool names if MINGW_ROOT_DIRECTORY not set
MINGW_INCLUDE_DIRECTORY ?= $(MINGW_ROOT_DIRECTORY)$(SLASH)include ;
MINGW_STDLIB_DIRECTORY ?= $(MINGW_ROOT_DIRECTORY)$(SLASH)lib ;
{
local GCC_INCLUDE_DIRECTORY = ;
local GCC_STDLIB_DIRECTORY = ;
extends-toolset gcc ;
GCC_BIN_DIR = $(MINGW_BIN_DIRECTORY) ;
flags mingw STDHDRS : $(MINGW_INCLUDE_DIRECTORY) ;
flags mingw STDLIBPATH : $(MINGW_STDLIB_DIRECTORY) ;
}
flags mingw CFLAGS <threading>multi : -mthreads ;
flags mingw LINKFLAGS <threading>multi : -mthreads ;
#### Link ####
rule Link-action
{
# This will appear before the import library name when building a DLL, but
# will be "multiplied away" otherwise. The --exclude-symbols directive
# proved to be neccessary with some versions of Cygwin.
IMPLIB_COMMAND on $(<) = "-Wl,--exclude-symbols,_bss_end__:_bss_start__:_data_end__:_data_start__ -Wl,--enable-auto-image-base -Wl,--out-implib," ;
mingw-Link-action $(<) : $(>) ;
# Workaround GCC's lack of command-files and NT's line-length limitation.
if $(NT) {
JAMSHELL on $(<) = % ;
}
return ;
}
# for mingw, we repeat all libraries so that dependencies are always resolved
actions mingw-Link-action bind NEEDLIBS
{
$(MINGW_BIN_DIRECTORY)g++ $(IMPLIB_COMMAND)$(<[2]) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) -Wl,-rpath-link,.
}
#### Cc #####
rule Cc-action
{
SPACE on $(<) = " " ;
mingw-Cc-action $(<) : $(>) ;
}
actions mingw-Cc-action
{
$(MINGW_BIN_DIRECTORY)gcc -c -Wall -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -isystem$(SPACE)"$(STDHDRS)" -o "$(<)" "$(>)"
}
#### C++ ####
rule C++-action
{
SPACE on $(<) = " " ;
mingw-C++-action $(<) : $(>) ;
}
actions mingw-C++-action
{
$(MINGW_BIN_DIRECTORY)g++ -c -Wall -ftemplate-depth-100 -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -isystem$(SPACE)"$(STDHDRS)" -o "$(<)" "$(>)"
}
#### Archive ####
rule Archive-action
{
mingw-Archive-action $(<) : $(>) ;
}
actions updated together piecemeal mingw-Archive-action
{
$(MINGW_BIN_DIRECTORY)ar ru$(ARFLAGS) "$(<:T)" "$(>:T)"
}