Ticket #7193: vacpp.jam.patch
File vacpp.jam.patch, 8.0 KB (added by , 10 years ago) |
---|
-
tools/build/v2/tools/vacpp.jam
old new 13 13 import common ; 14 14 import generators ; 15 15 import os ; 16 if [ os.name ] = LINUX 17 { 18 import gcc ; 19 } 16 20 17 21 feature.extend toolset : vacpp ; 18 22 toolset.inherit vacpp : unix ; 23 if [ os.name ] = LINUX 24 { 25 rule link ( targets * : sources * : properties * ) 26 { 27 gcc.quote-rpath $(targets) ; 28 } 29 30 rule link.dll ( targets * : sources * : properties * ) 31 { 32 gcc.quote-rpath $(targets) ; 33 } 34 35 rule archive ( targets * : sources * : properties * ) 36 { 37 gcc.archive $(targets) : $(sources) : $(properties) ; 38 } 39 } 19 40 generators.override vacpp.prebuilt : builtin.prebuilt ; 20 41 generators.override vacpp.searched-lib-generator : searched-lib-generator ; 21 42 … … 25 46 local condition = [ 26 47 common.check-init-parameters vacpp : version $(version) ] ; 27 48 28 command = [ common.get-invocation-command vacpp : xlC49 local tool-command = [ common.get-invocation-command vacpp : xlC 29 50 : $(command) : "/usr/vacpp/bin/xlC" ] ; 30 51 31 common.handle-options vacpp : $(condition) : $(command) : $(options) ; 52 common.handle-options vacpp : $(condition) : $(tool-command) : $(options) ; 53 54 if [ os.name ] = LINUX 55 { 56 gcc.init-link-flags vacpp gnu $(condition) ; 57 } 32 58 } 33 59 34 60 # Declare generators … … 43 69 flags vacpp CFLAGS <optimization>speed : -O3 -qstrict ; 44 70 flags vacpp CFLAGS <optimization>space : -O2 -qcompact ; 45 71 46 # Discretionary inlining (not recommended)72 # Inlining 47 73 flags vacpp CFLAGS <inlining>off : -qnoinline ; 48 flags vacpp CFLAGS <inlining>on : -qinline ; 49 #flags vacpp CFLAGS <inlining>full : -qinline ; 50 flags vacpp CFLAGS <inlining>full : ; 74 flags vacpp CFLAGS <inlining>on : -qinline=noauto ; 75 flags vacpp CFLAGS <inlining>full : -qinline=auto ; 51 76 52 77 # Exception handling 53 78 flags vacpp C++FLAGS <exception-handling>off : -qnoeh ; … … 59 84 60 85 # Enable 64-bit memory addressing model 61 86 flags vacpp CFLAGS <address-model>64 : -q64 ; 62 flags vacpp LINKFLAGS <address-model>64 : -q64 ;63 flags vacpp A RFLAGS<target-os>aix/<address-model>64 : -X 64 ;87 flags vacpp.link OPTIONS <address-model>64 : -q64 ; 88 flags vacpp AIX_OBJ_MODE <target-os>aix/<address-model>64 : -X 64 ; 64 89 65 90 # Use absolute path when generating debug information 66 91 flags vacpp CFLAGS <debug-symbols>on : -g -qfullpath ; 67 flags vacpp LINKFLAGS <debug-symbols>on : -g -qfullpath ;68 flags vacpp LINKFLAGS <debug-symbols>off: -s ;92 flags vacpp.link OPTIONS <debug-symbols>on : -g -qfullpath ; 93 flags vacpp.link OPTIONS <target-os>aix/<debug-symbols>off/<strip>on : -s ; 69 94 70 95 if [ os.name ] = AIX 71 96 { 72 97 flags vacpp.compile C++FLAGS : -qfuncsect ; 73 98 99 # Enable 32-bit Very Large Address-Space 100 flags vacpp.link OPTIONS <address-model>32 : -bmaxdata:0xAFFFFFFF/dsa ; 101 74 102 # The -bnoipath strips the prepending (relative) path of libraries from 75 103 # the loader section in the target library or executable. Hence, during 76 104 # load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded … … 84 112 # AIX 4.x and AIX 6.x. For details about the AIX linker see: 85 113 # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf 86 114 # 87 flags vacpp.link LINKFLAGS <link>shared : -bnoipath ;115 flags vacpp.link OPTIONS <link>shared : -bnoipath ; 88 116 89 117 # Run-time linking 90 118 flags vacpp.link EXE-LINKFLAGS <link>shared : -brtl ; … … 93 121 { 94 122 # Linux PPC 95 123 flags vacpp.compile CFLAGS <link>shared : -qpic=large ; 96 flags vacpp FINDLIBS : rt ; 124 flags vacpp.link OPTIONS <link>shared : -qpic=large ; 125 flags vacpp.link FINDLIBS-SA <threading>multi : rt ; 97 126 } 98 127 99 128 # Profiling 100 129 flags vacpp CFLAGS <profiling>on : -pg ; 101 flags vacpp LINKFLAGS <profiling>on : -pg ;130 flags vacpp.link OPTIONS <profiling>on : -pg ; 102 131 103 132 flags vacpp.compile OPTIONS <cflags> ; 104 133 flags vacpp.compile.c++ OPTIONS <cxxflags> ; … … 106 135 flags vacpp UNDEFS <undef> ; 107 136 flags vacpp HDRS <include> ; 108 137 flags vacpp STDHDRS <sysinclude> ; 109 flags vacpp.link OPTIONS <linkflags> ; 138 110 139 flags vacpp ARFLAGS <arflags> ; 140 flags vacpp ARFLAGS <archiveflags> ; 111 141 112 flags vacpp LIBPATH <library-path> ; 113 flags vacpp NEEDLIBS <library-file> ; 114 flags vacpp FINDLIBS <find-shared-library> ; 115 flags vacpp FINDLIBS <find-static-library> ; 116 117 # Select the compiler name according to the threading model. 118 flags vacpp VA_C_COMPILER <threading>single : xlc ; 119 flags vacpp VA_C_COMPILER <threading>multi : xlc_r ; 120 flags vacpp VA_CXX_COMPILER <threading>single : xlC ; 121 flags vacpp VA_CXX_COMPILER <threading>multi : xlC_r ; 142 flags vacpp.link USER_OPTIONS <linkflags> ; 143 flags vacpp.link LINKPATH <library-path> ; 144 flags vacpp.link LIBRARIES <library-file> ; 145 flags vacpp.link FINDLIBS-ST <find-static-library> ; 146 flags vacpp.link FINDLIBS-SA <find-shared-library> ; 147 148 # Select the compiler configuration stanza according to the threading model. 149 flags vacpp VA_C_COMPILER_CFG <threading>single : -F:xlc ; 150 flags vacpp VA_C_COMPILER_CFG <threading>multi : -F:xlc_r ; 151 flags vacpp VA_CXX_COMPILER_CFG <threading>single : -F:xlC ; 152 flags vacpp VA_CXX_COMPILER_CFG <threading>multi : -F:xlC_r ; 122 153 123 154 SPACE = " " ; 124 155 125 flags vacpp.link.dll HAVE_SONAME <target-os>linux : "" ; 126 127 actions vacpp.link bind NEEDLIBS 156 if [ os.name ] = AIX 128 157 { 129 $(VA_CXX_COMPILER) $(EXE-LINKFLAGS) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS) 158 actions vacpp.link bind LIBRARIES 159 { 160 $(CONFIG_COMMAND) $(VA_CXX_COMPILER_CFG) $(EXE-LINKFLAGS) -o "$(<[1])" -L$(LINKPATH) "$(>)" "$(LIBRARIES)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) $(USER_OPTIONS) 161 } 162 163 actions vacpp.link.dll bind LIBRARIES 164 { 165 $(CONFIG_COMMAND) $(VA_CXX_COMPILER_CFG) -G -o "$(<[1])" $(HAVE_SONAME)-Wl,-soname$(SPACE)-Wl,$(<[-1]:D=) -L$(LINKPATH) "$(>)" "$(LIBRARIES)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) $(USER_OPTIONS) 166 } 130 167 } 131 132 actions vacpp.link.dll bind NEEDLIBS 168 else 133 169 { 134 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) 170 actions link bind LIBRARIES 171 { 172 $(CONFIG_COMMAND) $(VA_CXX_COMPILER_CFG) -L"$(LINKPATH)" -Wl,-R,$(RPATH) -Wl,-rpath-link,"$(RPATH_LINK)" -o "$(<[1])" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) 173 } 174 actions link.dll bind LIBRARIES 175 { 176 $(CONFIG_COMMAND) $(VA_CXX_COMPILER_CFG) -G -L"$(LINKPATH)" -Wl,-R,$(RPATH) -o "$(<[1])" -Wl,-h,$(<[-1]:D=) $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) 177 } 135 178 } 136 179 137 180 actions vacpp.compile.c 138 181 { 139 $( VA_C_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"182 $(CONFIG_COMMAND) $(VA_C_COMPILER_CFG) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" 140 183 } 141 184 142 185 actions vacpp.compile.c++ 143 186 { 144 $( VA_CXX_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"187 $(CONFIG_COMMAND) $(VA_CXX_COMPILER_CFG) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" 145 188 } 146 189 147 actions updated together piecemeal vacpp.archive 190 if [ os.name ] = AIX 191 { 192 actions updated together piecemeal vacpp.archive 193 { 194 ar $(AIX_OBJ_MODE) $(ARFLAGS) rcu "$(<)" "$(>)" 195 ranlib $(AIX_OBJ_MODE) "$(<)" 196 } 197 } 198 else 148 199 { 149 ar $(ARFLAGS) ru "$(<)" "$(>)" 200 actions piecemeal archive 201 { 202 ar $(ARFLAGS) rc "$(<)" "$(>)" 203 ranlib "$(<)" 204 } 150 205 }