X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=library.rb;fp=library.rb;h=d1e9817bca9450569aa5877757e579be5bb46b7a;hb=c53ec2056dc2090ef0b8d2193b433aea4ee95cc3;hp=0000000000000000000000000000000000000000;hpb=bdefff1f62f93747a4ea21a81f46507965852299;p=ruby-edje.git diff --git a/library.rb b/library.rb new file mode 100644 index 0000000..d1e9817 --- /dev/null +++ b/library.rb @@ -0,0 +1,35 @@ +# $Id: library.rb 327 2005-04-27 14:27:01Z tilman $ + +require "rbconfig" + +class Library + def initialize(name, prefix, dir, lib = name) + @name = name + @prefix = prefix + @dir = dir + @lib = lib + end + + def ldflags + s = "#{ENV["LDFLAGS"]} -L #{@prefix}/lib -L " + + Config::CONFIG["libdir"] + " " + + Config::CONFIG["LIBRUBYARG_SHARED"] + + " -shared -Wl" + s << " -l#{@lib}" unless @lib.nil? + s + end + + def cflags + "#{ENV["CFLAGS"]} -I #{@prefix}/include " + + "-I #{Config::CONFIG['archdir']} " + + "-I #{Config::CONFIG['sitearchdir']} -fPIC" + end + + def so + "#{@dir}/#{@name}.so" + end + + def objects + Dir["#{@dir}/*.c"].map { |f| f.sub(/\.[^.]+$/, ".o") } + end +end