From 2ff16ddb65ff780e3038804a0da8be88e03f6d5b Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 13 Dec 2001 18:34:57 +0000 Subject: [PATCH] initial checkin [SVN r12050] --- mingw-tools.jam | 70 ++++++++++++++++++++++++++++++++++++++++++++++ v1/mingw-tools.jam | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 mingw-tools.jam create mode 100644 v1/mingw-tools.jam diff --git a/mingw-tools.jam b/mingw-tools.jam new file mode 100644 index 000000000..e4d65a8f1 --- /dev/null +++ b/mingw-tools.jam @@ -0,0 +1,70 @@ +# (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. + +# compute directories for invoking MINGW +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 = $(MINGW_INCLUDE_DIRECTORY) ; + local GCC_STDLIB_DIRECTORY = $(MINGW_STDLIB_DIRECTORY) ; + extends-toolset gcc ; +} + +#### 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,--out-implib," ; + mingw-Link-action $(<) : $(>) ; +} + +# 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 +{ + mingw-Cc-action $(<) : $(>) ; +} + +actions mingw-Cc-action +{ + $(MINGW_BIN_DIRECTORY)mingw -c -Wall -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" +} + +#### C++ #### +rule C++-action +{ + 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)" -I"$(STDHDRS)" -o "$(<)" "$(>)" +} + +#### Archive #### + +rule Archive-action +{ + mingw-Archive-action $(<) : $(>) ; +} + +actions updated together piecemeal mingw-Archive-action +{ + ar ru "$(<:T)" "$(>:T)" +} + diff --git a/v1/mingw-tools.jam b/v1/mingw-tools.jam new file mode 100644 index 000000000..e4d65a8f1 --- /dev/null +++ b/v1/mingw-tools.jam @@ -0,0 +1,70 @@ +# (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. + +# compute directories for invoking MINGW +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 = $(MINGW_INCLUDE_DIRECTORY) ; + local GCC_STDLIB_DIRECTORY = $(MINGW_STDLIB_DIRECTORY) ; + extends-toolset gcc ; +} + +#### 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,--out-implib," ; + mingw-Link-action $(<) : $(>) ; +} + +# 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 +{ + mingw-Cc-action $(<) : $(>) ; +} + +actions mingw-Cc-action +{ + $(MINGW_BIN_DIRECTORY)mingw -c -Wall -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" +} + +#### C++ #### +rule C++-action +{ + 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)" -I"$(STDHDRS)" -o "$(<)" "$(>)" +} + +#### Archive #### + +rule Archive-action +{ + mingw-Archive-action $(<) : $(>) ; +} + +actions updated together piecemeal mingw-Archive-action +{ + ar ru "$(<:T)" "$(>:T)" +} +