Permalink
Browse files

Few fixes for cross compiling.

  • Loading branch information...
1 parent 212c243 commit b7d99d9d9fc160c02bdb04c7b9db7f8146953683 @metaskills metaskills committed Dec 22, 2011
Showing with 8 additions and 9 deletions.
  1. +2 −3 Rakefile
  2. +6 −6 ext/tiny_tds/extconf.rb
View
@@ -42,8 +42,6 @@ end
task :compile => ["ports:freetds"] unless ENV['TINYTDS_SKIP_PORTS']
-Dir["tasks/*.rake"].sort.each { |f| load f }
-
Rake::ExtensionTask.new('tiny_tds', gemspec) do |ext|
ext.lib_dir = 'lib/tiny_tds'
if RUBY_PLATFORM =~ /mswin|mingw/ then
@@ -53,11 +51,12 @@ Rake::ExtensionTask.new('tiny_tds', gemspec) do |ext|
else
ext.cross_compile = true
ext.cross_platform = ['i386-mingw32']
- ext.cross_config_options << "--disable-lookup"
end
end
task :build => [:clean, :compile]
task :default => [:build, :test]
+Dir["tasks/*.rake"].sort.each { |f| load f }
+
View
@@ -6,8 +6,8 @@
# Shamelessly copied from nokogiri
#
-LIBDIR = Config::CONFIG['libdir']
-INCLUDEDIR = Config::CONFIG['includedir']
+LIBDIR = RbConfig::CONFIG['libdir']
+INCLUDEDIR = RbConfig::CONFIG['includedir']
$CFLAGS << " #{ENV["CFLAGS"]}"
$LDFLAGS << " #{ENV["LDFLAGS"]}"
@@ -31,8 +31,8 @@ def searchable_paths_with_directories(*directories)
end.flatten.compact
end
-if Config::CONFIG['target_os'] =~ /mswin32|mingw32/
- lib_prefix = 'lib' unless Config::CONFIG['target_os'] =~ /mingw32/
+if RbConfig::CONFIG['target_os'] =~ /mswin32|mingw32/
+ lib_prefix = 'lib' unless RbConfig::CONFIG['target_os'] =~ /mingw32/
# There's no default include/lib dir on Windows. Let's just add the Ruby ones
# and resort on the search path specified by INCLUDE and LIB environment
# variables
@@ -49,7 +49,7 @@ def searchable_paths_with_directories(*directories)
INCLUDEDIR,
# Finally fall back to /usr
'/usr/include'
- ].reject{ |dir| File.directory?(dir) }
+ ].reject{ |dir| !File.directory?(dir) }
LIB_DIRS = [
# First search /opt/local for macports
'/opt/local/lib',
@@ -59,7 +59,7 @@ def searchable_paths_with_directories(*directories)
LIBDIR,
# Finally fall back to /usr
'/usr/lib',
- ].reject{ |dir| File.directory?(dir) }
+ ].reject{ |dir| !File.directory?(dir) }
end
FREETDS_HEADER_DIRS = (searchable_paths_with_directories(['include'],['include','freetds']) + HEADER_DIRS).uniq

0 comments on commit b7d99d9

Please sign in to comment.