Index: libs/iostreams/build/Jamfile.v2
===================================================================
--- libs/iostreams/build/Jamfile.v2 (revision 86799)
+++ libs/iostreams/build/Jamfile.v2 (working copy)
@@ -21,6 +21,7 @@
import os ;
import path ;
import ac ;
+import print ;
local debug = [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] ;
for local v in NO_COMPRESSION
@@ -144,11 +145,43 @@
}
}
+if [ os.name ] = NT
+{
+ rule read-file ( file )
+ {
+ return [ SPLIT_BY_CHARACTERS [ SHELL "type \"$(file:G=)\" 2>nul" ] : "\n" ] ;
+ }
+}
+else
+{
+ rule read-file ( file )
+ {
+ return [ SPLIT_BY_CHARACTERS [ SHELL "cat \"$(file:G=)\" 2>/dev/null" ] : "\n" ] ;
+ }
+}
+rule make-bz2-def-file ( target : source : properties * )
+{
+ print.output $(target) ;
+ for local line in [ read-file $(source) ]
+ {
+ if ! [ MATCH "(LIBRARY[ \t]+LIBBZ2)" : $(line) ]
+ {
+ print.text $(line) : yes ;
+ }
+ }
+}
+
+if $(BZIP2_SOURCE)
+{
+ make bz2.def : $(BZIP2_SOURCE)/libbz2.def : @make-bz2-def-file ;
+ bz2-def-file = bz2.def ;
+}
+
local sources = file_descriptor.cpp mapped_file.cpp ;
local bz2 = [ create-library bzip2 : libbz2 bz2 :
blocksort bzlib compress crctable decompress huffman randtable :
- shared:$(BZIP2_SOURCE)/libbz2.def ] ;
+ shared:$(bz2-def-file) ] ;
if $(bz2)
{