Skip to content

Commit

Permalink
Enhanced extconf.rb.
Browse files Browse the repository at this point in the history
  • Loading branch information
Masao Mutoh committed Aug 27, 2003
1 parent 78d2bf9 commit 7fed658
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 67 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
@@ -1,3 +1,12 @@
2003-08-28 Masao Mutoh <mutoh@highway.ne.jp>

* README: Revised.
* AUTHORS: Modified.
* exec_make.rb: Added
* extconf.rb: Improved.
If the libraries are not found, they're ignored.
And you can specify to target libraries.

2003-08-08 Masao Mutoh <mutoh@highway.ne.jp>

* README: Updated.
Expand Down
66 changes: 37 additions & 29 deletions README
@@ -1,37 +1,31 @@
Ruby-GNOME2 -- Ruby bindings for GNOME-2.0
Ruby-GNOME2 -- Ruby bindings for GNOME-2.x
==========================================

This is a set of bindings for the GNOME-2.0 libraries for use from Ruby.

To use them, you will need Ruby-1.6 and glib-2.0.0, gtk+-2.0.0, pango-1.1.0,
gconf2-1.2.0, libgnome-2.0.0, libart_lgpl-2.3.0, libgnomecanvas-2.0.0,
libgnomeui-2.0.0, libglade-2.0.0, gnome-vfs-2.2.3, gstreamer-0.6.2,
libgtkhtml-2.2.0 or later installed on your system.
Keep in mind that you will need both the runtime libraries and the header
files installed.
This is a set of bindings for the GNOME-2.x libraries for use from Ruby.

Release packages
----------------
ruby-gtk2
- Ruby/GLib2
- Ruby/GdkPixbuf2
- Ruby/Pango
- Ruby/GTK2
- Ruby/GLib2 - GLib 2.0.x or later
- Ruby/Pango - Pango 1.1.x or later
- Ruby/GdkPixbuf2 - GTK+ 2.0.x or later
- Ruby/GTK2 - GTK+ 2.0.x or later

ruby-gstreamer
- Ruby/GLib2
- Ruby/GStreamer
- Ruby/GLib2 - GLib-2.0.x or later
- Ruby/GStreamer - GStreamer 0.6.x or later

ruby-gnome2-all
- ruby-gtk2
- Ruby/GNOME2
- Ruby/GnomeCanvas2
- Ruby/Libart2
- Ruby/Libglade2
- Ruby/GConf2
- Ruby/GnomeVFS
- Ruby/GStreamer
- Ruby/GtkHtml2
- Ruby/GNOME2 - libgnome-2.0.x, libgnomeui-2.0.x or later
- Ruby/GnomeCanvas2 - libgnomecanvas-2.0.x or later
- Ruby/Libart2 - libart_lgpl 2.3.12 or later
- Ruby/Libglade2 - Libglade 2.0.x or later
- Ruby/GConf2 - GConf 2.0.x or later
- Ruby/GnomeVFS - GnomeVFS 2.0.x or later
- Ruby/GStreamer - GStreamer 0.6.x or later
- Ruby/GtkHtml2 - GtkHtml2 2.0.x or later
- Ruby/GtkGLExt - GtkGLExt 1.0.3 or later


Install
Expand All @@ -41,13 +35,25 @@ Install
3. su
4. make install

To compile and install a particular sub-binding, you should run:
To compile and install a particular sub-binding,
you can add arguments:

0. cd <each sub-directory>
1. ruby extconf.rb
2. make
3. su
4. make install
ruby extconf.rb [subdir]...
e.g.) ruby extconf.rb glib pango gdkpixbuf

Or you can compile each sub-binding:

0. cd <each sub-directory>
1. ruby extconf.rb
2. make
3. su
4. make install

extconf.rb options
-------------------
--ruby : ruby directory
--topsrcdir : top source directory
--topdir : top directory

Dependencies
------------
Expand All @@ -66,6 +72,7 @@ Dependencies
Ruby/GnomeVFS depends on Ruby/GLib.
Ruby/GStreamer depends on Ruby/GLib.
Ruby/GtkHtml2 depends on Ruby/GTK.
Ruby/GtkGLExt depends on Ruby/GTK, rbogl.

Copying
-------
Expand All @@ -78,3 +85,4 @@ Copying
Project Website
---------------
http://ruby-gnome2.sourceforge.jp/

32 changes: 32 additions & 0 deletions exec_make.rb
@@ -0,0 +1,32 @@
=begin
exec_make.rb is called by top-level Makefile.
$Id: exec_make.rb,v 1.1 2003/08/27 17:28:04 mutoh Exp $
Copyright (C) 2003 Ruby-GNOME2 Project Team
=end

SUBDIRS = ARGV[0].split(" ")
EXECUTE = ARGV[1..-1].join(' ')

success = []
failure = []
SUBDIRS.each do |subdir|
ret = system("(cd #{subdir} && #{EXECUTE})")
if ret
success << subdir
else
failure << subdir
end
end

