Permalink
Browse files

Change constructor to default to using sources in the local directory…

…. Remove useless add_source method from Generator

git-svn-id: http://mkrf.rubyforge.org/svn/trunk@35 6e48df83-f314-0410-b1e7-e69642b30866
  • Loading branch information...
kevinclark
kevinclark committed Oct 5, 2006
1 parent 9524066 commit a6cdf76c3fd52bfa2e2f47f5dfeb4e14a856f384
Showing with 8 additions and 11 deletions.
  1. +3 −0 CHANGELOG
  2. +4 −9 lib/mkrf/generator.rb
  3. +0 −1 test/sample_files/syck-0.55/ext/ruby/ext/syck/extconf.rb
  4. +1 −1 test/unit/test_generator.rb
View
@@ -1,4 +1,7 @@
= svn
+* [CLEAN-UP] Removed useless add_source from Generator. We've got a constructor for that. [35]
+* [FIXED] Generator.new defaults to sources in the local directory, so extconfs can (and should) be kept in the same directory as the extension files (PROJ_ROOT/ext) and won't clobber pre-existing Rakefiles. [35]
+* [CLEAN-UP] Goodbye ugly method missing hack! [34]
* [NEW] Added objs to Generator. Access it as you might ldshared. -John G.
* [CLEAN-UP] Removed the redundant .so rule from the generated rakefile. -John G.
* [FIXED] Correct defaults in Availability. [29]
View
@@ -18,7 +18,7 @@ module Mkrf
# Configuration of the build can be passed to the +Generator+ constructor
# as a block:
#
- # Mkrf::Generator.new('libxml', '*.c') do |g|
+ # Mkrf::Generator.new('libxml', 'my_extensions_dir/*.c') do |g|
# g.include_library('socket','socket')
# g.include_header('libxml/xmlversion.h',
# '/opt/include/libxml2',
@@ -54,8 +54,8 @@ class Generator
#
# Params:
# * +extension_name+ -- the name of the extension
- # * +source_patterns+ -- an array of patterns describing source files to be compiled, ["lib/*.c"] by default
- def initialize(extension_name, source_patterns = ["lib/*.c"], availability_options = {})
+ # * +source_patterns+ -- an array of patterns describing source files to be compiled, ["*.c"] by default
+ def initialize(extension_name, source_patterns = ["*.c"], availability_options = {})
@sources = source_patterns
@extension_name = extension_name + ".#{CONFIG['DLEXT']}"
@available = Mkrf::Availability.new(availability_options)
@@ -69,19 +69,14 @@ def initialize(extension_name, source_patterns = ["lib/*.c"], availability_optio
write_rakefile
end
- # Add a new pattern to the list of source patterns
- def add_source(pattern)
- @sources << pattern
- end
-
# An array of the source patterns as single quoted strings
def sources
@sources.collect {|s| "'#{s}'"}
end
# Add a define to the compile string. Example:
#
- # Mkrf::Generator.new('my_library.bundle') do |g|
+ # Mkrf::Generator.new('my_library') do |g|
# g.add_define(HAVE_PTHREADS)
# end
#
@@ -6,5 +6,4 @@
Mkrf::Generator.new('syck') do |g|
g.include_header("st.h")
- g.add_source('*.c') # We can actually do this in the contructor, but this tests add_source
end
@@ -17,7 +17,7 @@ def setup
def test_default_sources
g = Mkrf::Generator.new('testlib')
- assert_equal ["'lib/*.c'"], g.sources, "Default sources incorrect"
+ assert_equal ["'*.c'"], g.sources, "Default sources incorrect"
end
def test_additional_code

0 comments on commit a6cdf76

Please sign in to comment.