From 7fed65848a224ba323f811a42b53643ad70d6da2 Mon Sep 17 00:00:00 2001 From: Masao Mutoh Date: Wed, 27 Aug 2003 17:28:04 +0000 Subject: [PATCH] Enhanced extconf.rb. --- ChangeLog | 9 ++++++ README | 66 +++++++++++++++++++++----------------- exec_make.rb | 32 +++++++++++++++++++ extconf.rb | 90 ++++++++++++++++++++++++++++++---------------------- 4 files changed, 130 insertions(+), 67 deletions(-) create mode 100644 exec_make.rb diff --git a/ChangeLog b/ChangeLog index ee8ef997ef..3139eb34dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-08-28 Masao Mutoh + + * 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 * README: Updated. diff --git a/README b/README index 8b8b41de78..c1116af7d4 100644 --- a/README +++ b/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 @@ -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 - 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 + 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 ------------ @@ -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 ------- @@ -78,3 +85,4 @@ Copying Project Website --------------- http://ruby-gnome2.sourceforge.jp/ + diff --git a/exec_make.rb b/exec_make.rb new file mode 100644 index 0000000000..5fd254d20a --- /dev/null +++ b/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." + diff --git a/extconf.rb b/extconf.rb index a54196965c..85419632db 100644 --- a/extconf.rb +++ b/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' @@ -11,18 +15,48 @@ # 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 @@ -30,47 +64,27 @@ 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." +