success << "NONE" if success.size == 0
failure << "NONE" if failure.size == 0

puts "\n"
puts "-----"
puts "SUCCEEDED: #{success.join(' ')}" if success.size > 0
puts "FAILED: #{failure.join(' ')}" if failure.size > 0
puts "-----"
puts "Done."

90 changes: 52 additions & 38 deletions extconf.rb
@@ -1,5 +1,9 @@
=begin
top-level extconf.rb for gnome extention library
top-level extconf.rb for Ruby-GNOME2
$Id: extconf.rb,v 1.7 2003/08/27 17:28:04 mutoh Exp $
Copyright (C) 2003 Ruby-GNOME2 Project Team
=end

require 'mkmf'
Expand All @@ -11,66 +15,76 @@
# detect sub-directories
#
$ruby = arg_config("--ruby", Config::CONFIG['RUBY_INSTALL_NAME'])

$srcdir = File.dirname(__FILE__)
$topsrcdir = $configure_args["--topsrcdir"] ||= $srcdir
$topdir = $configure_args["--topdir"] ||= Dir.pwd
subdirs = Dir.glob($topsrcdir+"/*/**/extconf.rb")
subdirs.collect! do |subdir|
subdir[0..$topsrcdir.size] = ""
File.dirname(subdir)
end

subdirs -= priorlibs
subdirs = priorlibs + subdirs #Change order
subdirs = ARGV.select{|v| /^--/ !~ v}

if subdirs.size == 0
subdirs = Dir.glob($topsrcdir+"/*/**/extconf.rb")
subdirs.collect! do |subdir|
subdir[0..$topsrcdir.size] = ""
File.dirname(subdir)
end
priorlibs &= subdirs
subdirs -= priorlibs
subdirs = priorlibs + subdirs #Change the order
end

#
# generate sub-directory Makefiles
#
targets = []
ignore = []
subdirs.each do |subdir|
STDERR.puts("#{$0}: Entering directory `#{subdir}'")
File.mkpath(subdir)
topdir = File.join(*([".."] * subdir.split(/\/+/).size))
/^\// =~ (dir = $topsrcdir) or dir = File.join(topdir, $topsrcdir)
srcdir = File.join(dir, subdir)
ret = system($ruby, "-C", subdir, File.join(srcdir, "extconf.rb"),
"--topsrcdir=#{dir}", "--topdir=#{topdir}", "--srcdir=#{srcdir}",
*ARGV)
STDERR.puts("#{$0}: Leaving directory '#{subdir}'")
if ret
targets << subdir
else
ignore << subdir
end
end
puts "\n-----"
puts "Target libraries: #{targets.join(', ')}" if targets.size > 0
puts "Ignored libraries: #{ignore.join(', ')}" if ignore.size > 0

#
# generate top-level Makefile
#
File.open("Makefile", "w") do |makefile|
makefile.print("\
TOPSRCDIR = #{$topsrcdir}
SUBDIRS = #{priorlibs.join(' ')} #{subdirs.join(' ')}
SUBDIRS = #{targets.join(' ')}
COMMAND = #{$ruby} #{$topsrcdir}/exec_make.rb
all:
for subdir in \$(SUBDIRS); do \\
(cd \$\${subdir} && \$(MAKE) all); \\
done;
$(COMMAND) '$(SUBDIRS)' $(MAKE) all;
install:
for subdir in \$(SUBDIRS); do \\
(cd \$\${subdir} && \$(MAKE) install); \\
done;
$(COMMAND) '$(SUBDIRS)' $(MAKE) install;
site-install:
for subdir in \$(SUBDIRS); do \\
(cd \$\${subdir} && \$(MAKE) site-install); \\
done;
$(COMMAND) '$(SUBDIRS)' $(MAKE) site-install;
clean:
for subdir in \$(SUBDIRS); do \\
(cd \$\$subdir && \$(MAKE) clean); \\
done; \\
$(COMMAND) '$(SUBDIRS)' $(MAKE) clean;
distclean:
for subdir in \$(SUBDIRS); do \\
(cd \$\${subdir} && \$(MAKE) distclean); \\
done;
$(COMMAND) '$(SUBDIRS)' $(MAKE) distclean;
rm -f Makefile mkmf.log
")
end

#
# generate sub-directory Makefiles
#
subdirs.each do |subdir|
STDERR.puts("#{$0}: Entering directory `#{subdir}'")
File.mkpath(subdir)
topdir = File.join(*([".."] * subdir.split(/\/+/).size))
/^\// =~ (dir = $topsrcdir) or dir = File.join(topdir, $topsrcdir)
srcdir = File.join(dir, subdir)
system($ruby, "-C", subdir, File.join(srcdir, "extconf.rb"),
"--topsrcdir=#{dir}", "--topdir=#{topdir}", "--srcdir=#{srcdir}",
*ARGV)
STDERR.puts("#{$0}: Leaving directory `#{subdir}'")
end
puts "-----"
puts "Done."

0 comments on commit 7fed658

Please sign in to comment.