Skip to content

Commit

Permalink
Fixed compile process.
Browse files Browse the repository at this point in the history
  • Loading branch information
trans committed Nov 15, 2007
1 parent 73a549d commit 8b58510
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 40 deletions.
2 changes: 2 additions & 0 deletions ext/tmail/base64/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
You can distribute/modify this program under the terms of
the GNU Lesser General Public License version 2.1.
*/


#include "ruby.h"
#include "version.h"
#include <stdio.h>
Expand Down
24 changes: 6 additions & 18 deletions ext/tmail/base64/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,22 @@

extension_name = 'base64'

arch = Config::CONFIG['arch']
arch = Config::CONFIG['sitearch']

windows = (/mswin/ =~ arch) #RUBY_PLATFORM
windows = (/djgpp|(cyg|ms|bcc)win|mingw/ =~ arch)

if (ENV['NORUBYEXT'] == 'true') || windows # TEMPORARILY ADD WINDOWS HERE
# LETS TRY FAKING IT OUT.
if windows
File.open('make.bat', 'w') do |f|
f << 'echo Native extension will be omitted.'
end
File.open('nmake.bat', 'w') do |f|
f << 'echo Native extension will be omitted.'
end
end
if (ENV['NORUBYEXT'] == 'true')
File.open('Makefile', 'w') do |f|
f << "all:\n"
f << "install:\n"
end
else
#dir_config(extension_name)
if windows && ENV['make'].nil?
$LIBS += " msvcprt.lib"
#dir_config(extension_name)
#create_makefile(extension_name, "tmail")
create_makefile(extension_name, "tmail/#{arch}")
else
$CFLAGS += " -D_FILE_OFFSET_BITS=64" #???
#dir_config(extension_name)
#create_makefile(extension_name, "tmail")
create_makefile(extension_name, "tmail/#{arch}")
end
create_makefile(extension_name)
end

24 changes: 6 additions & 18 deletions ext/tmail/scanner_c/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,22 @@

extension_name = 'scanner_c'

arch = Config::CONFIG['arch']
arch = Config::CONFIG['sitearch']

windows = (/mswin/ =~ arch) #RUBY_PLATFORM
windows = (/djgpp|(cyg|ms|bcc)win|mingw/ =~ arch)

if (ENV['NORUBYEXT'] == 'true') || windows # TEMPORARILY ADD WINDOWS HERE
# LETS TRY FAKING IT OUT.
if windows
File.open('make.bat', 'w') do |f|
f << 'echo Native extension will be omitted.'
end
File.open('nmake.bat', 'w') do |f|
f << 'echo Native extension will be omitted.'
end
end
if (ENV['NORUBYEXT'] == 'true')
File.open('Makefile', 'w') do |f|
f << "all:\n"
f << "install:\n"
end
else
#dir_config(extension_name)
if windows && ENV['make'].nil?
$LIBS += " msvcprt.lib"
#dir_config(extension_name)
#create_makefile(extension_name, "tmail")
create_makefile(extension_name, "tmail/#{arch}")
else
$CFLAGS += " -D_FILE_OFFSET_BITS=64" #???
#dir_config(extension_name)
#create_makefile(extension_name, "tmail")
create_makefile(extension_name, "tmail/#{arch}")
end
create_makefile(extension_name)
end

3 changes: 3 additions & 0 deletions meta/tmail-1.1.2.roll
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ formats: [zip, tgz, gem]

lib_path:
- lib/tmail
- ext/tmail/base64
- ext/tmail/scanner_c

gem_path:
- lib
- ext/tmail

12 changes: 8 additions & 4 deletions script/compile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ task :compile_base64 do
cd('ext/tmail/base64') do
ruby "extconf.rb"
make
file = glob("base64.#{dlext}").first
file = File.expand_path(file) if file

#file = glob("base64.#{dlext}").first
#file = File.expand_path(file) if file
end

#if file
# mkdir_p("lib/tmail/#{arch}")
# mv(file, "lib/tmail/#{arch}/")
Expand All @@ -24,9 +26,11 @@ task :compile_scanner_c do
cd("ext/tmail/scanner_c") do
ruby "extconf.rb"
make
file = glob("scanner_c.#{dlext}").first
file = File.expand_path(file) if file

#file = glob("scanner_c.#{dlext}").first
#file = File.expand_path(file) if file
end

#if file
# mkdir_p("lib/tmail/#{arch}")
# mv(file, "lib/tmail/#{arch}/")
Expand Down

0 comments on commit 8b58510

Please sign in to comment.