module Dev class BoostBuild @@default_toolset=nil def self.setDefaultToolset toolset @@default_toolset=toolset end def self.defaultToolset if(defined?(BOOSTBUILD_DEFAULT_TOOLSET)) puts_debug "BOOSTBUILD_DEFAULT_TOOLSET=#{BOOSTBUILD_DEFAULT_TOOLSET}" return BOOSTBUILD_DEFAULT_TOOLSET end return @@default_toolset if !@@default_toolset.nil? begin text='' Dir.chdir(DEV_ROOT) { |dir| text=`b2 --debug-configuration` } toolset='' text.scan(/([\.\w-]+)/).each{ | var_match | toolset=var_match[0].to_s } return toolset rescue return nil end end def self.getLibraryProperties(filename) #words=filename.split('-') #flags=words[2] if words.length == 4 #flags = flags + "-" + words[3] if words.length == 5 #result="" + getToolset(words[1]) if words.length==4 link="static" link="shared" if filename.index("lib") != 0 && !filename.include?(".a") link="shared" if filename.include?(".so") || filename.include?(".dylib") result = " " + link + " " variant = "release" variant = "debug" if filename.include?("d.") || filename.include?("-gd-") #result = result + " release " if !flags.include?("d") #result = result + " debug " if flags.include?("d") result = result + " #{variant} " threading="single" threading="multi" if filename.include?("-mt") #result = result + " multi " if flags.include?("mt") #result = result + " single " if !flags.include?("mt") result = result + " #{threading} " #result = result + " static " if flags.include?("s") result = result + " on " if filename.include?('-gd') #if flags.include?("g") result = result + ";" end def self.buildJamfile(directory) jamfilename=directory+"/Jamfile" if(File.exists?(jamfilename)) puts "Jamfile already exists." return end if(File.exists?(directory)) Dir.chdir(directory) do File.open(jamfilename,'w') { |jamfile| Dir.glob("*boost_*").each {|f| jamfile.puts getJamfileLine(f) # add extra shared entry for windows line = getJamfileLine(f) if(line.include?("static") && line.include?("-vc") && line.include?(".lib")) line = line.gsub("static","shared") jamfile.puts line end } } end end end def self.getJamfileLine(filename) words=filename.split('-') library = words[0] library = library[3,library.length-3] if library.index("lib") == 0 return "lib " + library + " : : ./" + filename + " " + getLibraryProperties(filename) end def self.getToolset(name) toolset = "msvc" toolset = "darwin-4.2.1" if name=='xgcc42' toolset = "msvc-9.0" if name=='vc90' toolset = "msvc-10.0" if name=='vc100' toolset = "msvc-11.0" if name=='vc110' return toolset end end end