Sha256: dffa33c8a401eda6ee7dae016ff1a8704cd15c667244e91a54540a130b42114c

Contents?: true

Size: 1.99 KB

Versions: 29

Compression:

Stored size: 1.99 KB

Contents

module Dev
class BoostBuild
  def self.defaultToolset
    text=`b2 --debug-configuration` 
	toolset=''
    text.scan(/<toolset>([\.\w-]+)/).each{ | var_match |
	 toolset=var_match[0].to_s
	}
    return toolset
  end

  def self.getLibraryProperties(filename)
    words=filename.split('-')
	flags=words[2];
	flags = flags + "-" + words[3] if words.length == 5
	result="<toolset>" + getToolset(words[1])
	link="static"
	link="shared" if filename.index("lib") != 0
	link="shared" if filename.include?(".so")
    result = result + " <link>" + link + " " 
	result = result + " <variant>release " if !flags.include?("d")
	result = result + " <variant>debug " if flags.include?("d")
	result = result + " <threading>multi " if flags.include?("mt")
	result = result + " <threading>single " if !flags.include?("mt")
	#result = result + " <runtime-link>shared " if !flags.include?("s")
	result = result + " <runtime-link>static " if flags.include?("s")
	#result = result + " <runtime-debugging>off " if !flags.include?("g")
	result = result + " <runtime-debugging>on " 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)
		  }
		}
	  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 + " : : <file>./" + 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

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
dev-1.0.125 lib/dev/BoostBuild.rb
dev-1.0.124 lib/dev/BoostBuild.rb
dev-1.0.123 lib/dev/BoostBuild.rb
dev-1.0.122 lib/dev/BoostBuild.rb
dev-1.0.121 lib/dev/BoostBuild.rb
dev-1.0.120 lib/dev/BoostBuild.rb
dev-1.0.119 lib/dev/BoostBuild.rb
dev-1.0.118 lib/dev/BoostBuild.rb
dev-1.0.117 lib/dev/BoostBuild.rb
dev-1.0.116 lib/dev/BoostBuild.rb
dev-1.0.115 lib/dev/BoostBuild.rb
dev-1.0.114 lib/dev/BoostBuild.rb
dev-1.0.113 lib/dev/BoostBuild.rb
dev-1.0.112 lib/dev/BoostBuild.rb
dev-1.0.111 lib/dev/BoostBuild.rb
dev-1.0.110 lib/dev/BoostBuild.rb
dev-1.0.109 lib/dev/BoostBuild.rb
dev-1.0.106 lib/dev/BoostBuild.rb
dev-1.0.105 lib/dev/BoostBuild.rb
dev-1.0.104 lib/dev/BoostBuild.rb