diff --git a/.editorconfig b/.editorconfig index a976c1da75..895e4fb507 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,6 +18,9 @@ indent_style = space [*.jam] indent_style = space +[*.sh] +indent_style = space + [.clangd] indent_size = 2 indent_style = space diff --git a/doc/src/history.adoc b/doc/src/history.adoc index aeceb7ad21..fdc32eaaba 100644 --- a/doc/src/history.adoc +++ b/doc/src/history.adoc @@ -3,6 +3,9 @@ == Version 5.3.0 +* *New*: Replace the old `vacpp` and `xlcpp` with a new `ibmcxx` toolset that + supports the old compilers and the new "IBM XL" and "IBM Open XL" compilers. + -- _René Ferdinand Rivera Morell_ and _Chris Ward_ * *New*: Add generic `cc` toolset for simply, direct, configuration of unknown C compiler toolsets (for example `tcc`). -- _René Ferdinand Rivera Morell_ diff --git a/doc/src/reference.adoc b/doc/src/reference.adoc index e9e33b8a86..58d3eae1fd 100644 --- a/doc/src/reference.adoc +++ b/doc/src/reference.adoc @@ -335,10 +335,10 @@ include::../../src/tools/embarcadero.jam[tag=doc] include::../../src/tools/emscripten.jam[tag=doc] include::../../src/tools/gcc.jam[tag=doc] include::../../src/tools/hp_cxx.jam[tag=doc] +include::../../src/tools/ibmcxx.jam[tag=doc] include::../../src/tools/intel.jam[tag=doc] include::../../src/tools/msvc.jam[tag=doc] include::../../src/tools/sun.jam[tag=doc] -include::../../src/tools/vacpp.jam[tag=doc] :leveloffset: -3 === Third-party libraries diff --git a/src/engine/build.sh b/src/engine/build.sh index 29d08fcbe9..0b459329f2 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -65,8 +65,8 @@ You can specify the toolset as the argument, i.e.: ./build.sh [options] gcc Toolsets supported by this script are: - acc, clang, como, gcc, intel-darwin, intel-linux, kcc, kylix, mipspro, - pathscale, pgi, qcc, sun, sunpro, tru64cxx, vacpp + acc, clang, como, gcc, ibmcxx-clang, intel-darwin, intel-linux, + kcc, kylix, mipspro, pathscale, pgi, qcc, sun, sunpro, tru64cxx For any toolset you can override the path to the compiler with the '--cxx' option. You can also use additional flags for the compiler with the @@ -223,20 +223,9 @@ check_toolset () if test_toolset tru64cxx && test_uname OSF1 && test_compiler cc ; then B2_TOOLSET=mipspro ; return ${TRUE} ; fi # QNX (qcc) if test_toolset qcc && test_uname QNX && test_compiler QCC ; then B2_TOOLSET=qcc ; return ${TRUE} ; fi - # Linux XL/VA C++ (xlcpp, vacpp) - if test_toolset xlcpp vacpp && test_uname Linux && test_compiler xlC_r ; then - if /usr/bin/lscpu | grep Byte | grep Little > /dev/null 2>&1 ; then - # Little endian linux - B2_TOOLSET=xlcpp - return ${TRUE} - else - # Big endian linux - B2_TOOLSET=vacpp - return ${TRUE} - fi - fi - # AIX VA C++ (vacpp) - if test_toolset vacpp && test_uname AIX && test_compiler xlC_r ; then B2_TOOLSET=vacpp ; return ${TRUE} ; fi + # AIX IBM Open XL (ibmcxx-clang) + IBMCXX=`ls -1 -r /opt/IBM/openxlC/17.*/bin/ibm-clang++_r` + if test_toolset ibmcxx-clang && test_uname AIX && test "" != "${IBMCXX}" && test_compiler "${IBMCXX}" ; then B2_TOOLSET=ibmcxx-clang ; return ${TRUE} ; fi # PGI (pgi) if test_toolset pgi && test_compiler pgc++ -std=c++11 ; then B2_TOOLSET=pgi ; return ${TRUE} ; fi # Pathscale C++ (pathscale) @@ -335,16 +324,10 @@ case "${B2_TOOLSET}" in B2_CXXFLAGS_DEBUG="-O0 -g -static-intel" ;; - vacpp) - CXX_VERSION_OPT=${CXX_VERSION_OPT:--qversion} - B2_CXXFLAGS_RELEASE="-O3 -s -qstrict -qinline" - B2_CXXFLAGS_DEBUG="-g -qNOOPTimize -qnoinline -pg" - ;; - - xlcpp) - CXX_VERSION_OPT=${CXX_VERSION_OPT:--qversion} - B2_CXXFLAGS_RELEASE="-s -O3 -qstrict -qinline" - B2_CXXFLAGS_DEBUG="-g -qNOOPTimize -qnoinline -pg" + ibmcxx-clang) + CXX_VERSION_OPT=${CXX_VERSION_OPT:---version} + B2_CXXFLAGS_RELEASE="-O3 -Wl,-s -Wno-deprecated-declarations" + B2_CXXFLAGS_DEBUG="-O0 -fno-inline -g -Wno-deprecated-declarations" ;; como) diff --git a/src/engine/jam.h b/src/engine/jam.h index c69895a873..61ccd16191 100644 --- a/src/engine/jam.h +++ b/src/engine/jam.h @@ -147,7 +147,9 @@ #define PATH_DELIM '/' #ifdef _AIX + #ifndef unix #define unix + #endif #define MAXLINE 23552 /* 24k - 1k, max chars per command line */ #define OSMINOR "OS=AIX" #define OS_AIX diff --git a/src/tools/ibmcxx.jam b/src/tools/ibmcxx.jam new file mode 100644 index 0000000000..a5a60f2c00 --- /dev/null +++ b/src/tools/ibmcxx.jam @@ -0,0 +1,334 @@ +#| +Copyright René Ferdinand Rivera Morell 2024-2025 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.txt +or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) +|# + +#| tag::doc[] + +[[bbv2.reference.tools.compiler.ibmcxx]] += IBM C and C++ Compiler Family + +The `ibmcxx` module supports the +https://www.ibm.com/products/c-and-c-plus-plus-compiler-family[IBM +C and C++ Compiler Family], for the AIX and Linux operating systems. + +The module is initialized using the following syntax: + +---- +using ibmcxx : [version] : [c++-compile-command] : [compiler options] ; +---- + +This statement may be repeated several times, if you want to configure +several versions of the compiler. + +Without a version or command B2 will attempt to find a compiler that matches +the options in various standard install location, including in the `PATH`. + +The following options can be provided, using +_`option-value syntax`_: + +`tool`:: +Indicates the type of frontend the compiler is. The values can be `clang` or +`ibm`. The `clang` frontend corresponds to the Open XL >= 17.x versions. And +the `ibm` frontend corresponds to XL <= 16.x. + +If you have multiple compilers configured as separate frontends one can select +the specific one by instead of using the base `ibmcxx` toolset name using +extended `ibmcxx-clang` or `ibmcxx-ibm` names. + +|# # end::doc[] + +import toolset : flags ; +import feature ; +import common ; +import generators ; +import os ; +import unix ; +import path ; +import sequence ; +import version ; + +# Common (minimal) toolset. +feature.extend toolset : ibmcxx ; +toolset.inherit ibmcxx : unix ; +feature.subfeature toolset ibmcxx : tool : clang ibm : propagated link-incompatible ; + +rule init ( version ? : command * : options * : requirements * ) +{ + # No command information given to go on. Try and discover the most + # recent tool available. + local version-detected ; + if ! $(command) && ! $(version) + { + local detected-versions = [ find-versions ] ; + version-detected = $(detected-versions[1]) ; + } + local tool = [ feature.get-values : $(options) ] ; + if $(tool) = clang || ! $(tool) + { + if ! $(command) && ( $(version) || $(version-detected) ) + { + command = [ common.find-tool "ibm-clang++_r" : + [ path.make "/opt/IBM/openxlC/$(version:E=$(version-detected))/bin" ] ] ; + } + if ! $(command) && ( $(version) || $(version-detected) ) + { + command = [ common.find-tool "xlclang++" : + [ path.make "/opt/IBM/xlC/$(version:E=$(version-detected))/bin" ] ] ; + } + if ! $(command) && ! ( $(version) || $(version-detected) ) + { + command = [ common.find-tool "xlclang++" : + [ path.make "/usr/xlcpp/bin" ] [ path.make "/usr/vacpp/bin" ] ] ; + } + if $(command) + { + tool = clang ; + version ?= $(version-detected) ; + } + } + if $(tool) = ibm || ! $(tool) + { + if ! $(command) && ( $(version) || $(version-detected) ) + { + command = [ common.find-tool "xlc++" : + [ path.make "/opt/IBM/xlC/$(version:E=$(version-detected))/bin" ] ] ; + } + if ! $(command) && ! $(version) + { + command = [ common.find-tool "xlc++" : + [ path.make "/usr/xlcpp/bin" ] [ path.make "/usr/vacpp/bin" ] ] ; + } + if $(command) + { + tool = ibm ; + version ?= $(version-detected) ; + } + } + local default_command = $(command:D=) ; + default_command ?= "ibm-clang++_r" ; + tool ?= clang ; + requirements += $(tool) ; + command = [ common.find-compiler ibmcxx : $(default_command) + : $(version) : $(command) ] ; + local condition = [ + common.check-init-parameters ibmcxx $(requirements) + : version $(version) ] ; + common.handle-options ibmcxx : $(condition) : $(command) : $(options) ; +} + +rule find-versions ( ) +{ + local paths = /opt/IBM/openxlC /opt/IBM/xlc ; + local found = [ path.glob $(paths) : "*" ] ; + local versions ; + for local f in $(found) + { + versions += $(f:D=) ; + } + versions = [ sequence.insertion-sort $(versions) : version.version-less ] ; + versions = [ sequence.reverse $(versions) ] ; + return $(versions) ; +} + +# Declare generators +generators.register-c-compiler ibmcxx.compile.c++.preprocess : CPP : PREPROCESSED_CPP : ibmcxx ; +generators.register-c-compiler ibmcxx.compile.c.preprocess : C : PREPROCESSED_C : ibmcxx ; +generators.register-c-compiler ibmcxx.compile.c++ : CPP : OBJ : ibmcxx ; +generators.register-c-compiler ibmcxx.compile.c : C : OBJ : ibmcxx ; +generators.register-c-compiler ibmcxx.compile.asm : ASM_CPP : OBJ : ibmcxx ; + +rule flags-clang ( name cond * : vals * : rules * ) +{ + flags-* $(name) $(cond) + clang + : $(vals) : $(rules) ; +} +rule flags-ibm ( name cond * : vals * : rules * ) +{ + flags-* $(name) $(cond) + ibm + : $(vals) : $(rules) ; +} +rule flags-* ( name cond * : vals * : rules * : sub ? ) +{ + cond = [ SORT $(cond) ] ; + local rules-mods = $(sub:E=ibmcxx).$(rules) ; + rules-mods ?= $(sub:E=ibmcxx) ; + for local rule-mod in $(rules-mods) + { + flags $(rule-mod) $(name) $(cond:J=/) : $(vals) : unchecked ; + } +} + +# Allow C++ style comments in C files +# flags-ibm CFLAGS : -qnoxlcompatmacros ; +# flags-ibm CFLAGS : -qcpluscmt ; + +# Optimization flags +flags-clang CFLAGS off : -O0 ; +flags-clang CFLAGS speed : -O3 ; +flags-clang CFLAGS space : -O2 -Os ; +flags-ibm CFLAGS off : -O0 ; +flags-ibm CFLAGS speed : -O3 -qstrict ; +flags-ibm CFLAGS space : -O2 -qcompact ; +# flags-ibm CFLAGS off : -qNOOPTimize ; + +# Discretionary inlining (not recommended) +flags-clang CFLAGS off : -fno-inline-functions ; +flags-ibm CFLAGS off : -qnoinline ; +flags-ibm CFLAGS on : -qinline ; + +# Exception handling +flags-clang C++FLAGS off : -fno-exceptions ; +flags-ibm C++FLAGS off : -qnoeh ; +flags-ibm C++FLAGS on : -qeh ; + +# Run-time Type Identification +flags-clang C++FLAGS off : -fno-rtti ; +flags-ibm C++FLAGS off : -qnortti ; +flags-ibm C++FLAGS on : -qrtti ; + +# Enable 64-bit memory addressing model +flags-clang CFLAGS 64 : -m64 ; +flags-clang LINKFLAGS 64 : -m64 ; +flags-ibm CFLAGS 64 : -q64 ; +flags-ibm LINKFLAGS 64 : -q64 ; +flags ibmcxx ARFLAGS aix/64 : -X 64 ; + +# Debug information +flags-clang CFLAGS on : -g ; +flags-clang LINKFLAGS on : -g ; +flags-ibm LINKFLAGS off : -s ; + +# Use absolute path when generating debug information +flags-ibm CFLAGS on : -g -qfullpath ; +flags-ibm LINKFLAGS on : -g -qfullpath ; + +# ?? +# flags-clang C++FLAGS aix : -ffunction-sections : compile ; +flags-ibm C++FLAGS aix : -qfuncsect : compile ; +flags-ibm CFLAGS linux shared : -qpic=large : compile ; +flags-ibm FINDLIBS linux : rt ; + +# The -bnoipath strips the prepending (relative) path of libraries from +# the loader section in the target library or executable. Hence, during +# load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded +# -blibpath (*similar* to -lrpath/-lrpath-link) is searched. Without +# this option, the prepending (relative) path + library name is +# hard-coded in the loader section, causing *only* this path to be +# searched during load-time. Note that the AIX linker does not have an +# -soname equivalent, this is as close as it gets. +# +# The above options are definitely for AIX 5.x, and most likely also for +# AIX 4.x and AIX 6.x. For details about the AIX linker see: +# http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf +# +flags-* LINKFLAGS aix shared : -bnoipath : link ; + +# Run-time linking +flags-* EXE-LINKFLAGS aix shared : -brtl : link ; + +# Symbol visibility +flags-ibm OPTIONS hidden : -qvisibility=hidden : compile ; +flags-ibm OPTIONS protected : -qvisibility=protected : compile ; +flags-ibm OPTIONS global : -qvisibility=default : compile ; +flags-clang OPTIONS hidden : -fvisibility=hidden : compile ; +flags-clang OPTIONS hidden : -fvisibility-inlines-hidden : compile.c++ ; +flags-clang OPTIONS protected : -fvisibility=protected : compile ; +flags-clang OPTIONS global : -fvisibility=default : compile ; +#flags-clang OPTIONS : -mdefault-visibility-mapping=all -fvisibility=default : compile link ; + +# Profiling +flags-* CFLAGS on : -pg ; +flags-* LINKFLAGS on : -pg ; + +# C++ standard version +flags-clang OPTIONS 98 : -std=c++98 : compile.c++ ; +flags-clang OPTIONS 03 : -std=c++03 : compile.c++ ; +flags-clang OPTIONS 11 : -std=c++11 : compile.c++ ; +flags-clang OPTIONS 14 : -std=c++14 : compile.c++ ; +flags-clang OPTIONS 17 : -std=c++17 : compile.c++ ; +flags-clang OPTIONS 20 : -std=c++20 : compile.c++ ; +flags-clang OPTIONS 23 : -std=c++2c : compile.c++ ; +flags-clang OPTIONS latest : -std=c++20 : compile.c++ ; + +flags-* USER_OPTIONS : : compile ; +flags-* USER_OPTIONS : : compile.c++ ; +flags-* DEFINES : : compile ; +flags-* UNDEFS : : compile ; +flags-* HDRS ; +flags-* STDHDRS ; +flags-* USER_OPTIONS : : link ; +flags-* ARFLAGS ; +flags-* USER_OPTIONS : : compile.asm ; + +flags-* LIBPATH ; +flags-* NEEDLIBS ; +flags-* FINDLIBS ; +flags-* FINDLIBS ; + +# Language for source files to compile. +flags-ibm OPTIONS : -qsourcetype=c : compile.c ; +flags-ibm OPTIONS : -qsourcetype=c++ : compile.c++ ; +flags-ibm OPTIONS : -qsourcetype=assembler : compile.asm ; +flags-clang OPTIONS : "-x c" : compile.c ; +flags-clang OPTIONS : "-x c++" : compile.c++ ; +flags-clang OPTIONS : "-x assembler-with-cpp" : compile.asm ; + +# Generate shared link objects. +flags-ibm LINKFLAGS : -G : link.dll ; +flags-clang LINKFLAGS : -shared : link.dll ; + +# Preprocessing. +flags-* OPTIONS off : -P + : compile.c.preprocess compile.c++.preprocess ; + +# Threading. +flags-ibm OPTIONS multi : -qthreaded : compile link ; +flags-clang OPTIONS multi : -pthread : compile link ; + + +_ = " " ; + +actions link bind NEEDLIBS +{ + "$(CONFIG_COMMAND)" $(EXE-LINKFLAGS) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS) +} + +actions link.dll bind NEEDLIBS +{ + "$(CONFIG_COMMAND)" $(LINKFLAGS) -o "$(<[1])" $(HAVE_SONAME)-Wl,-soname$(_)-Wl,$(<[-1]:D=) -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS) +} + +actions compile.c +{ + "$(CONFIG_COMMAND)" -c $(OPTIONS) $(USER_OPTIONS) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" +} + +actions compile.c++ +{ + "$(CONFIG_COMMAND)" -c $(OPTIONS) $(USER_OPTIONS) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" +} + +actions compile.asm +{ + "$(CONFIG_COMMAND)" -c $(OPTIONS) $(USER_OPTIONS) -U$(UNDEFS) -D$(DEFINES) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" +} + +actions updated together piecemeal archive +{ + ar $(ARFLAGS) ru "$(<)" "$(>)" +} + +actions compile.c.preprocess bind PCH_FILE +{ + "$(CONFIG_COMMAND)" -E $(OPTIONS) $(USER_OPTIONS) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" +} + +actions compile.c++.preprocess bind PCH_FILE +{ + "$(CONFIG_COMMAND)" -E $(OPTIONS) $(USER_OPTIONS) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" +} diff --git a/src/tools/vacpp.jam b/src/tools/vacpp.jam deleted file mode 100644 index a12a4abb9f..0000000000 --- a/src/tools/vacpp.jam +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright Vladimir Prus 2004. -# Copyright Toon Knapen 2004. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE.txt -# or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) - -#| tag::doc[] - -[[b2.reference.tools.compiler.vacpp]] -= IBM Visual Age - -The `vacpp` module supports the http://www.ibm.com/software/ad/vacpp[IBM -Visual Age] C++ Compiler, for the AIX operating system. Versions 7.1 and -8.0 are known to work. - -The module is initialized using the following syntax: - ----- -using vacpp ; ----- - -The module does not accept any initialization options. The compiler -should be installed in the `/usr/vacpp/bin` directory. - -Later versions of Visual Age are known as XL C/C++. They were not tested -with the the `vacpp` module. - -|# # end::doc[] - -# -# B2 V2 toolset for the IBM XL C++ compiler -# - -import toolset : flags ; -import feature ; -import common ; -import generators ; -import os ; - -feature.extend toolset : vacpp ; -toolset.inherit vacpp : unix ; - -# Configure the vacpp toolset -rule init ( version ? : command * : options * ) -{ - local condition = [ - common.check-init-parameters vacpp : version $(version) ] ; - - command = [ common.get-invocation-command vacpp : xlC - : $(command) : "/usr/vacpp/bin/xlC" ] ; - - common.handle-options vacpp : $(condition) : $(command) : $(options) ; -} - -# Declare generators -generators.register-c-compiler vacpp.compile.c : C : OBJ : vacpp ; -generators.register-c-compiler vacpp.compile.c++ : CPP : OBJ : vacpp ; - -# Allow C++ style comments in C files -flags vacpp CFLAGS : -qcpluscmt ; - -# Declare flags -flags vacpp CFLAGS off : -qNOOPTimize ; -flags vacpp CFLAGS speed : -O3 -qstrict ; -flags vacpp CFLAGS space : -O2 -qcompact ; - -# Discretionary inlining (not recommended) -flags vacpp CFLAGS off : -qnoinline ; -flags vacpp CFLAGS on : -qinline ; -#flags vacpp CFLAGS full : -qinline ; -flags vacpp CFLAGS full : ; - -# Exception handling -flags vacpp C++FLAGS off : -qnoeh ; -flags vacpp C++FLAGS on : -qeh ; - -# Run-time Type Identification -flags vacpp C++FLAGS off : -qnortti ; -flags vacpp C++FLAGS on : -qrtti ; - -# Enable 64-bit memory addressing model -flags vacpp CFLAGS 64 : -q64 ; -flags vacpp LINKFLAGS 64 : -q64 ; -flags vacpp ARFLAGS aix/64 : -X 64 ; - -# Use absolute path when generating debug information -flags vacpp CFLAGS on : -g -qfullpath ; -flags vacpp LINKFLAGS on : -g -qfullpath ; -flags vacpp LINKFLAGS off : -s ; - -if [ os.name ] = AIX -{ - flags vacpp.compile C++FLAGS : -qfuncsect ; - - # The -bnoipath strips the prepending (relative) path of libraries from - # the loader section in the target library or executable. Hence, during - # load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded - # -blibpath (*similar* to -lrpath/-lrpath-link) is searched. Without - # this option, the prepending (relative) path + library name is - # hard-coded in the loader section, causing *only* this path to be - # searched during load-time. Note that the AIX linker does not have an - # -soname equivalent, this is as close as it gets. - # - # The above options are definitely for AIX 5.x, and most likely also for - # AIX 4.x and AIX 6.x. For details about the AIX linker see: - # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf - # - flags vacpp.link LINKFLAGS shared : -bnoipath ; - - # Run-time linking - flags vacpp.link EXE-LINKFLAGS shared : -brtl ; -} -else -{ - # Linux PPC - flags vacpp.compile CFLAGS shared : -qpic=large ; - flags vacpp FINDLIBS : rt ; -} - -# Profiling -flags vacpp CFLAGS on : -pg ; -flags vacpp LINKFLAGS on : -pg ; - -flags vacpp.compile OPTIONS ; -flags vacpp.compile.c++ OPTIONS ; -flags vacpp DEFINES ; -flags vacpp UNDEFS ; -flags vacpp HDRS ; -flags vacpp STDHDRS ; -flags vacpp.link OPTIONS ; -flags vacpp ARFLAGS ; - -flags vacpp LIBPATH ; -flags vacpp NEEDLIBS ; -flags vacpp FINDLIBS ; -flags vacpp FINDLIBS ; - -# Select the compiler name according to the threading model. -flags vacpp VA_C_COMPILER single : xlc ; -flags vacpp VA_C_COMPILER multi : xlc_r ; -flags vacpp VA_CXX_COMPILER single : xlC ; -flags vacpp VA_CXX_COMPILER multi : xlC_r ; - -SPACE = " " ; - -flags vacpp.link.dll HAVE_SONAME linux : "" ; - -actions vacpp.link bind NEEDLIBS -{ - $(VA_CXX_COMPILER) $(EXE-LINKFLAGS) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS) -} - -actions vacpp.link.dll bind NEEDLIBS -{ - xlC_r -G $(LINKFLAGS) -o "$(<[1])" $(HAVE_SONAME)-Wl,-soname$(SPACE)-Wl,$(<[-1]:D=) -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS) -} - -actions vacpp.compile.c -{ - $(VA_C_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" -} - -actions vacpp.compile.c++ -{ - $(VA_CXX_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" -} - -actions updated together piecemeal vacpp.archive -{ - ar $(ARFLAGS) ru "$(<)" "$(>)" -} diff --git a/src/tools/xlcpp.jam b/src/tools/xlcpp.jam deleted file mode 100644 index 7d3c601c43..0000000000 --- a/src/tools/xlcpp.jam +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright Vladimir Prus 2004. -# Copyright Toon Knapen 2004. -# Copyright Catherine Morton 2015. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE.txt -# or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) - -# -# B2 V2 toolset for the IBM XL C++ compiler -# - -import toolset : flags ; -import feature ; -import common ; -import generators ; -import os ; - -feature.extend toolset : xlcpp ; -toolset.inherit xlcpp : unix ; - -# Configure the xlcpp toolset -rule init ( version ? : command * : options * ) -{ - local condition = [ - common.check-init-parameters xlcpp : version $(version) ] ; - - command = [ common.get-invocation-command xlcpp : xlC - : $(command) : "/usr/xlcpp/bin/xlC" ] ; - - common.handle-options xlcpp : $(condition) : $(command) : $(options) ; -} - -# Declare generators -generators.register-c-compiler xlcpp.compile.c : C : OBJ : xlcpp ; -generators.register-c-compiler xlcpp.compile.c++ : CPP : OBJ : xlcpp ; - -# Allow C++ style comments in C files -flags xlcpp CFLAGS : -qnoxlcompatmacros ; - -# Declare flags -flags xlcpp CFLAGS off : -qNOOPTimize ; -flags xlcpp CFLAGS speed : ; -flags xlcpp CFLAGS space : -O2 -qcompact ; - -# Discretionary inlining (not recommended) -flags xlcpp CFLAGS off : -qnoinline ; -flags xlcpp CFLAGS on : -qinline ; -#flags xlcpp CFLAGS full : -qinline ; -flags xlcpp CFLAGS full : ; - -# Exception handling -flags xlcpp C++FLAGS off : -qnoeh ; -flags xlcpp C++FLAGS on : -qeh ; - -# Run-time Type Identification -flags xlcpp C++FLAGS off : -qnortti ; -flags xlcpp C++FLAGS on : -qrtti ; - -# Enable 64-bit memory addressing model -flags xlcpp CFLAGS 64 : -q64 ; -flags xlcpp LINKFLAGS 64 : -q64 ; -flags xlcpp ARFLAGS aix/64 : -X 64 ; - -# Use absolute path when generating debug information -flags xlcpp CFLAGS on : -g -qfullpath ; -flags xlcpp LINKFLAGS on : -g -qfullpath ; -flags xlcpp LINKFLAGS off : -s ; - -if [ os.name ] = AIX -{ - flags xlcpp.compile C++FLAGS : -qfuncsect ; - - # The -bnoipath strips the prepending (relative) path of libraries from - # the loader section in the target library or executable. Hence, during - # load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded - # -blibpath (*similar* to -lrpath/-lrpath-link) is searched. Without - # this option, the prepending (relative) path + library name is - # hard-coded in the loader section, causing *only* this path to be - # searched during load-time. Note that the AIX linker does not have an - # -soname equivalent, this is as close as it gets. - # - # The above options are definitely for AIX 5.x, and most likely also for - # AIX 4.x and AIX 6.x. For details about the AIX linker see: - # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf - # - flags xlcpp.link LINKFLAGS shared : -bnoipath ; - - # Run-time linking - flags xlcpp.link EXE-LINKFLAGS shared : -brtl ; -} -else -{ - # Linux PPC - flags xlcpp.compile CFLAGS shared : -qpic=large ; - flags xlcpp FINDLIBS : rt ; - - flags xlcpp.compile OPTIONS hidden : -qvisibility=hidden ; - flags xlcpp.compile OPTIONS protected : -qvisibility=protected ; - flags xlcpp.compile OPTIONS global : -qvisibility=default ; -} - -# Profiling -flags xlcpp CFLAGS on : -pg ; -flags xlcpp LINKFLAGS on : -pg ; - -# Declare flags and actions for compilation -flags xlcpp.compile.c++ OPTIONS 98 : -std=c++03 ; -flags xlcpp.compile.c++ OPTIONS 03 : -std=c++03 ; -flags xlcpp.compile.c++ OPTIONS 0x : -std=c++11 ; -flags xlcpp.compile.c++ OPTIONS 11 : -std=c++11 ; -flags xlcpp.compile.c++ OPTIONS 1y : -std=c++1y ; -flags xlcpp.compile.c++ OPTIONS 14 : -std=c++1y ; -flags xlcpp.compile.c++ OPTIONS 1z : -std=c++1y ; -flags xlcpp.compile.c++ OPTIONS 17 : -std=c++1y ; -flags xlcpp.compile.c++ OPTIONS 2a : -std=c++1y ; -flags xlcpp.compile.c++ OPTIONS 20 : -std=c++1y ; -flags xlcpp.compile.c++ OPTIONS latest : -std=c++1y ; - -flags xlcpp.compile OPTIONS ; -flags xlcpp.compile.c++ OPTIONS ; -flags xlcpp DEFINES ; -flags xlcpp UNDEFS ; -flags xlcpp HDRS ; -flags xlcpp STDHDRS ; -flags xlcpp.link OPTIONS ; -flags xlcpp ARFLAGS ; - -flags xlcpp LIBPATH ; -flags xlcpp NEEDLIBS ; -flags xlcpp FINDLIBS ; -flags xlcpp FINDLIBS ; - -# Select the compiler name according to the threading model. -flags xlcpp VA_C_COMPILER single : xlc ; -flags xlcpp VA_C_COMPILER multi : xlc ; -flags xlcpp VA_CXX_COMPILER single : xlC ; -flags xlcpp VA_CXX_COMPILER multi : xlC ; - -SPACE = " " ; - -flags xlcpp.link.dll HAVE_SONAME linux : "" ; - -actions xlcpp.link bind NEEDLIBS -{ - $(VA_CXX_COMPILER) $(EXE-LINKFLAGS) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS) -} - -actions xlcpp.link.dll bind NEEDLIBS -{ - xlC -G $(LINKFLAGS) -o "$(<[1])" $(HAVE_SONAME)-Wl,-soname$(SPACE)-Wl,$(<[-1]:D=) -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS) -} - -actions xlcpp.compile.c -{ - $(VA_C_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" -} - -actions xlcpp.compile.c++ -{ - $(VA_CXX_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" -} - -actions updated together piecemeal xlcpp.archive -{ - ar $(ARFLAGS) ru "$(<)" "$(>)" -} diff --git a/test/project_glob.py b/test/project_glob.py index f8bbf09281..ccbd04d878 100644 --- a/test/project_glob.py +++ b/test/project_glob.py @@ -52,8 +52,8 @@ def test_source_location(): t.write("d2/d/l.cpp", """\ #if defined(_WIN32) __declspec(dllexport) -void force_import_lib_creation() {} #endif +void force_import_lib_creation() {} """) t.write("d2/d/jamfile.jam", "lib l : [ glob *.cpp ] ;") @@ -82,8 +82,8 @@ def test_wildcards_and_exclusion_patterns(): t.write("d2/d/l.cpp", """\ #if defined(_WIN32) __declspec(dllexport) -void force_import_lib_creation() {} #endif +void force_import_lib_creation() {} """) t.write("d2/d/jamfile.jam", "lib l : [ glob *.cpp ] ;") @@ -109,8 +109,8 @@ def test_glob_tree(): t.write("d2/d/l.cpp", """\ #if defined(_WIN32) __declspec(dllexport) -void force_import_lib_creation() {} #endif +void force_import_lib_creation() {} """) t.write("d2/d/jamfile.jam", "lib l : [ glob *.cpp ] ;") @@ -168,8 +168,8 @@ def test_glob_with_absolute_names(): t.write("d2/d/l.cpp", """\ #if defined(_WIN32) __declspec(dllexport) -void force_import_lib_creation() {} #endif +void force_import_lib_creation() {} """) t.write("d2/d/jamfile.jam", "lib l : [ glob *.cpp ] ;")