Class: Dev::BoostBuild
- Inherits:
-
Object
- Object
- Dev::BoostBuild
- Defined in:
- lib/dev/BoostBuild.rb
Class Method Summary collapse
- .buildJamfile(directory) ⇒ Object
- .defaultToolset ⇒ Object
- .getJamfileLine(filename) ⇒ Object
- .getLibraryProperties(filename) ⇒ Object
- .getToolset(name) ⇒ Object
Class Method Details
.buildJamfile(directory) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/dev/BoostBuild.rb', line 40 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 <link>shared line = getJamfileLine(f) if(line.include?("<link>static")) line = line.gsub("<link>static","<link>shared") jamfile.puts line end } } end end end |
.defaultToolset ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/dev/BoostBuild.rb', line 3 def self.defaultToolset begin text=`b2 --debug-configuration` toolset='' text.scan(/<toolset>([\.\w-]+)/).each{ | var_match | toolset=var_match[0].to_s } return toolset rescue return nil end end |
.getJamfileLine(filename) ⇒ Object
64 65 66 67 68 69 |
# File 'lib/dev/BoostBuild.rb', line 64 def self.getJamfileLine(filename) words=filename.split('-') library = words[0] library = library[3,library.length-3] if library.index("lib") == 0 return "lib " + library + " : : <file>./" + filename + " " + getLibraryProperties(filename) end |
.getLibraryProperties(filename) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/dev/BoostBuild.rb', line 16 def self.getLibraryProperties(filename) #words=filename.split('-') #flags=words[2] if words.length == 4 #flags = flags + "-" + words[3] if words.length == 5 #result="<toolset>" + getToolset(words[1]) if words.length==4 link="static" link="shared" if filename.index("lib") != 0 link="shared" if filename.include?(".so") result = " <link>" + link + " " variant = "release" variant = "debug" if filename.include?("d.") #result = result + " <variant>release " if !flags.include?("d") #result = result + " <variant>debug " if flags.include?("d") result = result + " <variant>#{variant} " threading="single" threading="multi" if filename.include?("-mt") #result = result + " <threading>multi " if flags.include?("mt") #result = result + " <threading>single " if !flags.include?("mt") result = result + " <threading>#{threading} " #result = result + " <runtime-link>static " if flags.include?("s") result = result + " <runtime-debugging>on " if filename.include?('-gd') #if flags.include?("g") result = result + ";" end |
.getToolset(name) ⇒ Object
71 72 73 74 75 76 77 78 |
# File 'lib/dev/BoostBuild.rb', line 71 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 |